serializePayload method
Call to serialize only the payload, no header, returns a int with a serialized size
Implementation
@override
int serializePayload(
imc.LoggingControl? message, ByteData byteData, int offset) {
if (message == null) return 0;
var byteOffset = offset;
// field op
byteData.setUint8(byteOffset, message.op.value);
byteOffset += 1;
// field name
var nameEncoded = utf8.encode(message.name);
var nameSSize = nameEncoded.length;
byteData.setUint16(byteOffset, nameSSize, imc.endianSer);
byteOffset += 2;
for (var b in nameEncoded) {
byteData.setUint8(byteOffset++, b);
}
return byteOffset - offset;
}