Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_wind_cov.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE WIND_COV PACKING
3
4#define MAVLINK_MSG_ID_WIND_COV 231
5
6
7typedef struct __mavlink_wind_cov_t {
8 uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/
9 float wind_x; /*< [m/s] Wind in North (NED) direction (NAN if unknown)*/
10 float wind_y; /*< [m/s] Wind in East (NED) direction (NAN if unknown)*/
11 float wind_z; /*< [m/s] Wind in down (NED) direction (NAN if unknown)*/
12 float var_horiz; /*< [m/s] Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)*/
13 float var_vert; /*< [m/s] Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)*/
14 float wind_alt; /*< [m] Altitude (MSL) that this measurement was taken at (NAN if unknown)*/
15 float horiz_accuracy; /*< [m/s] Horizontal speed 1-STD accuracy (0 if unknown)*/
16 float vert_accuracy; /*< [m/s] Vertical speed 1-STD accuracy (0 if unknown)*/
17} mavlink_wind_cov_t;
18
19#define MAVLINK_MSG_ID_WIND_COV_LEN 40
20#define MAVLINK_MSG_ID_WIND_COV_MIN_LEN 40
21#define MAVLINK_MSG_ID_231_LEN 40
22#define MAVLINK_MSG_ID_231_MIN_LEN 40
23
24#define MAVLINK_MSG_ID_WIND_COV_CRC 105
25#define MAVLINK_MSG_ID_231_CRC 105
26
27
28
29#if MAVLINK_COMMAND_24BIT
30#define MAVLINK_MESSAGE_INFO_WIND_COV {
31 231,
32 "WIND_COV",
33 9,
34 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_wind_cov_t, time_usec) },
35 { "wind_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_wind_cov_t, wind_x) },
36 { "wind_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_wind_cov_t, wind_y) },
37 { "wind_z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_wind_cov_t, wind_z) },
38 { "var_horiz", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_wind_cov_t, var_horiz) },
39 { "var_vert", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_wind_cov_t, var_vert) },
40 { "wind_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_wind_cov_t, wind_alt) },
41 { "horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_wind_cov_t, horiz_accuracy) },
42 { "vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_wind_cov_t, vert_accuracy) },
43 } \
44}
45#else
46#define MAVLINK_MESSAGE_INFO_WIND_COV {
47 "WIND_COV",
48 9,
49 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_wind_cov_t, time_usec) },
50 { "wind_x", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_wind_cov_t, wind_x) },
51 { "wind_y", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_wind_cov_t, wind_y) },
52 { "wind_z", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_wind_cov_t, wind_z) },
53 { "var_horiz", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_wind_cov_t, var_horiz) },
54 { "var_vert", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_wind_cov_t, var_vert) },
55 { "wind_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_wind_cov_t, wind_alt) },
56 { "horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_wind_cov_t, horiz_accuracy) },
57 { "vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_wind_cov_t, vert_accuracy) },
58 } \
59}
60#endif
61
62/**
63 * @brief Pack a wind_cov message
64 * @param system_id ID of this system
65 * @param component_id ID of this component (e.g. 200 for IMU)
66 * @param msg The MAVLink message to compress the data into
67 *
68 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
69 * @param wind_x [m/s] Wind in North (NED) direction (NAN if unknown)
70 * @param wind_y [m/s] Wind in East (NED) direction (NAN if unknown)
71 * @param wind_z [m/s] Wind in down (NED) direction (NAN if unknown)
72 * @param var_horiz [m/s] Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)
73 * @param var_vert [m/s] Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)
74 * @param wind_alt [m] Altitude (MSL) that this measurement was taken at (NAN if unknown)
75 * @param horiz_accuracy [m/s] Horizontal speed 1-STD accuracy (0 if unknown)
76 * @param vert_accuracy [m/s] Vertical speed 1-STD accuracy (0 if unknown)
77 * @return length of the message in bytes (excluding serial stream start sign)
78 */
79static inline uint16_t mavlink_msg_wind_cov_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
80 uint64_t time_usec, float wind_x, float wind_y, float wind_z, float var_horiz, float var_vert, float wind_alt, float horiz_accuracy, float vert_accuracy)
81{
82#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
84 _mav_put_uint64_t(buf, 0, time_usec);
85 _mav_put_float(buf, 8, wind_x);
86 _mav_put_float(buf, 12, wind_y);
87 _mav_put_float(buf, 16, wind_z);
88 _mav_put_float(buf, 20, var_horiz);
89 _mav_put_float(buf, 24, var_vert);
90 _mav_put_float(buf, 28, wind_alt);
91 _mav_put_float(buf, 32, horiz_accuracy);
92 _mav_put_float(buf, 36, vert_accuracy);
93
94 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WIND_COV_LEN);
95#else
96 mavlink_wind_cov_t packet;
97 packet.time_usec = time_usec;
98 packet.wind_x = wind_x;
99 packet.wind_y = wind_y;
100 packet.wind_z = wind_z;
101 packet.var_horiz = var_horiz;
102 packet.var_vert = var_vert;
103 packet.wind_alt = wind_alt;
104 packet.horiz_accuracy = horiz_accuracy;
105 packet.vert_accuracy = vert_accuracy;
106
107 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WIND_COV_LEN);
108#endif
109
110 msg->msgid = MAVLINK_MSG_ID_WIND_COV;
111 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
112}
113
114/**
115 * @brief Pack a wind_cov message
116 * @param system_id ID of this system
117 * @param component_id ID of this component (e.g. 200 for IMU)
118 * @param status MAVLink status structure
119 * @param msg The MAVLink message to compress the data into
120 *
121 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
122 * @param wind_x [m/s] Wind in North (NED) direction (NAN if unknown)
123 * @param wind_y [m/s] Wind in East (NED) direction (NAN if unknown)
124 * @param wind_z [m/s] Wind in down (NED) direction (NAN if unknown)
125 * @param var_horiz [m/s] Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)
126 * @param var_vert [m/s] Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)
127 * @param wind_alt [m] Altitude (MSL) that this measurement was taken at (NAN if unknown)
128 * @param horiz_accuracy [m/s] Horizontal speed 1-STD accuracy (0 if unknown)
129 * @param vert_accuracy [m/s] Vertical speed 1-STD accuracy (0 if unknown)
130 * @return length of the message in bytes (excluding serial stream start sign)
131 */
132static inline uint16_t mavlink_msg_wind_cov_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
133 uint64_t time_usec, float wind_x, float wind_y, float wind_z, float var_horiz, float var_vert, float wind_alt, float horiz_accuracy, float vert_accuracy)
134{
135#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
137 _mav_put_uint64_t(buf, 0, time_usec);
138 _mav_put_float(buf, 8, wind_x);
139 _mav_put_float(buf, 12, wind_y);
140 _mav_put_float(buf, 16, wind_z);
141 _mav_put_float(buf, 20, var_horiz);
142 _mav_put_float(buf, 24, var_vert);
143 _mav_put_float(buf, 28, wind_alt);
144 _mav_put_float(buf, 32, horiz_accuracy);
145 _mav_put_float(buf, 36, vert_accuracy);
146
147 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WIND_COV_LEN);
148#else
149 mavlink_wind_cov_t packet;
150 packet.time_usec = time_usec;
151 packet.wind_x = wind_x;
152 packet.wind_y = wind_y;
153 packet.wind_z = wind_z;
154 packet.var_horiz = var_horiz;
155 packet.var_vert = var_vert;
156 packet.wind_alt = wind_alt;
157 packet.horiz_accuracy = horiz_accuracy;
158 packet.vert_accuracy = vert_accuracy;
159
160 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WIND_COV_LEN);
161#endif
162
163 msg->msgid = MAVLINK_MSG_ID_WIND_COV;
164#if MAVLINK_CRC_EXTRA
165 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
166#else
167 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN);
168#endif
169}
170
171/**
172 * @brief Pack a wind_cov message on a channel
173 * @param system_id ID of this system
174 * @param component_id ID of this component (e.g. 200 for IMU)
175 * @param chan The MAVLink channel this message will be sent over
176 * @param msg The MAVLink message to compress the data into
177 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
178 * @param wind_x [m/s] Wind in North (NED) direction (NAN if unknown)
179 * @param wind_y [m/s] Wind in East (NED) direction (NAN if unknown)
180 * @param wind_z [m/s] Wind in down (NED) direction (NAN if unknown)
181 * @param var_horiz [m/s] Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)
182 * @param var_vert [m/s] Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)
183 * @param wind_alt [m] Altitude (MSL) that this measurement was taken at (NAN if unknown)
184 * @param horiz_accuracy [m/s] Horizontal speed 1-STD accuracy (0 if unknown)
185 * @param vert_accuracy [m/s] Vertical speed 1-STD accuracy (0 if unknown)
186 * @return length of the message in bytes (excluding serial stream start sign)
187 */
188static inline uint16_t mavlink_msg_wind_cov_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
189 mavlink_message_t* msg,
190 uint64_t time_usec,float wind_x,float wind_y,float wind_z,float var_horiz,float var_vert,float wind_alt,float horiz_accuracy,float vert_accuracy)
191{
192#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
194 _mav_put_uint64_t(buf, 0, time_usec);
195 _mav_put_float(buf, 8, wind_x);
196 _mav_put_float(buf, 12, wind_y);
197 _mav_put_float(buf, 16, wind_z);
198 _mav_put_float(buf, 20, var_horiz);
199 _mav_put_float(buf, 24, var_vert);
200 _mav_put_float(buf, 28, wind_alt);
201 _mav_put_float(buf, 32, horiz_accuracy);
202 _mav_put_float(buf, 36, vert_accuracy);
203
204 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_WIND_COV_LEN);
205#else
206 mavlink_wind_cov_t packet;
207 packet.time_usec = time_usec;
208 packet.wind_x = wind_x;
209 packet.wind_y = wind_y;
210 packet.wind_z = wind_z;
211 packet.var_horiz = var_horiz;
212 packet.var_vert = var_vert;
213 packet.wind_alt = wind_alt;
214 packet.horiz_accuracy = horiz_accuracy;
215 packet.vert_accuracy = vert_accuracy;
216
217 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_WIND_COV_LEN);
218#endif
219
220 msg->msgid = MAVLINK_MSG_ID_WIND_COV;
221 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
222}
223
224/**
225 * @brief Encode a wind_cov struct
226 *
227 * @param system_id ID of this system
228 * @param component_id ID of this component (e.g. 200 for IMU)
229 * @param msg The MAVLink message to compress the data into
230 * @param wind_cov C-struct to read the message contents from
231 */
232static inline uint16_t mavlink_msg_wind_cov_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_wind_cov_t* wind_cov)
233{
234 return mavlink_msg_wind_cov_pack(system_id, component_id, msg, wind_cov->time_usec, wind_cov->wind_x, wind_cov->wind_y, wind_cov->wind_z, wind_cov->var_horiz, wind_cov->var_vert, wind_cov->wind_alt, wind_cov->horiz_accuracy, wind_cov->vert_accuracy);
235}
236
237/**
238 * @brief Encode a wind_cov struct on a channel
239 *
240 * @param system_id ID of this system
241 * @param component_id ID of this component (e.g. 200 for IMU)
242 * @param chan The MAVLink channel this message will be sent over
243 * @param msg The MAVLink message to compress the data into
244 * @param wind_cov C-struct to read the message contents from
245 */
246static inline uint16_t mavlink_msg_wind_cov_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_wind_cov_t* wind_cov)
247{
248 return mavlink_msg_wind_cov_pack_chan(system_id, component_id, chan, msg, wind_cov->time_usec, wind_cov->wind_x, wind_cov->wind_y, wind_cov->wind_z, wind_cov->var_horiz, wind_cov->var_vert, wind_cov->wind_alt, wind_cov->horiz_accuracy, wind_cov->vert_accuracy);
249}
250
251/**
252 * @brief Encode a wind_cov struct with provided status structure
253 *
254 * @param system_id ID of this system
255 * @param component_id ID of this component (e.g. 200 for IMU)
256 * @param status MAVLink status structure
257 * @param msg The MAVLink message to compress the data into
258 * @param wind_cov C-struct to read the message contents from
259 */
260static inline uint16_t mavlink_msg_wind_cov_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_wind_cov_t* wind_cov)
261{
262 return mavlink_msg_wind_cov_pack_status(system_id, component_id, _status, msg, wind_cov->time_usec, wind_cov->wind_x, wind_cov->wind_y, wind_cov->wind_z, wind_cov->var_horiz, wind_cov->var_vert, wind_cov->wind_alt, wind_cov->horiz_accuracy, wind_cov->vert_accuracy);
263}
264
265/**
266 * @brief Send a wind_cov message
267 * @param chan MAVLink channel to send the message
268 *
269 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
270 * @param wind_x [m/s] Wind in North (NED) direction (NAN if unknown)
271 * @param wind_y [m/s] Wind in East (NED) direction (NAN if unknown)
272 * @param wind_z [m/s] Wind in down (NED) direction (NAN if unknown)
273 * @param var_horiz [m/s] Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)
274 * @param var_vert [m/s] Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)
275 * @param wind_alt [m] Altitude (MSL) that this measurement was taken at (NAN if unknown)
276 * @param horiz_accuracy [m/s] Horizontal speed 1-STD accuracy (0 if unknown)
277 * @param vert_accuracy [m/s] Vertical speed 1-STD accuracy (0 if unknown)
278 */
279#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
280
281static inline void mavlink_msg_wind_cov_send(mavlink_channel_t chan, uint64_t time_usec, float wind_x, float wind_y, float wind_z, float var_horiz, float var_vert, float wind_alt, float horiz_accuracy, float vert_accuracy)
282{
283#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
284 char buf[MAVLINK_MSG_ID_WIND_COV_LEN];
285 _mav_put_uint64_t(buf, 0, time_usec);
286 _mav_put_float(buf, 8, wind_x);
287 _mav_put_float(buf, 12, wind_y);
288 _mav_put_float(buf, 16, wind_z);
289 _mav_put_float(buf, 20, var_horiz);
290 _mav_put_float(buf, 24, var_vert);
291 _mav_put_float(buf, 28, wind_alt);
292 _mav_put_float(buf, 32, horiz_accuracy);
293 _mav_put_float(buf, 36, vert_accuracy);
294
295 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, buf, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
296#else
297 mavlink_wind_cov_t packet;
298 packet.time_usec = time_usec;
299 packet.wind_x = wind_x;
300 packet.wind_y = wind_y;
301 packet.wind_z = wind_z;
302 packet.var_horiz = var_horiz;
303 packet.var_vert = var_vert;
304 packet.wind_alt = wind_alt;
305 packet.horiz_accuracy = horiz_accuracy;
306 packet.vert_accuracy = vert_accuracy;
307
308 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)&packet, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
309#endif
310}
311
312/**
313 * @brief Send a wind_cov message
314 * @param chan MAVLink channel to send the message
315 * @param struct The MAVLink struct to serialize
316 */
317static inline void mavlink_msg_wind_cov_send_struct(mavlink_channel_t chan, const mavlink_wind_cov_t* wind_cov)
318{
319#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
320 mavlink_msg_wind_cov_send(chan, wind_cov->time_usec, wind_cov->wind_x, wind_cov->wind_y, wind_cov->wind_z, wind_cov->var_horiz, wind_cov->var_vert, wind_cov->wind_alt, wind_cov->horiz_accuracy, wind_cov->vert_accuracy);
321#else
322 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)wind_cov, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
323#endif
324}
325
326#if MAVLINK_MSG_ID_WIND_COV_LEN <= MAVLINK_MAX_PAYLOAD_LEN
327/*
328 This variant of _send() can be used to save stack space by reusing
329 memory from the receive buffer. The caller provides a
330 mavlink_message_t which is the size of a full mavlink message. This
331 is usually the receive buffer for the channel, and allows a reply to an
332 incoming message with minimum stack space usage.
333 */
334static inline void mavlink_msg_wind_cov_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, float wind_x, float wind_y, float wind_z, float var_horiz, float var_vert, float wind_alt, float horiz_accuracy, float vert_accuracy)
335{
336#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
337 char *buf = (char *)msgbuf;
338 _mav_put_uint64_t(buf, 0, time_usec);
339 _mav_put_float(buf, 8, wind_x);
340 _mav_put_float(buf, 12, wind_y);
341 _mav_put_float(buf, 16, wind_z);
342 _mav_put_float(buf, 20, var_horiz);
343 _mav_put_float(buf, 24, var_vert);
344 _mav_put_float(buf, 28, wind_alt);
345 _mav_put_float(buf, 32, horiz_accuracy);
346 _mav_put_float(buf, 36, vert_accuracy);
347
348 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, buf, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
349#else
350 mavlink_wind_cov_t *packet = (mavlink_wind_cov_t *)msgbuf;
351 packet->time_usec = time_usec;
352 packet->wind_x = wind_x;
353 packet->wind_y = wind_y;
354 packet->wind_z = wind_z;
355 packet->var_horiz = var_horiz;
356 packet->var_vert = var_vert;
357 packet->wind_alt = wind_alt;
358 packet->horiz_accuracy = horiz_accuracy;
359 packet->vert_accuracy = vert_accuracy;
360
361 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_WIND_COV, (const char *)packet, MAVLINK_MSG_ID_WIND_COV_MIN_LEN, MAVLINK_MSG_ID_WIND_COV_LEN, MAVLINK_MSG_ID_WIND_COV_CRC);
362#endif
363}
364#endif
365
366#endif
367
368// MESSAGE WIND_COV UNPACKING
369
370
371/**
372 * @brief Get field time_usec from wind_cov message
373 *
374 * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
375 */
376static inline uint64_t mavlink_msg_wind_cov_get_time_usec(const mavlink_message_t* msg)
377{
378 return _MAV_RETURN_uint64_t(msg, 0);
379}
380
381/**
382 * @brief Get field wind_x from wind_cov message
383 *
384 * @return [m/s] Wind in North (NED) direction (NAN if unknown)
385 */
386static inline float mavlink_msg_wind_cov_get_wind_x(const mavlink_message_t* msg)
387{
388 return _MAV_RETURN_float(msg, 8);
389}
390
391/**
392 * @brief Get field wind_y from wind_cov message
393 *
394 * @return [m/s] Wind in East (NED) direction (NAN if unknown)
395 */
396static inline float mavlink_msg_wind_cov_get_wind_y(const mavlink_message_t* msg)
397{
398 return _MAV_RETURN_float(msg, 12);
399}
400
401/**
402 * @brief Get field wind_z from wind_cov message
403 *
404 * @return [m/s] Wind in down (NED) direction (NAN if unknown)
405 */
406static inline float mavlink_msg_wind_cov_get_wind_z(const mavlink_message_t* msg)
407{
408 return _MAV_RETURN_float(msg, 16);
409}
410
411/**
412 * @brief Get field var_horiz from wind_cov message
413 *
414 * @return [m/s] Variability of wind in XY, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)
415 */
416static inline float mavlink_msg_wind_cov_get_var_horiz(const mavlink_message_t* msg)
417{
418 return _MAV_RETURN_float(msg, 20);
419}
420
421/**
422 * @brief Get field var_vert from wind_cov message
423 *
424 * @return [m/s] Variability of wind in Z, 1-STD estimated from a 1 Hz lowpassed wind estimate (NAN if unknown)
425 */
426static inline float mavlink_msg_wind_cov_get_var_vert(const mavlink_message_t* msg)
427{
428 return _MAV_RETURN_float(msg, 24);
429}
430
431/**
432 * @brief Get field wind_alt from wind_cov message
433 *
434 * @return [m] Altitude (MSL) that this measurement was taken at (NAN if unknown)
435 */
436static inline float mavlink_msg_wind_cov_get_wind_alt(const mavlink_message_t* msg)
437{
438 return _MAV_RETURN_float(msg, 28);
439}
440
441/**
442 * @brief Get field horiz_accuracy from wind_cov message
443 *
444 * @return [m/s] Horizontal speed 1-STD accuracy (0 if unknown)
445 */
446static inline float mavlink_msg_wind_cov_get_horiz_accuracy(const mavlink_message_t* msg)
447{
448 return _MAV_RETURN_float(msg, 32);
449}
450
451/**
452 * @brief Get field vert_accuracy from wind_cov message
453 *
454 * @return [m/s] Vertical speed 1-STD accuracy (0 if unknown)
455 */
456static inline float mavlink_msg_wind_cov_get_vert_accuracy(const mavlink_message_t* msg)
457{
458 return _MAV_RETURN_float(msg, 36);
459}
460
461/**
462 * @brief Decode a wind_cov message into a struct
463 *
464 * @param msg The message to decode
465 * @param wind_cov C-struct to decode the message contents into
466 */
467static inline void mavlink_msg_wind_cov_decode(const mavlink_message_t* msg, mavlink_wind_cov_t* wind_cov)
468{
469#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
470 wind_cov->time_usec = mavlink_msg_wind_cov_get_time_usec(msg);
471 wind_cov->wind_x = mavlink_msg_wind_cov_get_wind_x(msg);
472 wind_cov->wind_y = mavlink_msg_wind_cov_get_wind_y(msg);
473 wind_cov->wind_z = mavlink_msg_wind_cov_get_wind_z(msg);
474 wind_cov->var_horiz = mavlink_msg_wind_cov_get_var_horiz(msg);
475 wind_cov->var_vert = mavlink_msg_wind_cov_get_var_vert(msg);
476 wind_cov->wind_alt = mavlink_msg_wind_cov_get_wind_alt(msg);
477 wind_cov->horiz_accuracy = mavlink_msg_wind_cov_get_horiz_accuracy(msg);
478 wind_cov->vert_accuracy = mavlink_msg_wind_cov_get_vert_accuracy(msg);
479#else
480 uint8_t len = msg->len < MAVLINK_MSG_ID_WIND_COV_LEN? msg->len : MAVLINK_MSG_ID_WIND_COV_LEN;
481 memset(wind_cov, 0, MAVLINK_MSG_ID_WIND_COV_LEN);
482 memcpy(wind_cov, _MAV_PAYLOAD(msg), len);
483#endif
484}