RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
mavlink_msg_digicam_configure.h
1#pragma once
2// MESSAGE DIGICAM_CONFIGURE PACKING
3
4#define MAVLINK_MSG_ID_DIGICAM_CONFIGURE 154
5
6MAVPACKED(
7typedef struct __mavlink_digicam_configure_t {
8 float extra_value; /*< Correspondent value to given extra_param*/
9 uint16_t shutter_speed; /*< Divisor number //e.g. 1000 means 1/1000 (0 means ignore)*/
10 uint8_t target_system; /*< System ID*/
11 uint8_t target_component; /*< Component ID*/
12 uint8_t mode; /*< Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore)*/
13 uint8_t aperture; /*< F stop number x 10 //e.g. 28 means 2.8 (0 means ignore)*/
14 uint8_t iso; /*< ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore)*/
15 uint8_t exposure_type; /*< Exposure type enumeration from 1 to N (0 means ignore)*/
16 uint8_t command_id; /*< Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once*/
17 uint8_t engine_cut_off; /*< Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off)*/
18 uint8_t extra_param; /*< Extra parameters enumeration (0 means ignore)*/
19}) mavlink_digicam_configure_t;
20
21#define MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN 15
22#define MAVLINK_MSG_ID_DIGICAM_CONFIGURE_MIN_LEN 15
23#define MAVLINK_MSG_ID_154_LEN 15
24#define MAVLINK_MSG_ID_154_MIN_LEN 15
25
26#define MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC 84
27#define MAVLINK_MSG_ID_154_CRC 84
28
29
30
31#if MAVLINK_COMMAND_24BIT
32#define MAVLINK_MESSAGE_INFO_DIGICAM_CONFIGURE { \
33 154, \
34 "DIGICAM_CONFIGURE", \
35 11, \
36 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_digicam_configure_t, target_system) }, \
37 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_digicam_configure_t, target_component) }, \
38 { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_digicam_configure_t, mode) }, \
39 { "shutter_speed", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_digicam_configure_t, shutter_speed) }, \
40 { "aperture", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_digicam_configure_t, aperture) }, \
41 { "iso", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_digicam_configure_t, iso) }, \
42 { "exposure_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_digicam_configure_t, exposure_type) }, \
43 { "command_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_digicam_configure_t, command_id) }, \
44 { "engine_cut_off", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_digicam_configure_t, engine_cut_off) }, \
45 { "extra_param", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_digicam_configure_t, extra_param) }, \
46 { "extra_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_digicam_configure_t, extra_value) }, \
47 } \
48}
49#else
50#define MAVLINK_MESSAGE_INFO_DIGICAM_CONFIGURE { \
51 "DIGICAM_CONFIGURE", \
52 11, \
53 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_digicam_configure_t, target_system) }, \
54 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_digicam_configure_t, target_component) }, \
55 { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_digicam_configure_t, mode) }, \
56 { "shutter_speed", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_digicam_configure_t, shutter_speed) }, \
57 { "aperture", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_digicam_configure_t, aperture) }, \
58 { "iso", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_digicam_configure_t, iso) }, \
59 { "exposure_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_digicam_configure_t, exposure_type) }, \
60 { "command_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_digicam_configure_t, command_id) }, \
61 { "engine_cut_off", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_digicam_configure_t, engine_cut_off) }, \
62 { "extra_param", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_digicam_configure_t, extra_param) }, \
63 { "extra_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_digicam_configure_t, extra_value) }, \
64 } \
65}
66#endif
67
87static inline uint16_t mavlink_msg_digicam_configure_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
88 uint8_t target_system, uint8_t target_component, uint8_t mode, uint16_t shutter_speed, uint8_t aperture, uint8_t iso, uint8_t exposure_type, uint8_t command_id, uint8_t engine_cut_off, uint8_t extra_param, float extra_value)
89{
90#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
91 char buf[MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN];
92 _mav_put_float(buf, 0, extra_value);
93 _mav_put_uint16_t(buf, 4, shutter_speed);
94 _mav_put_uint8_t(buf, 6, target_system);
95 _mav_put_uint8_t(buf, 7, target_component);
96 _mav_put_uint8_t(buf, 8, mode);
97 _mav_put_uint8_t(buf, 9, aperture);
98 _mav_put_uint8_t(buf, 10, iso);
99 _mav_put_uint8_t(buf, 11, exposure_type);
100 _mav_put_uint8_t(buf, 12, command_id);
101 _mav_put_uint8_t(buf, 13, engine_cut_off);
102 _mav_put_uint8_t(buf, 14, extra_param);
103
104 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN);
105#else
106 mavlink_digicam_configure_t packet;
107 packet.extra_value = extra_value;
108 packet.shutter_speed = shutter_speed;
109 packet.target_system = target_system;
110 packet.target_component = target_component;
111 packet.mode = mode;
112 packet.aperture = aperture;
113 packet.iso = iso;
114 packet.exposure_type = exposure_type;
115 packet.command_id = command_id;
116 packet.engine_cut_off = engine_cut_off;
117 packet.extra_param = extra_param;
118
119 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN);
120#endif
121
122 msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE;
123 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC);
124}
125
145static inline uint16_t mavlink_msg_digicam_configure_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
146 mavlink_message_t* msg,
147 uint8_t target_system,uint8_t target_component,uint8_t mode,uint16_t shutter_speed,uint8_t aperture,uint8_t iso,uint8_t exposure_type,uint8_t command_id,uint8_t engine_cut_off,uint8_t extra_param,float extra_value)
148{
149#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
150 char buf[MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN];
151 _mav_put_float(buf, 0, extra_value);
152 _mav_put_uint16_t(buf, 4, shutter_speed);
153 _mav_put_uint8_t(buf, 6, target_system);
154 _mav_put_uint8_t(buf, 7, target_component);
155 _mav_put_uint8_t(buf, 8, mode);
156 _mav_put_uint8_t(buf, 9, aperture);
157 _mav_put_uint8_t(buf, 10, iso);
158 _mav_put_uint8_t(buf, 11, exposure_type);
159 _mav_put_uint8_t(buf, 12, command_id);
160 _mav_put_uint8_t(buf, 13, engine_cut_off);
161 _mav_put_uint8_t(buf, 14, extra_param);
162
163 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN);
164#else
165 mavlink_digicam_configure_t packet;
166 packet.extra_value = extra_value;
167 packet.shutter_speed = shutter_speed;
168 packet.target_system = target_system;
169 packet.target_component = target_component;
170 packet.mode = mode;
171 packet.aperture = aperture;
172 packet.iso = iso;
173 packet.exposure_type = exposure_type;
174 packet.command_id = command_id;
175 packet.engine_cut_off = engine_cut_off;
176 packet.extra_param = extra_param;
177
178 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN);
179#endif
180
181 msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE;
182 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC);
183}
184
193static inline uint16_t mavlink_msg_digicam_configure_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_digicam_configure_t* digicam_configure)
194{
195 return mavlink_msg_digicam_configure_pack(system_id, component_id, msg, digicam_configure->target_system, digicam_configure->target_component, digicam_configure->mode, digicam_configure->shutter_speed, digicam_configure->aperture, digicam_configure->iso, digicam_configure->exposure_type, digicam_configure->command_id, digicam_configure->engine_cut_off, digicam_configure->extra_param, digicam_configure->extra_value);
196}
197
207static inline uint16_t mavlink_msg_digicam_configure_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_digicam_configure_t* digicam_configure)
208{
209 return mavlink_msg_digicam_configure_pack_chan(system_id, component_id, chan, msg, digicam_configure->target_system, digicam_configure->target_component, digicam_configure->mode, digicam_configure->shutter_speed, digicam_configure->aperture, digicam_configure->iso, digicam_configure->exposure_type, digicam_configure->command_id, digicam_configure->engine_cut_off, digicam_configure->extra_param, digicam_configure->extra_value);
210}
211
228#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
229
230static inline void mavlink_msg_digicam_configure_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mode, uint16_t shutter_speed, uint8_t aperture, uint8_t iso, uint8_t exposure_type, uint8_t command_id, uint8_t engine_cut_off, uint8_t extra_param, float extra_value)
231{
232#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
233 char buf[MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN];
234 _mav_put_float(buf, 0, extra_value);
235 _mav_put_uint16_t(buf, 4, shutter_speed);
236 _mav_put_uint8_t(buf, 6, target_system);
237 _mav_put_uint8_t(buf, 7, target_component);
238 _mav_put_uint8_t(buf, 8, mode);
239 _mav_put_uint8_t(buf, 9, aperture);
240 _mav_put_uint8_t(buf, 10, iso);
241 _mav_put_uint8_t(buf, 11, exposure_type);
242 _mav_put_uint8_t(buf, 12, command_id);
243 _mav_put_uint8_t(buf, 13, engine_cut_off);
244 _mav_put_uint8_t(buf, 14, extra_param);
245
246 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, buf, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC);
247#else
248 mavlink_digicam_configure_t packet;
249 packet.extra_value = extra_value;
250 packet.shutter_speed = shutter_speed;
251 packet.target_system = target_system;
252 packet.target_component = target_component;
253 packet.mode = mode;
254 packet.aperture = aperture;
255 packet.iso = iso;
256 packet.exposure_type = exposure_type;
257 packet.command_id = command_id;
258 packet.engine_cut_off = engine_cut_off;
259 packet.extra_param = extra_param;
260
261 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, (const char *)&packet, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC);
262#endif
263}
264
270static inline void mavlink_msg_digicam_configure_send_struct(mavlink_channel_t chan, const mavlink_digicam_configure_t* digicam_configure)
271{
272#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
273 mavlink_msg_digicam_configure_send(chan, digicam_configure->target_system, digicam_configure->target_component, digicam_configure->mode, digicam_configure->shutter_speed, digicam_configure->aperture, digicam_configure->iso, digicam_configure->exposure_type, digicam_configure->command_id, digicam_configure->engine_cut_off, digicam_configure->extra_param, digicam_configure->extra_value);
274#else
275 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, (const char *)digicam_configure, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC);
276#endif
277}
278
279#if MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
280/*
281 This varient of _send() can be used to save stack space by re-using
282 memory from the receive buffer. The caller provides a
283 mavlink_message_t which is the size of a full mavlink message. This
284 is usually the receive buffer for the channel, and allows a reply to an
285 incoming message with minimum stack space usage.
286 */
287static inline void mavlink_msg_digicam_configure_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mode, uint16_t shutter_speed, uint8_t aperture, uint8_t iso, uint8_t exposure_type, uint8_t command_id, uint8_t engine_cut_off, uint8_t extra_param, float extra_value)
288{
289#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
290 char *buf = (char *)msgbuf;
291 _mav_put_float(buf, 0, extra_value);
292 _mav_put_uint16_t(buf, 4, shutter_speed);
293 _mav_put_uint8_t(buf, 6, target_system);
294 _mav_put_uint8_t(buf, 7, target_component);
295 _mav_put_uint8_t(buf, 8, mode);
296 _mav_put_uint8_t(buf, 9, aperture);
297 _mav_put_uint8_t(buf, 10, iso);
298 _mav_put_uint8_t(buf, 11, exposure_type);
299 _mav_put_uint8_t(buf, 12, command_id);
300 _mav_put_uint8_t(buf, 13, engine_cut_off);
301 _mav_put_uint8_t(buf, 14, extra_param);
302
303 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, buf, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC);
304#else
305 mavlink_digicam_configure_t *packet = (mavlink_digicam_configure_t *)msgbuf;
306 packet->extra_value = extra_value;
307 packet->shutter_speed = shutter_speed;
308 packet->target_system = target_system;
309 packet->target_component = target_component;
310 packet->mode = mode;
311 packet->aperture = aperture;
312 packet->iso = iso;
313 packet->exposure_type = exposure_type;
314 packet->command_id = command_id;
315 packet->engine_cut_off = engine_cut_off;
316 packet->extra_param = extra_param;
317
318 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, (const char *)packet, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC);
319#endif
320}
321#endif
322
323#endif
324
325// MESSAGE DIGICAM_CONFIGURE UNPACKING
326
327
333static inline uint8_t mavlink_msg_digicam_configure_get_target_system(const mavlink_message_t* msg)
334{
335 return _MAV_RETURN_uint8_t(msg, 6);
336}
337
343static inline uint8_t mavlink_msg_digicam_configure_get_target_component(const mavlink_message_t* msg)
344{
345 return _MAV_RETURN_uint8_t(msg, 7);
346}
347
353static inline uint8_t mavlink_msg_digicam_configure_get_mode(const mavlink_message_t* msg)
354{
355 return _MAV_RETURN_uint8_t(msg, 8);
356}
357
363static inline uint16_t mavlink_msg_digicam_configure_get_shutter_speed(const mavlink_message_t* msg)
364{
365 return _MAV_RETURN_uint16_t(msg, 4);
366}
367
373static inline uint8_t mavlink_msg_digicam_configure_get_aperture(const mavlink_message_t* msg)
374{
375 return _MAV_RETURN_uint8_t(msg, 9);
376}
377
383static inline uint8_t mavlink_msg_digicam_configure_get_iso(const mavlink_message_t* msg)
384{
385 return _MAV_RETURN_uint8_t(msg, 10);
386}
387
393static inline uint8_t mavlink_msg_digicam_configure_get_exposure_type(const mavlink_message_t* msg)
394{
395 return _MAV_RETURN_uint8_t(msg, 11);
396}
397
403static inline uint8_t mavlink_msg_digicam_configure_get_command_id(const mavlink_message_t* msg)
404{
405 return _MAV_RETURN_uint8_t(msg, 12);
406}
407
413static inline uint8_t mavlink_msg_digicam_configure_get_engine_cut_off(const mavlink_message_t* msg)
414{
415 return _MAV_RETURN_uint8_t(msg, 13);
416}
417
423static inline uint8_t mavlink_msg_digicam_configure_get_extra_param(const mavlink_message_t* msg)
424{
425 return _MAV_RETURN_uint8_t(msg, 14);
426}
427
433static inline float mavlink_msg_digicam_configure_get_extra_value(const mavlink_message_t* msg)
434{
435 return _MAV_RETURN_float(msg, 0);
436}
437
444static inline void mavlink_msg_digicam_configure_decode(const mavlink_message_t* msg, mavlink_digicam_configure_t* digicam_configure)
445{
446#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
447 digicam_configure->extra_value = mavlink_msg_digicam_configure_get_extra_value(msg);
448 digicam_configure->shutter_speed = mavlink_msg_digicam_configure_get_shutter_speed(msg);
449 digicam_configure->target_system = mavlink_msg_digicam_configure_get_target_system(msg);
450 digicam_configure->target_component = mavlink_msg_digicam_configure_get_target_component(msg);
451 digicam_configure->mode = mavlink_msg_digicam_configure_get_mode(msg);
452 digicam_configure->aperture = mavlink_msg_digicam_configure_get_aperture(msg);
453 digicam_configure->iso = mavlink_msg_digicam_configure_get_iso(msg);
454 digicam_configure->exposure_type = mavlink_msg_digicam_configure_get_exposure_type(msg);
455 digicam_configure->command_id = mavlink_msg_digicam_configure_get_command_id(msg);
456 digicam_configure->engine_cut_off = mavlink_msg_digicam_configure_get_engine_cut_off(msg);
457 digicam_configure->extra_param = mavlink_msg_digicam_configure_get_extra_param(msg);
458#else
459 uint8_t len = msg->len < MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN? msg->len : MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN;
460 memset(digicam_configure, 0, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN);
461 memcpy(digicam_configure, _MAV_PAYLOAD(msg), len);
462#endif
463}