MissionCount.parse constructor

MissionCount.parse(
  1. ByteData data_
)

Implementation

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

  return MissionCount(
      count: count,
      targetSystem: targetSystem,
      targetComponent: targetComponent,
      missionType: missionType,
      opaqueId: opaqueId);
}