eclipse / tahu

Eclipse Tahu addresses the existence of legacy SCADA/DCS/ICS protocols and infrastructures and provides a much-needed definition of how best to apply MQTT into these existing industrial operational environments.
https://eclipse.org/tahu
Eclipse Public License 2.0
224 stars 129 forks source link

Metric Properties in c libraries #52

Open CodyPannell opened 4 years ago

CodyPannell commented 4 years ago

Do the c libraries support metric properties? I'm sending a payload using python, it gets picked up by mqtt.fx and decoded into the following JSON:

{ "timestamp": 1582763391701, "metrics": [ { "name": "Properties/Report Interval", "alias": 9, "timestamp": 1582763391701, "dataType": "UInt32", "properties": { "engHigh": { "type": "Int32", "value": 43200 } }, "value": 0 } ], "seq": 0 }

I have a subscriber using the c libraries but it's overwriting the metric name to be "engHigh" and has_properties is never set to true. Stepping through the library, it looks like when the properties tag comes up it gets to this code which only has a debug_print statement but no logic.

if (metric_field->tag == metric_tag && ((metric_field->type & PB_LTYPE_SUBMESSAGE) == PB_LTYPE_SUBMESSAGE)) { DEBUG_PRINT(("\t\tFound a PB_LTYPE_SUBMESSAGE\n")); }

jbrzozoski commented 4 years ago

No, the reference library can't decode metric properties as it exists...