Find out which metrics and metadata etc are needed for a simple file. Allow a simple file metric similar to existing simple metrics.
The interface is already there with the FB_PayloadMetric, so it just needs to be added to the FB_SimplePayloadEncoder and FB_SimplePayloadDecoder.
Implement encoding of meta data, FB_PayloadMetric ~Line233 currently reads " {info 'TODO: i-campbell: encode meta data} //metadata fieldnumber //metadatasize //metadatavarints.bool * 12off"
Implement an FB_SparkplugFile Encode.
Pseudocode for encode: FB_PayloadMetric.SetDataType(MetricDataType.File); FB_PayloadMetric.SetName("NameOfMetric"); FB_PayloadMetric.SetTimeStamp(sentTime); FB_PayloadMetric.SetValueToBytes(fileSizeBytes,pArrayWithFileData,myPayload,BodyPool); FB_PayloadMetric.SetMetaData(HasMetaData,MetaData); FB_PayloadMetric(xDecode := FALSE, xEncode := TRUE);
Log in to post a comment.
The interface is already there with the FB_PayloadMetric, so it just needs to be added to the FB_SimplePayloadEncoder and FB_SimplePayloadDecoder.
Implement encoding of meta data, FB_PayloadMetric ~Line233
currently reads " {info 'TODO: i-campbell: encode meta data}
//metadata fieldnumber
//metadatasize
//metadatavarints.bool * 12off"
Implement an FB_SparkplugFile Encode.
Pseudocode for encode:
FB_PayloadMetric.SetDataType(MetricDataType.File);
FB_PayloadMetric.SetName("NameOfMetric");
FB_PayloadMetric.SetTimeStamp(sentTime);
FB_PayloadMetric.SetValueToBytes(fileSizeBytes,pArrayWithFileData,myPayload,BodyPool);
FB_PayloadMetric.SetMetaData(HasMetaData,MetaData);
FB_PayloadMetric(xDecode := FALSE, xEncode := TRUE);