You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

413 lines
19 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #pragma once
  2. // MESSAGE LIMITS_STATUS PACKING
  3. #define MAVLINK_MSG_ID_LIMITS_STATUS 167
  4. MAVPACKED(
  5. typedef struct __mavlink_limits_status_t {
  6. uint32_t last_trigger; /*< [ms] Time (since boot) of last breach.*/
  7. uint32_t last_action; /*< [ms] Time (since boot) of last recovery action.*/
  8. uint32_t last_recovery; /*< [ms] Time (since boot) of last successful recovery.*/
  9. uint32_t last_clear; /*< [ms] Time (since boot) of last all-clear.*/
  10. uint16_t breach_count; /*< Number of fence breaches.*/
  11. uint8_t limits_state; /*< State of AP_Limits.*/
  12. uint8_t mods_enabled; /*< AP_Limit_Module bitfield of enabled modules.*/
  13. uint8_t mods_required; /*< AP_Limit_Module bitfield of required modules.*/
  14. uint8_t mods_triggered; /*< AP_Limit_Module bitfield of triggered modules.*/
  15. }) mavlink_limits_status_t;
  16. #define MAVLINK_MSG_ID_LIMITS_STATUS_LEN 22
  17. #define MAVLINK_MSG_ID_LIMITS_STATUS_MIN_LEN 22
  18. #define MAVLINK_MSG_ID_167_LEN 22
  19. #define MAVLINK_MSG_ID_167_MIN_LEN 22
  20. #define MAVLINK_MSG_ID_LIMITS_STATUS_CRC 144
  21. #define MAVLINK_MSG_ID_167_CRC 144
  22. #if MAVLINK_COMMAND_24BIT
  23. #define MAVLINK_MESSAGE_INFO_LIMITS_STATUS { \
  24. 167, \
  25. "LIMITS_STATUS", \
  26. 9, \
  27. { { "limits_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_limits_status_t, limits_state) }, \
  28. { "last_trigger", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_limits_status_t, last_trigger) }, \
  29. { "last_action", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_limits_status_t, last_action) }, \
  30. { "last_recovery", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_limits_status_t, last_recovery) }, \
  31. { "last_clear", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_limits_status_t, last_clear) }, \
  32. { "breach_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_limits_status_t, breach_count) }, \
  33. { "mods_enabled", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_limits_status_t, mods_enabled) }, \
  34. { "mods_required", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_limits_status_t, mods_required) }, \
  35. { "mods_triggered", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_limits_status_t, mods_triggered) }, \
  36. } \
  37. }
  38. #else
  39. #define MAVLINK_MESSAGE_INFO_LIMITS_STATUS { \
  40. "LIMITS_STATUS", \
  41. 9, \
  42. { { "limits_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_limits_status_t, limits_state) }, \
  43. { "last_trigger", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_limits_status_t, last_trigger) }, \
  44. { "last_action", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_limits_status_t, last_action) }, \
  45. { "last_recovery", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_limits_status_t, last_recovery) }, \
  46. { "last_clear", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_limits_status_t, last_clear) }, \
  47. { "breach_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_limits_status_t, breach_count) }, \
  48. { "mods_enabled", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_limits_status_t, mods_enabled) }, \
  49. { "mods_required", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_limits_status_t, mods_required) }, \
  50. { "mods_triggered", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_limits_status_t, mods_triggered) }, \
  51. } \
  52. }
  53. #endif
  54. /**
  55. * @brief Pack a limits_status message
  56. * @param system_id ID of this system
  57. * @param component_id ID of this component (e.g. 200 for IMU)
  58. * @param msg The MAVLink message to compress the data into
  59. *
  60. * @param limits_state State of AP_Limits.
  61. * @param last_trigger [ms] Time (since boot) of last breach.
  62. * @param last_action [ms] Time (since boot) of last recovery action.
  63. * @param last_recovery [ms] Time (since boot) of last successful recovery.
  64. * @param last_clear [ms] Time (since boot) of last all-clear.
  65. * @param breach_count Number of fence breaches.
  66. * @param mods_enabled AP_Limit_Module bitfield of enabled modules.
  67. * @param mods_required AP_Limit_Module bitfield of required modules.
  68. * @param mods_triggered AP_Limit_Module bitfield of triggered modules.
  69. * @return length of the message in bytes (excluding serial stream start sign)
  70. */
  71. static inline uint16_t mavlink_msg_limits_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  72. 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)
  73. {
  74. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  75. char buf[MAVLINK_MSG_ID_LIMITS_STATUS_LEN];
  76. _mav_put_uint32_t(buf, 0, last_trigger);
  77. _mav_put_uint32_t(buf, 4, last_action);
  78. _mav_put_uint32_t(buf, 8, last_recovery);
  79. _mav_put_uint32_t(buf, 12, last_clear);
  80. _mav_put_uint16_t(buf, 16, breach_count);
  81. _mav_put_uint8_t(buf, 18, limits_state);
  82. _mav_put_uint8_t(buf, 19, mods_enabled);
  83. _mav_put_uint8_t(buf, 20, mods_required);
  84. _mav_put_uint8_t(buf, 21, mods_triggered);
  85. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LIMITS_STATUS_LEN);
  86. #else
  87. mavlink_limits_status_t packet;
  88. packet.last_trigger = last_trigger;
  89. packet.last_action = last_action;
  90. packet.last_recovery = last_recovery;
  91. packet.last_clear = last_clear;
  92. packet.breach_count = breach_count;
  93. packet.limits_state = limits_state;
  94. packet.mods_enabled = mods_enabled;
  95. packet.mods_required = mods_required;
  96. packet.mods_triggered = mods_triggered;
  97. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LIMITS_STATUS_LEN);
  98. #endif
  99. msg->msgid = MAVLINK_MSG_ID_LIMITS_STATUS;
  100. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_LIMITS_STATUS_MIN_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_CRC);
  101. }
  102. /**
  103. * @brief Pack a limits_status message on a channel
  104. * @param system_id ID of this system
  105. * @param component_id ID of this component (e.g. 200 for IMU)
  106. * @param chan The MAVLink channel this message will be sent over
  107. * @param msg The MAVLink message to compress the data into
  108. * @param limits_state State of AP_Limits.
  109. * @param last_trigger [ms] Time (since boot) of last breach.
  110. * @param last_action [ms] Time (since boot) of last recovery action.
  111. * @param last_recovery [ms] Time (since boot) of last successful recovery.
  112. * @param last_clear [ms] Time (since boot) of last all-clear.
  113. * @param breach_count Number of fence breaches.
  114. * @param mods_enabled AP_Limit_Module bitfield of enabled modules.
  115. * @param mods_required AP_Limit_Module bitfield of required modules.
  116. * @param mods_triggered AP_Limit_Module bitfield of triggered modules.
  117. * @return length of the message in bytes (excluding serial stream start sign)
  118. */
  119. static inline uint16_t mavlink_msg_limits_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  120. mavlink_message_t* msg,
  121. 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)
  122. {
  123. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  124. char buf[MAVLINK_MSG_ID_LIMITS_STATUS_LEN];
  125. _mav_put_uint32_t(buf, 0, last_trigger);
  126. _mav_put_uint32_t(buf, 4, last_action);
  127. _mav_put_uint32_t(buf, 8, last_recovery);
  128. _mav_put_uint32_t(buf, 12, last_clear);
  129. _mav_put_uint16_t(buf, 16, breach_count);
  130. _mav_put_uint8_t(buf, 18, limits_state);
  131. _mav_put_uint8_t(buf, 19, mods_enabled);
  132. _mav_put_uint8_t(buf, 20, mods_required);
  133. _mav_put_uint8_t(buf, 21, mods_triggered);
  134. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_LIMITS_STATUS_LEN);
  135. #else
  136. mavlink_limits_status_t packet;
  137. packet.last_trigger = last_trigger;
  138. packet.last_action = last_action;
  139. packet.last_recovery = last_recovery;
  140. packet.last_clear = last_clear;
  141. packet.breach_count = breach_count;
  142. packet.limits_state = limits_state;
  143. packet.mods_enabled = mods_enabled;
  144. packet.mods_required = mods_required;
  145. packet.mods_triggered = mods_triggered;
  146. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_LIMITS_STATUS_LEN);
  147. #endif
  148. msg->msgid = MAVLINK_MSG_ID_LIMITS_STATUS;
  149. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_LIMITS_STATUS_MIN_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_CRC);
  150. }
  151. /**
  152. * @brief Encode a limits_status struct
  153. *
  154. * @param system_id ID of this system
  155. * @param component_id ID of this component (e.g. 200 for IMU)
  156. * @param msg The MAVLink message to compress the data into
  157. * @param limits_status C-struct to read the message contents from
  158. */
  159. 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)
  160. {
  161. 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);
  162. }
  163. /**
  164. * @brief Encode a limits_status struct on a channel
  165. *
  166. * @param system_id ID of this system
  167. * @param component_id ID of this component (e.g. 200 for IMU)
  168. * @param chan The MAVLink channel this message will be sent over
  169. * @param msg The MAVLink message to compress the data into
  170. * @param limits_status C-struct to read the message contents from
  171. */
  172. 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)
  173. {
  174. 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);
  175. }
  176. /**
  177. * @brief Send a limits_status message
  178. * @param chan MAVLink channel to send the message
  179. *
  180. * @param limits_state State of AP_Limits.
  181. * @param last_trigger [ms] Time (since boot) of last breach.
  182. * @param last_action [ms] Time (since boot) of last recovery action.
  183. * @param last_recovery [ms] Time (since boot) of last successful recovery.
  184. * @param last_clear [ms] Time (since boot) of last all-clear.
  185. * @param breach_count Number of fence breaches.
  186. * @param mods_enabled AP_Limit_Module bitfield of enabled modules.
  187. * @param mods_required AP_Limit_Module bitfield of required modules.
  188. * @param mods_triggered AP_Limit_Module bitfield of triggered modules.
  189. */
  190. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  191. 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)
  192. {
  193. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  194. char buf[MAVLINK_MSG_ID_LIMITS_STATUS_LEN];
  195. _mav_put_uint32_t(buf, 0, last_trigger);
  196. _mav_put_uint32_t(buf, 4, last_action);
  197. _mav_put_uint32_t(buf, 8, last_recovery);
  198. _mav_put_uint32_t(buf, 12, last_clear);
  199. _mav_put_uint16_t(buf, 16, breach_count);
  200. _mav_put_uint8_t(buf, 18, limits_state);
  201. _mav_put_uint8_t(buf, 19, mods_enabled);
  202. _mav_put_uint8_t(buf, 20, mods_required);
  203. _mav_put_uint8_t(buf, 21, mods_triggered);
  204. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LIMITS_STATUS, buf, MAVLINK_MSG_ID_LIMITS_STATUS_MIN_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_CRC);
  205. #else
  206. mavlink_limits_status_t packet;
  207. packet.last_trigger = last_trigger;
  208. packet.last_action = last_action;
  209. packet.last_recovery = last_recovery;
  210. packet.last_clear = last_clear;
  211. packet.breach_count = breach_count;
  212. packet.limits_state = limits_state;
  213. packet.mods_enabled = mods_enabled;
  214. packet.mods_required = mods_required;
  215. packet.mods_triggered = mods_triggered;
  216. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LIMITS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_LIMITS_STATUS_MIN_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_CRC);
  217. #endif
  218. }
  219. /**
  220. * @brief Send a limits_status message
  221. * @param chan MAVLink channel to send the message
  222. * @param struct The MAVLink struct to serialize
  223. */
  224. static inline void mavlink_msg_limits_status_send_struct(mavlink_channel_t chan, const mavlink_limits_status_t* limits_status)
  225. {
  226. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  227. mavlink_msg_limits_status_send(chan, 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);
  228. #else
  229. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LIMITS_STATUS, (const char *)limits_status, MAVLINK_MSG_ID_LIMITS_STATUS_MIN_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_CRC);
  230. #endif
  231. }
  232. #if MAVLINK_MSG_ID_LIMITS_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  233. /*
  234. This varient of _send() can be used to save stack space by re-using
  235. memory from the receive buffer. The caller provides a
  236. mavlink_message_t which is the size of a full mavlink message. This
  237. is usually the receive buffer for the channel, and allows a reply to an
  238. incoming message with minimum stack space usage.
  239. */
  240. 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)
  241. {
  242. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  243. char *buf = (char *)msgbuf;
  244. _mav_put_uint32_t(buf, 0, last_trigger);
  245. _mav_put_uint32_t(buf, 4, last_action);
  246. _mav_put_uint32_t(buf, 8, last_recovery);
  247. _mav_put_uint32_t(buf, 12, last_clear);
  248. _mav_put_uint16_t(buf, 16, breach_count);
  249. _mav_put_uint8_t(buf, 18, limits_state);
  250. _mav_put_uint8_t(buf, 19, mods_enabled);
  251. _mav_put_uint8_t(buf, 20, mods_required);
  252. _mav_put_uint8_t(buf, 21, mods_triggered);
  253. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LIMITS_STATUS, buf, MAVLINK_MSG_ID_LIMITS_STATUS_MIN_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_CRC);
  254. #else
  255. mavlink_limits_status_t *packet = (mavlink_limits_status_t *)msgbuf;
  256. packet->last_trigger = last_trigger;
  257. packet->last_action = last_action;
  258. packet->last_recovery = last_recovery;
  259. packet->last_clear = last_clear;
  260. packet->breach_count = breach_count;
  261. packet->limits_state = limits_state;
  262. packet->mods_enabled = mods_enabled;
  263. packet->mods_required = mods_required;
  264. packet->mods_triggered = mods_triggered;
  265. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_LIMITS_STATUS, (const char *)packet, MAVLINK_MSG_ID_LIMITS_STATUS_MIN_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_LEN, MAVLINK_MSG_ID_LIMITS_STATUS_CRC);
  266. #endif
  267. }
  268. #endif
  269. #endif
  270. // MESSAGE LIMITS_STATUS UNPACKING
  271. /**
  272. * @brief Get field limits_state from limits_status message
  273. *
  274. * @return State of AP_Limits.
  275. */
  276. static inline uint8_t mavlink_msg_limits_status_get_limits_state(const mavlink_message_t* msg)
  277. {
  278. return _MAV_RETURN_uint8_t(msg, 18);
  279. }
  280. /**
  281. * @brief Get field last_trigger from limits_status message
  282. *
  283. * @return [ms] Time (since boot) of last breach.
  284. */
  285. static inline uint32_t mavlink_msg_limits_status_get_last_trigger(const mavlink_message_t* msg)
  286. {
  287. return _MAV_RETURN_uint32_t(msg, 0);
  288. }
  289. /**
  290. * @brief Get field last_action from limits_status message
  291. *
  292. * @return [ms] Time (since boot) of last recovery action.
  293. */
  294. static inline uint32_t mavlink_msg_limits_status_get_last_action(const mavlink_message_t* msg)
  295. {
  296. return _MAV_RETURN_uint32_t(msg, 4);
  297. }
  298. /**
  299. * @brief Get field last_recovery from limits_status message
  300. *
  301. * @return [ms] Time (since boot) of last successful recovery.
  302. */
  303. static inline uint32_t mavlink_msg_limits_status_get_last_recovery(const mavlink_message_t* msg)
  304. {
  305. return _MAV_RETURN_uint32_t(msg, 8);
  306. }
  307. /**
  308. * @brief Get field last_clear from limits_status message
  309. *
  310. * @return [ms] Time (since boot) of last all-clear.
  311. */
  312. static inline uint32_t mavlink_msg_limits_status_get_last_clear(const mavlink_message_t* msg)
  313. {
  314. return _MAV_RETURN_uint32_t(msg, 12);
  315. }
  316. /**
  317. * @brief Get field breach_count from limits_status message
  318. *
  319. * @return Number of fence breaches.
  320. */
  321. static inline uint16_t mavlink_msg_limits_status_get_breach_count(const mavlink_message_t* msg)
  322. {
  323. return _MAV_RETURN_uint16_t(msg, 16);
  324. }
  325. /**
  326. * @brief Get field mods_enabled from limits_status message
  327. *
  328. * @return AP_Limit_Module bitfield of enabled modules.
  329. */
  330. static inline uint8_t mavlink_msg_limits_status_get_mods_enabled(const mavlink_message_t* msg)
  331. {
  332. return _MAV_RETURN_uint8_t(msg, 19);
  333. }
  334. /**
  335. * @brief Get field mods_required from limits_status message
  336. *
  337. * @return AP_Limit_Module bitfield of required modules.
  338. */
  339. static inline uint8_t mavlink_msg_limits_status_get_mods_required(const mavlink_message_t* msg)
  340. {
  341. return _MAV_RETURN_uint8_t(msg, 20);
  342. }
  343. /**
  344. * @brief Get field mods_triggered from limits_status message
  345. *
  346. * @return AP_Limit_Module bitfield of triggered modules.
  347. */
  348. static inline uint8_t mavlink_msg_limits_status_get_mods_triggered(const mavlink_message_t* msg)
  349. {
  350. return _MAV_RETURN_uint8_t(msg, 21);
  351. }
  352. /**
  353. * @brief Decode a limits_status message into a struct
  354. *
  355. * @param msg The message to decode
  356. * @param limits_status C-struct to decode the message contents into
  357. */
  358. static inline void mavlink_msg_limits_status_decode(const mavlink_message_t* msg, mavlink_limits_status_t* limits_status)
  359. {
  360. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  361. limits_status->last_trigger = mavlink_msg_limits_status_get_last_trigger(msg);
  362. limits_status->last_action = mavlink_msg_limits_status_get_last_action(msg);
  363. limits_status->last_recovery = mavlink_msg_limits_status_get_last_recovery(msg);
  364. limits_status->last_clear = mavlink_msg_limits_status_get_last_clear(msg);
  365. limits_status->breach_count = mavlink_msg_limits_status_get_breach_count(msg);
  366. limits_status->limits_state = mavlink_msg_limits_status_get_limits_state(msg);
  367. limits_status->mods_enabled = mavlink_msg_limits_status_get_mods_enabled(msg);
  368. limits_status->mods_required = mavlink_msg_limits_status_get_mods_required(msg);
  369. limits_status->mods_triggered = mavlink_msg_limits_status_get_mods_triggered(msg);
  370. #else
  371. uint8_t len = msg->len < MAVLINK_MSG_ID_LIMITS_STATUS_LEN? msg->len : MAVLINK_MSG_ID_LIMITS_STATUS_LEN;
  372. memset(limits_status, 0, MAVLINK_MSG_ID_LIMITS_STATUS_LEN);
  373. memcpy(limits_status, _MAV_PAYLOAD(msg), len);
  374. #endif
  375. }