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
17 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #pragma once
  2. // MESSAGE CAMERA_STATUS PACKING
  3. #define MAVLINK_MSG_ID_CAMERA_STATUS 179
  4. MAVPACKED(
  5. typedef struct __mavlink_camera_status_t {
  6. uint64_t time_usec; /*< [us] Image timestamp (since UNIX epoch, according to camera clock).*/
  7. float p1; /*< Parameter 1 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum).*/
  8. float p2; /*< Parameter 2 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum).*/
  9. float p3; /*< Parameter 3 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum).*/
  10. float p4; /*< Parameter 4 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum).*/
  11. uint16_t img_idx; /*< Image index.*/
  12. uint8_t target_system; /*< System ID.*/
  13. uint8_t cam_idx; /*< Camera ID.*/
  14. uint8_t event_id; /*< Event type.*/
  15. }) mavlink_camera_status_t;
  16. #define MAVLINK_MSG_ID_CAMERA_STATUS_LEN 29
  17. #define MAVLINK_MSG_ID_CAMERA_STATUS_MIN_LEN 29
  18. #define MAVLINK_MSG_ID_179_LEN 29
  19. #define MAVLINK_MSG_ID_179_MIN_LEN 29
  20. #define MAVLINK_MSG_ID_CAMERA_STATUS_CRC 189
  21. #define MAVLINK_MSG_ID_179_CRC 189
  22. #if MAVLINK_COMMAND_24BIT
  23. #define MAVLINK_MESSAGE_INFO_CAMERA_STATUS { \
  24. 179, \
  25. "CAMERA_STATUS", \
  26. 9, \
  27. { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_status_t, time_usec) }, \
  28. { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_camera_status_t, target_system) }, \
  29. { "cam_idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_camera_status_t, cam_idx) }, \
  30. { "img_idx", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_camera_status_t, img_idx) }, \
  31. { "event_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_camera_status_t, event_id) }, \
  32. { "p1", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_camera_status_t, p1) }, \
  33. { "p2", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_camera_status_t, p2) }, \
  34. { "p3", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_camera_status_t, p3) }, \
  35. { "p4", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_camera_status_t, p4) }, \
  36. } \
  37. }
  38. #else
  39. #define MAVLINK_MESSAGE_INFO_CAMERA_STATUS { \
  40. "CAMERA_STATUS", \
  41. 9, \
  42. { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_status_t, time_usec) }, \
  43. { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_camera_status_t, target_system) }, \
  44. { "cam_idx", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_camera_status_t, cam_idx) }, \
  45. { "img_idx", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_camera_status_t, img_idx) }, \
  46. { "event_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_camera_status_t, event_id) }, \
  47. { "p1", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_camera_status_t, p1) }, \
  48. { "p2", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_camera_status_t, p2) }, \
  49. { "p3", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_camera_status_t, p3) }, \
  50. { "p4", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_camera_status_t, p4) }, \
  51. } \
  52. }
  53. #endif
  54. /**
  55. * @brief Pack a camera_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 time_usec [us] Image timestamp (since UNIX epoch, according to camera clock).
  61. * @param target_system System ID.
  62. * @param cam_idx Camera ID.
  63. * @param img_idx Image index.
  64. * @param event_id Event type.
  65. * @param p1 Parameter 1 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum).
  66. * @param p2 Parameter 2 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum).
  67. * @param p3 Parameter 3 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum).
  68. * @param p4 Parameter 4 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum).
  69. * @return length of the message in bytes (excluding serial stream start sign)
  70. */
  71. static inline uint16_t mavlink_msg_camera_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  72. uint64_t time_usec, uint8_t target_system, uint8_t cam_idx, uint16_t img_idx, uint8_t event_id, float p1, float p2, float p3, float p4)
  73. {
  74. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  75. char buf[MAVLINK_MSG_ID_CAMERA_STATUS_LEN];
  76. _mav_put_uint64_t(buf, 0, time_usec);
  77. _mav_put_float(buf, 8, p1);
  78. _mav_put_float(buf, 12, p2);
  79. _mav_put_float(buf, 16, p3);
  80. _mav_put_float(buf, 20, p4);
  81. _mav_put_uint16_t(buf, 24, img_idx);
  82. _mav_put_uint8_t(buf, 26, target_system);
  83. _mav_put_uint8_t(buf, 27, cam_idx);
  84. _mav_put_uint8_t(buf, 28, event_id);
  85. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_STATUS_LEN);
  86. #else
  87. mavlink_camera_status_t packet;
  88. packet.time_usec = time_usec;
  89. packet.p1 = p1;
  90. packet.p2 = p2;
  91. packet.p3 = p3;
  92. packet.p4 = p4;
  93. packet.img_idx = img_idx;
  94. packet.target_system = target_system;
  95. packet.cam_idx = cam_idx;
  96. packet.event_id = event_id;
  97. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_STATUS_LEN);
  98. #endif
  99. msg->msgid = MAVLINK_MSG_ID_CAMERA_STATUS;
  100. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_CRC);
  101. }
  102. /**
  103. * @brief Pack a camera_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 time_usec [us] Image timestamp (since UNIX epoch, according to camera clock).
  109. * @param target_system System ID.
  110. * @param cam_idx Camera ID.
  111. * @param img_idx Image index.
  112. * @param event_id Event type.
  113. * @param p1 Parameter 1 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum).
  114. * @param p2 Parameter 2 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum).
  115. * @param p3 Parameter 3 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum).
  116. * @param p4 Parameter 4 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum).
  117. * @return length of the message in bytes (excluding serial stream start sign)
  118. */
  119. static inline uint16_t mavlink_msg_camera_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  120. mavlink_message_t* msg,
  121. uint64_t time_usec,uint8_t target_system,uint8_t cam_idx,uint16_t img_idx,uint8_t event_id,float p1,float p2,float p3,float p4)
  122. {
  123. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  124. char buf[MAVLINK_MSG_ID_CAMERA_STATUS_LEN];
  125. _mav_put_uint64_t(buf, 0, time_usec);
  126. _mav_put_float(buf, 8, p1);
  127. _mav_put_float(buf, 12, p2);
  128. _mav_put_float(buf, 16, p3);
  129. _mav_put_float(buf, 20, p4);
  130. _mav_put_uint16_t(buf, 24, img_idx);
  131. _mav_put_uint8_t(buf, 26, target_system);
  132. _mav_put_uint8_t(buf, 27, cam_idx);
  133. _mav_put_uint8_t(buf, 28, event_id);
  134. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_STATUS_LEN);
  135. #else
  136. mavlink_camera_status_t packet;
  137. packet.time_usec = time_usec;
  138. packet.p1 = p1;
  139. packet.p2 = p2;
  140. packet.p3 = p3;
  141. packet.p4 = p4;
  142. packet.img_idx = img_idx;
  143. packet.target_system = target_system;
  144. packet.cam_idx = cam_idx;
  145. packet.event_id = event_id;
  146. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_STATUS_LEN);
  147. #endif
  148. msg->msgid = MAVLINK_MSG_ID_CAMERA_STATUS;
  149. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_CRC);
  150. }
  151. /**
  152. * @brief Encode a camera_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 camera_status C-struct to read the message contents from
  158. */
  159. static inline uint16_t mavlink_msg_camera_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_camera_status_t* camera_status)
  160. {
  161. return mavlink_msg_camera_status_pack(system_id, component_id, msg, camera_status->time_usec, camera_status->target_system, camera_status->cam_idx, camera_status->img_idx, camera_status->event_id, camera_status->p1, camera_status->p2, camera_status->p3, camera_status->p4);
  162. }
  163. /**
  164. * @brief Encode a camera_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 camera_status C-struct to read the message contents from
  171. */
  172. static inline uint16_t mavlink_msg_camera_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_camera_status_t* camera_status)
  173. {
  174. return mavlink_msg_camera_status_pack_chan(system_id, component_id, chan, msg, camera_status->time_usec, camera_status->target_system, camera_status->cam_idx, camera_status->img_idx, camera_status->event_id, camera_status->p1, camera_status->p2, camera_status->p3, camera_status->p4);
  175. }
  176. /**
  177. * @brief Send a camera_status message
  178. * @param chan MAVLink channel to send the message
  179. *
  180. * @param time_usec [us] Image timestamp (since UNIX epoch, according to camera clock).
  181. * @param target_system System ID.
  182. * @param cam_idx Camera ID.
  183. * @param img_idx Image index.
  184. * @param event_id Event type.
  185. * @param p1 Parameter 1 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum).
  186. * @param p2 Parameter 2 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum).
  187. * @param p3 Parameter 3 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum).
  188. * @param p4 Parameter 4 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum).
  189. */
  190. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  191. static inline void mavlink_msg_camera_status_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t target_system, uint8_t cam_idx, uint16_t img_idx, uint8_t event_id, float p1, float p2, float p3, float p4)
  192. {
  193. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  194. char buf[MAVLINK_MSG_ID_CAMERA_STATUS_LEN];
  195. _mav_put_uint64_t(buf, 0, time_usec);
  196. _mav_put_float(buf, 8, p1);
  197. _mav_put_float(buf, 12, p2);
  198. _mav_put_float(buf, 16, p3);
  199. _mav_put_float(buf, 20, p4);
  200. _mav_put_uint16_t(buf, 24, img_idx);
  201. _mav_put_uint8_t(buf, 26, target_system);
  202. _mav_put_uint8_t(buf, 27, cam_idx);
  203. _mav_put_uint8_t(buf, 28, event_id);
  204. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_STATUS, buf, MAVLINK_MSG_ID_CAMERA_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_CRC);
  205. #else
  206. mavlink_camera_status_t packet;
  207. packet.time_usec = time_usec;
  208. packet.p1 = p1;
  209. packet.p2 = p2;
  210. packet.p3 = p3;
  211. packet.p4 = p4;
  212. packet.img_idx = img_idx;
  213. packet.target_system = target_system;
  214. packet.cam_idx = cam_idx;
  215. packet.event_id = event_id;
  216. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_STATUS, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_CRC);
  217. #endif
  218. }
  219. /**
  220. * @brief Send a camera_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_camera_status_send_struct(mavlink_channel_t chan, const mavlink_camera_status_t* camera_status)
  225. {
  226. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  227. mavlink_msg_camera_status_send(chan, camera_status->time_usec, camera_status->target_system, camera_status->cam_idx, camera_status->img_idx, camera_status->event_id, camera_status->p1, camera_status->p2, camera_status->p3, camera_status->p4);
  228. #else
  229. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_STATUS, (const char *)camera_status, MAVLINK_MSG_ID_CAMERA_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_CRC);
  230. #endif
  231. }
  232. #if MAVLINK_MSG_ID_CAMERA_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_camera_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t target_system, uint8_t cam_idx, uint16_t img_idx, uint8_t event_id, float p1, float p2, float p3, float p4)
  241. {
  242. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  243. char *buf = (char *)msgbuf;
  244. _mav_put_uint64_t(buf, 0, time_usec);
  245. _mav_put_float(buf, 8, p1);
  246. _mav_put_float(buf, 12, p2);
  247. _mav_put_float(buf, 16, p3);
  248. _mav_put_float(buf, 20, p4);
  249. _mav_put_uint16_t(buf, 24, img_idx);
  250. _mav_put_uint8_t(buf, 26, target_system);
  251. _mav_put_uint8_t(buf, 27, cam_idx);
  252. _mav_put_uint8_t(buf, 28, event_id);
  253. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_STATUS, buf, MAVLINK_MSG_ID_CAMERA_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_CRC);
  254. #else
  255. mavlink_camera_status_t *packet = (mavlink_camera_status_t *)msgbuf;
  256. packet->time_usec = time_usec;
  257. packet->p1 = p1;
  258. packet->p2 = p2;
  259. packet->p3 = p3;
  260. packet->p4 = p4;
  261. packet->img_idx = img_idx;
  262. packet->target_system = target_system;
  263. packet->cam_idx = cam_idx;
  264. packet->event_id = event_id;
  265. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_STATUS, (const char *)packet, MAVLINK_MSG_ID_CAMERA_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_STATUS_CRC);
  266. #endif
  267. }
  268. #endif
  269. #endif
  270. // MESSAGE CAMERA_STATUS UNPACKING
  271. /**
  272. * @brief Get field time_usec from camera_status message
  273. *
  274. * @return [us] Image timestamp (since UNIX epoch, according to camera clock).
  275. */
  276. static inline uint64_t mavlink_msg_camera_status_get_time_usec(const mavlink_message_t* msg)
  277. {
  278. return _MAV_RETURN_uint64_t(msg, 0);
  279. }
  280. /**
  281. * @brief Get field target_system from camera_status message
  282. *
  283. * @return System ID.
  284. */
  285. static inline uint8_t mavlink_msg_camera_status_get_target_system(const mavlink_message_t* msg)
  286. {
  287. return _MAV_RETURN_uint8_t(msg, 26);
  288. }
  289. /**
  290. * @brief Get field cam_idx from camera_status message
  291. *
  292. * @return Camera ID.
  293. */
  294. static inline uint8_t mavlink_msg_camera_status_get_cam_idx(const mavlink_message_t* msg)
  295. {
  296. return _MAV_RETURN_uint8_t(msg, 27);
  297. }
  298. /**
  299. * @brief Get field img_idx from camera_status message
  300. *
  301. * @return Image index.
  302. */
  303. static inline uint16_t mavlink_msg_camera_status_get_img_idx(const mavlink_message_t* msg)
  304. {
  305. return _MAV_RETURN_uint16_t(msg, 24);
  306. }
  307. /**
  308. * @brief Get field event_id from camera_status message
  309. *
  310. * @return Event type.
  311. */
  312. static inline uint8_t mavlink_msg_camera_status_get_event_id(const mavlink_message_t* msg)
  313. {
  314. return _MAV_RETURN_uint8_t(msg, 28);
  315. }
  316. /**
  317. * @brief Get field p1 from camera_status message
  318. *
  319. * @return Parameter 1 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum).
  320. */
  321. static inline float mavlink_msg_camera_status_get_p1(const mavlink_message_t* msg)
  322. {
  323. return _MAV_RETURN_float(msg, 8);
  324. }
  325. /**
  326. * @brief Get field p2 from camera_status message
  327. *
  328. * @return Parameter 2 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum).
  329. */
  330. static inline float mavlink_msg_camera_status_get_p2(const mavlink_message_t* msg)
  331. {
  332. return _MAV_RETURN_float(msg, 12);
  333. }
  334. /**
  335. * @brief Get field p3 from camera_status message
  336. *
  337. * @return Parameter 3 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum).
  338. */
  339. static inline float mavlink_msg_camera_status_get_p3(const mavlink_message_t* msg)
  340. {
  341. return _MAV_RETURN_float(msg, 16);
  342. }
  343. /**
  344. * @brief Get field p4 from camera_status message
  345. *
  346. * @return Parameter 4 (meaning depends on event_id, see CAMERA_STATUS_TYPES enum).
  347. */
  348. static inline float mavlink_msg_camera_status_get_p4(const mavlink_message_t* msg)
  349. {
  350. return _MAV_RETURN_float(msg, 20);
  351. }
  352. /**
  353. * @brief Decode a camera_status message into a struct
  354. *
  355. * @param msg The message to decode
  356. * @param camera_status C-struct to decode the message contents into
  357. */
  358. static inline void mavlink_msg_camera_status_decode(const mavlink_message_t* msg, mavlink_camera_status_t* camera_status)
  359. {
  360. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  361. camera_status->time_usec = mavlink_msg_camera_status_get_time_usec(msg);
  362. camera_status->p1 = mavlink_msg_camera_status_get_p1(msg);
  363. camera_status->p2 = mavlink_msg_camera_status_get_p2(msg);
  364. camera_status->p3 = mavlink_msg_camera_status_get_p3(msg);
  365. camera_status->p4 = mavlink_msg_camera_status_get_p4(msg);
  366. camera_status->img_idx = mavlink_msg_camera_status_get_img_idx(msg);
  367. camera_status->target_system = mavlink_msg_camera_status_get_target_system(msg);
  368. camera_status->cam_idx = mavlink_msg_camera_status_get_cam_idx(msg);
  369. camera_status->event_id = mavlink_msg_camera_status_get_event_id(msg);
  370. #else
  371. uint8_t len = msg->len < MAVLINK_MSG_ID_CAMERA_STATUS_LEN? msg->len : MAVLINK_MSG_ID_CAMERA_STATUS_LEN;
  372. memset(camera_status, 0, MAVLINK_MSG_ID_CAMERA_STATUS_LEN);
  373. memcpy(camera_status, _MAV_PAYLOAD(msg), len);
  374. #endif
  375. }