WindCov.parse constructor

WindCov.parse(
  1. ByteData data_
)

Implementation

factory WindCov.parse(ByteData data_) {
  if (data_.lengthInBytes < WindCov.mavlinkEncodedLength) {
    var len = WindCov.mavlinkEncodedLength - data_.lengthInBytes;
    var d = data_.buffer.asUint8List() + List<int>.filled(len, 0);
    data_ = Uint8List.fromList(d).buffer.asByteData();
  }
  var timeUsec = data_.getUint64(0, Endian.little);
  var windX = data_.getFloat32(8, Endian.little);
  var windY = data_.getFloat32(12, Endian.little);
  var windZ = data_.getFloat32(16, Endian.little);
  var varHoriz = data_.getFloat32(20, Endian.little);
  var varVert = data_.getFloat32(24, Endian.little);
  var windAlt = data_.getFloat32(28, Endian.little);
  var horizAccuracy = data_.getFloat32(32, Endian.little);
  var vertAccuracy = data_.getFloat32(36, Endian.little);

  return WindCov(
      timeUsec: timeUsec,
      windX: windX,
      windY: windY,
      windZ: windZ,
      varHoriz: varHoriz,
      varVert: varVert,
      windAlt: windAlt,
      horizAccuracy: horizAccuracy,
      vertAccuracy: vertAccuracy);
}