DeviceOpWrite.parse constructor
DeviceOpWrite.parse(
- ByteData data_
Implementation
factory DeviceOpWrite.parse(ByteData data_) {
if (data_.lengthInBytes < DeviceOpWrite.mavlinkEncodedLength) {
var len = DeviceOpWrite.mavlinkEncodedLength - data_.lengthInBytes;
var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
data_ = Uint8List.fromList(d).buffer.asByteData();
}
var requestId = data_.getUint32(0, Endian.little);
var targetSystem = data_.getUint8(4);
var targetComponent = data_.getUint8(5);
var bustype = data_.getUint8(6);
var bus = data_.getUint8(7);
var address = data_.getUint8(8);
var busname = MavlinkMessage.asInt8List(data_, 9, 40);
var regstart = data_.getUint8(49);
var count = data_.getUint8(50);
var data = MavlinkMessage.asUint8List(data_, 51, 128);
var bank = data_.getUint8(179);
return DeviceOpWrite(
requestId: requestId,
targetSystem: targetSystem,
targetComponent: targetComponent,
bustype: bustype,
bus: bus,
address: address,
busname: busname,
regstart: regstart,
count: count,
data: data,
bank: bank);
}