Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_camera_image_captured.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE CAMERA_IMAGE_CAPTURED PACKING
3
4#define MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED 263
5
6
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; /*< 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). Field name is usually camera_device_id.*/
17 int8_t capture_result; /*< Image was captured successfully (MAV_BOOL_TRUE). Values not equal to 0 or 1 are invalid.*/
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;
20
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
25
26#define MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_CRC 133
27#define MAVLINK_MSG_ID_263_CRC 133
28
29#define MAVLINK_MSG_CAMERA_IMAGE_CAPTURED_FIELD_Q_LEN 4
30#define MAVLINK_MSG_CAMERA_IMAGE_CAPTURED_FIELD_FILE_URL_LEN 205
31
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 } \
49}
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 } \
66}
67#endif
68
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
74 *
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 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). Field name is usually camera_device_id.
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 Image was captured successfully (MAV_BOOL_TRUE). Values not equal to 0 or 1 are invalid.
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)
87 */
88static 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)
90{
91#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
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
120
123}
124
125/**
126 * @brief Pack a camera_image_captured message
127 * @param system_id ID of this system
128 * @param component_id ID of this component (e.g. 200 for IMU)
129 * @param status MAVLink status structure
130 * @param msg The MAVLink message to compress the data into
131 *
132 * @param time_boot_ms [ms] Timestamp (time since system boot).
133 * @param time_utc [us] Timestamp (time since UNIX epoch) in UTC. 0 for unknown.
134 * @param camera_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). Field name is usually camera_device_id.
135 * @param lat [degE7] Latitude where image was taken
136 * @param lon [degE7] Longitude where capture was taken
137 * @param alt [mm] Altitude (MSL) where image was taken
138 * @param relative_alt [mm] Altitude above ground
139 * @param q Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
140 * @param image_index Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)
141 * @param capture_result Image was captured successfully (MAV_BOOL_TRUE). Values not equal to 0 or 1 are invalid.
142 * @param file_url URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface.
143 * @return length of the message in bytes (excluding serial stream start sign)
144 */
145static inline uint16_t mavlink_msg_camera_image_captured_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, 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)
147{
148#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
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
177
179#if MAVLINK_CRC_EXTRA
180 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_CRC);
181#else
182 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN);
183#endif
184}
185
186/**
187 * @brief Pack a camera_image_captured message on a channel
188 * @param system_id ID of this system
189 * @param component_id ID of this component (e.g. 200 for IMU)
190 * @param chan The MAVLink channel this message will be sent over
191 * @param msg The MAVLink message to compress the data into
192 * @param time_boot_ms [ms] Timestamp (time since system boot).
193 * @param time_utc [us] Timestamp (time since UNIX epoch) in UTC. 0 for unknown.
194 * @param camera_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). Field name is usually camera_device_id.
195 * @param lat [degE7] Latitude where image was taken
196 * @param lon [degE7] Longitude where capture was taken
197 * @param alt [mm] Altitude (MSL) where image was taken
198 * @param relative_alt [mm] Altitude above ground
199 * @param q Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
200 * @param image_index Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)
201 * @param capture_result Image was captured successfully (MAV_BOOL_TRUE). Values not equal to 0 or 1 are invalid.
202 * @param file_url URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface.
203 * @return length of the message in bytes (excluding serial stream start sign)
204 */
205static inline uint16_t mavlink_msg_camera_image_captured_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
206 mavlink_message_t* msg,
207 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)
208{
209#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
211 _mav_put_uint64_t(buf, 0, time_utc);
212 _mav_put_uint32_t(buf, 8, time_boot_ms);
213 _mav_put_int32_t(buf, 12, lat);
214 _mav_put_int32_t(buf, 16, lon);
215 _mav_put_int32_t(buf, 20, alt);
216 _mav_put_int32_t(buf, 24, relative_alt);
217 _mav_put_int32_t(buf, 44, image_index);
218 _mav_put_uint8_t(buf, 48, camera_id);
219 _mav_put_int8_t(buf, 49, capture_result);
220 _mav_put_float_array(buf, 28, q, 4);
221 _mav_put_char_array(buf, 50, file_url, 205);
222 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN);
223#else
224 mavlink_camera_image_captured_t packet;
225 packet.time_utc = time_utc;
226 packet.time_boot_ms = time_boot_ms;
227 packet.lat = lat;
228 packet.lon = lon;
229 packet.alt = alt;
230 packet.relative_alt = relative_alt;
231 packet.image_index = image_index;
232 packet.camera_id = camera_id;
233 packet.capture_result = capture_result;
234 mav_array_memcpy(packet.q, q, sizeof(float)*4);
235 mav_array_memcpy(packet.file_url, file_url, sizeof(char)*205);
236 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN);
237#endif
238
240 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);
241}
242
243/**
244 * @brief Encode a camera_image_captured struct
245 *
246 * @param system_id ID of this system
247 * @param component_id ID of this component (e.g. 200 for IMU)
248 * @param msg The MAVLink message to compress the data into
249 * @param camera_image_captured C-struct to read the message contents from
250 */
251static 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)
252{
253 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);
254}
255
256/**
257 * @brief Encode a camera_image_captured struct on a channel
258 *
259 * @param system_id ID of this system
260 * @param component_id ID of this component (e.g. 200 for IMU)
261 * @param chan The MAVLink channel this message will be sent over
262 * @param msg The MAVLink message to compress the data into
263 * @param camera_image_captured C-struct to read the message contents from
264 */
265static 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)
266{
267 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);
268}
269
270/**
271 * @brief Encode a camera_image_captured struct with provided status structure
272 *
273 * @param system_id ID of this system
274 * @param component_id ID of this component (e.g. 200 for IMU)
275 * @param status MAVLink status structure
276 * @param msg The MAVLink message to compress the data into
277 * @param camera_image_captured C-struct to read the message contents from
278 */
279static inline uint16_t mavlink_msg_camera_image_captured_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_camera_image_captured_t* camera_image_captured)
280{
281 return mavlink_msg_camera_image_captured_pack_status(system_id, component_id, _status, 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);
282}
283
284/**
285 * @brief Send a camera_image_captured message
286 * @param chan MAVLink channel to send the message
287 *
288 * @param time_boot_ms [ms] Timestamp (time since system boot).
289 * @param time_utc [us] Timestamp (time since UNIX epoch) in UTC. 0 for unknown.
290 * @param camera_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). Field name is usually camera_device_id.
291 * @param lat [degE7] Latitude where image was taken
292 * @param lon [degE7] Longitude where capture was taken
293 * @param alt [mm] Altitude (MSL) where image was taken
294 * @param relative_alt [mm] Altitude above ground
295 * @param q Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
296 * @param image_index Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)
297 * @param capture_result Image was captured successfully (MAV_BOOL_TRUE). Values not equal to 0 or 1 are invalid.
298 * @param file_url URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface.
299 */
300#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
301
302static 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)
303{
304#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
305 char buf[MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN];
306 _mav_put_uint64_t(buf, 0, time_utc);
307 _mav_put_uint32_t(buf, 8, time_boot_ms);
308 _mav_put_int32_t(buf, 12, lat);
309 _mav_put_int32_t(buf, 16, lon);
310 _mav_put_int32_t(buf, 20, alt);
311 _mav_put_int32_t(buf, 24, relative_alt);
312 _mav_put_int32_t(buf, 44, image_index);
313 _mav_put_uint8_t(buf, 48, camera_id);
314 _mav_put_int8_t(buf, 49, capture_result);
315 _mav_put_float_array(buf, 28, q, 4);
316 _mav_put_char_array(buf, 50, file_url, 205);
317 _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);
318#else
319 mavlink_camera_image_captured_t packet;
320 packet.time_utc = time_utc;
321 packet.time_boot_ms = time_boot_ms;
322 packet.lat = lat;
323 packet.lon = lon;
324 packet.alt = alt;
325 packet.relative_alt = relative_alt;
326 packet.image_index = image_index;
327 packet.camera_id = camera_id;
328 packet.capture_result = capture_result;
329 mav_array_memcpy(packet.q, q, sizeof(float)*4);
330 mav_array_memcpy(packet.file_url, file_url, sizeof(char)*205);
331 _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);
332#endif
333}
334
335/**
336 * @brief Send a camera_image_captured message
337 * @param chan MAVLink channel to send the message
338 * @param struct The MAVLink struct to serialize
339 */
340static inline void mavlink_msg_camera_image_captured_send_struct(mavlink_channel_t chan, const mavlink_camera_image_captured_t* camera_image_captured)
341{
342#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
343 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);
344#else
345 _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);
346#endif
347}
348
349#if MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN <= MAVLINK_MAX_PAYLOAD_LEN
350/*
351 This variant of _send() can be used to save stack space by reusing
352 memory from the receive buffer. The caller provides a
353 mavlink_message_t which is the size of a full mavlink message. This
354 is usually the receive buffer for the channel, and allows a reply to an
355 incoming message with minimum stack space usage.
356 */
357static 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)
358{
359#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
360 char *buf = (char *)msgbuf;
361 _mav_put_uint64_t(buf, 0, time_utc);
362 _mav_put_uint32_t(buf, 8, time_boot_ms);
363 _mav_put_int32_t(buf, 12, lat);
364 _mav_put_int32_t(buf, 16, lon);
365 _mav_put_int32_t(buf, 20, alt);
366 _mav_put_int32_t(buf, 24, relative_alt);
367 _mav_put_int32_t(buf, 44, image_index);
368 _mav_put_uint8_t(buf, 48, camera_id);
369 _mav_put_int8_t(buf, 49, capture_result);
370 _mav_put_float_array(buf, 28, q, 4);
371 _mav_put_char_array(buf, 50, file_url, 205);
372 _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);
373#else
374 mavlink_camera_image_captured_t *packet = (mavlink_camera_image_captured_t *)msgbuf;
375 packet->time_utc = time_utc;
376 packet->time_boot_ms = time_boot_ms;
377 packet->lat = lat;
378 packet->lon = lon;
379 packet->alt = alt;
380 packet->relative_alt = relative_alt;
381 packet->image_index = image_index;
382 packet->camera_id = camera_id;
383 packet->capture_result = capture_result;
384 mav_array_memcpy(packet->q, q, sizeof(float)*4);
385 mav_array_memcpy(packet->file_url, file_url, sizeof(char)*205);
386 _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);
387#endif
388}
389#endif
390
391#endif
392
393// MESSAGE CAMERA_IMAGE_CAPTURED UNPACKING
394
395
396/**
397 * @brief Get field time_boot_ms from camera_image_captured message
398 *
399 * @return [ms] Timestamp (time since system boot).
400 */
401static inline uint32_t mavlink_msg_camera_image_captured_get_time_boot_ms(const mavlink_message_t* msg)
402{
403 return _MAV_RETURN_uint32_t(msg, 8);
404}
405
406/**
407 * @brief Get field time_utc from camera_image_captured message
408 *
409 * @return [us] Timestamp (time since UNIX epoch) in UTC. 0 for unknown.
410 */
411static inline uint64_t mavlink_msg_camera_image_captured_get_time_utc(const mavlink_message_t* msg)
412{
413 return _MAV_RETURN_uint64_t(msg, 0);
414}
415
416/**
417 * @brief Get field camera_id from camera_image_captured message
418 *
419 * @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). Field name is usually camera_device_id.
420 */
421static inline uint8_t mavlink_msg_camera_image_captured_get_camera_id(const mavlink_message_t* msg)
422{
423 return _MAV_RETURN_uint8_t(msg, 48);
424}
425
426/**
427 * @brief Get field lat from camera_image_captured message
428 *
429 * @return [degE7] Latitude where image was taken
430 */
431static inline int32_t mavlink_msg_camera_image_captured_get_lat(const mavlink_message_t* msg)
432{
433 return _MAV_RETURN_int32_t(msg, 12);
434}
435
436/**
437 * @brief Get field lon from camera_image_captured message
438 *
439 * @return [degE7] Longitude where capture was taken
440 */
441static inline int32_t mavlink_msg_camera_image_captured_get_lon(const mavlink_message_t* msg)
442{
443 return _MAV_RETURN_int32_t(msg, 16);
444}
445
446/**
447 * @brief Get field alt from camera_image_captured message
448 *
449 * @return [mm] Altitude (MSL) where image was taken
450 */
451static inline int32_t mavlink_msg_camera_image_captured_get_alt(const mavlink_message_t* msg)
452{
453 return _MAV_RETURN_int32_t(msg, 20);
454}
455
456/**
457 * @brief Get field relative_alt from camera_image_captured message
458 *
459 * @return [mm] Altitude above ground
460 */
461static inline int32_t mavlink_msg_camera_image_captured_get_relative_alt(const mavlink_message_t* msg)
462{
463 return _MAV_RETURN_int32_t(msg, 24);
464}
465
466/**
467 * @brief Get field q from camera_image_captured message
468 *
469 * @return Quaternion of camera orientation (w, x, y, z order, zero-rotation is 1, 0, 0, 0)
470 */
471static inline uint16_t mavlink_msg_camera_image_captured_get_q(const mavlink_message_t* msg, float *q)
472{
473 return _MAV_RETURN_float_array(msg, q, 4, 28);
474}
475
476/**
477 * @brief Get field image_index from camera_image_captured message
478 *
479 * @return Zero based index of this image (i.e. a new image will have index CAMERA_CAPTURE_STATUS.image count -1)
480 */
481static inline int32_t mavlink_msg_camera_image_captured_get_image_index(const mavlink_message_t* msg)
482{
483 return _MAV_RETURN_int32_t(msg, 44);
484}
485
486/**
487 * @brief Get field capture_result from camera_image_captured message
488 *
489 * @return Image was captured successfully (MAV_BOOL_TRUE). Values not equal to 0 or 1 are invalid.
490 */
491static inline int8_t mavlink_msg_camera_image_captured_get_capture_result(const mavlink_message_t* msg)
492{
493 return _MAV_RETURN_int8_t(msg, 49);
494}
495
496/**
497 * @brief Get field file_url from camera_image_captured message
498 *
499 * @return URL of image taken. Either local storage or http://foo.jpg if camera provides an HTTP interface.
500 */
501static inline uint16_t mavlink_msg_camera_image_captured_get_file_url(const mavlink_message_t* msg, char *file_url)
502{
503 return _MAV_RETURN_char_array(msg, file_url, 205, 50);
504}
505
506/**
507 * @brief Decode a camera_image_captured message into a struct
508 *
509 * @param msg The message to decode
510 * @param camera_image_captured C-struct to decode the message contents into
511 */
512static inline void mavlink_msg_camera_image_captured_decode(const mavlink_message_t* msg, mavlink_camera_image_captured_t* camera_image_captured)
513{
514#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
515 camera_image_captured->time_utc = mavlink_msg_camera_image_captured_get_time_utc(msg);
516 camera_image_captured->time_boot_ms = mavlink_msg_camera_image_captured_get_time_boot_ms(msg);
517 camera_image_captured->lat = mavlink_msg_camera_image_captured_get_lat(msg);
518 camera_image_captured->lon = mavlink_msg_camera_image_captured_get_lon(msg);
519 camera_image_captured->alt = mavlink_msg_camera_image_captured_get_alt(msg);
520 camera_image_captured->relative_alt = mavlink_msg_camera_image_captured_get_relative_alt(msg);
521 mavlink_msg_camera_image_captured_get_q(msg, camera_image_captured->q);
522 camera_image_captured->image_index = mavlink_msg_camera_image_captured_get_image_index(msg);
523 camera_image_captured->camera_id = mavlink_msg_camera_image_captured_get_camera_id(msg);
524 camera_image_captured->capture_result = mavlink_msg_camera_image_captured_get_capture_result(msg);
525 mavlink_msg_camera_image_captured_get_file_url(msg, camera_image_captured->file_url);
526#else
527 uint8_t len = msg->len < MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN? msg->len : MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN;
528 memset(camera_image_captured, 0, MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_LEN);
529 memcpy(camera_image_captured, _MAV_PAYLOAD(msg), len);
530#endif
531}