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.

463 lines
20 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #pragma once
  2. // MESSAGE COMMAND_LONG PACKING
  3. #define MAVLINK_MSG_ID_COMMAND_LONG 76
  4. MAVPACKED(
  5. typedef struct __mavlink_command_long_t {
  6. float param1; /*< Parameter 1 (for the specific command).*/
  7. float param2; /*< Parameter 2 (for the specific command).*/
  8. float param3; /*< Parameter 3 (for the specific command).*/
  9. float param4; /*< Parameter 4 (for the specific command).*/
  10. float param5; /*< Parameter 5 (for the specific command).*/
  11. float param6; /*< Parameter 6 (for the specific command).*/
  12. float param7; /*< Parameter 7 (for the specific command).*/
  13. uint16_t command; /*< Command ID (of command to send).*/
  14. uint8_t target_system; /*< System which should execute the command*/
  15. uint8_t target_component; /*< Component which should execute the command, 0 for all components*/
  16. uint8_t confirmation; /*< 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)*/
  17. }) mavlink_command_long_t;
  18. #define MAVLINK_MSG_ID_COMMAND_LONG_LEN 33
  19. #define MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN 33
  20. #define MAVLINK_MSG_ID_76_LEN 33
  21. #define MAVLINK_MSG_ID_76_MIN_LEN 33
  22. #define MAVLINK_MSG_ID_COMMAND_LONG_CRC 152
  23. #define MAVLINK_MSG_ID_76_CRC 152
  24. #if MAVLINK_COMMAND_24BIT
  25. #define MAVLINK_MESSAGE_INFO_COMMAND_LONG { \
  26. 76, \
  27. "COMMAND_LONG", \
  28. 11, \
  29. { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_long_t, target_system) }, \
  30. { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_long_t, target_component) }, \
  31. { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_long_t, command) }, \
  32. { "confirmation", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_long_t, confirmation) }, \
  33. { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_long_t, param1) }, \
  34. { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_long_t, param2) }, \
  35. { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_long_t, param3) }, \
  36. { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_long_t, param4) }, \
  37. { "param5", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_command_long_t, param5) }, \
  38. { "param6", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_command_long_t, param6) }, \
  39. { "param7", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_long_t, param7) }, \
  40. } \
  41. }
  42. #else
  43. #define MAVLINK_MESSAGE_INFO_COMMAND_LONG { \
  44. "COMMAND_LONG", \
  45. 11, \
  46. { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_long_t, target_system) }, \
  47. { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_long_t, target_component) }, \
  48. { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_long_t, command) }, \
  49. { "confirmation", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_long_t, confirmation) }, \
  50. { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_long_t, param1) }, \
  51. { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_long_t, param2) }, \
  52. { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_long_t, param3) }, \
  53. { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_long_t, param4) }, \
  54. { "param5", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_command_long_t, param5) }, \
  55. { "param6", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_command_long_t, param6) }, \
  56. { "param7", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_long_t, param7) }, \
  57. } \
  58. }
  59. #endif
  60. /**
  61. * @brief Pack a command_long message
  62. * @param system_id ID of this system
  63. * @param component_id ID of this component (e.g. 200 for IMU)
  64. * @param msg The MAVLink message to compress the data into
  65. *
  66. * @param target_system System which should execute the command
  67. * @param target_component Component which should execute the command, 0 for all components
  68. * @param command Command ID (of command to send).
  69. * @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
  70. * @param param1 Parameter 1 (for the specific command).
  71. * @param param2 Parameter 2 (for the specific command).
  72. * @param param3 Parameter 3 (for the specific command).
  73. * @param param4 Parameter 4 (for the specific command).
  74. * @param param5 Parameter 5 (for the specific command).
  75. * @param param6 Parameter 6 (for the specific command).
  76. * @param param7 Parameter 7 (for the specific command).
  77. * @return length of the message in bytes (excluding serial stream start sign)
  78. */
  79. static inline uint16_t mavlink_msg_command_long_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  80. uint8_t target_system, uint8_t target_component, uint16_t command, uint8_t confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7)
  81. {
  82. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  83. char buf[MAVLINK_MSG_ID_COMMAND_LONG_LEN];
  84. _mav_put_float(buf, 0, param1);
  85. _mav_put_float(buf, 4, param2);
  86. _mav_put_float(buf, 8, param3);
  87. _mav_put_float(buf, 12, param4);
  88. _mav_put_float(buf, 16, param5);
  89. _mav_put_float(buf, 20, param6);
  90. _mav_put_float(buf, 24, param7);
  91. _mav_put_uint16_t(buf, 28, command);
  92. _mav_put_uint8_t(buf, 30, target_system);
  93. _mav_put_uint8_t(buf, 31, target_component);
  94. _mav_put_uint8_t(buf, 32, confirmation);
  95. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_LONG_LEN);
  96. #else
  97. mavlink_command_long_t packet;
  98. packet.param1 = param1;
  99. packet.param2 = param2;
  100. packet.param3 = param3;
  101. packet.param4 = param4;
  102. packet.param5 = param5;
  103. packet.param6 = param6;
  104. packet.param7 = param7;
  105. packet.command = command;
  106. packet.target_system = target_system;
  107. packet.target_component = target_component;
  108. packet.confirmation = confirmation;
  109. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_LONG_LEN);
  110. #endif
  111. msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG;
  112. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
  113. }
  114. /**
  115. * @brief Pack a command_long message on a channel
  116. * @param system_id ID of this system
  117. * @param component_id ID of this component (e.g. 200 for IMU)
  118. * @param chan The MAVLink channel this message will be sent over
  119. * @param msg The MAVLink message to compress the data into
  120. * @param target_system System which should execute the command
  121. * @param target_component Component which should execute the command, 0 for all components
  122. * @param command Command ID (of command to send).
  123. * @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
  124. * @param param1 Parameter 1 (for the specific command).
  125. * @param param2 Parameter 2 (for the specific command).
  126. * @param param3 Parameter 3 (for the specific command).
  127. * @param param4 Parameter 4 (for the specific command).
  128. * @param param5 Parameter 5 (for the specific command).
  129. * @param param6 Parameter 6 (for the specific command).
  130. * @param param7 Parameter 7 (for the specific command).
  131. * @return length of the message in bytes (excluding serial stream start sign)
  132. */
  133. static inline uint16_t mavlink_msg_command_long_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  134. mavlink_message_t* msg,
  135. uint8_t target_system,uint8_t target_component,uint16_t command,uint8_t confirmation,float param1,float param2,float param3,float param4,float param5,float param6,float param7)
  136. {
  137. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  138. char buf[MAVLINK_MSG_ID_COMMAND_LONG_LEN];
  139. _mav_put_float(buf, 0, param1);
  140. _mav_put_float(buf, 4, param2);
  141. _mav_put_float(buf, 8, param3);
  142. _mav_put_float(buf, 12, param4);
  143. _mav_put_float(buf, 16, param5);
  144. _mav_put_float(buf, 20, param6);
  145. _mav_put_float(buf, 24, param7);
  146. _mav_put_uint16_t(buf, 28, command);
  147. _mav_put_uint8_t(buf, 30, target_system);
  148. _mav_put_uint8_t(buf, 31, target_component);
  149. _mav_put_uint8_t(buf, 32, confirmation);
  150. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_LONG_LEN);
  151. #else
  152. mavlink_command_long_t packet;
  153. packet.param1 = param1;
  154. packet.param2 = param2;
  155. packet.param3 = param3;
  156. packet.param4 = param4;
  157. packet.param5 = param5;
  158. packet.param6 = param6;
  159. packet.param7 = param7;
  160. packet.command = command;
  161. packet.target_system = target_system;
  162. packet.target_component = target_component;
  163. packet.confirmation = confirmation;
  164. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_LONG_LEN);
  165. #endif
  166. msg->msgid = MAVLINK_MSG_ID_COMMAND_LONG;
  167. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
  168. }
  169. /**
  170. * @brief Encode a command_long struct
  171. *
  172. * @param system_id ID of this system
  173. * @param component_id ID of this component (e.g. 200 for IMU)
  174. * @param msg The MAVLink message to compress the data into
  175. * @param command_long C-struct to read the message contents from
  176. */
  177. static inline uint16_t mavlink_msg_command_long_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_command_long_t* command_long)
  178. {
  179. return mavlink_msg_command_long_pack(system_id, component_id, msg, command_long->target_system, command_long->target_component, command_long->command, command_long->confirmation, command_long->param1, command_long->param2, command_long->param3, command_long->param4, command_long->param5, command_long->param6, command_long->param7);
  180. }
  181. /**
  182. * @brief Encode a command_long struct on a channel
  183. *
  184. * @param system_id ID of this system
  185. * @param component_id ID of this component (e.g. 200 for IMU)
  186. * @param chan The MAVLink channel this message will be sent over
  187. * @param msg The MAVLink message to compress the data into
  188. * @param command_long C-struct to read the message contents from
  189. */
  190. static inline uint16_t mavlink_msg_command_long_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_command_long_t* command_long)
  191. {
  192. return mavlink_msg_command_long_pack_chan(system_id, component_id, chan, msg, command_long->target_system, command_long->target_component, command_long->command, command_long->confirmation, command_long->param1, command_long->param2, command_long->param3, command_long->param4, command_long->param5, command_long->param6, command_long->param7);
  193. }
  194. /**
  195. * @brief Send a command_long message
  196. * @param chan MAVLink channel to send the message
  197. *
  198. * @param target_system System which should execute the command
  199. * @param target_component Component which should execute the command, 0 for all components
  200. * @param command Command ID (of command to send).
  201. * @param confirmation 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
  202. * @param param1 Parameter 1 (for the specific command).
  203. * @param param2 Parameter 2 (for the specific command).
  204. * @param param3 Parameter 3 (for the specific command).
  205. * @param param4 Parameter 4 (for the specific command).
  206. * @param param5 Parameter 5 (for the specific command).
  207. * @param param6 Parameter 6 (for the specific command).
  208. * @param param7 Parameter 7 (for the specific command).
  209. */
  210. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  211. static inline void mavlink_msg_command_long_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t command, uint8_t confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7)
  212. {
  213. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  214. char buf[MAVLINK_MSG_ID_COMMAND_LONG_LEN];
  215. _mav_put_float(buf, 0, param1);
  216. _mav_put_float(buf, 4, param2);
  217. _mav_put_float(buf, 8, param3);
  218. _mav_put_float(buf, 12, param4);
  219. _mav_put_float(buf, 16, param5);
  220. _mav_put_float(buf, 20, param6);
  221. _mav_put_float(buf, 24, param7);
  222. _mav_put_uint16_t(buf, 28, command);
  223. _mav_put_uint8_t(buf, 30, target_system);
  224. _mav_put_uint8_t(buf, 31, target_component);
  225. _mav_put_uint8_t(buf, 32, confirmation);
  226. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, buf, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
  227. #else
  228. mavlink_command_long_t packet;
  229. packet.param1 = param1;
  230. packet.param2 = param2;
  231. packet.param3 = param3;
  232. packet.param4 = param4;
  233. packet.param5 = param5;
  234. packet.param6 = param6;
  235. packet.param7 = param7;
  236. packet.command = command;
  237. packet.target_system = target_system;
  238. packet.target_component = target_component;
  239. packet.confirmation = confirmation;
  240. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
  241. #endif
  242. }
  243. /**
  244. * @brief Send a command_long message
  245. * @param chan MAVLink channel to send the message
  246. * @param struct The MAVLink struct to serialize
  247. */
  248. static inline void mavlink_msg_command_long_send_struct(mavlink_channel_t chan, const mavlink_command_long_t* command_long)
  249. {
  250. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  251. mavlink_msg_command_long_send(chan, command_long->target_system, command_long->target_component, command_long->command, command_long->confirmation, command_long->param1, command_long->param2, command_long->param3, command_long->param4, command_long->param5, command_long->param6, command_long->param7);
  252. #else
  253. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)command_long, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
  254. #endif
  255. }
  256. #if MAVLINK_MSG_ID_COMMAND_LONG_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  257. /*
  258. This varient of _send() can be used to save stack space by re-using
  259. memory from the receive buffer. The caller provides a
  260. mavlink_message_t which is the size of a full mavlink message. This
  261. is usually the receive buffer for the channel, and allows a reply to an
  262. incoming message with minimum stack space usage.
  263. */
  264. static inline void mavlink_msg_command_long_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t command, uint8_t confirmation, float param1, float param2, float param3, float param4, float param5, float param6, float param7)
  265. {
  266. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  267. char *buf = (char *)msgbuf;
  268. _mav_put_float(buf, 0, param1);
  269. _mav_put_float(buf, 4, param2);
  270. _mav_put_float(buf, 8, param3);
  271. _mav_put_float(buf, 12, param4);
  272. _mav_put_float(buf, 16, param5);
  273. _mav_put_float(buf, 20, param6);
  274. _mav_put_float(buf, 24, param7);
  275. _mav_put_uint16_t(buf, 28, command);
  276. _mav_put_uint8_t(buf, 30, target_system);
  277. _mav_put_uint8_t(buf, 31, target_component);
  278. _mav_put_uint8_t(buf, 32, confirmation);
  279. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, buf, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
  280. #else
  281. mavlink_command_long_t *packet = (mavlink_command_long_t *)msgbuf;
  282. packet->param1 = param1;
  283. packet->param2 = param2;
  284. packet->param3 = param3;
  285. packet->param4 = param4;
  286. packet->param5 = param5;
  287. packet->param6 = param6;
  288. packet->param7 = param7;
  289. packet->command = command;
  290. packet->target_system = target_system;
  291. packet->target_component = target_component;
  292. packet->confirmation = confirmation;
  293. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_LONG, (const char *)packet, MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN, MAVLINK_MSG_ID_COMMAND_LONG_LEN, MAVLINK_MSG_ID_COMMAND_LONG_CRC);
  294. #endif
  295. }
  296. #endif
  297. #endif
  298. // MESSAGE COMMAND_LONG UNPACKING
  299. /**
  300. * @brief Get field target_system from command_long message
  301. *
  302. * @return System which should execute the command
  303. */
  304. static inline uint8_t mavlink_msg_command_long_get_target_system(const mavlink_message_t* msg)
  305. {
  306. return _MAV_RETURN_uint8_t(msg, 30);
  307. }
  308. /**
  309. * @brief Get field target_component from command_long message
  310. *
  311. * @return Component which should execute the command, 0 for all components
  312. */
  313. static inline uint8_t mavlink_msg_command_long_get_target_component(const mavlink_message_t* msg)
  314. {
  315. return _MAV_RETURN_uint8_t(msg, 31);
  316. }
  317. /**
  318. * @brief Get field command from command_long message
  319. *
  320. * @return Command ID (of command to send).
  321. */
  322. static inline uint16_t mavlink_msg_command_long_get_command(const mavlink_message_t* msg)
  323. {
  324. return _MAV_RETURN_uint16_t(msg, 28);
  325. }
  326. /**
  327. * @brief Get field confirmation from command_long message
  328. *
  329. * @return 0: First transmission of this command. 1-255: Confirmation transmissions (e.g. for kill command)
  330. */
  331. static inline uint8_t mavlink_msg_command_long_get_confirmation(const mavlink_message_t* msg)
  332. {
  333. return _MAV_RETURN_uint8_t(msg, 32);
  334. }
  335. /**
  336. * @brief Get field param1 from command_long message
  337. *
  338. * @return Parameter 1 (for the specific command).
  339. */
  340. static inline float mavlink_msg_command_long_get_param1(const mavlink_message_t* msg)
  341. {
  342. return _MAV_RETURN_float(msg, 0);
  343. }
  344. /**
  345. * @brief Get field param2 from command_long message
  346. *
  347. * @return Parameter 2 (for the specific command).
  348. */
  349. static inline float mavlink_msg_command_long_get_param2(const mavlink_message_t* msg)
  350. {
  351. return _MAV_RETURN_float(msg, 4);
  352. }
  353. /**
  354. * @brief Get field param3 from command_long message
  355. *
  356. * @return Parameter 3 (for the specific command).
  357. */
  358. static inline float mavlink_msg_command_long_get_param3(const mavlink_message_t* msg)
  359. {
  360. return _MAV_RETURN_float(msg, 8);
  361. }
  362. /**
  363. * @brief Get field param4 from command_long message
  364. *
  365. * @return Parameter 4 (for the specific command).
  366. */
  367. static inline float mavlink_msg_command_long_get_param4(const mavlink_message_t* msg)
  368. {
  369. return _MAV_RETURN_float(msg, 12);
  370. }
  371. /**
  372. * @brief Get field param5 from command_long message
  373. *
  374. * @return Parameter 5 (for the specific command).
  375. */
  376. static inline float mavlink_msg_command_long_get_param5(const mavlink_message_t* msg)
  377. {
  378. return _MAV_RETURN_float(msg, 16);
  379. }
  380. /**
  381. * @brief Get field param6 from command_long message
  382. *
  383. * @return Parameter 6 (for the specific command).
  384. */
  385. static inline float mavlink_msg_command_long_get_param6(const mavlink_message_t* msg)
  386. {
  387. return _MAV_RETURN_float(msg, 20);
  388. }
  389. /**
  390. * @brief Get field param7 from command_long message
  391. *
  392. * @return Parameter 7 (for the specific command).
  393. */
  394. static inline float mavlink_msg_command_long_get_param7(const mavlink_message_t* msg)
  395. {
  396. return _MAV_RETURN_float(msg, 24);
  397. }
  398. /**
  399. * @brief Decode a command_long message into a struct
  400. *
  401. * @param msg The message to decode
  402. * @param command_long C-struct to decode the message contents into
  403. */
  404. static inline void mavlink_msg_command_long_decode(const mavlink_message_t* msg, mavlink_command_long_t* command_long)
  405. {
  406. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  407. command_long->param1 = mavlink_msg_command_long_get_param1(msg);
  408. command_long->param2 = mavlink_msg_command_long_get_param2(msg);
  409. command_long->param3 = mavlink_msg_command_long_get_param3(msg);
  410. command_long->param4 = mavlink_msg_command_long_get_param4(msg);
  411. command_long->param5 = mavlink_msg_command_long_get_param5(msg);
  412. command_long->param6 = mavlink_msg_command_long_get_param6(msg);
  413. command_long->param7 = mavlink_msg_command_long_get_param7(msg);
  414. command_long->command = mavlink_msg_command_long_get_command(msg);
  415. command_long->target_system = mavlink_msg_command_long_get_target_system(msg);
  416. command_long->target_component = mavlink_msg_command_long_get_target_component(msg);
  417. command_long->confirmation = mavlink_msg_command_long_get_confirmation(msg);
  418. #else
  419. uint8_t len = msg->len < MAVLINK_MSG_ID_COMMAND_LONG_LEN? msg->len : MAVLINK_MSG_ID_COMMAND_LONG_LEN;
  420. memset(command_long, 0, MAVLINK_MSG_ID_COMMAND_LONG_LEN);
  421. memcpy(command_long, _MAV_PAYLOAD(msg), len);
  422. #endif
  423. }