Merge pull request #10476 from radiolinkW/RADIOLINKF722
[inav.git] / lib / main / MAVLink / common / mavlink_msg_camera_image_captured.h
blob01d772b62a71422277e167711255c5b14ebe43eb
1 #pragma once
2 // MESSAGE CAMERA_IMAGE_CAPTURED PACKING
4 #define MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED 263
7 typedef struct __mavlink_camera_image_captured_t {
8 uint64_t time_utc; /*< [us] Timestamp (time since UNIX epoch) in UTC. 0 for unknown.*/
9 uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
10 int32_t lat; /*< [degE7] Latitude where image was taken*/
11 int32_t lon; /*< [degE7] Longitude where capture was taken*/
12 int32_t alt; /*< [mm] Altitude (MSL) where image was taken*/
13 int32_t relative_alt; /*< [mm] Altitude above ground*/
14 float q[4]; /*< Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)*/
15 int32_t image_index; /*< Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)*/
16 uint8_t camera_id; /*< Deprecated/unused. Component IDs are used to differentiate multiple cameras.*/
17 int8_t capture_result; /*< Boolean indicating success (1) or failure (0) while capturing this image.*/
18 char file_url[205]; /*< URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface.*/
19 } mavlink_camera_image_captured_t;
21 #define MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN 255
22 #define MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN 255
23 #define MAVLINK_MSG_ID_263_LEN 255
24 #define MAVLINK_MSG_ID_263_MIN_LEN 255
26 #define MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_CRC 133
27 #define MAVLINK_MSG_ID_263_CRC 133
29 #define MAVLINK_MSG_CAMERA_IMAGE_CAPTURED_FIELD_Q_LEN 4
30 #define MAVLINK_MSG_CAMERA_IMAGE_CAPTURED_FIELD_FILE_URL_LEN 205
32 #if MAVLINK_COMMAND_24BIT
33 #define MAVLINK_MESSAGE_INFO_CAMERA_IMAGE_CAPTURED { \
34 263, \
35 "CAMERA_IMAGE_CAPTURED", \
36 11, \
37 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_camera_image_captured_t, time_boot_ms) }, \
38 { "time_utc", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_image_captured_t, time_utc) }, \
39 { "camera_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 48, offsetof(mavlink_camera_image_captured_t, camera_id) }, \
40 { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_camera_image_captured_t, lat) }, \
41 { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_camera_image_captured_t, lon) }, \
42 { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_camera_image_captured_t, alt) }, \
43 { "relative_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_camera_image_captured_t, relative_alt) }, \
44 { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 28, offsetof(mavlink_camera_image_captured_t, q) }, \
45 { "image_index", NULL, MAVLINK_TYPE_INT32_T, 0, 44, offsetof(mavlink_camera_image_captured_t, image_index) }, \
46 { "capture_result", NULL, MAVLINK_TYPE_INT8_T, 0, 49, offsetof(mavlink_camera_image_captured_t, capture_result) }, \
47 { "file_url", NULL, MAVLINK_TYPE_CHAR, 205, 50, offsetof(mavlink_camera_image_captured_t, file_url) }, \
48 } \
50 #else
51 #define MAVLINK_MESSAGE_INFO_CAMERA_IMAGE_CAPTURED { \
52 "CAMERA_IMAGE_CAPTURED", \
53 11, \
54 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_camera_image_captured_t, time_boot_ms) }, \
55 { "time_utc", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_camera_image_captured_t, time_utc) }, \
56 { "camera_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 48, offsetof(mavlink_camera_image_captured_t, camera_id) }, \
57 { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_camera_image_captured_t, lat) }, \
58 { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_camera_image_captured_t, lon) }, \
59 { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_camera_image_captured_t, alt) }, \
60 { "relative_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_camera_image_captured_t, relative_alt) }, \
61 { "q", NULL, MAVLINK_TYPE_FLOAT, 4, 28, offsetof(mavlink_camera_image_captured_t, q) }, \
62 { "image_index", NULL, MAVLINK_TYPE_INT32_T, 0, 44, offsetof(mavlink_camera_image_captured_t, image_index) }, \
63 { "capture_result", NULL, MAVLINK_TYPE_INT8_T, 0, 49, offsetof(mavlink_camera_image_captured_t, capture_result) }, \
64 { "file_url", NULL, MAVLINK_TYPE_CHAR, 205, 50, offsetof(mavlink_camera_image_captured_t, file_url) }, \
65 } \
67 #endif
69 /**
70 * @brief Pack a camera_image_captured message
71 * @param system_id ID of this system
72 * @param component_id ID of this component (e.g. 200 for IMU)
73 * @param msg The MAVLink message to compress the data into
75 * @param time_boot_ms [ms] Timestamp (time since system boot).
76 * @param time_utc [us] Timestamp (time since UNIX epoch) in UTC. 0 for unknown.
77 * @param camera_id Deprecated/unused. Component IDs are used to differentiate multiple cameras.
78 * @param lat [degE7] Latitude where image was taken
79 * @param lon [degE7] Longitude where capture was taken
80 * @param alt [mm] Altitude (MSL) where image was taken
81 * @param relative_alt [mm] Altitude above ground
82 * @param q Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
83 * @param image_index Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)
84 * @param capture_result Boolean indicating success (1) or failure (0) while capturing this image.
85 * @param file_url URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface.
86 * @return length of the message in bytes (excluding serial stream start sign)
88 static inline uint16_t mavlink_msg_camera_image_captured_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
89 uint32_t time_boot_ms, uint64_t time_utc, uint8_t camera_id, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, const float *q, int32_t image_index, int8_t capture_result, const char *file_url)
91 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
92 char buf[MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN];
93 _mav_put_uint64_t(buf, 0, time_utc);
94 _mav_put_uint32_t(buf, 8, time_boot_ms);
95 _mav_put_int32_t(buf, 12, lat);
96 _mav_put_int32_t(buf, 16, lon);
97 _mav_put_int32_t(buf, 20, alt);
98 _mav_put_int32_t(buf, 24, relative_alt);
99 _mav_put_int32_t(buf, 44, image_index);
100 _mav_put_uint8_t(buf, 48, camera_id);
101 _mav_put_int8_t(buf, 49, capture_result);
102 _mav_put_float_array(buf, 28, q, 4);
103 _mav_put_char_array(buf, 50, file_url, 205);
104 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN);
105 #else
106 mavlink_camera_image_captured_t packet;
107 packet.time_utc = time_utc;
108 packet.time_boot_ms = time_boot_ms;
109 packet.lat = lat;
110 packet.lon = lon;
111 packet.alt = alt;
112 packet.relative_alt = relative_alt;
113 packet.image_index = image_index;
114 packet.camera_id = camera_id;
115 packet.capture_result = capture_result;
116 mav_array_memcpy(packet.q, q, sizeof(float)*4);
117 mav_array_memcpy(packet.file_url, file_url, sizeof(char)*205);
118 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN);
119 #endif
121 msg->msgid = MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED;
122 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_CRC);
126 * @brief Pack a camera_image_captured message on a channel
127 * @param system_id ID of this system
128 * @param component_id ID of this component (e.g. 200 for IMU)
129 * @param chan The MAVLink channel this message will be sent over
130 * @param msg The MAVLink message to compress the data into
131 * @param time_boot_ms [ms] Timestamp (time since system boot).
132 * @param time_utc [us] Timestamp (time since UNIX epoch) in UTC. 0 for unknown.
133 * @param camera_id Deprecated/unused. Component IDs are used to differentiate multiple cameras.
134 * @param lat [degE7] Latitude where image was taken
135 * @param lon [degE7] Longitude where capture was taken
136 * @param alt [mm] Altitude (MSL) where image was taken
137 * @param relative_alt [mm] Altitude above ground
138 * @param q Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
139 * @param image_index Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)
140 * @param capture_result Boolean indicating success (1) or failure (0) while capturing this image.
141 * @param file_url URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface.
142 * @return length of the message in bytes (excluding serial stream start sign)
144 static inline uint16_t mavlink_msg_camera_image_captured_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
145 mavlink_message_t* msg,
146 uint32_t time_boot_ms,uint64_t time_utc,uint8_t camera_id,int32_t lat,int32_t lon,int32_t alt,int32_t relative_alt,const float *q,int32_t image_index,int8_t capture_result,const char *file_url)
148 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
149 char buf[MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN];
150 _mav_put_uint64_t(buf, 0, time_utc);
151 _mav_put_uint32_t(buf, 8, time_boot_ms);
152 _mav_put_int32_t(buf, 12, lat);
153 _mav_put_int32_t(buf, 16, lon);
154 _mav_put_int32_t(buf, 20, alt);
155 _mav_put_int32_t(buf, 24, relative_alt);
156 _mav_put_int32_t(buf, 44, image_index);
157 _mav_put_uint8_t(buf, 48, camera_id);
158 _mav_put_int8_t(buf, 49, capture_result);
159 _mav_put_float_array(buf, 28, q, 4);
160 _mav_put_char_array(buf, 50, file_url, 205);
161 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN);
162 #else
163 mavlink_camera_image_captured_t packet;
164 packet.time_utc = time_utc;
165 packet.time_boot_ms = time_boot_ms;
166 packet.lat = lat;
167 packet.lon = lon;
168 packet.alt = alt;
169 packet.relative_alt = relative_alt;
170 packet.image_index = image_index;
171 packet.camera_id = camera_id;
172 packet.capture_result = capture_result;
173 mav_array_memcpy(packet.q, q, sizeof(float)*4);
174 mav_array_memcpy(packet.file_url, file_url, sizeof(char)*205);
175 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN);
176 #endif
178 msg->msgid = MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED;
179 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_CRC);
183 * @brief Encode a camera_image_captured struct
185 * @param system_id ID of this system
186 * @param component_id ID of this component (e.g. 200 for IMU)
187 * @param msg The MAVLink message to compress the data into
188 * @param camera_image_captured C-struct to read the message contents from
190 static inline uint16_t mavlink_msg_camera_image_captured_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_camera_image_captured_t* camera_image_captured)
192 return mavlink_msg_camera_image_captured_pack(system_id, component_id, msg, camera_image_captured->time_boot_ms, camera_image_captured->time_utc, camera_image_captured->camera_id, camera_image_captured->lat, camera_image_captured->lon, camera_image_captured->alt, camera_image_captured->relative_alt, camera_image_captured->q, camera_image_captured->image_index, camera_image_captured->capture_result, camera_image_captured->file_url);
196 * @brief Encode a camera_image_captured struct on a channel
198 * @param system_id ID of this system
199 * @param component_id ID of this component (e.g. 200 for IMU)
200 * @param chan The MAVLink channel this message will be sent over
201 * @param msg The MAVLink message to compress the data into
202 * @param camera_image_captured C-struct to read the message contents from
204 static inline uint16_t mavlink_msg_camera_image_captured_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_camera_image_captured_t* camera_image_captured)
206 return mavlink_msg_camera_image_captured_pack_chan(system_id, component_id, chan, msg, camera_image_captured->time_boot_ms, camera_image_captured->time_utc, camera_image_captured->camera_id, camera_image_captured->lat, camera_image_captured->lon, camera_image_captured->alt, camera_image_captured->relative_alt, camera_image_captured->q, camera_image_captured->image_index, camera_image_captured->capture_result, camera_image_captured->file_url);
210 * @brief Send a camera_image_captured message
211 * @param chan MAVLink channel to send the message
213 * @param time_boot_ms [ms] Timestamp (time since system boot).
214 * @param time_utc [us] Timestamp (time since UNIX epoch) in UTC. 0 for unknown.
215 * @param camera_id Deprecated/unused. Component IDs are used to differentiate multiple cameras.
216 * @param lat [degE7] Latitude where image was taken
217 * @param lon [degE7] Longitude where capture was taken
218 * @param alt [mm] Altitude (MSL) where image was taken
219 * @param relative_alt [mm] Altitude above ground
220 * @param q Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
221 * @param image_index Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)
222 * @param capture_result Boolean indicating success (1) or failure (0) while capturing this image.
223 * @param file_url URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface.
225 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
227 static inline void mavlink_msg_camera_image_captured_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint64_t time_utc, uint8_t camera_id, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, const float *q, int32_t image_index, int8_t capture_result, const char *file_url)
229 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
230 char buf[MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN];
231 _mav_put_uint64_t(buf, 0, time_utc);
232 _mav_put_uint32_t(buf, 8, time_boot_ms);
233 _mav_put_int32_t(buf, 12, lat);
234 _mav_put_int32_t(buf, 16, lon);
235 _mav_put_int32_t(buf, 20, alt);
236 _mav_put_int32_t(buf, 24, relative_alt);
237 _mav_put_int32_t(buf, 44, image_index);
238 _mav_put_uint8_t(buf, 48, camera_id);
239 _mav_put_int8_t(buf, 49, capture_result);
240 _mav_put_float_array(buf, 28, q, 4);
241 _mav_put_char_array(buf, 50, file_url, 205);
242 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED, buf, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_CRC);
243 #else
244 mavlink_camera_image_captured_t packet;
245 packet.time_utc = time_utc;
246 packet.time_boot_ms = time_boot_ms;
247 packet.lat = lat;
248 packet.lon = lon;
249 packet.alt = alt;
250 packet.relative_alt = relative_alt;
251 packet.image_index = image_index;
252 packet.camera_id = camera_id;
253 packet.capture_result = capture_result;
254 mav_array_memcpy(packet.q, q, sizeof(float)*4);
255 mav_array_memcpy(packet.file_url, file_url, sizeof(char)*205);
256 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_CRC);
257 #endif
261 * @brief Send a camera_image_captured message
262 * @param chan MAVLink channel to send the message
263 * @param struct The MAVLink struct to serialize
265 static inline void mavlink_msg_camera_image_captured_send_struct(mavlink_channel_t chan, const mavlink_camera_image_captured_t* camera_image_captured)
267 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
268 mavlink_msg_camera_image_captured_send(chan, camera_image_captured->time_boot_ms, camera_image_captured->time_utc, camera_image_captured->camera_id, camera_image_captured->lat, camera_image_captured->lon, camera_image_captured->alt, camera_image_captured->relative_alt, camera_image_captured->q, camera_image_captured->image_index, camera_image_captured->capture_result, camera_image_captured->file_url);
269 #else
270 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED, (const char *)camera_image_captured, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_CRC);
271 #endif
274 #if MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN <= MAVLINK_MAX_PAYLOAD_LEN
276 This varient of _send() can be used to save stack space by re-using
277 memory from the receive buffer. The caller provides a
278 mavlink_message_t which is the size of a full mavlink message. This
279 is usually the receive buffer for the channel, and allows a reply to an
280 incoming message with minimum stack space usage.
282 static inline void mavlink_msg_camera_image_captured_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint64_t time_utc, uint8_t camera_id, int32_t lat, int32_t lon, int32_t alt, int32_t relative_alt, const float *q, int32_t image_index, int8_t capture_result, const char *file_url)
284 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
285 char *buf = (char *)msgbuf;
286 _mav_put_uint64_t(buf, 0, time_utc);
287 _mav_put_uint32_t(buf, 8, time_boot_ms);
288 _mav_put_int32_t(buf, 12, lat);
289 _mav_put_int32_t(buf, 16, lon);
290 _mav_put_int32_t(buf, 20, alt);
291 _mav_put_int32_t(buf, 24, relative_alt);
292 _mav_put_int32_t(buf, 44, image_index);
293 _mav_put_uint8_t(buf, 48, camera_id);
294 _mav_put_int8_t(buf, 49, capture_result);
295 _mav_put_float_array(buf, 28, q, 4);
296 _mav_put_char_array(buf, 50, file_url, 205);
297 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED, buf, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_CRC);
298 #else
299 mavlink_camera_image_captured_t *packet = (mavlink_camera_image_captured_t *)msgbuf;
300 packet->time_utc = time_utc;
301 packet->time_boot_ms = time_boot_ms;
302 packet->lat = lat;
303 packet->lon = lon;
304 packet->alt = alt;
305 packet->relative_alt = relative_alt;
306 packet->image_index = image_index;
307 packet->camera_id = camera_id;
308 packet->capture_result = capture_result;
309 mav_array_memcpy(packet->q, q, sizeof(float)*4);
310 mav_array_memcpy(packet->file_url, file_url, sizeof(char)*205);
311 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED, (const char *)packet, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_CRC);
312 #endif
314 #endif
316 #endif
318 // MESSAGE CAMERA_IMAGE_CAPTURED UNPACKING
322 * @brief Get field time_boot_ms from camera_image_captured message
324 * @return [ms] Timestamp (time since system boot).
326 static inline uint32_t mavlink_msg_camera_image_captured_get_time_boot_ms(const mavlink_message_t* msg)
328 return _MAV_RETURN_uint32_t(msg, 8);
332 * @brief Get field time_utc from camera_image_captured message
334 * @return [us] Timestamp (time since UNIX epoch) in UTC. 0 for unknown.
336 static inline uint64_t mavlink_msg_camera_image_captured_get_time_utc(const mavlink_message_t* msg)
338 return _MAV_RETURN_uint64_t(msg, 0);
342 * @brief Get field camera_id from camera_image_captured message
344 * @return Deprecated/unused. Component IDs are used to differentiate multiple cameras.
346 static inline uint8_t mavlink_msg_camera_image_captured_get_camera_id(const mavlink_message_t* msg)
348 return _MAV_RETURN_uint8_t(msg, 48);
352 * @brief Get field lat from camera_image_captured message
354 * @return [degE7] Latitude where image was taken
356 static inline int32_t mavlink_msg_camera_image_captured_get_lat(const mavlink_message_t* msg)
358 return _MAV_RETURN_int32_t(msg, 12);
362 * @brief Get field lon from camera_image_captured message
364 * @return [degE7] Longitude where capture was taken
366 static inline int32_t mavlink_msg_camera_image_captured_get_lon(const mavlink_message_t* msg)
368 return _MAV_RETURN_int32_t(msg, 16);
372 * @brief Get field alt from camera_image_captured message
374 * @return [mm] Altitude (MSL) where image was taken
376 static inline int32_t mavlink_msg_camera_image_captured_get_alt(const mavlink_message_t* msg)
378 return _MAV_RETURN_int32_t(msg, 20);
382 * @brief Get field relative_alt from camera_image_captured message
384 * @return [mm] Altitude above ground
386 static inline int32_t mavlink_msg_camera_image_captured_get_relative_alt(const mavlink_message_t* msg)
388 return _MAV_RETURN_int32_t(msg, 24);
392 * @brief Get field q from camera_image_captured message
394 * @return Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
396 static inline uint16_t mavlink_msg_camera_image_captured_get_q(const mavlink_message_t* msg, float *q)
398 return _MAV_RETURN_float_array(msg, q, 4, 28);
402 * @brief Get field image_index from camera_image_captured message
404 * @return Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)
406 static inline int32_t mavlink_msg_camera_image_captured_get_image_index(const mavlink_message_t* msg)
408 return _MAV_RETURN_int32_t(msg, 44);
412 * @brief Get field capture_result from camera_image_captured message
414 * @return Boolean indicating success (1) or failure (0) while capturing this image.
416 static inline int8_t mavlink_msg_camera_image_captured_get_capture_result(const mavlink_message_t* msg)
418 return _MAV_RETURN_int8_t(msg, 49);
422 * @brief Get field file_url from camera_image_captured message
424 * @return URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface.
426 static inline uint16_t mavlink_msg_camera_image_captured_get_file_url(const mavlink_message_t* msg, char *file_url)
428 return _MAV_RETURN_char_array(msg, file_url, 205, 50);
432 * @brief Decode a camera_image_captured message into a struct
434 * @param msg The message to decode
435 * @param camera_image_captured C-struct to decode the message contents into
437 static inline void mavlink_msg_camera_image_captured_decode(const mavlink_message_t* msg, mavlink_camera_image_captured_t* camera_image_captured)
439 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
440 camera_image_captured->time_utc = mavlink_msg_camera_image_captured_get_time_utc(msg);
441 camera_image_captured->time_boot_ms = mavlink_msg_camera_image_captured_get_time_boot_ms(msg);
442 camera_image_captured->lat = mavlink_msg_camera_image_captured_get_lat(msg);
443 camera_image_captured->lon = mavlink_msg_camera_image_captured_get_lon(msg);
444 camera_image_captured->alt = mavlink_msg_camera_image_captured_get_alt(msg);
445 camera_image_captured->relative_alt = mavlink_msg_camera_image_captured_get_relative_alt(msg);
446 mavlink_msg_camera_image_captured_get_q(msg, camera_image_captured->q);
447 camera_image_captured->image_index = mavlink_msg_camera_image_captured_get_image_index(msg);
448 camera_image_captured->camera_id = mavlink_msg_camera_image_captured_get_camera_id(msg);
449 camera_image_captured->capture_result = mavlink_msg_camera_image_captured_get_capture_result(msg);
450 mavlink_msg_camera_image_captured_get_file_url(msg, camera_image_captured->file_url);
451 #else
452 uint8_t len = msg->len < MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN? msg->len : MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN;
453 memset(camera_image_captured, 0, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN);
454 memcpy(camera_image_captured, _MAV_PAYLOAD(msg), len);
455 #endif