Airspeed.parse constructor
Airspeed.parse(
- ByteData data_
Implementation
factory Airspeed.parse(ByteData data_) {
if (data_.lengthInBytes < Airspeed.mavlinkEncodedLength) {
var len = Airspeed.mavlinkEncodedLength - data_.lengthInBytes;
var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
data_ = Uint8List.fromList(d).buffer.asByteData();
}
var airspeed = data_.getFloat32(0, Endian.little);
var rawPress = data_.getFloat32(4, Endian.little);
var temperature = data_.getInt16(8, Endian.little);
var id = data_.getUint8(10);
var flags = data_.getUint8(11);
return Airspeed(
airspeed: airspeed,
rawPress: rawPress,
temperature: temperature,
id: id,
flags: flags);
}