DeviceOpReadReply.parse constructor

DeviceOpReadReply.parse(
  1. ByteData data_
)

Implementation

factory DeviceOpReadReply.parse(ByteData data_) {
  if (data_.lengthInBytes < DeviceOpReadReply.mavlinkEncodedLength) {
    var len = DeviceOpReadReply.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 result = data_.getUint8(4);
  var regstart = data_.getUint8(5);
  var count = data_.getUint8(6);
  var data = MavlinkMessage.asUint8List(data_, 7, 128);
  var bank = data_.getUint8(135);

  return DeviceOpReadReply(
      requestId: requestId,
      result: result,
      regstart: regstart,
      count: count,
      data: data,
      bank: bank);
}