Commit 7cc73e39 authored by Micha Mueller's avatar Micha Mueller
Browse files

Implement printConfig for BACnet plugin

parent 0b5b37cc
......@@ -288,3 +288,8 @@ void BACnetClient::rejectHandler(BACNET_ADDRESS * src, uint8_t invokeId, uint8_t
throw std::runtime_error(str + errorMsg);
}
void BACnetClient::printConfig(LOG_LEVEL ll) {
LOG_VAR(ll) << " BACnetClient here";
LOG_VAR(ll) << " Timeout: " << _timeout;
}
......@@ -60,6 +60,13 @@ public:
*/
double readProperty(uint32_t deviceObjInstance, uint32_t objInstance = 0, BACNET_OBJECT_TYPE objType = OBJECT_DEVICE, BACNET_PROPERTY_ID objProperty = PROP_PRESENT_VALUE, int32_t objIndex = BACNET_ARRAY_ALL);
/**
* Print information about configured attributes
*
* @param ll Severity level of the log messages.
*/
void printConfig(LOG_LEVEL ll);
private:
/* Handler to process incoming BACnet data */
......@@ -88,7 +95,7 @@ private:
boost::asio::io_service::strand* _strand;
boost::log::sources::severity_logger<boost::log::trivial::severity_level> lg;
LOGGER lg;
};
#endif /* BACNETCLIENT_H_ */
......@@ -71,3 +71,13 @@ void BACnetConfigurator::global(CFG_VAL config) {
return;
}
}
void BACnetConfigurator::printConfiguratorConfig(LOG_LEVEL ll) {
LOG_VAR(ll) << " Not other plugin specific general attributes";
if (_bacClient) {
_bacClient->printConfig(ll);
} else {
LOG_VAR(ll) << " No BACClient present!";
}
}
......@@ -26,6 +26,8 @@ protected:
void global(CFG_VAL config) override;
void printConfiguratorConfig(LOG_LEVEL ll) override;
private:
BACnetClientPtr _bacClient;
};
......
......@@ -57,6 +57,14 @@ public:
void setPropertyId(const std::string& property) { _propertyId = static_cast<BACNET_PROPERTY_ID>(stoul(property)); }
void setObjectIndex(int32_t objectIndex) { _objectIndex = objectIndex; }
void printConfig(LOG_LEVEL ll, LOGGER& lg) override {
LOG_VAR(ll) << " Factor: " << _factor;
LOG_VAR(ll) << " objectInstance: " << _objectInstance;
LOG_VAR(ll) << " objectType: " << _objectType;
LOG_VAR(ll) << " propertyId: " << _propertyId;
LOG_VAR(ll) << " objectIndex: " << _objectIndex;
}
protected:
double _factor;
uint32_t _objectInstance;
......
......@@ -99,3 +99,12 @@ void BACnetSensorGroup::readAsync() {
}
_pendingTasks--;
}
void BACnetSensorGroup::printConfig(LOG_LEVEL ll) {
LOG_VAR(ll) << " deviceInstance: " << _deviceInstance;
if (_bacClient) {
LOG_VAR(ll) << " BACClient set";
} else {
LOG_VAR(ll) << " No BACClient set!";
}
}
......@@ -30,6 +30,7 @@ public:
void setDeviceInstance(const std::string& deviceInstance) { _deviceInstance = stoul(deviceInstance); }
uint32_t getDeviceInstance() const { return _deviceInstance; }
void printConfig(LOG_LEVEL ll);
private:
void read() override;
......
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