NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mavlink_msg_digicam_configure.h
Go to the documentation of this file.
1 // MESSAGE DIGICAM_CONFIGURE PACKING
2 
3 #define MAVLINK_MSG_ID_DIGICAM_CONFIGURE 154
4 
6 {
7  float extra_value;
8  uint16_t shutter_speed;
9  uint8_t target_system;
10  uint8_t target_component;
11  uint8_t mode;
12  uint8_t aperture;
13  uint8_t iso;
14  uint8_t exposure_type;
15  uint8_t command_id;
16  uint8_t engine_cut_off;
17  uint8_t extra_param;
19 
20 #define MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN 15
21 #define MAVLINK_MSG_ID_154_LEN 15
22 
23 #define MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC 84
24 #define MAVLINK_MSG_ID_154_CRC 84
25 
26 
27 
28 #define MAVLINK_MESSAGE_INFO_DIGICAM_CONFIGURE { \
29  "DIGICAM_CONFIGURE", \
30  11, \
31  { { "extra_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_digicam_configure_t, extra_value) }, \
32  { "shutter_speed", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_digicam_configure_t, shutter_speed) }, \
33  { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_digicam_configure_t, target_system) }, \
34  { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_digicam_configure_t, target_component) }, \
35  { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_digicam_configure_t, mode) }, \
36  { "aperture", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_digicam_configure_t, aperture) }, \
37  { "iso", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_digicam_configure_t, iso) }, \
38  { "exposure_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_digicam_configure_t, exposure_type) }, \
39  { "command_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_digicam_configure_t, command_id) }, \
40  { "engine_cut_off", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_digicam_configure_t, engine_cut_off) }, \
41  { "extra_param", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_digicam_configure_t, extra_param) }, \
42  } \
43 }
44 
45 
65 static inline uint16_t mavlink_msg_digicam_configure_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
66  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)
67 {
68 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
70  _mav_put_float(buf, 0, extra_value);
71  _mav_put_uint16_t(buf, 4, shutter_speed);
72  _mav_put_uint8_t(buf, 6, target_system);
73  _mav_put_uint8_t(buf, 7, target_component);
74  _mav_put_uint8_t(buf, 8, mode);
75  _mav_put_uint8_t(buf, 9, aperture);
76  _mav_put_uint8_t(buf, 10, iso);
77  _mav_put_uint8_t(buf, 11, exposure_type);
78  _mav_put_uint8_t(buf, 12, command_id);
79  _mav_put_uint8_t(buf, 13, engine_cut_off);
80  _mav_put_uint8_t(buf, 14, extra_param);
81 
83 #else
85  packet.extra_value = extra_value;
86  packet.shutter_speed = shutter_speed;
87  packet.target_system = target_system;
88  packet.target_component = target_component;
89  packet.mode = mode;
90  packet.aperture = aperture;
91  packet.iso = iso;
92  packet.exposure_type = exposure_type;
93  packet.command_id = command_id;
94  packet.engine_cut_off = engine_cut_off;
95  packet.extra_param = extra_param;
96 
98 #endif
99 
101 #if MAVLINK_CRC_EXTRA
103 #else
104  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN);
105 #endif
106 }
107 
127 static inline uint16_t mavlink_msg_digicam_configure_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
128  mavlink_message_t* msg,
129  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)
130 {
131 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
133  _mav_put_float(buf, 0, extra_value);
134  _mav_put_uint16_t(buf, 4, shutter_speed);
135  _mav_put_uint8_t(buf, 6, target_system);
136  _mav_put_uint8_t(buf, 7, target_component);
137  _mav_put_uint8_t(buf, 8, mode);
138  _mav_put_uint8_t(buf, 9, aperture);
139  _mav_put_uint8_t(buf, 10, iso);
140  _mav_put_uint8_t(buf, 11, exposure_type);
141  _mav_put_uint8_t(buf, 12, command_id);
142  _mav_put_uint8_t(buf, 13, engine_cut_off);
143  _mav_put_uint8_t(buf, 14, extra_param);
144 
146 #else
148  packet.extra_value = extra_value;
149  packet.shutter_speed = shutter_speed;
150  packet.target_system = target_system;
151  packet.target_component = target_component;
152  packet.mode = mode;
153  packet.aperture = aperture;
154  packet.iso = iso;
155  packet.exposure_type = exposure_type;
156  packet.command_id = command_id;
157  packet.engine_cut_off = engine_cut_off;
158  packet.extra_param = extra_param;
159 
161 #endif
162 
164 #if MAVLINK_CRC_EXTRA
166 #else
167  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN);
168 #endif
169 }
170 
179 static 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)
180 {
181  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);
182 }
183 
193 static 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)
194 {
195  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);
196 }
197 
214 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
215 
216 static 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)
217 {
218 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
220  _mav_put_float(buf, 0, extra_value);
221  _mav_put_uint16_t(buf, 4, shutter_speed);
222  _mav_put_uint8_t(buf, 6, target_system);
223  _mav_put_uint8_t(buf, 7, target_component);
224  _mav_put_uint8_t(buf, 8, mode);
225  _mav_put_uint8_t(buf, 9, aperture);
226  _mav_put_uint8_t(buf, 10, iso);
227  _mav_put_uint8_t(buf, 11, exposure_type);
228  _mav_put_uint8_t(buf, 12, command_id);
229  _mav_put_uint8_t(buf, 13, engine_cut_off);
230  _mav_put_uint8_t(buf, 14, extra_param);
231 
232 #if MAVLINK_CRC_EXTRA
234 #else
235  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, buf, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN);
236 #endif
237 #else
239  packet.extra_value = extra_value;
240  packet.shutter_speed = shutter_speed;
241  packet.target_system = target_system;
242  packet.target_component = target_component;
243  packet.mode = mode;
244  packet.aperture = aperture;
245  packet.iso = iso;
246  packet.exposure_type = exposure_type;
247  packet.command_id = command_id;
248  packet.engine_cut_off = engine_cut_off;
249  packet.extra_param = extra_param;
250 
251 #if MAVLINK_CRC_EXTRA
252  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, (const char *)&packet, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC);
253 #else
254  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, (const char *)&packet, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN);
255 #endif
256 #endif
257 }
258 
259 #if MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
260 /*
261  This varient of _send() can be used to save stack space by re-using
262  memory from the receive buffer. The caller provides a
263  mavlink_message_t which is the size of a full mavlink message. This
264  is usually the receive buffer for the channel, and allows a reply to an
265  incoming message with minimum stack space usage.
266  */
267 static 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)
268 {
269 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
270  char *buf = (char *)msgbuf;
271  _mav_put_float(buf, 0, extra_value);
272  _mav_put_uint16_t(buf, 4, shutter_speed);
273  _mav_put_uint8_t(buf, 6, target_system);
274  _mav_put_uint8_t(buf, 7, target_component);
275  _mav_put_uint8_t(buf, 8, mode);
276  _mav_put_uint8_t(buf, 9, aperture);
277  _mav_put_uint8_t(buf, 10, iso);
278  _mav_put_uint8_t(buf, 11, exposure_type);
279  _mav_put_uint8_t(buf, 12, command_id);
280  _mav_put_uint8_t(buf, 13, engine_cut_off);
281  _mav_put_uint8_t(buf, 14, extra_param);
282 
283 #if MAVLINK_CRC_EXTRA
285 #else
286  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, buf, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN);
287 #endif
288 #else
290  packet->extra_value = extra_value;
291  packet->shutter_speed = shutter_speed;
292  packet->target_system = target_system;
293  packet->target_component = target_component;
294  packet->mode = mode;
295  packet->aperture = aperture;
296  packet->iso = iso;
297  packet->exposure_type = exposure_type;
298  packet->command_id = command_id;
299  packet->engine_cut_off = engine_cut_off;
300  packet->extra_param = extra_param;
301 
302 #if MAVLINK_CRC_EXTRA
303  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, (const char *)packet, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_CRC);
304 #else
305  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, (const char *)packet, MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN);
306 #endif
307 #endif
308 }
309 #endif
310 
311 #endif
312 
313 // MESSAGE DIGICAM_CONFIGURE UNPACKING
314 
315 
321 static inline uint8_t mavlink_msg_digicam_configure_get_target_system(const mavlink_message_t* msg)
322 {
323  return _MAV_RETURN_uint8_t(msg, 6);
324 }
325 
331 static inline uint8_t mavlink_msg_digicam_configure_get_target_component(const mavlink_message_t* msg)
332 {
333  return _MAV_RETURN_uint8_t(msg, 7);
334 }
335 
341 static inline uint8_t mavlink_msg_digicam_configure_get_mode(const mavlink_message_t* msg)
342 {
343  return _MAV_RETURN_uint8_t(msg, 8);
344 }
345 
351 static inline uint16_t mavlink_msg_digicam_configure_get_shutter_speed(const mavlink_message_t* msg)
352 {
353  return _MAV_RETURN_uint16_t(msg, 4);
354 }
355 
361 static inline uint8_t mavlink_msg_digicam_configure_get_aperture(const mavlink_message_t* msg)
362 {
363  return _MAV_RETURN_uint8_t(msg, 9);
364 }
365 
371 static inline uint8_t mavlink_msg_digicam_configure_get_iso(const mavlink_message_t* msg)
372 {
373  return _MAV_RETURN_uint8_t(msg, 10);
374 }
375 
381 static inline uint8_t mavlink_msg_digicam_configure_get_exposure_type(const mavlink_message_t* msg)
382 {
383  return _MAV_RETURN_uint8_t(msg, 11);
384 }
385 
391 static inline uint8_t mavlink_msg_digicam_configure_get_command_id(const mavlink_message_t* msg)
392 {
393  return _MAV_RETURN_uint8_t(msg, 12);
394 }
395 
401 static inline uint8_t mavlink_msg_digicam_configure_get_engine_cut_off(const mavlink_message_t* msg)
402 {
403  return _MAV_RETURN_uint8_t(msg, 13);
404 }
405 
411 static inline uint8_t mavlink_msg_digicam_configure_get_extra_param(const mavlink_message_t* msg)
412 {
413  return _MAV_RETURN_uint8_t(msg, 14);
414 }
415 
421 static inline float mavlink_msg_digicam_configure_get_extra_value(const mavlink_message_t* msg)
422 {
423  return _MAV_RETURN_float(msg, 0);
424 }
425 
432 static inline void mavlink_msg_digicam_configure_decode(const mavlink_message_t* msg, mavlink_digicam_configure_t* digicam_configure)
433 {
434 #if MAVLINK_NEED_BYTE_SWAP
435  digicam_configure->extra_value = mavlink_msg_digicam_configure_get_extra_value(msg);
436  digicam_configure->shutter_speed = mavlink_msg_digicam_configure_get_shutter_speed(msg);
437  digicam_configure->target_system = mavlink_msg_digicam_configure_get_target_system(msg);
438  digicam_configure->target_component = mavlink_msg_digicam_configure_get_target_component(msg);
439  digicam_configure->mode = mavlink_msg_digicam_configure_get_mode(msg);
440  digicam_configure->aperture = mavlink_msg_digicam_configure_get_aperture(msg);
441  digicam_configure->iso = mavlink_msg_digicam_configure_get_iso(msg);
442  digicam_configure->exposure_type = mavlink_msg_digicam_configure_get_exposure_type(msg);
443  digicam_configure->command_id = mavlink_msg_digicam_configure_get_command_id(msg);
444  digicam_configure->engine_cut_off = mavlink_msg_digicam_configure_get_engine_cut_off(msg);
445  digicam_configure->extra_param = mavlink_msg_digicam_configure_get_extra_param(msg);
446 #else
447  memcpy(digicam_configure, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN);
448 #endif
449 }
#define _mav_put_float(buf, wire_offset, b)
Definition: protocol.h:145
#define _MAV_RETURN_uint8_t(msg, wire_offset)
Definition: protocol.h:238
uint8_t mode
Definition: gimbal.h:49
#define _mav_put_uint8_t(buf, wire_offset, b)
Definition: protocol.h:134
#define _mav_put_uint16_t(buf, wire_offset, b)
Definition: protocol.h:139