Merge remote-tracking branch 'upstream/master' into abo_fw_alt_vel_control
[inav.git] / lib / main / MAVLink / common / mavlink_msg_link_node_status.h
blob8da7b71d9e7cad255d3807822bd612a5d89824dd
1 #pragma once
2 // MESSAGE LINK_NODE_STATUS PACKING
4 #define MAVLINK_MSG_ID_LINK_NODE_STATUS 8
7 typedef struct __mavlink_link_node_status_t {
8 uint64_t timestamp; /*< [ms] Timestamp (time since system boot).*/
9 uint32_t tx_rate; /*< [bytes/s] Transmit rate*/
10 uint32_t rx_rate; /*< [bytes/s] Receive rate*/
11 uint32_t messages_sent; /*< Messages sent*/
12 uint32_t messages_received; /*< Messages received (estimated from counting seq)*/
13 uint32_t messages_lost; /*< Messages lost (estimated from counting seq)*/
14 uint16_t rx_parse_err; /*< [bytes] Number of bytes that could not be parsed correctly.*/
15 uint16_t tx_overflows; /*< [bytes] Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX*/
16 uint16_t rx_overflows; /*< [bytes] Receive buffer overflows. This number wraps around as it reaches UINT16_MAX*/
17 uint8_t tx_buf; /*< [%] Remaining free transmit buffer space*/
18 uint8_t rx_buf; /*< [%] Remaining free receive buffer space*/
19 } mavlink_link_node_status_t;
21 #define MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN 36
22 #define MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN 36
23 #define MAVLINK_MSG_ID_8_LEN 36
24 #define MAVLINK_MSG_ID_8_MIN_LEN 36
26 #define MAVLINK_MSG_ID_LINK_NODE_STATUS_CRC 117
27 #define MAVLINK_MSG_ID_8_CRC 117
31 #if MAVLINK_COMMAND_24BIT
32 #define MAVLINK_MESSAGE_INFO_LINK_NODE_STATUS { \
33 8, \
34 "LINK_NODE_STATUS", \
35 11, \
36 { { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_link_node_status_t, timestamp) }, \
37 { "tx_buf", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_link_node_status_t, tx_buf) }, \
38 { "rx_buf", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_link_node_status_t, rx_buf) }, \
39 { "tx_rate", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_link_node_status_t, tx_rate) }, \
40 { "rx_rate", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_link_node_status_t, rx_rate) }, \
41 { "rx_parse_err", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_link_node_status_t, rx_parse_err) }, \
42 { "tx_overflows", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_link_node_status_t, tx_overflows) }, \
43 { "rx_overflows", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_link_node_status_t, rx_overflows) }, \
44 { "messages_sent", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_link_node_status_t, messages_sent) }, \
45 { "messages_received", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_link_node_status_t, messages_received) }, \
46 { "messages_lost", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_link_node_status_t, messages_lost) }, \
47 } \
49 #else
50 #define MAVLINK_MESSAGE_INFO_LINK_NODE_STATUS { \
51 "LINK_NODE_STATUS", \
52 11, \
53 { { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_link_node_status_t, timestamp) }, \
54 { "tx_buf", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_link_node_status_t, tx_buf) }, \
55 { "rx_buf", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_link_node_status_t, rx_buf) }, \
56 { "tx_rate", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_link_node_status_t, tx_rate) }, \
57 { "rx_rate", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_link_node_status_t, rx_rate) }, \
58 { "rx_parse_err", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_link_node_status_t, rx_parse_err) }, \
59 { "tx_overflows", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_link_node_status_t, tx_overflows) }, \
60 { "rx_overflows", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_link_node_status_t, rx_overflows) }, \
61 { "messages_sent", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_link_node_status_t, messages_sent) }, \
62 { "messages_received", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_link_node_status_t, messages_received) }, \
63 { "messages_lost", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_link_node_status_t, messages_lost) }, \
64 } \
66 #endif
68 /**
69 * @brief Pack a link_node_status message
70 * @param system_id ID of this system
71 * @param component_id ID of this component (e.g. 200 for IMU)
72 * @param msg The MAVLink message to compress the data into
74 * @param timestamp [ms] Timestamp (time since system boot).
75 * @param tx_buf [%] Remaining free transmit buffer space
76 * @param rx_buf [%] Remaining free receive buffer space
77 * @param tx_rate [bytes/s] Transmit rate
78 * @param rx_rate [bytes/s] Receive rate
79 * @param rx_parse_err [bytes] Number of bytes that could not be parsed correctly.
80 * @param tx_overflows [bytes] Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX
81 * @param rx_overflows [bytes] Receive buffer overflows. This number wraps around as it reaches UINT16_MAX
82 * @param messages_sent Messages sent
83 * @param messages_received Messages received (estimated from counting seq)
84 * @param messages_lost Messages lost (estimated from counting seq)
85 * @return length of the message in bytes (excluding serial stream start sign)
87 static inline uint16_t mavlink_msg_link_node_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
88 uint64_t timestamp, uint8_t tx_buf, uint8_t rx_buf, uint32_t tx_rate, uint32_t rx_rate, uint16_t rx_parse_err, uint16_t tx_overflows, uint16_t rx_overflows, uint32_t messages_sent, uint32_t messages_received, uint32_t messages_lost)
90 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
91 char buf[MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN];
92 _mav_put_uint64_t(buf, 0, timestamp);
93 _mav_put_uint32_t(buf, 8, tx_rate);
94 _mav_put_uint32_t(buf, 12, rx_rate);
95 _mav_put_uint32_t(buf, 16, messages_sent);
96 _mav_put_uint32_t(buf, 20, messages_received);
97 _mav_put_uint32_t(buf, 24, messages_lost);
98 _mav_put_uint16_t(buf, 28, rx_parse_err);
99 _mav_put_uint16_t(buf, 30, tx_overflows);
100 _mav_put_uint16_t(buf, 32, rx_overflows);
101 _mav_put_uint8_t(buf, 34, tx_buf);
102 _mav_put_uint8_t(buf, 35, rx_buf);
104 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN);
105 #else
106 mavlink_link_node_status_t packet;
107 packet.timestamp = timestamp;
108 packet.tx_rate = tx_rate;
109 packet.rx_rate = rx_rate;
110 packet.messages_sent = messages_sent;
111 packet.messages_received = messages_received;
112 packet.messages_lost = messages_lost;
113 packet.rx_parse_err = rx_parse_err;
114 packet.tx_overflows = tx_overflows;
115 packet.rx_overflows = rx_overflows;
116 packet.tx_buf = tx_buf;
117 packet.rx_buf = rx_buf;
119 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN);
120 #endif
122 msg->msgid = MAVLINK_MSG_ID_LINK_NODE_STATUS;
123 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_CRC);
127 * @brief Pack a link_node_status message on a channel
128 * @param system_id ID of this system
129 * @param component_id ID of this component (e.g. 200 for IMU)
130 * @param chan The MAVLink channel this message will be sent over
131 * @param msg The MAVLink message to compress the data into
132 * @param timestamp [ms] Timestamp (time since system boot).
133 * @param tx_buf [%] Remaining free transmit buffer space
134 * @param rx_buf [%] Remaining free receive buffer space
135 * @param tx_rate [bytes/s] Transmit rate
136 * @param rx_rate [bytes/s] Receive rate
137 * @param rx_parse_err [bytes] Number of bytes that could not be parsed correctly.
138 * @param tx_overflows [bytes] Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX
139 * @param rx_overflows [bytes] Receive buffer overflows. This number wraps around as it reaches UINT16_MAX
140 * @param messages_sent Messages sent
141 * @param messages_received Messages received (estimated from counting seq)
142 * @param messages_lost Messages lost (estimated from counting seq)
143 * @return length of the message in bytes (excluding serial stream start sign)
145 static inline uint16_t mavlink_msg_link_node_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
146 mavlink_message_t* msg,
147 uint64_t timestamp,uint8_t tx_buf,uint8_t rx_buf,uint32_t tx_rate,uint32_t rx_rate,uint16_t rx_parse_err,uint16_t tx_overflows,uint16_t rx_overflows,uint32_t messages_sent,uint32_t messages_received,uint32_t messages_lost)
149 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
150 char buf[MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN];
151 _mav_put_uint64_t(buf, 0, timestamp);
152 _mav_put_uint32_t(buf, 8, tx_rate);
153 _mav_put_uint32_t(buf, 12, rx_rate);
154 _mav_put_uint32_t(buf, 16, messages_sent);
155 _mav_put_uint32_t(buf, 20, messages_received);
156 _mav_put_uint32_t(buf, 24, messages_lost);
157 _mav_put_uint16_t(buf, 28, rx_parse_err);
158 _mav_put_uint16_t(buf, 30, tx_overflows);
159 _mav_put_uint16_t(buf, 32, rx_overflows);
160 _mav_put_uint8_t(buf, 34, tx_buf);
161 _mav_put_uint8_t(buf, 35, rx_buf);
163 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN);
164 #else
165 mavlink_link_node_status_t packet;
166 packet.timestamp = timestamp;
167 packet.tx_rate = tx_rate;
168 packet.rx_rate = rx_rate;
169 packet.messages_sent = messages_sent;
170 packet.messages_received = messages_received;
171 packet.messages_lost = messages_lost;
172 packet.rx_parse_err = rx_parse_err;
173 packet.tx_overflows = tx_overflows;
174 packet.rx_overflows = rx_overflows;
175 packet.tx_buf = tx_buf;
176 packet.rx_buf = rx_buf;
178 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN);
179 #endif
181 msg->msgid = MAVLINK_MSG_ID_LINK_NODE_STATUS;
182 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_CRC);
186 * @brief Encode a link_node_status struct
188 * @param system_id ID of this system
189 * @param component_id ID of this component (e.g. 200 for IMU)
190 * @param msg The MAVLink message to compress the data into
191 * @param link_node_status C-struct to read the message contents from
193 static inline uint16_t mavlink_msg_link_node_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_link_node_status_t* link_node_status)
195 return mavlink_msg_link_node_status_pack(system_id, component_id, msg, link_node_status->timestamp, link_node_status->tx_buf, link_node_status->rx_buf, link_node_status->tx_rate, link_node_status->rx_rate, link_node_status->rx_parse_err, link_node_status->tx_overflows, link_node_status->rx_overflows, link_node_status->messages_sent, link_node_status->messages_received, link_node_status->messages_lost);
199 * @brief Encode a link_node_status struct on a channel
201 * @param system_id ID of this system
202 * @param component_id ID of this component (e.g. 200 for IMU)
203 * @param chan The MAVLink channel this message will be sent over
204 * @param msg The MAVLink message to compress the data into
205 * @param link_node_status C-struct to read the message contents from
207 static inline uint16_t mavlink_msg_link_node_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_link_node_status_t* link_node_status)
209 return mavlink_msg_link_node_status_pack_chan(system_id, component_id, chan, msg, link_node_status->timestamp, link_node_status->tx_buf, link_node_status->rx_buf, link_node_status->tx_rate, link_node_status->rx_rate, link_node_status->rx_parse_err, link_node_status->tx_overflows, link_node_status->rx_overflows, link_node_status->messages_sent, link_node_status->messages_received, link_node_status->messages_lost);
213 * @brief Send a link_node_status message
214 * @param chan MAVLink channel to send the message
216 * @param timestamp [ms] Timestamp (time since system boot).
217 * @param tx_buf [%] Remaining free transmit buffer space
218 * @param rx_buf [%] Remaining free receive buffer space
219 * @param tx_rate [bytes/s] Transmit rate
220 * @param rx_rate [bytes/s] Receive rate
221 * @param rx_parse_err [bytes] Number of bytes that could not be parsed correctly.
222 * @param tx_overflows [bytes] Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX
223 * @param rx_overflows [bytes] Receive buffer overflows. This number wraps around as it reaches UINT16_MAX
224 * @param messages_sent Messages sent
225 * @param messages_received Messages received (estimated from counting seq)
226 * @param messages_lost Messages lost (estimated from counting seq)
228 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
230 static inline void mavlink_msg_link_node_status_send(mavlink_channel_t chan, uint64_t timestamp, uint8_t tx_buf, uint8_t rx_buf, uint32_t tx_rate, uint32_t rx_rate, uint16_t rx_parse_err, uint16_t tx_overflows, uint16_t rx_overflows, uint32_t messages_sent, uint32_t messages_received, uint32_t messages_lost)
232 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
233 char buf[MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN];
234 _mav_put_uint64_t(buf, 0, timestamp);
235 _mav_put_uint32_t(buf, 8, tx_rate);
236 _mav_put_uint32_t(buf, 12, rx_rate);
237 _mav_put_uint32_t(buf, 16, messages_sent);
238 _mav_put_uint32_t(buf, 20, messages_received);
239 _mav_put_uint32_t(buf, 24, messages_lost);
240 _mav_put_uint16_t(buf, 28, rx_parse_err);
241 _mav_put_uint16_t(buf, 30, tx_overflows);
242 _mav_put_uint16_t(buf, 32, rx_overflows);
243 _mav_put_uint8_t(buf, 34, tx_buf);
244 _mav_put_uint8_t(buf, 35, rx_buf);
246 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LINK_NODE_STATUS, buf, MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_CRC);
247 #else
248 mavlink_link_node_status_t packet;
249 packet.timestamp = timestamp;
250 packet.tx_rate = tx_rate;
251 packet.rx_rate = rx_rate;
252 packet.messages_sent = messages_sent;
253 packet.messages_received = messages_received;
254 packet.messages_lost = messages_lost;
255 packet.rx_parse_err = rx_parse_err;
256 packet.tx_overflows = tx_overflows;
257 packet.rx_overflows = rx_overflows;
258 packet.tx_buf = tx_buf;
259 packet.rx_buf = rx_buf;
261 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LINK_NODE_STATUS, (const char *)&packet, MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_CRC);
262 #endif
266 * @brief Send a link_node_status message
267 * @param chan MAVLink channel to send the message
268 * @param struct The MAVLink struct to serialize
270 static inline void mavlink_msg_link_node_status_send_struct(mavlink_channel_t chan, const mavlink_link_node_status_t* link_node_status)
272 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
273 mavlink_msg_link_node_status_send(chan, link_node_status->timestamp, link_node_status->tx_buf, link_node_status->rx_buf, link_node_status->tx_rate, link_node_status->rx_rate, link_node_status->rx_parse_err, link_node_status->tx_overflows, link_node_status->rx_overflows, link_node_status->messages_sent, link_node_status->messages_received, link_node_status->messages_lost);
274 #else
275 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LINK_NODE_STATUS, (const char *)link_node_status, MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_CRC);
276 #endif
279 #if MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
281 This varient of _send() can be used to save stack space by re-using
282 memory from the receive buffer. The caller provides a
283 mavlink_message_t which is the size of a full mavlink message. This
284 is usually the receive buffer for the channel, and allows a reply to an
285 incoming message with minimum stack space usage.
287 static inline void mavlink_msg_link_node_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t timestamp, uint8_t tx_buf, uint8_t rx_buf, uint32_t tx_rate, uint32_t rx_rate, uint16_t rx_parse_err, uint16_t tx_overflows, uint16_t rx_overflows, uint32_t messages_sent, uint32_t messages_received, uint32_t messages_lost)
289 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
290 char *buf = (char *)msgbuf;
291 _mav_put_uint64_t(buf, 0, timestamp);
292 _mav_put_uint32_t(buf, 8, tx_rate);
293 _mav_put_uint32_t(buf, 12, rx_rate);
294 _mav_put_uint32_t(buf, 16, messages_sent);
295 _mav_put_uint32_t(buf, 20, messages_received);
296 _mav_put_uint32_t(buf, 24, messages_lost);
297 _mav_put_uint16_t(buf, 28, rx_parse_err);
298 _mav_put_uint16_t(buf, 30, tx_overflows);
299 _mav_put_uint16_t(buf, 32, rx_overflows);
300 _mav_put_uint8_t(buf, 34, tx_buf);
301 _mav_put_uint8_t(buf, 35, rx_buf);
303 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LINK_NODE_STATUS, buf, MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_CRC);
304 #else
305 mavlink_link_node_status_t *packet = (mavlink_link_node_status_t *)msgbuf;
306 packet->timestamp = timestamp;
307 packet->tx_rate = tx_rate;
308 packet->rx_rate = rx_rate;
309 packet->messages_sent = messages_sent;
310 packet->messages_received = messages_received;
311 packet->messages_lost = messages_lost;
312 packet->rx_parse_err = rx_parse_err;
313 packet->tx_overflows = tx_overflows;
314 packet->rx_overflows = rx_overflows;
315 packet->tx_buf = tx_buf;
316 packet->rx_buf = rx_buf;
318 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LINK_NODE_STATUS, (const char *)packet, MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN, MAVLINK_MSG_ID_LINK_NODE_STATUS_CRC);
319 #endif
321 #endif
323 #endif
325 // MESSAGE LINK_NODE_STATUS UNPACKING
329 * @brief Get field timestamp from link_node_status message
331 * @return [ms] Timestamp (time since system boot).
333 static inline uint64_t mavlink_msg_link_node_status_get_timestamp(const mavlink_message_t* msg)
335 return _MAV_RETURN_uint64_t(msg, 0);
339 * @brief Get field tx_buf from link_node_status message
341 * @return [%] Remaining free transmit buffer space
343 static inline uint8_t mavlink_msg_link_node_status_get_tx_buf(const mavlink_message_t* msg)
345 return _MAV_RETURN_uint8_t(msg, 34);
349 * @brief Get field rx_buf from link_node_status message
351 * @return [%] Remaining free receive buffer space
353 static inline uint8_t mavlink_msg_link_node_status_get_rx_buf(const mavlink_message_t* msg)
355 return _MAV_RETURN_uint8_t(msg, 35);
359 * @brief Get field tx_rate from link_node_status message
361 * @return [bytes/s] Transmit rate
363 static inline uint32_t mavlink_msg_link_node_status_get_tx_rate(const mavlink_message_t* msg)
365 return _MAV_RETURN_uint32_t(msg, 8);
369 * @brief Get field rx_rate from link_node_status message
371 * @return [bytes/s] Receive rate
373 static inline uint32_t mavlink_msg_link_node_status_get_rx_rate(const mavlink_message_t* msg)
375 return _MAV_RETURN_uint32_t(msg, 12);
379 * @brief Get field rx_parse_err from link_node_status message
381 * @return [bytes] Number of bytes that could not be parsed correctly.
383 static inline uint16_t mavlink_msg_link_node_status_get_rx_parse_err(const mavlink_message_t* msg)
385 return _MAV_RETURN_uint16_t(msg, 28);
389 * @brief Get field tx_overflows from link_node_status message
391 * @return [bytes] Transmit buffer overflows. This number wraps around as it reaches UINT16_MAX
393 static inline uint16_t mavlink_msg_link_node_status_get_tx_overflows(const mavlink_message_t* msg)
395 return _MAV_RETURN_uint16_t(msg, 30);
399 * @brief Get field rx_overflows from link_node_status message
401 * @return [bytes] Receive buffer overflows. This number wraps around as it reaches UINT16_MAX
403 static inline uint16_t mavlink_msg_link_node_status_get_rx_overflows(const mavlink_message_t* msg)
405 return _MAV_RETURN_uint16_t(msg, 32);
409 * @brief Get field messages_sent from link_node_status message
411 * @return Messages sent
413 static inline uint32_t mavlink_msg_link_node_status_get_messages_sent(const mavlink_message_t* msg)
415 return _MAV_RETURN_uint32_t(msg, 16);
419 * @brief Get field messages_received from link_node_status message
421 * @return Messages received (estimated from counting seq)
423 static inline uint32_t mavlink_msg_link_node_status_get_messages_received(const mavlink_message_t* msg)
425 return _MAV_RETURN_uint32_t(msg, 20);
429 * @brief Get field messages_lost from link_node_status message
431 * @return Messages lost (estimated from counting seq)
433 static inline uint32_t mavlink_msg_link_node_status_get_messages_lost(const mavlink_message_t* msg)
435 return _MAV_RETURN_uint32_t(msg, 24);
439 * @brief Decode a link_node_status message into a struct
441 * @param msg The message to decode
442 * @param link_node_status C-struct to decode the message contents into
444 static inline void mavlink_msg_link_node_status_decode(const mavlink_message_t* msg, mavlink_link_node_status_t* link_node_status)
446 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
447 link_node_status->timestamp = mavlink_msg_link_node_status_get_timestamp(msg);
448 link_node_status->tx_rate = mavlink_msg_link_node_status_get_tx_rate(msg);
449 link_node_status->rx_rate = mavlink_msg_link_node_status_get_rx_rate(msg);
450 link_node_status->messages_sent = mavlink_msg_link_node_status_get_messages_sent(msg);
451 link_node_status->messages_received = mavlink_msg_link_node_status_get_messages_received(msg);
452 link_node_status->messages_lost = mavlink_msg_link_node_status_get_messages_lost(msg);
453 link_node_status->rx_parse_err = mavlink_msg_link_node_status_get_rx_parse_err(msg);
454 link_node_status->tx_overflows = mavlink_msg_link_node_status_get_tx_overflows(msg);
455 link_node_status->rx_overflows = mavlink_msg_link_node_status_get_rx_overflows(msg);
456 link_node_status->tx_buf = mavlink_msg_link_node_status_get_tx_buf(msg);
457 link_node_status->rx_buf = mavlink_msg_link_node_status_get_rx_buf(msg);
458 #else
459 uint8_t len = msg->len < MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN? msg->len : MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN;
460 memset(link_node_status, 0, MAVLINK_MSG_ID_LINK_NODE_STATUS_LEN);
461 memcpy(link_node_status, _MAV_PAYLOAD(msg), len);
462 #endif