Commit c80dc233 authored by Micha Mueller's avatar Micha Mueller
Browse files

Change format of config file for BACnet Plugin

parent 9e43f473
global {
mqttPrefix /FF112233445566778899FFFFFFFF
mqttPrefix /FF112233445566778899FFFF
}
SensorTemplate {
sensor def0 {
templates {
property def0 {
id 85
interval 1000
mqttsuffix 0000
minValues 3
}
}
sensors {
sensor bac0 {
default def1
interval 1000
minValue 1
mqttsuffix 0000
deviceInstance 1234
; objectType 8
; objectInstance 1234
; property 85
}
sensor bac1 {
deviceInstance 4321
interval 1000
mqttsuffix 0001
}
devices {
device {
instance 1234
mqttPart FF
object {
type 1
instance 1
mqttPart FF
property test1 {
default def0
mqttsuffix 0000
}
property smth {
id 75
mqttsuffix 0001
}
}
object {
type 1
instance 2
mqttPart FF
property propName {
default def0
minValues 1
mqttsuffix 0002
}
property propName2 {
id 80
minValues 1
mqttsuffix 0003
}
}
}
......@@ -16,7 +16,7 @@ BACnetSensor::BACnetSensor(const std::string& name) :
_deviceInstance = 0;
_objectInstance = 0;
_objectType = OBJECT_DEVICE;
_property = PROP_PRESENT_VALUE;
_propertyId = PROP_PRESENT_VALUE;
_objectIndex = BACNET_ARRAY_ALL;
_bacClient = NULL;
}
......@@ -30,7 +30,7 @@ void BACnetSensor::read() {
reading.timestamp = getTimestamp();
try {
reading.value = _bacClient->readProperty(_deviceInstance);
reading.value = _bacClient->readProperty(_deviceInstance, _objectInstance, _objectType, _propertyId);
_readingQueue->push(reading);
_latestValue.value = reading.value;
_latestValue.timestamp = reading.timestamp;
......
......@@ -52,12 +52,12 @@ public:
_objectType = objectType;
}
BACNET_PROPERTY_ID getProperty() const {
return _property;
BACNET_PROPERTY_ID getPropertyId() const {
return _propertyId;
}
void setProperty(BACNET_PROPERTY_ID property) {
_property = property;
void setPropertyId(BACNET_PROPERTY_ID property) {
_propertyId = property;
}
void setBACnetClient(BACnetClient* bacClient) {
......@@ -79,7 +79,7 @@ private:
uint32_t _deviceInstance;
uint32_t _objectInstance;
BACNET_OBJECT_TYPE _objectType;
BACNET_PROPERTY_ID _property;
BACNET_PROPERTY_ID _propertyId;
int32_t _objectIndex;
BACnetClient* _bacClient;
......
Supports Markdown
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