MissionWritePartialList.parse constructor

MissionWritePartialList.parse(
  1. ByteData data_
)

Implementation

factory MissionWritePartialList.parse(ByteData data_) {
  if (data_.lengthInBytes < MissionWritePartialList.mavlinkEncodedLength) {
    var len =
        MissionWritePartialList.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var startIndex = data_.getInt16(0, Endian.little);
  var endIndex = data_.getInt16(2, Endian.little);
  var targetSystem = data_.getUint8(4);
  var targetComponent = data_.getUint8(5);
  var missionType = data_.getUint8(6);

  return MissionWritePartialList(
      startIndex: startIndex,
      endIndex: endIndex,
      targetSystem: targetSystem,
      targetComponent: targetComponent,
      missionType: missionType);
}