On the sparkplug protocol there are the following “Basic types” defined:
// Basic Types
Int8 = 1;
Int16 = 2;
Int32 = 3;
Int64 = 4;
UInt8 = 5;
UInt16 = 6;
UInt32 = 7;
UInt64 = 8;
Float = 9;
Double = 10;
Boolean = 11;
String = 12;
DateTime = 13;
Text = 14;
However, inside the message Metric definition, the (signed) integers are ignored and only the unsigned integer from GoogleProtobuf are used for dealing with int_value and long_value inside the “oneof value” part:
message Metric {
# Other defs removed for clearness
oneof value {
uint32 int_value = 10;
uint64 long_value = 11;
float float_value = 12;
double double_value = 13;
bool boolean_value = 14;
string string_value = 15;
bytes bytes_value = 16; // Bytes, File
DataSet dataset_value = 17;
Template template_value = 18;
MetricValueExtension extension_value = 19;
}
}
On Protocol Buffers - Scalar Value Types the .proto Type “uint32/64” is equivalent to “uint32/64” of C++, this means that I’m not able to use C++ signed integers (int32/64) directly on Sparkplug.
What “oneof value” should I use for transferring negative signed integers (C++type = int32/64) on Sparkplug?