Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1702 | - | 1 | // MESSAGE DIGICAM_CONFIGURE PACKING |
2 | |||
3 | #define MAVLINK_MSG_ID_DIGICAM_CONFIGURE 154 |
||
4 | |||
5 | typedef struct __mavlink_digicam_configure_t |
||
6 | { |
||
7 | float extra_value; ///< Correspondent value to given extra_param |
||
8 | uint16_t shutter_speed; ///< Divisor number //e.g. 1000 means 1/1000 (0 means ignore) |
||
9 | uint8_t target_system; ///< System ID |
||
10 | uint8_t target_component; ///< Component ID |
||
11 | uint8_t mode; ///< Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore) |
||
12 | uint8_t aperture; ///< F stop number x 10 //e.g. 28 means 2.8 (0 means ignore) |
||
13 | uint8_t iso; ///< ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore) |
||
14 | uint8_t exposure_type; ///< Exposure type enumeration from 1 to N (0 means ignore) |
||
15 | uint8_t command_id; ///< Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once |
||
16 | uint8_t engine_cut_off; ///< Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) |
||
17 | uint8_t extra_param; ///< Extra parameters enumeration (0 means ignore) |
||
18 | } mavlink_digicam_configure_t; |
||
19 | |||
20 | #define MAVLINK_MSG_ID_DIGICAM_CONFIGURE_LEN 15 |
||
21 | #define MAVLINK_MSG_ID_154_LEN 15 |
||
22 | |||
23 | |||
24 | |||
25 | #define MAVLINK_MESSAGE_INFO_DIGICAM_CONFIGURE { \ |
||
26 | "DIGICAM_CONFIGURE", \ |
||
27 | 11, \ |
||
28 | { { "extra_value", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_digicam_configure_t, extra_value) }, \ |
||
29 | { "shutter_speed", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_digicam_configure_t, shutter_speed) }, \ |
||
30 | { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_digicam_configure_t, target_system) }, \ |
||
31 | { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_digicam_configure_t, target_component) }, \ |
||
32 | { "mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_digicam_configure_t, mode) }, \ |
||
33 | { "aperture", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_digicam_configure_t, aperture) }, \ |
||
34 | { "iso", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_digicam_configure_t, iso) }, \ |
||
35 | { "exposure_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_digicam_configure_t, exposure_type) }, \ |
||
36 | { "command_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_digicam_configure_t, command_id) }, \ |
||
37 | { "engine_cut_off", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_digicam_configure_t, engine_cut_off) }, \ |
||
38 | { "extra_param", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_digicam_configure_t, extra_param) }, \ |
||
39 | } \ |
||
40 | } |
||
41 | |||
42 | |||
43 | /** |
||
44 | * @brief Pack a digicam_configure message |
||
45 | * @param system_id ID of this system |
||
46 | * @param component_id ID of this component (e.g. 200 for IMU) |
||
47 | * @param msg The MAVLink message to compress the data into |
||
48 | * |
||
49 | * @param target_system System ID |
||
50 | * @param target_component Component ID |
||
51 | * @param mode Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore) |
||
52 | * @param shutter_speed Divisor number //e.g. 1000 means 1/1000 (0 means ignore) |
||
53 | * @param aperture F stop number x 10 //e.g. 28 means 2.8 (0 means ignore) |
||
54 | * @param iso ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore) |
||
55 | * @param exposure_type Exposure type enumeration from 1 to N (0 means ignore) |
||
56 | * @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once |
||
57 | * @param engine_cut_off Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) |
||
58 | * @param extra_param Extra parameters enumeration (0 means ignore) |
||
59 | * @param extra_value Correspondent value to given extra_param |
||
60 | * @return length of the message in bytes (excluding serial stream start sign) |
||
61 | */ |
||
62 | static inline uint16_t mavlink_msg_digicam_configure_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, |
||
63 | 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) |
||
64 | { |
||
65 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
||
66 | char buf[15]; |
||
67 | _mav_put_float(buf, 0, extra_value); |
||
68 | _mav_put_uint16_t(buf, 4, shutter_speed); |
||
69 | _mav_put_uint8_t(buf, 6, target_system); |
||
70 | _mav_put_uint8_t(buf, 7, target_component); |
||
71 | _mav_put_uint8_t(buf, 8, mode); |
||
72 | _mav_put_uint8_t(buf, 9, aperture); |
||
73 | _mav_put_uint8_t(buf, 10, iso); |
||
74 | _mav_put_uint8_t(buf, 11, exposure_type); |
||
75 | _mav_put_uint8_t(buf, 12, command_id); |
||
76 | _mav_put_uint8_t(buf, 13, engine_cut_off); |
||
77 | _mav_put_uint8_t(buf, 14, extra_param); |
||
78 | |||
79 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); |
||
80 | #else |
||
81 | mavlink_digicam_configure_t packet; |
||
82 | packet.extra_value = extra_value; |
||
83 | packet.shutter_speed = shutter_speed; |
||
84 | packet.target_system = target_system; |
||
85 | packet.target_component = target_component; |
||
86 | packet.mode = mode; |
||
87 | packet.aperture = aperture; |
||
88 | packet.iso = iso; |
||
89 | packet.exposure_type = exposure_type; |
||
90 | packet.command_id = command_id; |
||
91 | packet.engine_cut_off = engine_cut_off; |
||
92 | packet.extra_param = extra_param; |
||
93 | |||
94 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); |
||
95 | #endif |
||
96 | |||
97 | msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE; |
||
98 | return mavlink_finalize_message(msg, system_id, component_id, 15, 84); |
||
99 | } |
||
100 | |||
101 | /** |
||
102 | * @brief Pack a digicam_configure message on a channel |
||
103 | * @param system_id ID of this system |
||
104 | * @param component_id ID of this component (e.g. 200 for IMU) |
||
105 | * @param chan The MAVLink channel this message was sent over |
||
106 | * @param msg The MAVLink message to compress the data into |
||
107 | * @param target_system System ID |
||
108 | * @param target_component Component ID |
||
109 | * @param mode Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore) |
||
110 | * @param shutter_speed Divisor number //e.g. 1000 means 1/1000 (0 means ignore) |
||
111 | * @param aperture F stop number x 10 //e.g. 28 means 2.8 (0 means ignore) |
||
112 | * @param iso ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore) |
||
113 | * @param exposure_type Exposure type enumeration from 1 to N (0 means ignore) |
||
114 | * @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once |
||
115 | * @param engine_cut_off Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) |
||
116 | * @param extra_param Extra parameters enumeration (0 means ignore) |
||
117 | * @param extra_value Correspondent value to given extra_param |
||
118 | * @return length of the message in bytes (excluding serial stream start sign) |
||
119 | */ |
||
120 | static inline uint16_t mavlink_msg_digicam_configure_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, |
||
121 | mavlink_message_t* msg, |
||
122 | 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) |
||
123 | { |
||
124 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
||
125 | char buf[15]; |
||
126 | _mav_put_float(buf, 0, extra_value); |
||
127 | _mav_put_uint16_t(buf, 4, shutter_speed); |
||
128 | _mav_put_uint8_t(buf, 6, target_system); |
||
129 | _mav_put_uint8_t(buf, 7, target_component); |
||
130 | _mav_put_uint8_t(buf, 8, mode); |
||
131 | _mav_put_uint8_t(buf, 9, aperture); |
||
132 | _mav_put_uint8_t(buf, 10, iso); |
||
133 | _mav_put_uint8_t(buf, 11, exposure_type); |
||
134 | _mav_put_uint8_t(buf, 12, command_id); |
||
135 | _mav_put_uint8_t(buf, 13, engine_cut_off); |
||
136 | _mav_put_uint8_t(buf, 14, extra_param); |
||
137 | |||
138 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 15); |
||
139 | #else |
||
140 | mavlink_digicam_configure_t packet; |
||
141 | packet.extra_value = extra_value; |
||
142 | packet.shutter_speed = shutter_speed; |
||
143 | packet.target_system = target_system; |
||
144 | packet.target_component = target_component; |
||
145 | packet.mode = mode; |
||
146 | packet.aperture = aperture; |
||
147 | packet.iso = iso; |
||
148 | packet.exposure_type = exposure_type; |
||
149 | packet.command_id = command_id; |
||
150 | packet.engine_cut_off = engine_cut_off; |
||
151 | packet.extra_param = extra_param; |
||
152 | |||
153 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 15); |
||
154 | #endif |
||
155 | |||
156 | msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONFIGURE; |
||
157 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 15, 84); |
||
158 | } |
||
159 | |||
160 | /** |
||
161 | * @brief Encode a digicam_configure struct into a message |
||
162 | * |
||
163 | * @param system_id ID of this system |
||
164 | * @param component_id ID of this component (e.g. 200 for IMU) |
||
165 | * @param msg The MAVLink message to compress the data into |
||
166 | * @param digicam_configure C-struct to read the message contents from |
||
167 | */ |
||
168 | 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) |
||
169 | { |
||
170 | 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); |
||
171 | } |
||
172 | |||
173 | /** |
||
174 | * @brief Send a digicam_configure message |
||
175 | * @param chan MAVLink channel to send the message |
||
176 | * |
||
177 | * @param target_system System ID |
||
178 | * @param target_component Component ID |
||
179 | * @param mode Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore) |
||
180 | * @param shutter_speed Divisor number //e.g. 1000 means 1/1000 (0 means ignore) |
||
181 | * @param aperture F stop number x 10 //e.g. 28 means 2.8 (0 means ignore) |
||
182 | * @param iso ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore) |
||
183 | * @param exposure_type Exposure type enumeration from 1 to N (0 means ignore) |
||
184 | * @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once |
||
185 | * @param engine_cut_off Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) |
||
186 | * @param extra_param Extra parameters enumeration (0 means ignore) |
||
187 | * @param extra_value Correspondent value to given extra_param |
||
188 | */ |
||
189 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
||
190 | |||
191 | 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) |
||
192 | { |
||
193 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
||
194 | char buf[15]; |
||
195 | _mav_put_float(buf, 0, extra_value); |
||
196 | _mav_put_uint16_t(buf, 4, shutter_speed); |
||
197 | _mav_put_uint8_t(buf, 6, target_system); |
||
198 | _mav_put_uint8_t(buf, 7, target_component); |
||
199 | _mav_put_uint8_t(buf, 8, mode); |
||
200 | _mav_put_uint8_t(buf, 9, aperture); |
||
201 | _mav_put_uint8_t(buf, 10, iso); |
||
202 | _mav_put_uint8_t(buf, 11, exposure_type); |
||
203 | _mav_put_uint8_t(buf, 12, command_id); |
||
204 | _mav_put_uint8_t(buf, 13, engine_cut_off); |
||
205 | _mav_put_uint8_t(buf, 14, extra_param); |
||
206 | |||
207 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, buf, 15, 84); |
||
208 | #else |
||
209 | mavlink_digicam_configure_t packet; |
||
210 | packet.extra_value = extra_value; |
||
211 | packet.shutter_speed = shutter_speed; |
||
212 | packet.target_system = target_system; |
||
213 | packet.target_component = target_component; |
||
214 | packet.mode = mode; |
||
215 | packet.aperture = aperture; |
||
216 | packet.iso = iso; |
||
217 | packet.exposure_type = exposure_type; |
||
218 | packet.command_id = command_id; |
||
219 | packet.engine_cut_off = engine_cut_off; |
||
220 | packet.extra_param = extra_param; |
||
221 | |||
222 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONFIGURE, (const char *)&packet, 15, 84); |
||
223 | #endif |
||
224 | } |
||
225 | |||
226 | #endif |
||
227 | |||
228 | // MESSAGE DIGICAM_CONFIGURE UNPACKING |
||
229 | |||
230 | |||
231 | /** |
||
232 | * @brief Get field target_system from digicam_configure message |
||
233 | * |
||
234 | * @return System ID |
||
235 | */ |
||
236 | static inline uint8_t mavlink_msg_digicam_configure_get_target_system(const mavlink_message_t* msg) |
||
237 | { |
||
238 | return _MAV_RETURN_uint8_t(msg, 6); |
||
239 | } |
||
240 | |||
241 | /** |
||
242 | * @brief Get field target_component from digicam_configure message |
||
243 | * |
||
244 | * @return Component ID |
||
245 | */ |
||
246 | static inline uint8_t mavlink_msg_digicam_configure_get_target_component(const mavlink_message_t* msg) |
||
247 | { |
||
248 | return _MAV_RETURN_uint8_t(msg, 7); |
||
249 | } |
||
250 | |||
251 | /** |
||
252 | * @brief Get field mode from digicam_configure message |
||
253 | * |
||
254 | * @return Mode enumeration from 1 to N //P, TV, AV, M, Etc (0 means ignore) |
||
255 | */ |
||
256 | static inline uint8_t mavlink_msg_digicam_configure_get_mode(const mavlink_message_t* msg) |
||
257 | { |
||
258 | return _MAV_RETURN_uint8_t(msg, 8); |
||
259 | } |
||
260 | |||
261 | /** |
||
262 | * @brief Get field shutter_speed from digicam_configure message |
||
263 | * |
||
264 | * @return Divisor number //e.g. 1000 means 1/1000 (0 means ignore) |
||
265 | */ |
||
266 | static inline uint16_t mavlink_msg_digicam_configure_get_shutter_speed(const mavlink_message_t* msg) |
||
267 | { |
||
268 | return _MAV_RETURN_uint16_t(msg, 4); |
||
269 | } |
||
270 | |||
271 | /** |
||
272 | * @brief Get field aperture from digicam_configure message |
||
273 | * |
||
274 | * @return F stop number x 10 //e.g. 28 means 2.8 (0 means ignore) |
||
275 | */ |
||
276 | static inline uint8_t mavlink_msg_digicam_configure_get_aperture(const mavlink_message_t* msg) |
||
277 | { |
||
278 | return _MAV_RETURN_uint8_t(msg, 9); |
||
279 | } |
||
280 | |||
281 | /** |
||
282 | * @brief Get field iso from digicam_configure message |
||
283 | * |
||
284 | * @return ISO enumeration from 1 to N //e.g. 80, 100, 200, Etc (0 means ignore) |
||
285 | */ |
||
286 | static inline uint8_t mavlink_msg_digicam_configure_get_iso(const mavlink_message_t* msg) |
||
287 | { |
||
288 | return _MAV_RETURN_uint8_t(msg, 10); |
||
289 | } |
||
290 | |||
291 | /** |
||
292 | * @brief Get field exposure_type from digicam_configure message |
||
293 | * |
||
294 | * @return Exposure type enumeration from 1 to N (0 means ignore) |
||
295 | */ |
||
296 | static inline uint8_t mavlink_msg_digicam_configure_get_exposure_type(const mavlink_message_t* msg) |
||
297 | { |
||
298 | return _MAV_RETURN_uint8_t(msg, 11); |
||
299 | } |
||
300 | |||
301 | /** |
||
302 | * @brief Get field command_id from digicam_configure message |
||
303 | * |
||
304 | * @return Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once |
||
305 | */ |
||
306 | static inline uint8_t mavlink_msg_digicam_configure_get_command_id(const mavlink_message_t* msg) |
||
307 | { |
||
308 | return _MAV_RETURN_uint8_t(msg, 12); |
||
309 | } |
||
310 | |||
311 | /** |
||
312 | * @brief Get field engine_cut_off from digicam_configure message |
||
313 | * |
||
314 | * @return Main engine cut-off time before camera trigger in seconds/10 (0 means no cut-off) |
||
315 | */ |
||
316 | static inline uint8_t mavlink_msg_digicam_configure_get_engine_cut_off(const mavlink_message_t* msg) |
||
317 | { |
||
318 | return _MAV_RETURN_uint8_t(msg, 13); |
||
319 | } |
||
320 | |||
321 | /** |
||
322 | * @brief Get field extra_param from digicam_configure message |
||
323 | * |
||
324 | * @return Extra parameters enumeration (0 means ignore) |
||
325 | */ |
||
326 | static inline uint8_t mavlink_msg_digicam_configure_get_extra_param(const mavlink_message_t* msg) |
||
327 | { |
||
328 | return _MAV_RETURN_uint8_t(msg, 14); |
||
329 | } |
||
330 | |||
331 | /** |
||
332 | * @brief Get field extra_value from digicam_configure message |
||
333 | * |
||
334 | * @return Correspondent value to given extra_param |
||
335 | */ |
||
336 | static inline float mavlink_msg_digicam_configure_get_extra_value(const mavlink_message_t* msg) |
||
337 | { |
||
338 | return _MAV_RETURN_float(msg, 0); |
||
339 | } |
||
340 | |||
341 | /** |
||
342 | * @brief Decode a digicam_configure message into a struct |
||
343 | * |
||
344 | * @param msg The message to decode |
||
345 | * @param digicam_configure C-struct to decode the message contents into |
||
346 | */ |
||
347 | static inline void mavlink_msg_digicam_configure_decode(const mavlink_message_t* msg, mavlink_digicam_configure_t* digicam_configure) |
||
348 | { |
||
349 | #if MAVLINK_NEED_BYTE_SWAP |
||
350 | digicam_configure->extra_value = mavlink_msg_digicam_configure_get_extra_value(msg); |
||
351 | digicam_configure->shutter_speed = mavlink_msg_digicam_configure_get_shutter_speed(msg); |
||
352 | digicam_configure->target_system = mavlink_msg_digicam_configure_get_target_system(msg); |
||
353 | digicam_configure->target_component = mavlink_msg_digicam_configure_get_target_component(msg); |
||
354 | digicam_configure->mode = mavlink_msg_digicam_configure_get_mode(msg); |
||
355 | digicam_configure->aperture = mavlink_msg_digicam_configure_get_aperture(msg); |
||
356 | digicam_configure->iso = mavlink_msg_digicam_configure_get_iso(msg); |
||
357 | digicam_configure->exposure_type = mavlink_msg_digicam_configure_get_exposure_type(msg); |
||
358 | digicam_configure->command_id = mavlink_msg_digicam_configure_get_command_id(msg); |
||
359 | digicam_configure->engine_cut_off = mavlink_msg_digicam_configure_get_engine_cut_off(msg); |
||
360 | digicam_configure->extra_param = mavlink_msg_digicam_configure_get_extra_param(msg); |
||
361 | #else |
||
362 | memcpy(digicam_configure, _MAV_PAYLOAD(msg), 15); |
||
363 | #endif |
||
364 | } |