For now, we do not use anything except the basic metrics we can sooner "complete" Payload encode/ decode by throwing not implemented for all of the Metric members we don't use (template, etc)
Create a sample FB_SparkplugBoolMetric, which contains some storage to play around with this idea.
With basic metrics is ment: basetype variables, no "advanced" metrics or historical things
Whatever happens, the TimeStamp is mandatory and implemented.
As TimeStamp we take the current time as read from the controller. If an interested user has a controller which does not contain an RTC, we will work with that user to come up with an alternative. For now though, it is not supported.
So I think simple decode will need:
.Decode()
.GetTimestamp()
.GetSeq()
.GetFirstMetric(name => , datatype => , timestamp => , valueString => , valueLreal => , valueReal=> , valueVarInt => , HasNext => )
.GetNextMetric(name => , datatype => , timestamp => , valueString => , valueLreal => , valueReal=> , valueVarInt => , HasNext => )
It is up to EoN_Node to decide:
Which (if any) of my SparkplugValues does this metric belong to?
Is this metric writeable?
What to do with the seq?
what to do with the timestamps?
Diff:
NDEATH is an exception which does not require a Payload.seq
So the Initialize must include HasSeq : BOOL;