NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mavlink_msg_limits_status.h
Go to the documentation of this file.
1 // MESSAGE LIMITS_STATUS PACKING
2 
3 #define MAVLINK_MSG_ID_LIMITS_STATUS 167
4 
6 {
7  uint32_t last_trigger;
8  uint32_t last_action;
9  uint32_t last_recovery;
10  uint32_t last_clear;
11  uint16_t breach_count;
12  uint8_t limits_state;
13  uint8_t mods_enabled;
14  uint8_t mods_required;
15  uint8_t mods_triggered;
17 
18 #define MAVLINK_MSG_ID_LIMITS_STATUS_LEN 22
19 #define MAVLINK_MSG_ID_167_LEN 22
20 
21 #define MAVLINK_MSG_ID_LIMITS_STATUS_CRC 144
22 #define MAVLINK_MSG_ID_167_CRC 144
23 
24 
25 
26 #define MAVLINK_MESSAGE_INFO_LIMITS_STATUS { \
27  "LIMITS_STATUS", \
28  9, \
29  { { "last_trigger", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_limits_status_t, last_trigger) }, \
30  { "last_action", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_limits_status_t, last_action) }, \
31  { "last_recovery", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_limits_status_t, last_recovery) }, \
32  { "last_clear", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_limits_status_t, last_clear) }, \
33  { "breach_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_limits_status_t, breach_count) }, \
34  { "limits_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_limits_status_t, limits_state) }, \
35  { "mods_enabled", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_limits_status_t, mods_enabled) }, \
36  { "mods_required", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_limits_status_t, mods_required) }, \
37  { "mods_triggered", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_limits_status_t, mods_triggered) }, \
38  } \
39 }
40 
41 
59 static inline uint16_t mavlink_msg_limits_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
60  uint8_t limits_state, uint32_t last_trigger, uint32_t last_action, uint32_t last_recovery, uint32_t last_clear, uint16_t breach_count, uint8_t mods_enabled, uint8_t mods_required, uint8_t mods_triggered)
61 {
62 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
64  _mav_put_uint32_t(buf, 0, last_trigger);
65  _mav_put_uint32_t(buf, 4, last_action);
66  _mav_put_uint32_t(buf, 8, last_recovery);
67  _mav_put_uint32_t(buf, 12, last_clear);
68  _mav_put_uint16_t(buf, 16, breach_count);
69  _mav_put_uint8_t(buf, 18, limits_state);
70  _mav_put_uint8_t(buf, 19, mods_enabled);
71  _mav_put_uint8_t(buf, 20, mods_required);
72  _mav_put_uint8_t(buf, 21, mods_triggered);
73 
75 #else
77  packet.last_trigger = last_trigger;
78  packet.last_action = last_action;
79  packet.last_recovery = last_recovery;
80  packet.last_clear = last_clear;
81  packet.breach_count = breach_count;
82  packet.limits_state = limits_state;
83  packet.mods_enabled = mods_enabled;
84  packet.mods_required = mods_required;
85  packet.mods_triggered = mods_triggered;
86 
88 #endif
89 
90  msg->msgid = MAVLINK_MSG_ID_LIMITS_STATUS;
91 #if MAVLINK_CRC_EXTRA
93 #else
94  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LIMITS_STATUS_LEN);
95 #endif
96 }
97 
115 static inline uint16_t mavlink_msg_limits_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
116  mavlink_message_t* msg,
117  uint8_t limits_state,uint32_t last_trigger,uint32_t last_action,uint32_t last_recovery,uint32_t last_clear,uint16_t breach_count,uint8_t mods_enabled,uint8_t mods_required,uint8_t mods_triggered)
118 {
119 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
121  _mav_put_uint32_t(buf, 0, last_trigger);
122  _mav_put_uint32_t(buf, 4, last_action);
123  _mav_put_uint32_t(buf, 8, last_recovery);
124  _mav_put_uint32_t(buf, 12, last_clear);
125  _mav_put_uint16_t(buf, 16, breach_count);
126  _mav_put_uint8_t(buf, 18, limits_state);
127  _mav_put_uint8_t(buf, 19, mods_enabled);
128  _mav_put_uint8_t(buf, 20, mods_required);
129  _mav_put_uint8_t(buf, 21, mods_triggered);
130 
132 #else
134  packet.last_trigger = last_trigger;
135  packet.last_action = last_action;
136  packet.last_recovery = last_recovery;
137  packet.last_clear = last_clear;
138  packet.breach_count = breach_count;
139  packet.limits_state = limits_state;
140  packet.mods_enabled = mods_enabled;
141  packet.mods_required = mods_required;
142  packet.mods_triggered = mods_triggered;
143 
145 #endif
146 
147  msg->msgid = MAVLINK_MSG_ID_LIMITS_STATUS;
148 #if MAVLINK_CRC_EXTRA
150 #else
151  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LIMITS_STATUS_LEN);
152 #endif
153 }
154 
163 static inline uint16_t mavlink_msg_limits_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_limits_status_t* limits_status)
164 {
165  return mavlink_msg_limits_status_pack(system_id, component_id, msg, limits_status->limits_state, limits_status->last_trigger, limits_status->last_action, limits_status->last_recovery, limits_status->last_clear, limits_status->breach_count, limits_status->mods_enabled, limits_status->mods_required, limits_status->mods_triggered);
166 }
167 
177 static inline uint16_t mavlink_msg_limits_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_limits_status_t* limits_status)
178 {
179  return mavlink_msg_limits_status_pack_chan(system_id, component_id, chan, msg, limits_status->limits_state, limits_status->last_trigger, limits_status->last_action, limits_status->last_recovery, limits_status->last_clear, limits_status->breach_count, limits_status->mods_enabled, limits_status->mods_required, limits_status->mods_triggered);
180 }
181 
196 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
197 
198 static inline void mavlink_msg_limits_status_send(mavlink_channel_t chan, uint8_t limits_state, uint32_t last_trigger, uint32_t last_action, uint32_t last_recovery, uint32_t last_clear, uint16_t breach_count, uint8_t mods_enabled, uint8_t mods_required, uint8_t mods_triggered)
199 {
200 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
202  _mav_put_uint32_t(buf, 0, last_trigger);
203  _mav_put_uint32_t(buf, 4, last_action);
204  _mav_put_uint32_t(buf, 8, last_recovery);
205  _mav_put_uint32_t(buf, 12, last_clear);
206  _mav_put_uint16_t(buf, 16, breach_count);
207  _mav_put_uint8_t(buf, 18, limits_state);
208  _mav_put_uint8_t(buf, 19, mods_enabled);
209  _mav_put_uint8_t(buf, 20, mods_required);
210  _mav_put_uint8_t(buf, 21, mods_triggered);
211 
212 #if MAVLINK_CRC_EXTRA
214 #else
215  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LIMITS_STATUS, buf, MAVLINK_MSG_ID_LIMITS_STATUS_LEN);
216 #endif
217 #else
219  packet.last_trigger = last_trigger;
220  packet.last_action = last_action;
221  packet.last_recovery = last_recovery;
222  packet.last_clear = last_clear;
223  packet.breach_count = breach_count;
224  packet.limits_state = limits_state;
225  packet.mods_enabled = mods_enabled;
226  packet.mods_required = mods_required;
227  packet.mods_triggered = mods_triggered;
228 
229 #if MAVLINK_CRC_EXTRA
230  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LIMITS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_LIMITS_STATUS_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_CRC);
231 #else
232  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LIMITS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_LIMITS_STATUS_LEN);
233 #endif
234 #endif
235 }
236 
237 #if MAVLINK_MSG_ID_LIMITS_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
238 /*
239  This varient of _send() can be used to save stack space by re-using
240  memory from the receive buffer. The caller provides a
241  mavlink_message_t which is the size of a full mavlink message. This
242  is usually the receive buffer for the channel, and allows a reply to an
243  incoming message with minimum stack space usage.
244  */
245 static inline void mavlink_msg_limits_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t limits_state, uint32_t last_trigger, uint32_t last_action, uint32_t last_recovery, uint32_t last_clear, uint16_t breach_count, uint8_t mods_enabled, uint8_t mods_required, uint8_t mods_triggered)
246 {
247 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
248  char *buf = (char *)msgbuf;
249  _mav_put_uint32_t(buf, 0, last_trigger);
250  _mav_put_uint32_t(buf, 4, last_action);
251  _mav_put_uint32_t(buf, 8, last_recovery);
252  _mav_put_uint32_t(buf, 12, last_clear);
253  _mav_put_uint16_t(buf, 16, breach_count);
254  _mav_put_uint8_t(buf, 18, limits_state);
255  _mav_put_uint8_t(buf, 19, mods_enabled);
256  _mav_put_uint8_t(buf, 20, mods_required);
257  _mav_put_uint8_t(buf, 21, mods_triggered);
258 
259 #if MAVLINK_CRC_EXTRA
261 #else
262  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LIMITS_STATUS, buf, MAVLINK_MSG_ID_LIMITS_STATUS_LEN);
263 #endif
264 #else
266  packet->last_trigger = last_trigger;
267  packet->last_action = last_action;
268  packet->last_recovery = last_recovery;
269  packet->last_clear = last_clear;
270  packet->breach_count = breach_count;
271  packet->limits_state = limits_state;
272  packet->mods_enabled = mods_enabled;
273  packet->mods_required = mods_required;
274  packet->mods_triggered = mods_triggered;
275 
276 #if MAVLINK_CRC_EXTRA
277  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LIMITS_STATUS, (const char *)packet, MAVLINK_MSG_ID_LIMITS_STATUS_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_CRC);
278 #else
279  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LIMITS_STATUS, (const char *)packet, MAVLINK_MSG_ID_LIMITS_STATUS_LEN);
280 #endif
281 #endif
282 }
283 #endif
284 
285 #endif
286 
287 // MESSAGE LIMITS_STATUS UNPACKING
288 
289 
295 static inline uint8_t mavlink_msg_limits_status_get_limits_state(const mavlink_message_t* msg)
296 {
297  return _MAV_RETURN_uint8_t(msg, 18);
298 }
299 
305 static inline uint32_t mavlink_msg_limits_status_get_last_trigger(const mavlink_message_t* msg)
306 {
307  return _MAV_RETURN_uint32_t(msg, 0);
308 }
309 
315 static inline uint32_t mavlink_msg_limits_status_get_last_action(const mavlink_message_t* msg)
316 {
317  return _MAV_RETURN_uint32_t(msg, 4);
318 }
319 
325 static inline uint32_t mavlink_msg_limits_status_get_last_recovery(const mavlink_message_t* msg)
326 {
327  return _MAV_RETURN_uint32_t(msg, 8);
328 }
329 
335 static inline uint32_t mavlink_msg_limits_status_get_last_clear(const mavlink_message_t* msg)
336 {
337  return _MAV_RETURN_uint32_t(msg, 12);
338 }
339 
345 static inline uint16_t mavlink_msg_limits_status_get_breach_count(const mavlink_message_t* msg)
346 {
347  return _MAV_RETURN_uint16_t(msg, 16);
348 }
349 
355 static inline uint8_t mavlink_msg_limits_status_get_mods_enabled(const mavlink_message_t* msg)
356 {
357  return _MAV_RETURN_uint8_t(msg, 19);
358 }
359 
365 static inline uint8_t mavlink_msg_limits_status_get_mods_required(const mavlink_message_t* msg)
366 {
367  return _MAV_RETURN_uint8_t(msg, 20);
368 }
369 
375 static inline uint8_t mavlink_msg_limits_status_get_mods_triggered(const mavlink_message_t* msg)
376 {
377  return _MAV_RETURN_uint8_t(msg, 21);
378 }
379 
386 static inline void mavlink_msg_limits_status_decode(const mavlink_message_t* msg, mavlink_limits_status_t* limits_status)
387 {
388 #if MAVLINK_NEED_BYTE_SWAP
389  limits_status->last_trigger = mavlink_msg_limits_status_get_last_trigger(msg);
390  limits_status->last_action = mavlink_msg_limits_status_get_last_action(msg);
391  limits_status->last_recovery = mavlink_msg_limits_status_get_last_recovery(msg);
392  limits_status->last_clear = mavlink_msg_limits_status_get_last_clear(msg);
393  limits_status->breach_count = mavlink_msg_limits_status_get_breach_count(msg);
394  limits_status->limits_state = mavlink_msg_limits_status_get_limits_state(msg);
395  limits_status->mods_enabled = mavlink_msg_limits_status_get_mods_enabled(msg);
396  limits_status->mods_required = mavlink_msg_limits_status_get_mods_required(msg);
397  limits_status->mods_triggered = mavlink_msg_limits_status_get_mods_triggered(msg);
398 #else
399  memcpy(limits_status, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_LIMITS_STATUS_LEN);
400 #endif
401 }
#define _MAV_RETURN_uint8_t(msg, wire_offset)
Definition: protocol.h:238
#define _mav_put_uint8_t(buf, wire_offset, b)
Definition: protocol.h:134
#define _mav_put_uint16_t(buf, wire_offset, b)
Definition: protocol.h:139
#define _mav_put_uint32_t(buf, wire_offset, b)
Definition: protocol.h:141