fromBytes static method
A factory constructor to deserialize a frame from bytes.
Implementation
static MaxDataFrame fromBytes(ByteData view, int offset) {
// Ensure there's enough data for type (1) + maxData (8)
if (view.lengthInBytes < offset + 1 + 8) {
throw ArgumentError('Byte array too short for MaxDataFrame at offset $offset. Need ${1 + 8} bytes, got ${view.lengthInBytes - offset}');
}
final maxData = view.getUint64(offset + 1, Endian.big);
return MaxDataFrame(maxData: maxData);
}