RflySimSDK v3.08
RflySimSDK说明文档
载入中...
搜索中...
未找到
mavlink_msg_camera_information.h
1#pragma once
2// MESSAGE CAMERA_INFORMATION PACKING
3
4#define MAVLINK_MSG_ID_CAMERA_INFORMATION 259
5
6MAVPACKED(
7typedef struct __mavlink_camera_information_t {
8 uint32_t time_boot_ms; /*< Timestamp (milliseconds since system boot)*/
9 uint32_t firmware_version; /*< Version of the camera firmware (v << 24 & 0xff = Dev, v << 16 & 0xff = Patch, v << 8 & 0xff = Minor, v & 0xff = Major)*/
10 float focal_length; /*< Focal length in mm*/
11 float sensor_size_h; /*< Image sensor size horizontal in mm*/
12 float sensor_size_v; /*< Image sensor size vertical in mm*/
13 uint32_t flags; /*< CAMERA_CAP_FLAGS enum flags (bitmap) describing camera capabilities.*/
14 uint16_t resolution_h; /*< Image resolution in pixels horizontal*/
15 uint16_t resolution_v; /*< Image resolution in pixels vertical*/
16 uint16_t cam_definition_version; /*< Camera definition version (iteration)*/
17 uint8_t vendor_name[32]; /*< Name of the camera vendor*/
18 uint8_t model_name[32]; /*< Name of the camera model*/
19 uint8_t lens_id; /*< Reserved for a lens ID*/
20 char cam_definition_uri[140]; /*< Camera definition URI (if any, otherwise only basic functions will be available).*/
21}) mavlink_camera_information_t;
22
23#define MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN 235
24#define MAVLINK_MSG_ID_CAMERA_INFORMATION_MIN_LEN 235
25#define MAVLINK_MSG_ID_259_LEN 235
26#define MAVLINK_MSG_ID_259_MIN_LEN 235
27
28#define MAVLINK_MSG_ID_CAMERA_INFORMATION_CRC 92
29#define MAVLINK_MSG_ID_259_CRC 92
30
31#define MAVLINK_MSG_CAMERA_INFORMATION_FIELD_VENDOR_NAME_LEN 32
32#define MAVLINK_MSG_CAMERA_INFORMATION_FIELD_MODEL_NAME_LEN 32
33#define MAVLINK_MSG_CAMERA_INFORMATION_FIELD_CAM_DEFINITION_URI_LEN 140
34
35#if MAVLINK_COMMAND_24BIT
36#define MAVLINK_MESSAGE_INFO_CAMERA_INFORMATION { \
37 259, \
38 "CAMERA_INFORMATION", \
39 13, \
40 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_camera_information_t, time_boot_ms) }, \
41 { "vendor_name", NULL, MAVLINK_TYPE_UINT8_T, 32, 30, offsetof(mavlink_camera_information_t, vendor_name) }, \
42 { "model_name", NULL, MAVLINK_TYPE_UINT8_T, 32, 62, offsetof(mavlink_camera_information_t, model_name) }, \
43 { "firmware_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_camera_information_t, firmware_version) }, \
44 { "focal_length", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_camera_information_t, focal_length) }, \
45 { "sensor_size_h", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_camera_information_t, sensor_size_h) }, \
46 { "sensor_size_v", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_camera_information_t, sensor_size_v) }, \
47 { "resolution_h", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_camera_information_t, resolution_h) }, \
48 { "resolution_v", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_camera_information_t, resolution_v) }, \
49 { "lens_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 94, offsetof(mavlink_camera_information_t, lens_id) }, \
50 { "flags", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_camera_information_t, flags) }, \
51 { "cam_definition_version", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_camera_information_t, cam_definition_version) }, \
52 { "cam_definition_uri", NULL, MAVLINK_TYPE_CHAR, 140, 95, offsetof(mavlink_camera_information_t, cam_definition_uri) }, \
53 } \
54}
55#else
56#define MAVLINK_MESSAGE_INFO_CAMERA_INFORMATION { \
57 "CAMERA_INFORMATION", \
58 13, \
59 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_camera_information_t, time_boot_ms) }, \
60 { "vendor_name", NULL, MAVLINK_TYPE_UINT8_T, 32, 30, offsetof(mavlink_camera_information_t, vendor_name) }, \
61 { "model_name", NULL, MAVLINK_TYPE_UINT8_T, 32, 62, offsetof(mavlink_camera_information_t, model_name) }, \
62 { "firmware_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_camera_information_t, firmware_version) }, \
63 { "focal_length", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_camera_information_t, focal_length) }, \
64 { "sensor_size_h", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_camera_information_t, sensor_size_h) }, \
65 { "sensor_size_v", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_camera_information_t, sensor_size_v) }, \
66 { "resolution_h", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_camera_information_t, resolution_h) }, \
67 { "resolution_v", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_camera_information_t, resolution_v) }, \
68 { "lens_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 94, offsetof(mavlink_camera_information_t, lens_id) }, \
69 { "flags", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_camera_information_t, flags) }, \
70 { "cam_definition_version", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_camera_information_t, cam_definition_version) }, \
71 { "cam_definition_uri", NULL, MAVLINK_TYPE_CHAR, 140, 95, offsetof(mavlink_camera_information_t, cam_definition_uri) }, \
72 } \
73}
74#endif
75
76/**
77 * @brief Pack a camera_information message
78 * @param system_id ID of this system
79 * @param component_id ID of this component (e.g. 200 for IMU)
80 * @param msg The MAVLink message to compress the data into
81 *
82 * @param time_boot_ms Timestamp (milliseconds since system boot)
83 * @param vendor_name Name of the camera vendor
84 * @param model_name Name of the camera model
85 * @param firmware_version Version of the camera firmware (v << 24 & 0xff = Dev, v << 16 & 0xff = Patch, v << 8 & 0xff = Minor, v & 0xff = Major)
86 * @param focal_length Focal length in mm
87 * @param sensor_size_h Image sensor size horizontal in mm
88 * @param sensor_size_v Image sensor size vertical in mm
89 * @param resolution_h Image resolution in pixels horizontal
90 * @param resolution_v Image resolution in pixels vertical
91 * @param lens_id Reserved for a lens ID
92 * @param flags CAMERA_CAP_FLAGS enum flags (bitmap) describing camera capabilities.
93 * @param cam_definition_version Camera definition version (iteration)
94 * @param cam_definition_uri Camera definition URI (if any, otherwise only basic functions will be available).
95 * @return length of the message in bytes (excluding serial stream start sign)
96 */
97static inline uint16_t mavlink_msg_camera_information_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
98 uint32_t time_boot_ms, const uint8_t *vendor_name, const uint8_t *model_name, uint32_t firmware_version, float focal_length, float sensor_size_h, float sensor_size_v, uint16_t resolution_h, uint16_t resolution_v, uint8_t lens_id, uint32_t flags, uint16_t cam_definition_version, const char *cam_definition_uri)
99{
100#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
101 char buf[MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN];
102 _mav_put_uint32_t(buf, 0, time_boot_ms);
103 _mav_put_uint32_t(buf, 4, firmware_version);
104 _mav_put_float(buf, 8, focal_length);
105 _mav_put_float(buf, 12, sensor_size_h);
106 _mav_put_float(buf, 16, sensor_size_v);
107 _mav_put_uint32_t(buf, 20, flags);
108 _mav_put_uint16_t(buf, 24, resolution_h);
109 _mav_put_uint16_t(buf, 26, resolution_v);
110 _mav_put_uint16_t(buf, 28, cam_definition_version);
111 _mav_put_uint8_t(buf, 94, lens_id);
112 _mav_put_uint8_t_array(buf, 30, vendor_name, 32);
113 _mav_put_uint8_t_array(buf, 62, model_name, 32);
114 _mav_put_char_array(buf, 95, cam_definition_uri, 140);
115 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN);
116#else
117 mavlink_camera_information_t packet;
118 packet.time_boot_ms = time_boot_ms;
119 packet.firmware_version = firmware_version;
120 packet.focal_length = focal_length;
121 packet.sensor_size_h = sensor_size_h;
122 packet.sensor_size_v = sensor_size_v;
123 packet.flags = flags;
124 packet.resolution_h = resolution_h;
125 packet.resolution_v = resolution_v;
126 packet.cam_definition_version = cam_definition_version;
127 packet.lens_id = lens_id;
128 mav_array_memcpy(packet.vendor_name, vendor_name, sizeof(uint8_t)*32);
129 mav_array_memcpy(packet.model_name, model_name, sizeof(uint8_t)*32);
130 mav_array_memcpy(packet.cam_definition_uri, cam_definition_uri, sizeof(char)*140);
131 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN);
132#endif
133
134 msg->msgid = MAVLINK_MSG_ID_CAMERA_INFORMATION;
135 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_CAMERA_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_CRC);
136}
137
138/**
139 * @brief Pack a camera_information message on a channel
140 * @param system_id ID of this system
141 * @param component_id ID of this component (e.g. 200 for IMU)
142 * @param chan The MAVLink channel this message will be sent over
143 * @param msg The MAVLink message to compress the data into
144 * @param time_boot_ms Timestamp (milliseconds since system boot)
145 * @param vendor_name Name of the camera vendor
146 * @param model_name Name of the camera model
147 * @param firmware_version Version of the camera firmware (v << 24 & 0xff = Dev, v << 16 & 0xff = Patch, v << 8 & 0xff = Minor, v & 0xff = Major)
148 * @param focal_length Focal length in mm
149 * @param sensor_size_h Image sensor size horizontal in mm
150 * @param sensor_size_v Image sensor size vertical in mm
151 * @param resolution_h Image resolution in pixels horizontal
152 * @param resolution_v Image resolution in pixels vertical
153 * @param lens_id Reserved for a lens ID
154 * @param flags CAMERA_CAP_FLAGS enum flags (bitmap) describing camera capabilities.
155 * @param cam_definition_version Camera definition version (iteration)
156 * @param cam_definition_uri Camera definition URI (if any, otherwise only basic functions will be available).
157 * @return length of the message in bytes (excluding serial stream start sign)
158 */
159static inline uint16_t mavlink_msg_camera_information_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
160 mavlink_message_t* msg,
161 uint32_t time_boot_ms,const uint8_t *vendor_name,const uint8_t *model_name,uint32_t firmware_version,float focal_length,float sensor_size_h,float sensor_size_v,uint16_t resolution_h,uint16_t resolution_v,uint8_t lens_id,uint32_t flags,uint16_t cam_definition_version,const char *cam_definition_uri)
162{
163#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
164 char buf[MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN];
165 _mav_put_uint32_t(buf, 0, time_boot_ms);
166 _mav_put_uint32_t(buf, 4, firmware_version);
167 _mav_put_float(buf, 8, focal_length);
168 _mav_put_float(buf, 12, sensor_size_h);
169 _mav_put_float(buf, 16, sensor_size_v);
170 _mav_put_uint32_t(buf, 20, flags);
171 _mav_put_uint16_t(buf, 24, resolution_h);
172 _mav_put_uint16_t(buf, 26, resolution_v);
173 _mav_put_uint16_t(buf, 28, cam_definition_version);
174 _mav_put_uint8_t(buf, 94, lens_id);
175 _mav_put_uint8_t_array(buf, 30, vendor_name, 32);
176 _mav_put_uint8_t_array(buf, 62, model_name, 32);
177 _mav_put_char_array(buf, 95, cam_definition_uri, 140);
178 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN);
179#else
180 mavlink_camera_information_t packet;
181 packet.time_boot_ms = time_boot_ms;
182 packet.firmware_version = firmware_version;
183 packet.focal_length = focal_length;
184 packet.sensor_size_h = sensor_size_h;
185 packet.sensor_size_v = sensor_size_v;
186 packet.flags = flags;
187 packet.resolution_h = resolution_h;
188 packet.resolution_v = resolution_v;
189 packet.cam_definition_version = cam_definition_version;
190 packet.lens_id = lens_id;
191 mav_array_memcpy(packet.vendor_name, vendor_name, sizeof(uint8_t)*32);
192 mav_array_memcpy(packet.model_name, model_name, sizeof(uint8_t)*32);
193 mav_array_memcpy(packet.cam_definition_uri, cam_definition_uri, sizeof(char)*140);
194 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN);
195#endif
196
197 msg->msgid = MAVLINK_MSG_ID_CAMERA_INFORMATION;
198 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_CAMERA_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_CRC);
199}
200
201/**
202 * @brief Encode a camera_information struct
203 *
204 * @param system_id ID of this system
205 * @param component_id ID of this component (e.g. 200 for IMU)
206 * @param msg The MAVLink message to compress the data into
207 * @param camera_information C-struct to read the message contents from
208 */
209static inline uint16_t mavlink_msg_camera_information_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_camera_information_t* camera_information)
210{
211 return mavlink_msg_camera_information_pack(system_id, component_id, msg, camera_information->time_boot_ms, camera_information->vendor_name, camera_information->model_name, camera_information->firmware_version, camera_information->focal_length, camera_information->sensor_size_h, camera_information->sensor_size_v, camera_information->resolution_h, camera_information->resolution_v, camera_information->lens_id, camera_information->flags, camera_information->cam_definition_version, camera_information->cam_definition_uri);
212}
213
214/**
215 * @brief Encode a camera_information struct on a channel
216 *
217 * @param system_id ID of this system
218 * @param component_id ID of this component (e.g. 200 for IMU)
219 * @param chan The MAVLink channel this message will be sent over
220 * @param msg The MAVLink message to compress the data into
221 * @param camera_information C-struct to read the message contents from
222 */
223static inline uint16_t mavlink_msg_camera_information_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_camera_information_t* camera_information)
224{
225 return mavlink_msg_camera_information_pack_chan(system_id, component_id, chan, msg, camera_information->time_boot_ms, camera_information->vendor_name, camera_information->model_name, camera_information->firmware_version, camera_information->focal_length, camera_information->sensor_size_h, camera_information->sensor_size_v, camera_information->resolution_h, camera_information->resolution_v, camera_information->lens_id, camera_information->flags, camera_information->cam_definition_version, camera_information->cam_definition_uri);
226}
227
228/**
229 * @brief Send a camera_information message
230 * @param chan MAVLink channel to send the message
231 *
232 * @param time_boot_ms Timestamp (milliseconds since system boot)
233 * @param vendor_name Name of the camera vendor
234 * @param model_name Name of the camera model
235 * @param firmware_version Version of the camera firmware (v << 24 & 0xff = Dev, v << 16 & 0xff = Patch, v << 8 & 0xff = Minor, v & 0xff = Major)
236 * @param focal_length Focal length in mm
237 * @param sensor_size_h Image sensor size horizontal in mm
238 * @param sensor_size_v Image sensor size vertical in mm
239 * @param resolution_h Image resolution in pixels horizontal
240 * @param resolution_v Image resolution in pixels vertical
241 * @param lens_id Reserved for a lens ID
242 * @param flags CAMERA_CAP_FLAGS enum flags (bitmap) describing camera capabilities.
243 * @param cam_definition_version Camera definition version (iteration)
244 * @param cam_definition_uri Camera definition URI (if any, otherwise only basic functions will be available).
245 */
246#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
247
248static inline void mavlink_msg_camera_information_send(mavlink_channel_t chan, uint32_t time_boot_ms, const uint8_t *vendor_name, const uint8_t *model_name, uint32_t firmware_version, float focal_length, float sensor_size_h, float sensor_size_v, uint16_t resolution_h, uint16_t resolution_v, uint8_t lens_id, uint32_t flags, uint16_t cam_definition_version, const char *cam_definition_uri)
249{
250#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
251 char buf[MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN];
252 _mav_put_uint32_t(buf, 0, time_boot_ms);
253 _mav_put_uint32_t(buf, 4, firmware_version);
254 _mav_put_float(buf, 8, focal_length);
255 _mav_put_float(buf, 12, sensor_size_h);
256 _mav_put_float(buf, 16, sensor_size_v);
257 _mav_put_uint32_t(buf, 20, flags);
258 _mav_put_uint16_t(buf, 24, resolution_h);
259 _mav_put_uint16_t(buf, 26, resolution_v);
260 _mav_put_uint16_t(buf, 28, cam_definition_version);
261 _mav_put_uint8_t(buf, 94, lens_id);
262 _mav_put_uint8_t_array(buf, 30, vendor_name, 32);
263 _mav_put_uint8_t_array(buf, 62, model_name, 32);
264 _mav_put_char_array(buf, 95, cam_definition_uri, 140);
265 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_INFORMATION, buf, MAVLINK_MSG_ID_CAMERA_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_CRC);
266#else
267 mavlink_camera_information_t packet;
268 packet.time_boot_ms = time_boot_ms;
269 packet.firmware_version = firmware_version;
270 packet.focal_length = focal_length;
271 packet.sensor_size_h = sensor_size_h;
272 packet.sensor_size_v = sensor_size_v;
273 packet.flags = flags;
274 packet.resolution_h = resolution_h;
275 packet.resolution_v = resolution_v;
276 packet.cam_definition_version = cam_definition_version;
277 packet.lens_id = lens_id;
278 mav_array_memcpy(packet.vendor_name, vendor_name, sizeof(uint8_t)*32);
279 mav_array_memcpy(packet.model_name, model_name, sizeof(uint8_t)*32);
280 mav_array_memcpy(packet.cam_definition_uri, cam_definition_uri, sizeof(char)*140);
281 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_INFORMATION, (const char *)&packet, MAVLINK_MSG_ID_CAMERA_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_CRC);
282#endif
283}
284
285/**
286 * @brief Send a camera_information message
287 * @param chan MAVLink channel to send the message
288 * @param struct The MAVLink struct to serialize
289 */
290static inline void mavlink_msg_camera_information_send_struct(mavlink_channel_t chan, const mavlink_camera_information_t* camera_information)
291{
292#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
293 mavlink_msg_camera_information_send(chan, camera_information->time_boot_ms, camera_information->vendor_name, camera_information->model_name, camera_information->firmware_version, camera_information->focal_length, camera_information->sensor_size_h, camera_information->sensor_size_v, camera_information->resolution_h, camera_information->resolution_v, camera_information->lens_id, camera_information->flags, camera_information->cam_definition_version, camera_information->cam_definition_uri);
294#else
295 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_INFORMATION, (const char *)camera_information, MAVLINK_MSG_ID_CAMERA_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_CRC);
296#endif
297}
298
299#if MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
300/*
301 This varient of _send() can be used to save stack space by re-using
302 memory from the receive buffer. The caller provides a
303 mavlink_message_t which is the size of a full mavlink message. This
304 is usually the receive buffer for the channel, and allows a reply to an
305 incoming message with minimum stack space usage.
306 */
307static inline void mavlink_msg_camera_information_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, const uint8_t *vendor_name, const uint8_t *model_name, uint32_t firmware_version, float focal_length, float sensor_size_h, float sensor_size_v, uint16_t resolution_h, uint16_t resolution_v, uint8_t lens_id, uint32_t flags, uint16_t cam_definition_version, const char *cam_definition_uri)
308{
309#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
310 char *buf = (char *)msgbuf;
311 _mav_put_uint32_t(buf, 0, time_boot_ms);
312 _mav_put_uint32_t(buf, 4, firmware_version);
313 _mav_put_float(buf, 8, focal_length);
314 _mav_put_float(buf, 12, sensor_size_h);
315 _mav_put_float(buf, 16, sensor_size_v);
316 _mav_put_uint32_t(buf, 20, flags);
317 _mav_put_uint16_t(buf, 24, resolution_h);
318 _mav_put_uint16_t(buf, 26, resolution_v);
319 _mav_put_uint16_t(buf, 28, cam_definition_version);
320 _mav_put_uint8_t(buf, 94, lens_id);
321 _mav_put_uint8_t_array(buf, 30, vendor_name, 32);
322 _mav_put_uint8_t_array(buf, 62, model_name, 32);
323 _mav_put_char_array(buf, 95, cam_definition_uri, 140);
324 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_INFORMATION, buf, MAVLINK_MSG_ID_CAMERA_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_CRC);
325#else
326 mavlink_camera_information_t *packet = (mavlink_camera_information_t *)msgbuf;
327 packet->time_boot_ms = time_boot_ms;
328 packet->firmware_version = firmware_version;
329 packet->focal_length = focal_length;
330 packet->sensor_size_h = sensor_size_h;
331 packet->sensor_size_v = sensor_size_v;
332 packet->flags = flags;
333 packet->resolution_h = resolution_h;
334 packet->resolution_v = resolution_v;
335 packet->cam_definition_version = cam_definition_version;
336 packet->lens_id = lens_id;
337 mav_array_memcpy(packet->vendor_name, vendor_name, sizeof(uint8_t)*32);
338 mav_array_memcpy(packet->model_name, model_name, sizeof(uint8_t)*32);
339 mav_array_memcpy(packet->cam_definition_uri, cam_definition_uri, sizeof(char)*140);
340 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_CAMERA_INFORMATION, (const char *)packet, MAVLINK_MSG_ID_CAMERA_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN, MAVLINK_MSG_ID_CAMERA_INFORMATION_CRC);
341#endif
342}
343#endif
344
345#endif
346
347// MESSAGE CAMERA_INFORMATION UNPACKING
348
349
350/**
351 * @brief Get field time_boot_ms from camera_information message
352 *
353 * @return Timestamp (milliseconds since system boot)
354 */
355static inline uint32_t mavlink_msg_camera_information_get_time_boot_ms(const mavlink_message_t* msg)
356{
357 return _MAV_RETURN_uint32_t(msg, 0);
358}
359
360/**
361 * @brief Get field vendor_name from camera_information message
362 *
363 * @return Name of the camera vendor
364 */
365static inline uint16_t mavlink_msg_camera_information_get_vendor_name(const mavlink_message_t* msg, uint8_t *vendor_name)
366{
367 return _MAV_RETURN_uint8_t_array(msg, vendor_name, 32, 30);
368}
369
370/**
371 * @brief Get field model_name from camera_information message
372 *
373 * @return Name of the camera model
374 */
375static inline uint16_t mavlink_msg_camera_information_get_model_name(const mavlink_message_t* msg, uint8_t *model_name)
376{
377 return _MAV_RETURN_uint8_t_array(msg, model_name, 32, 62);
378}
379
380/**
381 * @brief Get field firmware_version from camera_information message
382 *
383 * @return Version of the camera firmware (v << 24 & 0xff = Dev, v << 16 & 0xff = Patch, v << 8 & 0xff = Minor, v & 0xff = Major)
384 */
385static inline uint32_t mavlink_msg_camera_information_get_firmware_version(const mavlink_message_t* msg)
386{
387 return _MAV_RETURN_uint32_t(msg, 4);
388}
389
390/**
391 * @brief Get field focal_length from camera_information message
392 *
393 * @return Focal length in mm
394 */
395static inline float mavlink_msg_camera_information_get_focal_length(const mavlink_message_t* msg)
396{
397 return _MAV_RETURN_float(msg, 8);
398}
399
400/**
401 * @brief Get field sensor_size_h from camera_information message
402 *
403 * @return Image sensor size horizontal in mm
404 */
405static inline float mavlink_msg_camera_information_get_sensor_size_h(const mavlink_message_t* msg)
406{
407 return _MAV_RETURN_float(msg, 12);
408}
409
410/**
411 * @brief Get field sensor_size_v from camera_information message
412 *
413 * @return Image sensor size vertical in mm
414 */
415static inline float mavlink_msg_camera_information_get_sensor_size_v(const mavlink_message_t* msg)
416{
417 return _MAV_RETURN_float(msg, 16);
418}
419
420/**
421 * @brief Get field resolution_h from camera_information message
422 *
423 * @return Image resolution in pixels horizontal
424 */
425static inline uint16_t mavlink_msg_camera_information_get_resolution_h(const mavlink_message_t* msg)
426{
427 return _MAV_RETURN_uint16_t(msg, 24);
428}
429
430/**
431 * @brief Get field resolution_v from camera_information message
432 *
433 * @return Image resolution in pixels vertical
434 */
435static inline uint16_t mavlink_msg_camera_information_get_resolution_v(const mavlink_message_t* msg)
436{
437 return _MAV_RETURN_uint16_t(msg, 26);
438}
439
440/**
441 * @brief Get field lens_id from camera_information message
442 *
443 * @return Reserved for a lens ID
444 */
445static inline uint8_t mavlink_msg_camera_information_get_lens_id(const mavlink_message_t* msg)
446{
447 return _MAV_RETURN_uint8_t(msg, 94);
448}
449
450/**
451 * @brief Get field flags from camera_information message
452 *
453 * @return CAMERA_CAP_FLAGS enum flags (bitmap) describing camera capabilities.
454 */
455static inline uint32_t mavlink_msg_camera_information_get_flags(const mavlink_message_t* msg)
456{
457 return _MAV_RETURN_uint32_t(msg, 20);
458}
459
460/**
461 * @brief Get field cam_definition_version from camera_information message
462 *
463 * @return Camera definition version (iteration)
464 */
465static inline uint16_t mavlink_msg_camera_information_get_cam_definition_version(const mavlink_message_t* msg)
466{
467 return _MAV_RETURN_uint16_t(msg, 28);
468}
469
470/**
471 * @brief Get field cam_definition_uri from camera_information message
472 *
473 * @return Camera definition URI (if any, otherwise only basic functions will be available).
474 */
475static inline uint16_t mavlink_msg_camera_information_get_cam_definition_uri(const mavlink_message_t* msg, char *cam_definition_uri)
476{
477 return _MAV_RETURN_char_array(msg, cam_definition_uri, 140, 95);
478}
479
480/**
481 * @brief Decode a camera_information message into a struct
482 *
483 * @param msg The message to decode
484 * @param camera_information C-struct to decode the message contents into
485 */
486static inline void mavlink_msg_camera_information_decode(const mavlink_message_t* msg, mavlink_camera_information_t* camera_information)
487{
488#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
489 camera_information->time_boot_ms = mavlink_msg_camera_information_get_time_boot_ms(msg);
490 camera_information->firmware_version = mavlink_msg_camera_information_get_firmware_version(msg);
491 camera_information->focal_length = mavlink_msg_camera_information_get_focal_length(msg);
492 camera_information->sensor_size_h = mavlink_msg_camera_information_get_sensor_size_h(msg);
493 camera_information->sensor_size_v = mavlink_msg_camera_information_get_sensor_size_v(msg);
494 camera_information->flags = mavlink_msg_camera_information_get_flags(msg);
495 camera_information->resolution_h = mavlink_msg_camera_information_get_resolution_h(msg);
496 camera_information->resolution_v = mavlink_msg_camera_information_get_resolution_v(msg);
497 camera_information->cam_definition_version = mavlink_msg_camera_information_get_cam_definition_version(msg);
498 mavlink_msg_camera_information_get_vendor_name(msg, camera_information->vendor_name);
499 mavlink_msg_camera_information_get_model_name(msg, camera_information->model_name);
500 camera_information->lens_id = mavlink_msg_camera_information_get_lens_id(msg);
501 mavlink_msg_camera_information_get_cam_definition_uri(msg, camera_information->cam_definition_uri);
502#else
503 uint8_t len = msg->len < MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN? msg->len : MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN;
504 memset(camera_information, 0, MAVLINK_MSG_ID_CAMERA_INFORMATION_LEN);
505 memcpy(camera_information, _MAV_PAYLOAD(msg), len);
506#endif
507}