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.

513 lines
21 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #pragma once
  2. // MESSAGE COMMAND_INT PACKING
  3. #define MAVLINK_MSG_ID_COMMAND_INT 75
  4. MAVPACKED(
  5. typedef struct __mavlink_command_int_t {
  6. float param1; /*< PARAM1, see MAV_CMD enum*/
  7. float param2; /*< PARAM2, see MAV_CMD enum*/
  8. float param3; /*< PARAM3, see MAV_CMD enum*/
  9. float param4; /*< PARAM4, see MAV_CMD enum*/
  10. int32_t x; /*< PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7*/
  11. int32_t y; /*< PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7*/
  12. float z; /*< PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame).*/
  13. uint16_t command; /*< The scheduled action for the mission item.*/
  14. uint8_t target_system; /*< System ID*/
  15. uint8_t target_component; /*< Component ID*/
  16. uint8_t frame; /*< The coordinate system of the COMMAND.*/
  17. uint8_t current; /*< false:0, true:1*/
  18. uint8_t autocontinue; /*< autocontinue to next wp*/
  19. }) mavlink_command_int_t;
  20. #define MAVLINK_MSG_ID_COMMAND_INT_LEN 35
  21. #define MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN 35
  22. #define MAVLINK_MSG_ID_75_LEN 35
  23. #define MAVLINK_MSG_ID_75_MIN_LEN 35
  24. #define MAVLINK_MSG_ID_COMMAND_INT_CRC 158
  25. #define MAVLINK_MSG_ID_75_CRC 158
  26. #if MAVLINK_COMMAND_24BIT
  27. #define MAVLINK_MESSAGE_INFO_COMMAND_INT { \
  28. 75, \
  29. "COMMAND_INT", \
  30. 13, \
  31. { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_int_t, target_system) }, \
  32. { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_int_t, target_component) }, \
  33. { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_int_t, frame) }, \
  34. { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_int_t, command) }, \
  35. { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_command_int_t, current) }, \
  36. { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_command_int_t, autocontinue) }, \
  37. { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_int_t, param1) }, \
  38. { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_int_t, param2) }, \
  39. { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_int_t, param3) }, \
  40. { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_int_t, param4) }, \
  41. { "x", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_command_int_t, x) }, \
  42. { "y", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_command_int_t, y) }, \
  43. { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_int_t, z) }, \
  44. } \
  45. }
  46. #else
  47. #define MAVLINK_MESSAGE_INFO_COMMAND_INT { \
  48. "COMMAND_INT", \
  49. 13, \
  50. { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_int_t, target_system) }, \
  51. { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_int_t, target_component) }, \
  52. { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_int_t, frame) }, \
  53. { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_int_t, command) }, \
  54. { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_command_int_t, current) }, \
  55. { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_command_int_t, autocontinue) }, \
  56. { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_int_t, param1) }, \
  57. { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_int_t, param2) }, \
  58. { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_int_t, param3) }, \
  59. { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_int_t, param4) }, \
  60. { "x", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_command_int_t, x) }, \
  61. { "y", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_command_int_t, y) }, \
  62. { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_int_t, z) }, \
  63. } \
  64. }
  65. #endif
  66. /**
  67. * @brief Pack a command_int message
  68. * @param system_id ID of this system
  69. * @param component_id ID of this component (e.g. 200 for IMU)
  70. * @param msg The MAVLink message to compress the data into
  71. *
  72. * @param target_system System ID
  73. * @param target_component Component ID
  74. * @param frame The coordinate system of the COMMAND.
  75. * @param command The scheduled action for the mission item.
  76. * @param current false:0, true:1
  77. * @param autocontinue autocontinue to next wp
  78. * @param param1 PARAM1, see MAV_CMD enum
  79. * @param param2 PARAM2, see MAV_CMD enum
  80. * @param param3 PARAM3, see MAV_CMD enum
  81. * @param param4 PARAM4, see MAV_CMD enum
  82. * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
  83. * @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
  84. * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame).
  85. * @return length of the message in bytes (excluding serial stream start sign)
  86. */
  87. static inline uint16_t mavlink_msg_command_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  88. uint8_t target_system, uint8_t target_component, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z)
  89. {
  90. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  91. char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN];
  92. _mav_put_float(buf, 0, param1);
  93. _mav_put_float(buf, 4, param2);
  94. _mav_put_float(buf, 8, param3);
  95. _mav_put_float(buf, 12, param4);
  96. _mav_put_int32_t(buf, 16, x);
  97. _mav_put_int32_t(buf, 20, y);
  98. _mav_put_float(buf, 24, z);
  99. _mav_put_uint16_t(buf, 28, command);
  100. _mav_put_uint8_t(buf, 30, target_system);
  101. _mav_put_uint8_t(buf, 31, target_component);
  102. _mav_put_uint8_t(buf, 32, frame);
  103. _mav_put_uint8_t(buf, 33, current);
  104. _mav_put_uint8_t(buf, 34, autocontinue);
  105. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_INT_LEN);
  106. #else
  107. mavlink_command_int_t packet;
  108. packet.param1 = param1;
  109. packet.param2 = param2;
  110. packet.param3 = param3;
  111. packet.param4 = param4;
  112. packet.x = x;
  113. packet.y = y;
  114. packet.z = z;
  115. packet.command = command;
  116. packet.target_system = target_system;
  117. packet.target_component = target_component;
  118. packet.frame = frame;
  119. packet.current = current;
  120. packet.autocontinue = autocontinue;
  121. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_INT_LEN);
  122. #endif
  123. msg->msgid = MAVLINK_MSG_ID_COMMAND_INT;
  124. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
  125. }
  126. /**
  127. * @brief Pack a command_int 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 target_system System ID
  133. * @param target_component Component ID
  134. * @param frame The coordinate system of the COMMAND.
  135. * @param command The scheduled action for the mission item.
  136. * @param current false:0, true:1
  137. * @param autocontinue autocontinue to next wp
  138. * @param param1 PARAM1, see MAV_CMD enum
  139. * @param param2 PARAM2, see MAV_CMD enum
  140. * @param param3 PARAM3, see MAV_CMD enum
  141. * @param param4 PARAM4, see MAV_CMD enum
  142. * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
  143. * @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
  144. * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame).
  145. * @return length of the message in bytes (excluding serial stream start sign)
  146. */
  147. static inline uint16_t mavlink_msg_command_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  148. mavlink_message_t* msg,
  149. uint8_t target_system,uint8_t target_component,uint8_t frame,uint16_t command,uint8_t current,uint8_t autocontinue,float param1,float param2,float param3,float param4,int32_t x,int32_t y,float z)
  150. {
  151. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  152. char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN];
  153. _mav_put_float(buf, 0, param1);
  154. _mav_put_float(buf, 4, param2);
  155. _mav_put_float(buf, 8, param3);
  156. _mav_put_float(buf, 12, param4);
  157. _mav_put_int32_t(buf, 16, x);
  158. _mav_put_int32_t(buf, 20, y);
  159. _mav_put_float(buf, 24, z);
  160. _mav_put_uint16_t(buf, 28, command);
  161. _mav_put_uint8_t(buf, 30, target_system);
  162. _mav_put_uint8_t(buf, 31, target_component);
  163. _mav_put_uint8_t(buf, 32, frame);
  164. _mav_put_uint8_t(buf, 33, current);
  165. _mav_put_uint8_t(buf, 34, autocontinue);
  166. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_INT_LEN);
  167. #else
  168. mavlink_command_int_t packet;
  169. packet.param1 = param1;
  170. packet.param2 = param2;
  171. packet.param3 = param3;
  172. packet.param4 = param4;
  173. packet.x = x;
  174. packet.y = y;
  175. packet.z = z;
  176. packet.command = command;
  177. packet.target_system = target_system;
  178. packet.target_component = target_component;
  179. packet.frame = frame;
  180. packet.current = current;
  181. packet.autocontinue = autocontinue;
  182. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_INT_LEN);
  183. #endif
  184. msg->msgid = MAVLINK_MSG_ID_COMMAND_INT;
  185. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
  186. }
  187. /**
  188. * @brief Encode a command_int struct
  189. *
  190. * @param system_id ID of this system
  191. * @param component_id ID of this component (e.g. 200 for IMU)
  192. * @param msg The MAVLink message to compress the data into
  193. * @param command_int C-struct to read the message contents from
  194. */
  195. static inline uint16_t mavlink_msg_command_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_command_int_t* command_int)
  196. {
  197. return mavlink_msg_command_int_pack(system_id, component_id, msg, command_int->target_system, command_int->target_component, command_int->frame, command_int->command, command_int->current, command_int->autocontinue, command_int->param1, command_int->param2, command_int->param3, command_int->param4, command_int->x, command_int->y, command_int->z);
  198. }
  199. /**
  200. * @brief Encode a command_int struct on a channel
  201. *
  202. * @param system_id ID of this system
  203. * @param component_id ID of this component (e.g. 200 for IMU)
  204. * @param chan The MAVLink channel this message will be sent over
  205. * @param msg The MAVLink message to compress the data into
  206. * @param command_int C-struct to read the message contents from
  207. */
  208. static inline uint16_t mavlink_msg_command_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_command_int_t* command_int)
  209. {
  210. return mavlink_msg_command_int_pack_chan(system_id, component_id, chan, msg, command_int->target_system, command_int->target_component, command_int->frame, command_int->command, command_int->current, command_int->autocontinue, command_int->param1, command_int->param2, command_int->param3, command_int->param4, command_int->x, command_int->y, command_int->z);
  211. }
  212. /**
  213. * @brief Send a command_int message
  214. * @param chan MAVLink channel to send the message
  215. *
  216. * @param target_system System ID
  217. * @param target_component Component ID
  218. * @param frame The coordinate system of the COMMAND.
  219. * @param command The scheduled action for the mission item.
  220. * @param current false:0, true:1
  221. * @param autocontinue autocontinue to next wp
  222. * @param param1 PARAM1, see MAV_CMD enum
  223. * @param param2 PARAM2, see MAV_CMD enum
  224. * @param param3 PARAM3, see MAV_CMD enum
  225. * @param param4 PARAM4, see MAV_CMD enum
  226. * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
  227. * @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
  228. * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame).
  229. */
  230. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  231. static inline void mavlink_msg_command_int_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z)
  232. {
  233. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  234. char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN];
  235. _mav_put_float(buf, 0, param1);
  236. _mav_put_float(buf, 4, param2);
  237. _mav_put_float(buf, 8, param3);
  238. _mav_put_float(buf, 12, param4);
  239. _mav_put_int32_t(buf, 16, x);
  240. _mav_put_int32_t(buf, 20, y);
  241. _mav_put_float(buf, 24, z);
  242. _mav_put_uint16_t(buf, 28, command);
  243. _mav_put_uint8_t(buf, 30, target_system);
  244. _mav_put_uint8_t(buf, 31, target_component);
  245. _mav_put_uint8_t(buf, 32, frame);
  246. _mav_put_uint8_t(buf, 33, current);
  247. _mav_put_uint8_t(buf, 34, autocontinue);
  248. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, buf, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
  249. #else
  250. mavlink_command_int_t packet;
  251. packet.param1 = param1;
  252. packet.param2 = param2;
  253. packet.param3 = param3;
  254. packet.param4 = param4;
  255. packet.x = x;
  256. packet.y = y;
  257. packet.z = z;
  258. packet.command = command;
  259. packet.target_system = target_system;
  260. packet.target_component = target_component;
  261. packet.frame = frame;
  262. packet.current = current;
  263. packet.autocontinue = autocontinue;
  264. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
  265. #endif
  266. }
  267. /**
  268. * @brief Send a command_int message
  269. * @param chan MAVLink channel to send the message
  270. * @param struct The MAVLink struct to serialize
  271. */
  272. static inline void mavlink_msg_command_int_send_struct(mavlink_channel_t chan, const mavlink_command_int_t* command_int)
  273. {
  274. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  275. mavlink_msg_command_int_send(chan, command_int->target_system, command_int->target_component, command_int->frame, command_int->command, command_int->current, command_int->autocontinue, command_int->param1, command_int->param2, command_int->param3, command_int->param4, command_int->x, command_int->y, command_int->z);
  276. #else
  277. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)command_int, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
  278. #endif
  279. }
  280. #if MAVLINK_MSG_ID_COMMAND_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  281. /*
  282. This varient of _send() can be used to save stack space by re-using
  283. memory from the receive buffer. The caller provides a
  284. mavlink_message_t which is the size of a full mavlink message. This
  285. is usually the receive buffer for the channel, and allows a reply to an
  286. incoming message with minimum stack space usage.
  287. */
  288. static inline void mavlink_msg_command_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z)
  289. {
  290. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  291. char *buf = (char *)msgbuf;
  292. _mav_put_float(buf, 0, param1);
  293. _mav_put_float(buf, 4, param2);
  294. _mav_put_float(buf, 8, param3);
  295. _mav_put_float(buf, 12, param4);
  296. _mav_put_int32_t(buf, 16, x);
  297. _mav_put_int32_t(buf, 20, y);
  298. _mav_put_float(buf, 24, z);
  299. _mav_put_uint16_t(buf, 28, command);
  300. _mav_put_uint8_t(buf, 30, target_system);
  301. _mav_put_uint8_t(buf, 31, target_component);
  302. _mav_put_uint8_t(buf, 32, frame);
  303. _mav_put_uint8_t(buf, 33, current);
  304. _mav_put_uint8_t(buf, 34, autocontinue);
  305. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, buf, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
  306. #else
  307. mavlink_command_int_t *packet = (mavlink_command_int_t *)msgbuf;
  308. packet->param1 = param1;
  309. packet->param2 = param2;
  310. packet->param3 = param3;
  311. packet->param4 = param4;
  312. packet->x = x;
  313. packet->y = y;
  314. packet->z = z;
  315. packet->command = command;
  316. packet->target_system = target_system;
  317. packet->target_component = target_component;
  318. packet->frame = frame;
  319. packet->current = current;
  320. packet->autocontinue = autocontinue;
  321. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)packet, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
  322. #endif
  323. }
  324. #endif
  325. #endif
  326. // MESSAGE COMMAND_INT UNPACKING
  327. /**
  328. * @brief Get field target_system from command_int message
  329. *
  330. * @return System ID
  331. */
  332. static inline uint8_t mavlink_msg_command_int_get_target_system(const mavlink_message_t* msg)
  333. {
  334. return _MAV_RETURN_uint8_t(msg, 30);
  335. }
  336. /**
  337. * @brief Get field target_component from command_int message
  338. *
  339. * @return Component ID
  340. */
  341. static inline uint8_t mavlink_msg_command_int_get_target_component(const mavlink_message_t* msg)
  342. {
  343. return _MAV_RETURN_uint8_t(msg, 31);
  344. }
  345. /**
  346. * @brief Get field frame from command_int message
  347. *
  348. * @return The coordinate system of the COMMAND.
  349. */
  350. static inline uint8_t mavlink_msg_command_int_get_frame(const mavlink_message_t* msg)
  351. {
  352. return _MAV_RETURN_uint8_t(msg, 32);
  353. }
  354. /**
  355. * @brief Get field command from command_int message
  356. *
  357. * @return The scheduled action for the mission item.
  358. */
  359. static inline uint16_t mavlink_msg_command_int_get_command(const mavlink_message_t* msg)
  360. {
  361. return _MAV_RETURN_uint16_t(msg, 28);
  362. }
  363. /**
  364. * @brief Get field current from command_int message
  365. *
  366. * @return false:0, true:1
  367. */
  368. static inline uint8_t mavlink_msg_command_int_get_current(const mavlink_message_t* msg)
  369. {
  370. return _MAV_RETURN_uint8_t(msg, 33);
  371. }
  372. /**
  373. * @brief Get field autocontinue from command_int message
  374. *
  375. * @return autocontinue to next wp
  376. */
  377. static inline uint8_t mavlink_msg_command_int_get_autocontinue(const mavlink_message_t* msg)
  378. {
  379. return _MAV_RETURN_uint8_t(msg, 34);
  380. }
  381. /**
  382. * @brief Get field param1 from command_int message
  383. *
  384. * @return PARAM1, see MAV_CMD enum
  385. */
  386. static inline float mavlink_msg_command_int_get_param1(const mavlink_message_t* msg)
  387. {
  388. return _MAV_RETURN_float(msg, 0);
  389. }
  390. /**
  391. * @brief Get field param2 from command_int message
  392. *
  393. * @return PARAM2, see MAV_CMD enum
  394. */
  395. static inline float mavlink_msg_command_int_get_param2(const mavlink_message_t* msg)
  396. {
  397. return _MAV_RETURN_float(msg, 4);
  398. }
  399. /**
  400. * @brief Get field param3 from command_int message
  401. *
  402. * @return PARAM3, see MAV_CMD enum
  403. */
  404. static inline float mavlink_msg_command_int_get_param3(const mavlink_message_t* msg)
  405. {
  406. return _MAV_RETURN_float(msg, 8);
  407. }
  408. /**
  409. * @brief Get field param4 from command_int message
  410. *
  411. * @return PARAM4, see MAV_CMD enum
  412. */
  413. static inline float mavlink_msg_command_int_get_param4(const mavlink_message_t* msg)
  414. {
  415. return _MAV_RETURN_float(msg, 12);
  416. }
  417. /**
  418. * @brief Get field x from command_int message
  419. *
  420. * @return PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
  421. */
  422. static inline int32_t mavlink_msg_command_int_get_x(const mavlink_message_t* msg)
  423. {
  424. return _MAV_RETURN_int32_t(msg, 16);
  425. }
  426. /**
  427. * @brief Get field y from command_int message
  428. *
  429. * @return PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
  430. */
  431. static inline int32_t mavlink_msg_command_int_get_y(const mavlink_message_t* msg)
  432. {
  433. return _MAV_RETURN_int32_t(msg, 20);
  434. }
  435. /**
  436. * @brief Get field z from command_int message
  437. *
  438. * @return PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame).
  439. */
  440. static inline float mavlink_msg_command_int_get_z(const mavlink_message_t* msg)
  441. {
  442. return _MAV_RETURN_float(msg, 24);
  443. }
  444. /**
  445. * @brief Decode a command_int message into a struct
  446. *
  447. * @param msg The message to decode
  448. * @param command_int C-struct to decode the message contents into
  449. */
  450. static inline void mavlink_msg_command_int_decode(const mavlink_message_t* msg, mavlink_command_int_t* command_int)
  451. {
  452. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  453. command_int->param1 = mavlink_msg_command_int_get_param1(msg);
  454. command_int->param2 = mavlink_msg_command_int_get_param2(msg);
  455. command_int->param3 = mavlink_msg_command_int_get_param3(msg);
  456. command_int->param4 = mavlink_msg_command_int_get_param4(msg);
  457. command_int->x = mavlink_msg_command_int_get_x(msg);
  458. command_int->y = mavlink_msg_command_int_get_y(msg);
  459. command_int->z = mavlink_msg_command_int_get_z(msg);
  460. command_int->command = mavlink_msg_command_int_get_command(msg);
  461. command_int->target_system = mavlink_msg_command_int_get_target_system(msg);
  462. command_int->target_component = mavlink_msg_command_int_get_target_component(msg);
  463. command_int->frame = mavlink_msg_command_int_get_frame(msg);
  464. command_int->current = mavlink_msg_command_int_get_current(msg);
  465. command_int->autocontinue = mavlink_msg_command_int_get_autocontinue(msg);
  466. #else
  467. uint8_t len = msg->len < MAVLINK_MSG_ID_COMMAND_INT_LEN? msg->len : MAVLINK_MSG_ID_COMMAND_INT_LEN;
  468. memset(command_int, 0, MAVLINK_MSG_ID_COMMAND_INT_LEN);
  469. memcpy(command_int, _MAV_PAYLOAD(msg), len);
  470. #endif
  471. }