SerialUdbExtraF14.parse constructor

SerialUdbExtraF14.parse(
  1. ByteData data_
)

Implementation

factory SerialUdbExtraF14.parse(ByteData data_) {
  if (data_.lengthInBytes < SerialUdbExtraF14.mavlinkEncodedLength) {
    var len = SerialUdbExtraF14.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var sueTrapSource = data_.getUint32(0, Endian.little);
  var sueRcon = data_.getInt16(4, Endian.little);
  var sueTrapFlags = data_.getInt16(6, Endian.little);
  var sueOscFailCount = data_.getInt16(8, Endian.little);
  var sueWindEstimation = data_.getUint8(10);
  var sueGpsType = data_.getUint8(11);
  var sueDr = data_.getUint8(12);
  var sueBoardType = data_.getUint8(13);
  var sueAirframe = data_.getUint8(14);
  var sueClockConfig = data_.getUint8(15);
  var sueFlightPlanType = data_.getUint8(16);

  return SerialUdbExtraF14(
      sueTrapSource: sueTrapSource,
      sueRcon: sueRcon,
      sueTrapFlags: sueTrapFlags,
      sueOscFailCount: sueOscFailCount,
      sueWindEstimation: sueWindEstimation,
      sueGpsType: sueGpsType,
      sueDr: sueDr,
      sueBoardType: sueBoardType,
      sueAirframe: sueAirframe,
      sueClockConfig: sueClockConfig,
      sueFlightPlanType: sueFlightPlanType);
}