AvailableModes.parse constructor

AvailableModes.parse(
  1. ByteData data_
)

Implementation

factory AvailableModes.parse(ByteData data_) {
  if (data_.lengthInBytes < AvailableModes.mavlinkEncodedLength) {
    var len = AvailableModes.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var customMode = data_.getUint32(0, Endian.little);
  var properties = data_.getUint32(4, Endian.little);
  var numberModes = data_.getUint8(8);
  var modeIndex = data_.getUint8(9);
  var standardMode = data_.getUint8(10);
  var modeName = MavlinkMessage.asInt8List(data_, 11, 35);

  return AvailableModes(
      customMode: customMode,
      properties: properties,
      numberModes: numberModes,
      modeIndex: modeIndex,
      standardMode: standardMode,
      modeName: modeName);
}