MissionCurrent.parse constructor

MissionCurrent.parse(
  1. ByteData data_
)

Implementation

factory MissionCurrent.parse(ByteData data_) {
  if (data_.lengthInBytes < MissionCurrent.mavlinkEncodedLength) {
    var len = MissionCurrent.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var seq = data_.getUint16(0, Endian.little);
  var total = data_.getUint16(2, Endian.little);
  var missionState = data_.getUint8(4);
  var missionMode = data_.getUint8(5);
  var missionId = data_.getUint32(6, Endian.little);
  var fenceId = data_.getUint32(10, Endian.little);
  var rallyPointsId = data_.getUint32(14, Endian.little);

  return MissionCurrent(
      seq: seq,
      total: total,
      missionState: missionState,
      missionMode: missionMode,
      missionId: missionId,
      fenceId: fenceId,
      rallyPointsId: rallyPointsId);
}