SerialUdbExtraF5.parse constructor

SerialUdbExtraF5.parse(
  1. ByteData data_
)

Implementation

factory SerialUdbExtraF5.parse(ByteData data_) {
  if (data_.lengthInBytes < SerialUdbExtraF5.mavlinkEncodedLength) {
    var len = SerialUdbExtraF5.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var sueYawkpAileron = data_.getFloat32(0, Endian.little);
  var sueYawkdAileron = data_.getFloat32(4, Endian.little);
  var sueRollkp = data_.getFloat32(8, Endian.little);
  var sueRollkd = data_.getFloat32(12, Endian.little);

  return SerialUdbExtraF5(
      sueYawkpAileron: sueYawkpAileron,
      sueYawkdAileron: sueYawkdAileron,
      sueRollkp: sueRollkp,
      sueRollkd: sueRollkd);
}