SensorAirflowAngles.parse constructor

SensorAirflowAngles.parse(
  1. ByteData data_
)

Implementation

factory SensorAirflowAngles.parse(ByteData data_) {
  if (data_.lengthInBytes < SensorAirflowAngles.mavlinkEncodedLength) {
    var len = SensorAirflowAngles.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var timestamp = data_.getUint64(0, Endian.little);
  var angleofattack = data_.getFloat32(8, Endian.little);
  var sideslip = data_.getFloat32(12, Endian.little);
  var angleofattackValid = data_.getUint8(16);
  var sideslipValid = data_.getUint8(17);

  return SensorAirflowAngles(
      timestamp: timestamp,
      angleofattack: angleofattack,
      sideslip: sideslip,
      angleofattackValid: angleofattackValid,
      sideslipValid: sideslipValid);
}