CommandAck.parse constructor

CommandAck.parse(
  1. ByteData data_
)

Implementation

factory CommandAck.parse(ByteData data_) {
  if (data_.lengthInBytes < CommandAck.mavlinkEncodedLength) {
    var len = CommandAck.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var command = data_.getUint16(0, Endian.little);
  var result = data_.getUint8(2);
  var progress = data_.getUint8(3);
  var resultParam2 = data_.getInt32(4, Endian.little);
  var targetSystem = data_.getUint8(8);
  var targetComponent = data_.getUint8(9);

  return CommandAck(
      command: command,
      result: result,
      progress: progress,
      resultParam2: resultParam2,
      targetSystem: targetSystem,
      targetComponent: targetComponent);
}