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