SerialUdbExtraF18.parse constructor

SerialUdbExtraF18.parse(
  1. ByteData data_
)

Implementation

factory SerialUdbExtraF18.parse(ByteData data_) {
  if (data_.lengthInBytes < SerialUdbExtraF18.mavlinkEncodedLength) {
    var len = SerialUdbExtraF18.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var angleOfAttackNormal = data_.getFloat32(0, Endian.little);
  var angleOfAttackInverted = data_.getFloat32(4, Endian.little);
  var elevatorTrimNormal = data_.getFloat32(8, Endian.little);
  var elevatorTrimInverted = data_.getFloat32(12, Endian.little);
  var referenceSpeed = data_.getFloat32(16, Endian.little);

  return SerialUdbExtraF18(
      angleOfAttackNormal: angleOfAttackNormal,
      angleOfAttackInverted: angleOfAttackInverted,
      elevatorTrimNormal: elevatorTrimNormal,
      elevatorTrimInverted: elevatorTrimInverted,
      referenceSpeed: referenceSpeed);
}