Commit 64cdead1 authored by Micha Müller's avatar Micha Müller
Browse files

Minor fix to configurators

parent 7a67c75b
...@@ -483,6 +483,13 @@ protected: ...@@ -483,6 +483,13 @@ protected:
} }
} }
//read in values inherited from EntityInterface
BOOST_FOREACH(boost::property_tree::iptree::value_type &val, config) {
if (boost::iequals(val.first, "mqttPart")) {
sEntity.setMqttPart(val.second.data());
}
}
sensorEntity(sEntity, config); sensorEntity(sEntity, config);
BOOST_FOREACH(boost::property_tree::iptree::value_type &val, config) { BOOST_FOREACH(boost::property_tree::iptree::value_type &val, config) {
......
...@@ -91,7 +91,7 @@ public: ...@@ -91,7 +91,7 @@ public:
return *this; return *this;
} }
//TODO check if getHostName() aliases are still required after refactor //TODO refactor getEntityName -> getName()
///@name Getters ///@name Getters
///@{ ///@{
const std::string& getEntityName() const { return _name; } const std::string& getEntityName() const { return _name; }
......
...@@ -55,7 +55,7 @@ void BACnetConfigurator::sensorGroup(BACnetSensorGroup& s, CFG_VAL config) { ...@@ -55,7 +55,7 @@ void BACnetConfigurator::sensorGroup(BACnetSensorGroup& s, CFG_VAL config) {
} }
void BACnetConfigurator::global(CFG_VAL config) { void BACnetConfigurator::global(CFG_VAL config) {
_bacClient = std::make_shared<BACnetClient>(); _bacClient = std::make_shared<BACnetClient>("BACnetClient");
std::string address_cache, interface; std::string address_cache, interface;
unsigned port = 47808, timeout = 1000, apdu_timeout = 200, apdu_retries = 0; unsigned port = 47808, timeout = 1000, apdu_timeout = 200, apdu_retries = 0;
......
...@@ -72,14 +72,12 @@ void IPMIConfigurator::sensorGroup(IPMISensorGroup& s, CFG_VAL config) { ...@@ -72,14 +72,12 @@ void IPMIConfigurator::sensorGroup(IPMISensorGroup& s, CFG_VAL config) {
} }
void IPMIConfigurator::sensorEntity(IPMIHost& s, CFG_VAL config) { void IPMIConfigurator::sensorEntity(IPMIHost& s, CFG_VAL config) {
s.setHostName(config.data());
s.setSessionTimeout(_globalHost.sessionTimeout); s.setSessionTimeout(_globalHost.sessionTimeout);
s.setRetransmissionTimeout(_globalHost.retransmissionTimeout); s.setRetransmissionTimeout(_globalHost.retransmissionTimeout);
s.setCache(_tempdir); s.setCache(_tempdir);
ADD { ADD {
ATTRIBUTE("username", setUserName); ATTRIBUTE("username", setUserName);
ATTRIBUTE("password", setPassword); ATTRIBUTE("password", setPassword);
ATTRIBUTE("mqttPart", setMqttPart);
ATTRIBUTE("cipher", setCipher); ATTRIBUTE("cipher", setCipher);
ATTRIBUTE("ipmiVersion", setIpmiVersion); ATTRIBUTE("ipmiVersion", setIpmiVersion);
} }
......
...@@ -52,6 +52,5 @@ void PDUConfigurator::sensorGroup(PDUSensorGroup& s, CFG_VAL config) { ...@@ -52,6 +52,5 @@ void PDUConfigurator::sensorGroup(PDUSensorGroup& s, CFG_VAL config) {
void PDUConfigurator::sensorEntity(PDUUnit& s, CFG_VAL config) { void PDUConfigurator::sensorEntity(PDUUnit& s, CFG_VAL config) {
ADD { ADD {
ATTRIBUTE("host", setHost); ATTRIBUTE("host", setHost);
//TODO add support for mqttPart if required
} }
} }
...@@ -65,6 +65,5 @@ void SNMPConfigurator::sensorEntity(SNMPConnection& s, CFG_VAL config) { ...@@ -65,6 +65,5 @@ void SNMPConfigurator::sensorEntity(SNMPConnection& s, CFG_VAL config) {
ATTRIBUTE("PrivProto", setPrivProto); ATTRIBUTE("PrivProto", setPrivProto);
ATTRIBUTE("AuthKey", setAuthKey); ATTRIBUTE("AuthKey", setAuthKey);
ATTRIBUTE("PrivKey", setPrivKey); ATTRIBUTE("PrivKey", setPrivKey);
ATTRIBUTE("MqttPart", setMqttPart);
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment