mavlink_msg_camera_capture_status.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. #pragma once
  2. // MESSAGE CAMERA_CAPTURE_STATUS PACKING
  3. #define MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS 262
  4. MAVPACKED(
  5. typedef struct __mavlink_camera_capture_status_t {
  6. uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
  7. float image_interval; /*< [s] Image capture interval*/
  8. uint32_t recording_time_ms; /*< [ms] Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy.*/
  9. float available_capacity; /*< [MiB] Available storage capacity.*/
  10. uint8_t image_status; /*< Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)*/
  11. uint8_t video_status; /*< Current status of video capturing (0: idle, 1: capture in progress)*/
  12. int32_t image_count; /*< Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT).*/
  13. }) mavlink_camera_capture_status_t;
  14. #define MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN 22
  15. #define MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN 18
  16. #define MAVLINK_MSG_ID_262_LEN 22
  17. #define MAVLINK_MSG_ID_262_MIN_LEN 18
  18. #define MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_CRC 12
  19. #define MAVLINK_MSG_ID_262_CRC 12
  20. #if MAVLINK_COMMAND_24BIT
  21. #define MAVLINK_MESSAGE_INFO_CAMERA_CAPTURE_STATUS { \
  22. 262, \
  23. "CAMERA_CAPTURE_STATUS", \
  24. 7, \
  25. { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_camera_capture_status_t, time_boot_ms) }, \
  26. { "image_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_camera_capture_status_t, image_status) }, \
  27. { "video_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_camera_capture_status_t, video_status) }, \
  28. { "image_interval", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_camera_capture_status_t, image_interval) }, \
  29. { "recording_time_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_camera_capture_status_t, recording_time_ms) }, \
  30. { "available_capacity", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_camera_capture_status_t, available_capacity) }, \
  31. { "image_count", NULL, MAVLINK_TYPE_INT32_T, 0, 18, offsetof(mavlink_camera_capture_status_t, image_count) }, \
  32. } \
  33. }
  34. #else
  35. #define MAVLINK_MESSAGE_INFO_CAMERA_CAPTURE_STATUS { \
  36. "CAMERA_CAPTURE_STATUS", \
  37. 7, \
  38. { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_camera_capture_status_t, time_boot_ms) }, \
  39. { "image_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_camera_capture_status_t, image_status) }, \
  40. { "video_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_camera_capture_status_t, video_status) }, \
  41. { "image_interval", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_camera_capture_status_t, image_interval) }, \
  42. { "recording_time_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_camera_capture_status_t, recording_time_ms) }, \
  43. { "available_capacity", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_camera_capture_status_t, available_capacity) }, \
  44. { "image_count", NULL, MAVLINK_TYPE_INT32_T, 0, 18, offsetof(mavlink_camera_capture_status_t, image_count) }, \
  45. } \
  46. }
  47. #endif
  48. /**
  49. * @brief Pack a camera_capture_status message
  50. * @param system_id ID of this system
  51. * @param component_id ID of this component (e.g. 200 for IMU)
  52. * @param msg The MAVLink message to compress the data into
  53. *
  54. * @param time_boot_ms [ms] Timestamp (time since system boot).
  55. * @param image_status Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)
  56. * @param video_status Current status of video capturing (0: idle, 1: capture in progress)
  57. * @param image_interval [s] Image capture interval
  58. * @param recording_time_ms [ms] Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy.
  59. * @param available_capacity [MiB] Available storage capacity.
  60. * @param image_count Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT).
  61. * @return length of the message in bytes (excluding serial stream start sign)
  62. */
  63. static inline uint16_t mavlink_msg_camera_capture_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  64. uint32_t time_boot_ms, uint8_t image_status, uint8_t video_status, float image_interval, uint32_t recording_time_ms, float available_capacity, int32_t image_count)
  65. {
  66. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  67. char buf[MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN];
  68. _mav_put_uint32_t(buf, 0, time_boot_ms);
  69. _mav_put_float(buf, 4, image_interval);
  70. _mav_put_uint32_t(buf, 8, recording_time_ms);
  71. _mav_put_float(buf, 12, available_capacity);
  72. _mav_put_uint8_t(buf, 16, image_status);
  73. _mav_put_uint8_t(buf, 17, video_status);
  74. _mav_put_int32_t(buf, 18, image_count);
  75. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN);
  76. #else
  77. mavlink_camera_capture_status_t packet;
  78. packet.time_boot_ms = time_boot_ms;
  79. packet.image_interval = image_interval;
  80. packet.recording_time_ms = recording_time_ms;
  81. packet.available_capacity = available_capacity;
  82. packet.image_status = image_status;
  83. packet.video_status = video_status;
  84. packet.image_count = image_count;
  85. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN);
  86. #endif
  87. msg->msgid = MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS;
  88. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_CRC);
  89. }
  90. /**
  91. * @brief Pack a camera_capture_status message
  92. * @param system_id ID of this system
  93. * @param component_id ID of this component (e.g. 200 for IMU)
  94. * @param status MAVLink status structure
  95. * @param msg The MAVLink message to compress the data into
  96. *
  97. * @param time_boot_ms [ms] Timestamp (time since system boot).
  98. * @param image_status Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)
  99. * @param video_status Current status of video capturing (0: idle, 1: capture in progress)
  100. * @param image_interval [s] Image capture interval
  101. * @param recording_time_ms [ms] Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy.
  102. * @param available_capacity [MiB] Available storage capacity.
  103. * @param image_count Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT).
  104. * @return length of the message in bytes (excluding serial stream start sign)
  105. */
  106. static inline uint16_t mavlink_msg_camera_capture_status_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
  107. uint32_t time_boot_ms, uint8_t image_status, uint8_t video_status, float image_interval, uint32_t recording_time_ms, float available_capacity, int32_t image_count)
  108. {
  109. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  110. char buf[MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN];
  111. _mav_put_uint32_t(buf, 0, time_boot_ms);
  112. _mav_put_float(buf, 4, image_interval);
  113. _mav_put_uint32_t(buf, 8, recording_time_ms);
  114. _mav_put_float(buf, 12, available_capacity);
  115. _mav_put_uint8_t(buf, 16, image_status);
  116. _mav_put_uint8_t(buf, 17, video_status);
  117. _mav_put_int32_t(buf, 18, image_count);
  118. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN);
  119. #else
  120. mavlink_camera_capture_status_t packet;
  121. packet.time_boot_ms = time_boot_ms;
  122. packet.image_interval = image_interval;
  123. packet.recording_time_ms = recording_time_ms;
  124. packet.available_capacity = available_capacity;
  125. packet.image_status = image_status;
  126. packet.video_status = video_status;
  127. packet.image_count = image_count;
  128. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN);
  129. #endif
  130. msg->msgid = MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS;
  131. #if MAVLINK_CRC_EXTRA
  132. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_CRC);
  133. #else
  134. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN);
  135. #endif
  136. }
  137. /**
  138. * @brief Pack a camera_capture_status message on a channel
  139. * @param system_id ID of this system
  140. * @param component_id ID of this component (e.g. 200 for IMU)
  141. * @param chan The MAVLink channel this message will be sent over
  142. * @param msg The MAVLink message to compress the data into
  143. * @param time_boot_ms [ms] Timestamp (time since system boot).
  144. * @param image_status Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)
  145. * @param video_status Current status of video capturing (0: idle, 1: capture in progress)
  146. * @param image_interval [s] Image capture interval
  147. * @param recording_time_ms [ms] Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy.
  148. * @param available_capacity [MiB] Available storage capacity.
  149. * @param image_count Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT).
  150. * @return length of the message in bytes (excluding serial stream start sign)
  151. */
  152. static inline uint16_t mavlink_msg_camera_capture_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  153. mavlink_message_t* msg,
  154. uint32_t time_boot_ms,uint8_t image_status,uint8_t video_status,float image_interval,uint32_t recording_time_ms,float available_capacity,int32_t image_count)
  155. {
  156. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  157. char buf[MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN];
  158. _mav_put_uint32_t(buf, 0, time_boot_ms);
  159. _mav_put_float(buf, 4, image_interval);
  160. _mav_put_uint32_t(buf, 8, recording_time_ms);
  161. _mav_put_float(buf, 12, available_capacity);
  162. _mav_put_uint8_t(buf, 16, image_status);
  163. _mav_put_uint8_t(buf, 17, video_status);
  164. _mav_put_int32_t(buf, 18, image_count);
  165. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN);
  166. #else
  167. mavlink_camera_capture_status_t packet;
  168. packet.time_boot_ms = time_boot_ms;
  169. packet.image_interval = image_interval;
  170. packet.recording_time_ms = recording_time_ms;
  171. packet.available_capacity = available_capacity;
  172. packet.image_status = image_status;
  173. packet.video_status = video_status;
  174. packet.image_count = image_count;
  175. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN);
  176. #endif
  177. msg->msgid = MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS;
  178. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_CRC);
  179. }
  180. /**
  181. * @brief Encode a camera_capture_status struct
  182. *
  183. * @param system_id ID of this system
  184. * @param component_id ID of this component (e.g. 200 for IMU)
  185. * @param msg The MAVLink message to compress the data into
  186. * @param camera_capture_status C-struct to read the message contents from
  187. */
  188. static inline uint16_t mavlink_msg_camera_capture_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_camera_capture_status_t* camera_capture_status)
  189. {
  190. return mavlink_msg_camera_capture_status_pack(system_id, component_id, msg, camera_capture_status->time_boot_ms, camera_capture_status->image_status, camera_capture_status->video_status, camera_capture_status->image_interval, camera_capture_status->recording_time_ms, camera_capture_status->available_capacity, camera_capture_status->image_count);
  191. }
  192. /**
  193. * @brief Encode a camera_capture_status struct on a channel
  194. *
  195. * @param system_id ID of this system
  196. * @param component_id ID of this component (e.g. 200 for IMU)
  197. * @param chan The MAVLink channel this message will be sent over
  198. * @param msg The MAVLink message to compress the data into
  199. * @param camera_capture_status C-struct to read the message contents from
  200. */
  201. static inline uint16_t mavlink_msg_camera_capture_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_camera_capture_status_t* camera_capture_status)
  202. {
  203. return mavlink_msg_camera_capture_status_pack_chan(system_id, component_id, chan, msg, camera_capture_status->time_boot_ms, camera_capture_status->image_status, camera_capture_status->video_status, camera_capture_status->image_interval, camera_capture_status->recording_time_ms, camera_capture_status->available_capacity, camera_capture_status->image_count);
  204. }
  205. /**
  206. * @brief Encode a camera_capture_status struct with provided status structure
  207. *
  208. * @param system_id ID of this system
  209. * @param component_id ID of this component (e.g. 200 for IMU)
  210. * @param status MAVLink status structure
  211. * @param msg The MAVLink message to compress the data into
  212. * @param camera_capture_status C-struct to read the message contents from
  213. */
  214. static inline uint16_t mavlink_msg_camera_capture_status_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_camera_capture_status_t* camera_capture_status)
  215. {
  216. return mavlink_msg_camera_capture_status_pack_status(system_id, component_id, _status, msg, camera_capture_status->time_boot_ms, camera_capture_status->image_status, camera_capture_status->video_status, camera_capture_status->image_interval, camera_capture_status->recording_time_ms, camera_capture_status->available_capacity, camera_capture_status->image_count);
  217. }
  218. /**
  219. * @brief Send a camera_capture_status message
  220. * @param chan MAVLink channel to send the message
  221. *
  222. * @param time_boot_ms [ms] Timestamp (time since system boot).
  223. * @param image_status Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)
  224. * @param video_status Current status of video capturing (0: idle, 1: capture in progress)
  225. * @param image_interval [s] Image capture interval
  226. * @param recording_time_ms [ms] Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy.
  227. * @param available_capacity [MiB] Available storage capacity.
  228. * @param image_count Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT).
  229. */
  230. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  231. static inline void mavlink_msg_camera_capture_status_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t image_status, uint8_t video_status, float image_interval, uint32_t recording_time_ms, float available_capacity, int32_t image_count)
  232. {
  233. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  234. char buf[MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN];
  235. _mav_put_uint32_t(buf, 0, time_boot_ms);
  236. _mav_put_float(buf, 4, image_interval);
  237. _mav_put_uint32_t(buf, 8, recording_time_ms);
  238. _mav_put_float(buf, 12, available_capacity);
  239. _mav_put_uint8_t(buf, 16, image_status);
  240. _mav_put_uint8_t(buf, 17, video_status);
  241. _mav_put_int32_t(buf, 18, image_count);
  242. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS, buf, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_CRC);
  243. #else
  244. mavlink_camera_capture_status_t packet;
  245. packet.time_boot_ms = time_boot_ms;
  246. packet.image_interval = image_interval;
  247. packet.recording_time_ms = recording_time_ms;
  248. packet.available_capacity = available_capacity;
  249. packet.image_status = image_status;
  250. packet.video_status = video_status;
  251. packet.image_count = image_count;
  252. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_CRC);
  253. #endif
  254. }
  255. /**
  256. * @brief Send a camera_capture_status message
  257. * @param chan MAVLink channel to send the message
  258. * @param struct The MAVLink struct to serialize
  259. */
  260. static inline void mavlink_msg_camera_capture_status_send_struct(mavlink_channel_t chan, const mavlink_camera_capture_status_t* camera_capture_status)
  261. {
  262. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  263. mavlink_msg_camera_capture_status_send(chan, camera_capture_status->time_boot_ms, camera_capture_status->image_status, camera_capture_status->video_status, camera_capture_status->image_interval, camera_capture_status->recording_time_ms, camera_capture_status->available_capacity, camera_capture_status->image_count);
  264. #else
  265. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS, (const char *)camera_capture_status, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_CRC);
  266. #endif
  267. }
  268. #if MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  269. /*
  270. This variant of _send() can be used to save stack space by re-using
  271. memory from the receive buffer. The caller provides a
  272. mavlink_message_t which is the size of a full mavlink message. This
  273. is usually the receive buffer for the channel, and allows a reply to an
  274. incoming message with minimum stack space usage.
  275. */
  276. static inline void mavlink_msg_camera_capture_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t image_status, uint8_t video_status, float image_interval, uint32_t recording_time_ms, float available_capacity, int32_t image_count)
  277. {
  278. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  279. char *buf = (char *)msgbuf;
  280. _mav_put_uint32_t(buf, 0, time_boot_ms);
  281. _mav_put_float(buf, 4, image_interval);
  282. _mav_put_uint32_t(buf, 8, recording_time_ms);
  283. _mav_put_float(buf, 12, available_capacity);
  284. _mav_put_uint8_t(buf, 16, image_status);
  285. _mav_put_uint8_t(buf, 17, video_status);
  286. _mav_put_int32_t(buf, 18, image_count);
  287. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS, buf, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_CRC);
  288. #else
  289. mavlink_camera_capture_status_t *packet = (mavlink_camera_capture_status_t *)msgbuf;
  290. packet->time_boot_ms = time_boot_ms;
  291. packet->image_interval = image_interval;
  292. packet->recording_time_ms = recording_time_ms;
  293. packet->available_capacity = available_capacity;
  294. packet->image_status = image_status;
  295. packet->video_status = video_status;
  296. packet->image_count = image_count;
  297. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS, (const char *)packet, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_CRC);
  298. #endif
  299. }
  300. #endif
  301. #endif
  302. // MESSAGE CAMERA_CAPTURE_STATUS UNPACKING
  303. /**
  304. * @brief Get field time_boot_ms from camera_capture_status message
  305. *
  306. * @return [ms] Timestamp (time since system boot).
  307. */
  308. static inline uint32_t mavlink_msg_camera_capture_status_get_time_boot_ms(const mavlink_message_t* msg)
  309. {
  310. return _MAV_RETURN_uint32_t(msg, 0);
  311. }
  312. /**
  313. * @brief Get field image_status from camera_capture_status message
  314. *
  315. * @return Current status of image capturing (0: idle, 1: capture in progress, 2: interval set but idle, 3: interval set and capture in progress)
  316. */
  317. static inline uint8_t mavlink_msg_camera_capture_status_get_image_status(const mavlink_message_t* msg)
  318. {
  319. return _MAV_RETURN_uint8_t(msg, 16);
  320. }
  321. /**
  322. * @brief Get field video_status from camera_capture_status message
  323. *
  324. * @return Current status of video capturing (0: idle, 1: capture in progress)
  325. */
  326. static inline uint8_t mavlink_msg_camera_capture_status_get_video_status(const mavlink_message_t* msg)
  327. {
  328. return _MAV_RETURN_uint8_t(msg, 17);
  329. }
  330. /**
  331. * @brief Get field image_interval from camera_capture_status message
  332. *
  333. * @return [s] Image capture interval
  334. */
  335. static inline float mavlink_msg_camera_capture_status_get_image_interval(const mavlink_message_t* msg)
  336. {
  337. return _MAV_RETURN_float(msg, 4);
  338. }
  339. /**
  340. * @brief Get field recording_time_ms from camera_capture_status message
  341. *
  342. * @return [ms] Elapsed time since recording started (0: Not supported/available). A GCS should compute recording time and use non-zero values of this field to correct any discrepancy.
  343. */
  344. static inline uint32_t mavlink_msg_camera_capture_status_get_recording_time_ms(const mavlink_message_t* msg)
  345. {
  346. return _MAV_RETURN_uint32_t(msg, 8);
  347. }
  348. /**
  349. * @brief Get field available_capacity from camera_capture_status message
  350. *
  351. * @return [MiB] Available storage capacity.
  352. */
  353. static inline float mavlink_msg_camera_capture_status_get_available_capacity(const mavlink_message_t* msg)
  354. {
  355. return _MAV_RETURN_float(msg, 12);
  356. }
  357. /**
  358. * @brief Get field image_count from camera_capture_status message
  359. *
  360. * @return Total number of images captured ('forever', or until reset using MAV_CMD_STORAGE_FORMAT).
  361. */
  362. static inline int32_t mavlink_msg_camera_capture_status_get_image_count(const mavlink_message_t* msg)
  363. {
  364. return _MAV_RETURN_int32_t(msg, 18);
  365. }
  366. /**
  367. * @brief Decode a camera_capture_status message into a struct
  368. *
  369. * @param msg The message to decode
  370. * @param camera_capture_status C-struct to decode the message contents into
  371. */
  372. static inline void mavlink_msg_camera_capture_status_decode(const mavlink_message_t* msg, mavlink_camera_capture_status_t* camera_capture_status)
  373. {
  374. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  375. camera_capture_status->time_boot_ms = mavlink_msg_camera_capture_status_get_time_boot_ms(msg);
  376. camera_capture_status->image_interval = mavlink_msg_camera_capture_status_get_image_interval(msg);
  377. camera_capture_status->recording_time_ms = mavlink_msg_camera_capture_status_get_recording_time_ms(msg);
  378. camera_capture_status->available_capacity = mavlink_msg_camera_capture_status_get_available_capacity(msg);
  379. camera_capture_status->image_status = mavlink_msg_camera_capture_status_get_image_status(msg);
  380. camera_capture_status->video_status = mavlink_msg_camera_capture_status_get_video_status(msg);
  381. camera_capture_status->image_count = mavlink_msg_camera_capture_status_get_image_count(msg);
  382. #else
  383. uint8_t len = msg->len < MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN? msg->len : MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN;
  384. memset(camera_capture_status, 0, MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_LEN);
  385. memcpy(camera_capture_status, _MAV_PAYLOAD(msg), len);
  386. #endif
  387. }