MissionAck.parse constructor

MissionAck.parse(
  1. ByteData data_
)

Implementation

factory MissionAck.parse(ByteData data_) {
  if (data_.lengthInBytes < MissionAck.mavlinkEncodedLength) {
    var len = MissionAck.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var targetSystem = data_.getUint8(0);
  var targetComponent = data_.getUint8(1);
  var type = data_.getUint8(2);
  var missionType = data_.getUint8(3);
  var opaqueId = data_.getUint32(4, Endian.little);

  return MissionAck(
      targetSystem: targetSystem,
      targetComponent: targetComponent,
      type: type,
      missionType: missionType,
      opaqueId: opaqueId);
}