DataStream.parse constructor
DataStream.parse(
- ByteData data_
Implementation
factory DataStream.parse(ByteData data_) {
if (data_.lengthInBytes < DataStream.mavlinkEncodedLength) {
var len = DataStream.mavlinkEncodedLength - data_.lengthInBytes;
var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
data_ = Uint8List.fromList(d).buffer.asByteData();
}
var messageRate = data_.getUint16(0, Endian.little);
var streamId = data_.getUint8(2);
var onOff = data_.getUint8(3);
return DataStream(
messageRate: messageRate, streamId: streamId, onOff: onOff);
}