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.

438 lines
18 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #pragma once
  2. // MESSAGE RALLY_POINT PACKING
  3. #define MAVLINK_MSG_ID_RALLY_POINT 175
  4. MAVPACKED(
  5. typedef struct __mavlink_rally_point_t {
  6. int32_t lat; /*< [degE7] Latitude of point.*/
  7. int32_t lng; /*< [degE7] Longitude of point.*/
  8. int16_t alt; /*< [m] Transit / loiter altitude relative to home.*/
  9. int16_t break_alt; /*< [m] Break altitude relative to home.*/
  10. uint16_t land_dir; /*< [cdeg] Heading to aim for when landing.*/
  11. uint8_t target_system; /*< System ID.*/
  12. uint8_t target_component; /*< Component ID.*/
  13. uint8_t idx; /*< Point index (first point is 0).*/
  14. uint8_t count; /*< Total number of points (for sanity checking).*/
  15. uint8_t flags; /*< Configuration flags.*/
  16. }) mavlink_rally_point_t;
  17. #define MAVLINK_MSG_ID_RALLY_POINT_LEN 19
  18. #define MAVLINK_MSG_ID_RALLY_POINT_MIN_LEN 19
  19. #define MAVLINK_MSG_ID_175_LEN 19
  20. #define MAVLINK_MSG_ID_175_MIN_LEN 19
  21. #define MAVLINK_MSG_ID_RALLY_POINT_CRC 138
  22. #define MAVLINK_MSG_ID_175_CRC 138
  23. #if MAVLINK_COMMAND_24BIT
  24. #define MAVLINK_MESSAGE_INFO_RALLY_POINT { \
  25. 175, \
  26. "RALLY_POINT", \
  27. 10, \
  28. { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_rally_point_t, target_system) }, \
  29. { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 15, offsetof(mavlink_rally_point_t, target_component) }, \
  30. { "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_rally_point_t, idx) }, \
  31. { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_rally_point_t, count) }, \
  32. { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_rally_point_t, lat) }, \
  33. { "lng", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_rally_point_t, lng) }, \
  34. { "alt", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_rally_point_t, alt) }, \
  35. { "break_alt", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_rally_point_t, break_alt) }, \
  36. { "land_dir", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rally_point_t, land_dir) }, \
  37. { "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_rally_point_t, flags) }, \
  38. } \
  39. }
  40. #else
  41. #define MAVLINK_MESSAGE_INFO_RALLY_POINT { \
  42. "RALLY_POINT", \
  43. 10, \
  44. { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_rally_point_t, target_system) }, \
  45. { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 15, offsetof(mavlink_rally_point_t, target_component) }, \
  46. { "idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_rally_point_t, idx) }, \
  47. { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_rally_point_t, count) }, \
  48. { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_rally_point_t, lat) }, \
  49. { "lng", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_rally_point_t, lng) }, \
  50. { "alt", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_rally_point_t, alt) }, \
  51. { "break_alt", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_rally_point_t, break_alt) }, \
  52. { "land_dir", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rally_point_t, land_dir) }, \
  53. { "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_rally_point_t, flags) }, \
  54. } \
  55. }
  56. #endif
  57. /**
  58. * @brief Pack a rally_point message
  59. * @param system_id ID of this system
  60. * @param component_id ID of this component (e.g. 200 for IMU)
  61. * @param msg The MAVLink message to compress the data into
  62. *
  63. * @param target_system System ID.
  64. * @param target_component Component ID.
  65. * @param idx Point index (first point is 0).
  66. * @param count Total number of points (for sanity checking).
  67. * @param lat [degE7] Latitude of point.
  68. * @param lng [degE7] Longitude of point.
  69. * @param alt [m] Transit / loiter altitude relative to home.
  70. * @param break_alt [m] Break altitude relative to home.
  71. * @param land_dir [cdeg] Heading to aim for when landing.
  72. * @param flags Configuration flags.
  73. * @return length of the message in bytes (excluding serial stream start sign)
  74. */
  75. static inline uint16_t mavlink_msg_rally_point_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  76. uint8_t target_system, uint8_t target_component, uint8_t idx, uint8_t count, int32_t lat, int32_t lng, int16_t alt, int16_t break_alt, uint16_t land_dir, uint8_t flags)
  77. {
  78. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  79. char buf[MAVLINK_MSG_ID_RALLY_POINT_LEN];
  80. _mav_put_int32_t(buf, 0, lat);
  81. _mav_put_int32_t(buf, 4, lng);
  82. _mav_put_int16_t(buf, 8, alt);
  83. _mav_put_int16_t(buf, 10, break_alt);
  84. _mav_put_uint16_t(buf, 12, land_dir);
  85. _mav_put_uint8_t(buf, 14, target_system);
  86. _mav_put_uint8_t(buf, 15, target_component);
  87. _mav_put_uint8_t(buf, 16, idx);
  88. _mav_put_uint8_t(buf, 17, count);
  89. _mav_put_uint8_t(buf, 18, flags);
  90. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RALLY_POINT_LEN);
  91. #else
  92. mavlink_rally_point_t packet;
  93. packet.lat = lat;
  94. packet.lng = lng;
  95. packet.alt = alt;
  96. packet.break_alt = break_alt;
  97. packet.land_dir = land_dir;
  98. packet.target_system = target_system;
  99. packet.target_component = target_component;
  100. packet.idx = idx;
  101. packet.count = count;
  102. packet.flags = flags;
  103. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RALLY_POINT_LEN);
  104. #endif
  105. msg->msgid = MAVLINK_MSG_ID_RALLY_POINT;
  106. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RALLY_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_POINT_LEN, MAVLINK_MSG_ID_RALLY_POINT_CRC);
  107. }
  108. /**
  109. * @brief Pack a rally_point message on a channel
  110. * @param system_id ID of this system
  111. * @param component_id ID of this component (e.g. 200 for IMU)
  112. * @param chan The MAVLink channel this message will be sent over
  113. * @param msg The MAVLink message to compress the data into
  114. * @param target_system System ID.
  115. * @param target_component Component ID.
  116. * @param idx Point index (first point is 0).
  117. * @param count Total number of points (for sanity checking).
  118. * @param lat [degE7] Latitude of point.
  119. * @param lng [degE7] Longitude of point.
  120. * @param alt [m] Transit / loiter altitude relative to home.
  121. * @param break_alt [m] Break altitude relative to home.
  122. * @param land_dir [cdeg] Heading to aim for when landing.
  123. * @param flags Configuration flags.
  124. * @return length of the message in bytes (excluding serial stream start sign)
  125. */
  126. static inline uint16_t mavlink_msg_rally_point_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  127. mavlink_message_t* msg,
  128. uint8_t target_system,uint8_t target_component,uint8_t idx,uint8_t count,int32_t lat,int32_t lng,int16_t alt,int16_t break_alt,uint16_t land_dir,uint8_t flags)
  129. {
  130. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  131. char buf[MAVLINK_MSG_ID_RALLY_POINT_LEN];
  132. _mav_put_int32_t(buf, 0, lat);
  133. _mav_put_int32_t(buf, 4, lng);
  134. _mav_put_int16_t(buf, 8, alt);
  135. _mav_put_int16_t(buf, 10, break_alt);
  136. _mav_put_uint16_t(buf, 12, land_dir);
  137. _mav_put_uint8_t(buf, 14, target_system);
  138. _mav_put_uint8_t(buf, 15, target_component);
  139. _mav_put_uint8_t(buf, 16, idx);
  140. _mav_put_uint8_t(buf, 17, count);
  141. _mav_put_uint8_t(buf, 18, flags);
  142. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RALLY_POINT_LEN);
  143. #else
  144. mavlink_rally_point_t packet;
  145. packet.lat = lat;
  146. packet.lng = lng;
  147. packet.alt = alt;
  148. packet.break_alt = break_alt;
  149. packet.land_dir = land_dir;
  150. packet.target_system = target_system;
  151. packet.target_component = target_component;
  152. packet.idx = idx;
  153. packet.count = count;
  154. packet.flags = flags;
  155. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RALLY_POINT_LEN);
  156. #endif
  157. msg->msgid = MAVLINK_MSG_ID_RALLY_POINT;
  158. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RALLY_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_POINT_LEN, MAVLINK_MSG_ID_RALLY_POINT_CRC);
  159. }
  160. /**
  161. * @brief Encode a rally_point struct
  162. *
  163. * @param system_id ID of this system
  164. * @param component_id ID of this component (e.g. 200 for IMU)
  165. * @param msg The MAVLink message to compress the data into
  166. * @param rally_point C-struct to read the message contents from
  167. */
  168. static inline uint16_t mavlink_msg_rally_point_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rally_point_t* rally_point)
  169. {
  170. return mavlink_msg_rally_point_pack(system_id, component_id, msg, rally_point->target_system, rally_point->target_component, rally_point->idx, rally_point->count, rally_point->lat, rally_point->lng, rally_point->alt, rally_point->break_alt, rally_point->land_dir, rally_point->flags);
  171. }
  172. /**
  173. * @brief Encode a rally_point struct on a channel
  174. *
  175. * @param system_id ID of this system
  176. * @param component_id ID of this component (e.g. 200 for IMU)
  177. * @param chan The MAVLink channel this message will be sent over
  178. * @param msg The MAVLink message to compress the data into
  179. * @param rally_point C-struct to read the message contents from
  180. */
  181. static inline uint16_t mavlink_msg_rally_point_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rally_point_t* rally_point)
  182. {
  183. return mavlink_msg_rally_point_pack_chan(system_id, component_id, chan, msg, rally_point->target_system, rally_point->target_component, rally_point->idx, rally_point->count, rally_point->lat, rally_point->lng, rally_point->alt, rally_point->break_alt, rally_point->land_dir, rally_point->flags);
  184. }
  185. /**
  186. * @brief Send a rally_point message
  187. * @param chan MAVLink channel to send the message
  188. *
  189. * @param target_system System ID.
  190. * @param target_component Component ID.
  191. * @param idx Point index (first point is 0).
  192. * @param count Total number of points (for sanity checking).
  193. * @param lat [degE7] Latitude of point.
  194. * @param lng [degE7] Longitude of point.
  195. * @param alt [m] Transit / loiter altitude relative to home.
  196. * @param break_alt [m] Break altitude relative to home.
  197. * @param land_dir [cdeg] Heading to aim for when landing.
  198. * @param flags Configuration flags.
  199. */
  200. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  201. static inline void mavlink_msg_rally_point_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx, uint8_t count, int32_t lat, int32_t lng, int16_t alt, int16_t break_alt, uint16_t land_dir, uint8_t flags)
  202. {
  203. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  204. char buf[MAVLINK_MSG_ID_RALLY_POINT_LEN];
  205. _mav_put_int32_t(buf, 0, lat);
  206. _mav_put_int32_t(buf, 4, lng);
  207. _mav_put_int16_t(buf, 8, alt);
  208. _mav_put_int16_t(buf, 10, break_alt);
  209. _mav_put_uint16_t(buf, 12, land_dir);
  210. _mav_put_uint8_t(buf, 14, target_system);
  211. _mav_put_uint8_t(buf, 15, target_component);
  212. _mav_put_uint8_t(buf, 16, idx);
  213. _mav_put_uint8_t(buf, 17, count);
  214. _mav_put_uint8_t(buf, 18, flags);
  215. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_POINT, buf, MAVLINK_MSG_ID_RALLY_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_POINT_LEN, MAVLINK_MSG_ID_RALLY_POINT_CRC);
  216. #else
  217. mavlink_rally_point_t packet;
  218. packet.lat = lat;
  219. packet.lng = lng;
  220. packet.alt = alt;
  221. packet.break_alt = break_alt;
  222. packet.land_dir = land_dir;
  223. packet.target_system = target_system;
  224. packet.target_component = target_component;
  225. packet.idx = idx;
  226. packet.count = count;
  227. packet.flags = flags;
  228. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_POINT, (const char *)&packet, MAVLINK_MSG_ID_RALLY_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_POINT_LEN, MAVLINK_MSG_ID_RALLY_POINT_CRC);
  229. #endif
  230. }
  231. /**
  232. * @brief Send a rally_point message
  233. * @param chan MAVLink channel to send the message
  234. * @param struct The MAVLink struct to serialize
  235. */
  236. static inline void mavlink_msg_rally_point_send_struct(mavlink_channel_t chan, const mavlink_rally_point_t* rally_point)
  237. {
  238. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  239. mavlink_msg_rally_point_send(chan, rally_point->target_system, rally_point->target_component, rally_point->idx, rally_point->count, rally_point->lat, rally_point->lng, rally_point->alt, rally_point->break_alt, rally_point->land_dir, rally_point->flags);
  240. #else
  241. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_POINT, (const char *)rally_point, MAVLINK_MSG_ID_RALLY_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_POINT_LEN, MAVLINK_MSG_ID_RALLY_POINT_CRC);
  242. #endif
  243. }
  244. #if MAVLINK_MSG_ID_RALLY_POINT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  245. /*
  246. This varient of _send() can be used to save stack space by re-using
  247. memory from the receive buffer. The caller provides a
  248. mavlink_message_t which is the size of a full mavlink message. This
  249. is usually the receive buffer for the channel, and allows a reply to an
  250. incoming message with minimum stack space usage.
  251. */
  252. static inline void mavlink_msg_rally_point_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t idx, uint8_t count, int32_t lat, int32_t lng, int16_t alt, int16_t break_alt, uint16_t land_dir, uint8_t flags)
  253. {
  254. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  255. char *buf = (char *)msgbuf;
  256. _mav_put_int32_t(buf, 0, lat);
  257. _mav_put_int32_t(buf, 4, lng);
  258. _mav_put_int16_t(buf, 8, alt);
  259. _mav_put_int16_t(buf, 10, break_alt);
  260. _mav_put_uint16_t(buf, 12, land_dir);
  261. _mav_put_uint8_t(buf, 14, target_system);
  262. _mav_put_uint8_t(buf, 15, target_component);
  263. _mav_put_uint8_t(buf, 16, idx);
  264. _mav_put_uint8_t(buf, 17, count);
  265. _mav_put_uint8_t(buf, 18, flags);
  266. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_POINT, buf, MAVLINK_MSG_ID_RALLY_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_POINT_LEN, MAVLINK_MSG_ID_RALLY_POINT_CRC);
  267. #else
  268. mavlink_rally_point_t *packet = (mavlink_rally_point_t *)msgbuf;
  269. packet->lat = lat;
  270. packet->lng = lng;
  271. packet->alt = alt;
  272. packet->break_alt = break_alt;
  273. packet->land_dir = land_dir;
  274. packet->target_system = target_system;
  275. packet->target_component = target_component;
  276. packet->idx = idx;
  277. packet->count = count;
  278. packet->flags = flags;
  279. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RALLY_POINT, (const char *)packet, MAVLINK_MSG_ID_RALLY_POINT_MIN_LEN, MAVLINK_MSG_ID_RALLY_POINT_LEN, MAVLINK_MSG_ID_RALLY_POINT_CRC);
  280. #endif
  281. }
  282. #endif
  283. #endif
  284. // MESSAGE RALLY_POINT UNPACKING
  285. /**
  286. * @brief Get field target_system from rally_point message
  287. *
  288. * @return System ID.
  289. */
  290. static inline uint8_t mavlink_msg_rally_point_get_target_system(const mavlink_message_t* msg)
  291. {
  292. return _MAV_RETURN_uint8_t(msg, 14);
  293. }
  294. /**
  295. * @brief Get field target_component from rally_point message
  296. *
  297. * @return Component ID.
  298. */
  299. static inline uint8_t mavlink_msg_rally_point_get_target_component(const mavlink_message_t* msg)
  300. {
  301. return _MAV_RETURN_uint8_t(msg, 15);
  302. }
  303. /**
  304. * @brief Get field idx from rally_point message
  305. *
  306. * @return Point index (first point is 0).
  307. */
  308. static inline uint8_t mavlink_msg_rally_point_get_idx(const mavlink_message_t* msg)
  309. {
  310. return _MAV_RETURN_uint8_t(msg, 16);
  311. }
  312. /**
  313. * @brief Get field count from rally_point message
  314. *
  315. * @return Total number of points (for sanity checking).
  316. */
  317. static inline uint8_t mavlink_msg_rally_point_get_count(const mavlink_message_t* msg)
  318. {
  319. return _MAV_RETURN_uint8_t(msg, 17);
  320. }
  321. /**
  322. * @brief Get field lat from rally_point message
  323. *
  324. * @return [degE7] Latitude of point.
  325. */
  326. static inline int32_t mavlink_msg_rally_point_get_lat(const mavlink_message_t* msg)
  327. {
  328. return _MAV_RETURN_int32_t(msg, 0);
  329. }
  330. /**
  331. * @brief Get field lng from rally_point message
  332. *
  333. * @return [degE7] Longitude of point.
  334. */
  335. static inline int32_t mavlink_msg_rally_point_get_lng(const mavlink_message_t* msg)
  336. {
  337. return _MAV_RETURN_int32_t(msg, 4);
  338. }
  339. /**
  340. * @brief Get field alt from rally_point message
  341. *
  342. * @return [m] Transit / loiter altitude relative to home.
  343. */
  344. static inline int16_t mavlink_msg_rally_point_get_alt(const mavlink_message_t* msg)
  345. {
  346. return _MAV_RETURN_int16_t(msg, 8);
  347. }
  348. /**
  349. * @brief Get field break_alt from rally_point message
  350. *
  351. * @return [m] Break altitude relative to home.
  352. */
  353. static inline int16_t mavlink_msg_rally_point_get_break_alt(const mavlink_message_t* msg)
  354. {
  355. return _MAV_RETURN_int16_t(msg, 10);
  356. }
  357. /**
  358. * @brief Get field land_dir from rally_point message
  359. *
  360. * @return [cdeg] Heading to aim for when landing.
  361. */
  362. static inline uint16_t mavlink_msg_rally_point_get_land_dir(const mavlink_message_t* msg)
  363. {
  364. return _MAV_RETURN_uint16_t(msg, 12);
  365. }
  366. /**
  367. * @brief Get field flags from rally_point message
  368. *
  369. * @return Configuration flags.
  370. */
  371. static inline uint8_t mavlink_msg_rally_point_get_flags(const mavlink_message_t* msg)
  372. {
  373. return _MAV_RETURN_uint8_t(msg, 18);
  374. }
  375. /**
  376. * @brief Decode a rally_point message into a struct
  377. *
  378. * @param msg The message to decode
  379. * @param rally_point C-struct to decode the message contents into
  380. */
  381. static inline void mavlink_msg_rally_point_decode(const mavlink_message_t* msg, mavlink_rally_point_t* rally_point)
  382. {
  383. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  384. rally_point->lat = mavlink_msg_rally_point_get_lat(msg);
  385. rally_point->lng = mavlink_msg_rally_point_get_lng(msg);
  386. rally_point->alt = mavlink_msg_rally_point_get_alt(msg);
  387. rally_point->break_alt = mavlink_msg_rally_point_get_break_alt(msg);
  388. rally_point->land_dir = mavlink_msg_rally_point_get_land_dir(msg);
  389. rally_point->target_system = mavlink_msg_rally_point_get_target_system(msg);
  390. rally_point->target_component = mavlink_msg_rally_point_get_target_component(msg);
  391. rally_point->idx = mavlink_msg_rally_point_get_idx(msg);
  392. rally_point->count = mavlink_msg_rally_point_get_count(msg);
  393. rally_point->flags = mavlink_msg_rally_point_get_flags(msg);
  394. #else
  395. uint8_t len = msg->len < MAVLINK_MSG_ID_RALLY_POINT_LEN? msg->len : MAVLINK_MSG_ID_RALLY_POINT_LEN;
  396. memset(rally_point, 0, MAVLINK_MSG_ID_RALLY_POINT_LEN);
  397. memcpy(rally_point, _MAV_PAYLOAD(msg), len);
  398. #endif
  399. }