HighLatency2.parse constructor

HighLatency2.parse(
  1. ByteData data_
)

Implementation

factory HighLatency2.parse(ByteData data_) {
  if (data_.lengthInBytes < HighLatency2.mavlinkEncodedLength) {
    var len = HighLatency2.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var timestamp = data_.getUint32(0, Endian.little);
  var latitude = data_.getInt32(4, Endian.little);
  var longitude = data_.getInt32(8, Endian.little);
  var customMode = data_.getUint16(12, Endian.little);
  var altitude = data_.getInt16(14, Endian.little);
  var targetAltitude = data_.getInt16(16, Endian.little);
  var targetDistance = data_.getUint16(18, Endian.little);
  var wpNum = data_.getUint16(20, Endian.little);
  var failureFlags = data_.getUint16(22, Endian.little);
  var type = data_.getUint8(24);
  var autopilot = data_.getUint8(25);
  var heading = data_.getUint8(26);
  var targetHeading = data_.getUint8(27);
  var throttle = data_.getUint8(28);
  var airspeed = data_.getUint8(29);
  var airspeedSp = data_.getUint8(30);
  var groundspeed = data_.getUint8(31);
  var windspeed = data_.getUint8(32);
  var windHeading = data_.getUint8(33);
  var eph = data_.getUint8(34);
  var epv = data_.getUint8(35);
  var temperatureAir = data_.getInt8(36);
  var climbRate = data_.getInt8(37);
  var battery = data_.getInt8(38);
  var custom0 = data_.getInt8(39);
  var custom1 = data_.getInt8(40);
  var custom2 = data_.getInt8(41);

  return HighLatency2(
      timestamp: timestamp,
      latitude: latitude,
      longitude: longitude,
      customMode: customMode,
      altitude: altitude,
      targetAltitude: targetAltitude,
      targetDistance: targetDistance,
      wpNum: wpNum,
      failureFlags: failureFlags,
      type: type,
      autopilot: autopilot,
      heading: heading,
      targetHeading: targetHeading,
      throttle: throttle,
      airspeed: airspeed,
      airspeedSp: airspeedSp,
      groundspeed: groundspeed,
      windspeed: windspeed,
      windHeading: windHeading,
      eph: eph,
      epv: epv,
      temperatureAir: temperatureAir,
      climbRate: climbRate,
      battery: battery,
      custom0: custom0,
      custom1: custom1,
      custom2: custom2);
}