Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_available_modes_monitor.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE AVAILABLE_MODES_MONITOR PACKING
3
4#define MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR 437
5
6
8 uint8_t seq; /*< Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically).*/
9} mavlink_available_modes_monitor_t;
10
11#define MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_LEN 1
12#define MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_MIN_LEN 1
13#define MAVLINK_MSG_ID_437_LEN 1
14#define MAVLINK_MSG_ID_437_MIN_LEN 1
15
16#define MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_CRC 30
17#define MAVLINK_MSG_ID_437_CRC 30
18
19
20
21#if MAVLINK_COMMAND_24BIT
22#define MAVLINK_MESSAGE_INFO_AVAILABLE_MODES_MONITOR {
23 437,
24 "AVAILABLE_MODES_MONITOR",
25 1,
26 { { "seq", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_available_modes_monitor_t, seq) },
27 } \
28}
29#else
30#define MAVLINK_MESSAGE_INFO_AVAILABLE_MODES_MONITOR {
31 "AVAILABLE_MODES_MONITOR",
32 1,
33 { { "seq", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_available_modes_monitor_t, seq) },
34 } \
35}
36#endif
37
38/**
39 * @brief Pack a available_modes_monitor message
40 * @param system_id ID of this system
41 * @param component_id ID of this component (e.g. 200 for IMU)
42 * @param msg The MAVLink message to compress the data into
43 *
44 * @param seq Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically).
45 * @return length of the message in bytes (excluding serial stream start sign)
46 */
47static inline uint16_t mavlink_msg_available_modes_monitor_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
48 uint8_t seq)
49{
50#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
52 _mav_put_uint8_t(buf, 0, seq);
53
54 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_LEN);
55#else
56 mavlink_available_modes_monitor_t packet;
57 packet.seq = seq;
58
59 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_LEN);
60#endif
61
64}
65
66/**
67 * @brief Pack a available_modes_monitor message
68 * @param system_id ID of this system
69 * @param component_id ID of this component (e.g. 200 for IMU)
70 * @param status MAVLink status structure
71 * @param msg The MAVLink message to compress the data into
72 *
73 * @param seq Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically).
74 * @return length of the message in bytes (excluding serial stream start sign)
75 */
76static inline uint16_t mavlink_msg_available_modes_monitor_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
77 uint8_t seq)
78{
79#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
81 _mav_put_uint8_t(buf, 0, seq);
82
83 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_LEN);
84#else
85 mavlink_available_modes_monitor_t packet;
86 packet.seq = seq;
87
88 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_LEN);
89#endif
90
92#if MAVLINK_CRC_EXTRA
93 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_MIN_LEN, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_LEN, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_CRC);
94#else
95 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_MIN_LEN, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_LEN);
96#endif
97}
98
99/**
100 * @brief Pack a available_modes_monitor message on a channel
101 * @param system_id ID of this system
102 * @param component_id ID of this component (e.g. 200 for IMU)
103 * @param chan The MAVLink channel this message will be sent over
104 * @param msg The MAVLink message to compress the data into
105 * @param seq Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically).
106 * @return length of the message in bytes (excluding serial stream start sign)
107 */
108static inline uint16_t mavlink_msg_available_modes_monitor_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
109 mavlink_message_t* msg,
110 uint8_t seq)
111{
112#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
114 _mav_put_uint8_t(buf, 0, seq);
115
116 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_LEN);
117#else
118 mavlink_available_modes_monitor_t packet;
119 packet.seq = seq;
120
121 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_LEN);
122#endif
123
126}
127
128/**
129 * @brief Encode a available_modes_monitor struct
130 *
131 * @param system_id ID of this system
132 * @param component_id ID of this component (e.g. 200 for IMU)
133 * @param msg The MAVLink message to compress the data into
134 * @param available_modes_monitor C-struct to read the message contents from
135 */
136static inline uint16_t mavlink_msg_available_modes_monitor_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_available_modes_monitor_t* available_modes_monitor)
137{
138 return mavlink_msg_available_modes_monitor_pack(system_id, component_id, msg, available_modes_monitor->seq);
139}
140
141/**
142 * @brief Encode a available_modes_monitor struct on a channel
143 *
144 * @param system_id ID of this system
145 * @param component_id ID of this component (e.g. 200 for IMU)
146 * @param chan The MAVLink channel this message will be sent over
147 * @param msg The MAVLink message to compress the data into
148 * @param available_modes_monitor C-struct to read the message contents from
149 */
150static inline uint16_t mavlink_msg_available_modes_monitor_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_available_modes_monitor_t* available_modes_monitor)
151{
152 return mavlink_msg_available_modes_monitor_pack_chan(system_id, component_id, chan, msg, available_modes_monitor->seq);
153}
154
155/**
156 * @brief Encode a available_modes_monitor struct with provided status structure
157 *
158 * @param system_id ID of this system
159 * @param component_id ID of this component (e.g. 200 for IMU)
160 * @param status MAVLink status structure
161 * @param msg The MAVLink message to compress the data into
162 * @param available_modes_monitor C-struct to read the message contents from
163 */
164static inline uint16_t mavlink_msg_available_modes_monitor_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_available_modes_monitor_t* available_modes_monitor)
165{
166 return mavlink_msg_available_modes_monitor_pack_status(system_id, component_id, _status, msg, available_modes_monitor->seq);
167}
168
169/**
170 * @brief Send a available_modes_monitor message
171 * @param chan MAVLink channel to send the message
172 *
173 * @param seq Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically).
174 */
175#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
176
177static inline void mavlink_msg_available_modes_monitor_send(mavlink_channel_t chan, uint8_t seq)
178{
179#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
180 char buf[MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_LEN];
181 _mav_put_uint8_t(buf, 0, seq);
182
183 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR, buf, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_MIN_LEN, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_LEN, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_CRC);
184#else
185 mavlink_available_modes_monitor_t packet;
186 packet.seq = seq;
187
188 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR, (const char *)&packet, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_MIN_LEN, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_LEN, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_CRC);
189#endif
190}
191
192/**
193 * @brief Send a available_modes_monitor message
194 * @param chan MAVLink channel to send the message
195 * @param struct The MAVLink struct to serialize
196 */
197static inline void mavlink_msg_available_modes_monitor_send_struct(mavlink_channel_t chan, const mavlink_available_modes_monitor_t* available_modes_monitor)
198{
199#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
200 mavlink_msg_available_modes_monitor_send(chan, available_modes_monitor->seq);
201#else
202 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR, (const char *)available_modes_monitor, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_MIN_LEN, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_LEN, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_CRC);
203#endif
204}
205
206#if MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_LEN <= MAVLINK_MAX_PAYLOAD_LEN
207/*
208 This variant of _send() can be used to save stack space by reusing
209 memory from the receive buffer. The caller provides a
210 mavlink_message_t which is the size of a full mavlink message. This
211 is usually the receive buffer for the channel, and allows a reply to an
212 incoming message with minimum stack space usage.
213 */
214static inline void mavlink_msg_available_modes_monitor_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t seq)
215{
216#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
217 char *buf = (char *)msgbuf;
218 _mav_put_uint8_t(buf, 0, seq);
219
220 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR, buf, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_MIN_LEN, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_LEN, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_CRC);
221#else
222 mavlink_available_modes_monitor_t *packet = (mavlink_available_modes_monitor_t *)msgbuf;
223 packet->seq = seq;
224
225 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR, (const char *)packet, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_MIN_LEN, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_LEN, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_CRC);
226#endif
227}
228#endif
229
230#endif
231
232// MESSAGE AVAILABLE_MODES_MONITOR UNPACKING
233
234
235/**
236 * @brief Get field seq from available_modes_monitor message
237 *
238 * @return Sequence number. The value iterates sequentially whenever AVAILABLE_MODES changes (e.g. support for a new mode is added/removed dynamically).
239 */
240static inline uint8_t mavlink_msg_available_modes_monitor_get_seq(const mavlink_message_t* msg)
241{
242 return _MAV_RETURN_uint8_t(msg, 0);
243}
244
245/**
246 * @brief Decode a available_modes_monitor message into a struct
247 *
248 * @param msg The message to decode
249 * @param available_modes_monitor C-struct to decode the message contents into
250 */
251static inline void mavlink_msg_available_modes_monitor_decode(const mavlink_message_t* msg, mavlink_available_modes_monitor_t* available_modes_monitor)
252{
253#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
254 available_modes_monitor->seq = mavlink_msg_available_modes_monitor_get_seq(msg);
255#else
256 uint8_t len = msg->len < MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_LEN? msg->len : MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_LEN;
257 memset(available_modes_monitor, 0, MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_LEN);
258 memcpy(available_modes_monitor, _MAV_PAYLOAD(msg), len);
259#endif
260}