Wind.parse constructor

Wind.parse(
  1. ByteData data_
)

Implementation

factory Wind.parse(ByteData data_) {
  if (data_.lengthInBytes < Wind.mavlinkEncodedLength) {
    var len = Wind.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var direction = data_.getFloat32(0, Endian.little);
  var speed = data_.getFloat32(4, Endian.little);
  var speedZ = data_.getFloat32(8, Endian.little);

  return Wind(direction: direction, speed: speed, speedZ: speedZ);
}