UavionixAdsbOutCfg.parse constructor

UavionixAdsbOutCfg.parse(
  1. ByteData data_
)

Implementation

factory UavionixAdsbOutCfg.parse(ByteData data_) {
  if (data_.lengthInBytes < UavionixAdsbOutCfg.mavlinkEncodedLength) {
    var len = UavionixAdsbOutCfg.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var icao = data_.getUint32(0, Endian.little);
  var stallspeed = data_.getUint16(4, Endian.little);
  var callsign = MavlinkMessage.asInt8List(data_, 6, 9);
  var emittertype = data_.getUint8(15);
  var aircraftsize = data_.getUint8(16);
  var gpsoffsetlat = data_.getUint8(17);
  var gpsoffsetlon = data_.getUint8(18);
  var rfselect = data_.getUint8(19);

  return UavionixAdsbOutCfg(
      icao: icao,
      stallspeed: stallspeed,
      callsign: callsign,
      emittertype: emittertype,
      aircraftsize: aircraftsize,
      gpsoffsetlat: gpsoffsetlat,
      gpsoffsetlon: gpsoffsetlon,
      rfselect: rfselect);
}