You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using the JavaScript sparkplug-payload library to build a cloud system where IoT devices are sending data to using Sparkplug specification. Currently we have an issue where we can't decode the uint32 values that are being sent by the devices. The Sparkplug specification states the following:
As you can see, they are specifying the data type as 7, which corresponds to uint32 in the Sparkplug specification, and they are setting the int_value.
However, when decoding this using the sparkplug-payload library, we are getting the value as null.
Upon investigating the library code, we found the following part in the decoding:
case 7: // UInt32
if (object.longValue instanceof Long) {
return object.longValue.toInt() as T;
} else {
return object.longValue as T;
}
We also found this issue from 3 years ago, where somebody else asked about this and it seems like a decision was made to change the handling of uint32 values as int_value. However, the current version is still treating uint32 as long_value instead of int_value.
So, from our understanding, the library right now does not conform with the Sparkplug specification. Is this actually the case, or are we missing something here? If so, is this intentional? Are we supposed to send long_value for uint32 metrics?
The text was updated successfully, but these errors were encountered:
Hello,
We are using the JavaScript sparkplug-payload library to build a cloud system where IoT devices are sending data to using Sparkplug specification. Currently we have an issue where we can't decode the uint32 values that are being sent by the devices. The Sparkplug specification states the following:
Based on this, our embedded developers are sending us values, and for uint32 they are using
int_value
. An example is as follows:As you can see, they are specifying the data type as 7, which corresponds to uint32 in the Sparkplug specification, and they are setting the int_value.
However, when decoding this using the sparkplug-payload library, we are getting the value as
null
.Upon investigating the library code, we found the following part in the decoding:
We also found this issue from 3 years ago, where somebody else asked about this and it seems like a decision was made to change the handling of uint32 values as int_value. However, the current version is still treating uint32 as long_value instead of int_value.
So, from our understanding, the library right now does not conform with the Sparkplug specification. Is this actually the case, or are we missing something here? If so, is this intentional? Are we supposed to send long_value for uint32 metrics?
The text was updated successfully, but these errors were encountered: