CanFrame.parse constructor
CanFrame.parse(
- ByteData data_
Implementation
factory CanFrame.parse(ByteData data_) {
if (data_.lengthInBytes < CanFrame.mavlinkEncodedLength) {
var len = CanFrame.mavlinkEncodedLength - data_.lengthInBytes;
var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
data_ = Uint8List.fromList(d).buffer.asByteData();
}
var id = data_.getUint32(0, Endian.little);
var targetSystem = data_.getUint8(4);
var targetComponent = data_.getUint8(5);
var bus = data_.getUint8(6);
var len = data_.getUint8(7);
var data = MavlinkMessage.asUint8List(data_, 8, 8);
return CanFrame(
id: id,
targetSystem: targetSystem,
targetComponent: targetComponent,
bus: bus,
len: len,
data: data);
}