Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1702 | - | 1 | // MESSAGE DIGICAM_CONTROL PACKING |
2 | |||
3 | #define MAVLINK_MSG_ID_DIGICAM_CONTROL 155 |
||
4 | |||
5 | typedef struct __mavlink_digicam_control_t |
||
6 | { |
||
7 | uint8_t target_system; ///< System ID |
||
8 | uint8_t target_component; ///< Component ID |
||
9 | uint8_t session; ///< 0: stop, 1: start or keep it up //Session control e.g. show/hide lens |
||
10 | uint8_t zoom_pos; ///< 1 to N //Zoom's absolute position (0 means ignore) |
||
11 | int8_t zoom_step; ///< -100 to 100 //Zooming step value to offset zoom from the current position |
||
12 | uint8_t focus_lock; ///< 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus |
||
13 | uint8_t shot; ///< 0: ignore, 1: shot or start filming |
||
14 | uint8_t command_id; ///< Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once |
||
15 | uint8_t extra_param; ///< Extra parameters enumeration (0 means ignore) |
||
16 | float extra_value; ///< Correspondent value to given extra_param |
||
17 | } mavlink_digicam_control_t; |
||
18 | |||
19 | #define MAVLINK_MSG_ID_DIGICAM_CONTROL_LEN 13 |
||
20 | #define MAVLINK_MSG_ID_155_LEN 13 |
||
21 | |||
22 | |||
23 | |||
24 | #define MAVLINK_MESSAGE_INFO_DIGICAM_CONTROL { \ |
||
25 | "DIGICAM_CONTROL", \ |
||
26 | 10, \ |
||
27 | { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_digicam_control_t, target_system) }, \ |
||
28 | { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_digicam_control_t, target_component) }, \ |
||
29 | { "session", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_digicam_control_t, session) }, \ |
||
30 | { "zoom_pos", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_digicam_control_t, zoom_pos) }, \ |
||
31 | { "zoom_step", NULL, MAVLINK_TYPE_INT8_T, 0, 4, offsetof(mavlink_digicam_control_t, zoom_step) }, \ |
||
32 | { "focus_lock", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_digicam_control_t, focus_lock) }, \ |
||
33 | { "shot", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_digicam_control_t, shot) }, \ |
||
34 | { "command_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_digicam_control_t, command_id) }, \ |
||
35 | { "extra_param", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_digicam_control_t, extra_param) }, \ |
||
36 | { "extra_value", NULL, MAVLINK_TYPE_FLOAT, 0, 9, offsetof(mavlink_digicam_control_t, extra_value) }, \ |
||
37 | } \ |
||
38 | } |
||
39 | |||
40 | |||
41 | /** |
||
42 | * @brief Pack a digicam_control message |
||
43 | * @param system_id ID of this system |
||
44 | * @param component_id ID of this component (e.g. 200 for IMU) |
||
45 | * @param msg The MAVLink message to compress the data into |
||
46 | * |
||
47 | * @param target_system System ID |
||
48 | * @param target_component Component ID |
||
49 | * @param session 0: stop, 1: start or keep it up //Session control e.g. show/hide lens |
||
50 | * @param zoom_pos 1 to N //Zoom's absolute position (0 means ignore) |
||
51 | * @param zoom_step -100 to 100 //Zooming step value to offset zoom from the current position |
||
52 | * @param focus_lock 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus |
||
53 | * @param shot 0: ignore, 1: shot or start filming |
||
54 | * @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once |
||
55 | * @param extra_param Extra parameters enumeration (0 means ignore) |
||
56 | * @param extra_value Correspondent value to given extra_param |
||
57 | * @return length of the message in bytes (excluding serial stream start sign) |
||
58 | */ |
||
59 | static inline uint16_t mavlink_msg_digicam_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, |
||
60 | uint8_t target_system, uint8_t target_component, uint8_t session, uint8_t zoom_pos, int8_t zoom_step, uint8_t focus_lock, uint8_t shot, uint8_t command_id, uint8_t extra_param, float extra_value) |
||
61 | { |
||
62 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
||
63 | char buf[13]; |
||
64 | _mav_put_uint8_t(buf, 0, target_system); |
||
65 | _mav_put_uint8_t(buf, 1, target_component); |
||
66 | _mav_put_uint8_t(buf, 2, session); |
||
67 | _mav_put_uint8_t(buf, 3, zoom_pos); |
||
68 | _mav_put_int8_t(buf, 4, zoom_step); |
||
69 | _mav_put_uint8_t(buf, 5, focus_lock); |
||
70 | _mav_put_uint8_t(buf, 6, shot); |
||
71 | _mav_put_uint8_t(buf, 7, command_id); |
||
72 | _mav_put_uint8_t(buf, 8, extra_param); |
||
73 | _mav_put_float(buf, 9, extra_value); |
||
74 | |||
75 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 13); |
||
76 | #else |
||
77 | mavlink_digicam_control_t packet; |
||
78 | packet.target_system = target_system; |
||
79 | packet.target_component = target_component; |
||
80 | packet.session = session; |
||
81 | packet.zoom_pos = zoom_pos; |
||
82 | packet.zoom_step = zoom_step; |
||
83 | packet.focus_lock = focus_lock; |
||
84 | packet.shot = shot; |
||
85 | packet.command_id = command_id; |
||
86 | packet.extra_param = extra_param; |
||
87 | packet.extra_value = extra_value; |
||
88 | |||
89 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 13); |
||
90 | #endif |
||
91 | |||
92 | msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL; |
||
93 | return mavlink_finalize_message(msg, system_id, component_id, 13); |
||
94 | } |
||
95 | |||
96 | /** |
||
97 | * @brief Pack a digicam_control message on a channel |
||
98 | * @param system_id ID of this system |
||
99 | * @param component_id ID of this component (e.g. 200 for IMU) |
||
100 | * @param chan The MAVLink channel this message was sent over |
||
101 | * @param msg The MAVLink message to compress the data into |
||
102 | * @param target_system System ID |
||
103 | * @param target_component Component ID |
||
104 | * @param session 0: stop, 1: start or keep it up //Session control e.g. show/hide lens |
||
105 | * @param zoom_pos 1 to N //Zoom's absolute position (0 means ignore) |
||
106 | * @param zoom_step -100 to 100 //Zooming step value to offset zoom from the current position |
||
107 | * @param focus_lock 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus |
||
108 | * @param shot 0: ignore, 1: shot or start filming |
||
109 | * @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once |
||
110 | * @param extra_param Extra parameters enumeration (0 means ignore) |
||
111 | * @param extra_value Correspondent value to given extra_param |
||
112 | * @return length of the message in bytes (excluding serial stream start sign) |
||
113 | */ |
||
114 | static inline uint16_t mavlink_msg_digicam_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, |
||
115 | mavlink_message_t* msg, |
||
116 | uint8_t target_system,uint8_t target_component,uint8_t session,uint8_t zoom_pos,int8_t zoom_step,uint8_t focus_lock,uint8_t shot,uint8_t command_id,uint8_t extra_param,float extra_value) |
||
117 | { |
||
118 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
||
119 | char buf[13]; |
||
120 | _mav_put_uint8_t(buf, 0, target_system); |
||
121 | _mav_put_uint8_t(buf, 1, target_component); |
||
122 | _mav_put_uint8_t(buf, 2, session); |
||
123 | _mav_put_uint8_t(buf, 3, zoom_pos); |
||
124 | _mav_put_int8_t(buf, 4, zoom_step); |
||
125 | _mav_put_uint8_t(buf, 5, focus_lock); |
||
126 | _mav_put_uint8_t(buf, 6, shot); |
||
127 | _mav_put_uint8_t(buf, 7, command_id); |
||
128 | _mav_put_uint8_t(buf, 8, extra_param); |
||
129 | _mav_put_float(buf, 9, extra_value); |
||
130 | |||
131 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 13); |
||
132 | #else |
||
133 | mavlink_digicam_control_t packet; |
||
134 | packet.target_system = target_system; |
||
135 | packet.target_component = target_component; |
||
136 | packet.session = session; |
||
137 | packet.zoom_pos = zoom_pos; |
||
138 | packet.zoom_step = zoom_step; |
||
139 | packet.focus_lock = focus_lock; |
||
140 | packet.shot = shot; |
||
141 | packet.command_id = command_id; |
||
142 | packet.extra_param = extra_param; |
||
143 | packet.extra_value = extra_value; |
||
144 | |||
145 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 13); |
||
146 | #endif |
||
147 | |||
148 | msg->msgid = MAVLINK_MSG_ID_DIGICAM_CONTROL; |
||
149 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 13); |
||
150 | } |
||
151 | |||
152 | /** |
||
153 | * @brief Encode a digicam_control struct into a message |
||
154 | * |
||
155 | * @param system_id ID of this system |
||
156 | * @param component_id ID of this component (e.g. 200 for IMU) |
||
157 | * @param msg The MAVLink message to compress the data into |
||
158 | * @param digicam_control C-struct to read the message contents from |
||
159 | */ |
||
160 | static inline uint16_t mavlink_msg_digicam_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_digicam_control_t* digicam_control) |
||
161 | { |
||
162 | return mavlink_msg_digicam_control_pack(system_id, component_id, msg, digicam_control->target_system, digicam_control->target_component, digicam_control->session, digicam_control->zoom_pos, digicam_control->zoom_step, digicam_control->focus_lock, digicam_control->shot, digicam_control->command_id, digicam_control->extra_param, digicam_control->extra_value); |
||
163 | } |
||
164 | |||
165 | /** |
||
166 | * @brief Send a digicam_control message |
||
167 | * @param chan MAVLink channel to send the message |
||
168 | * |
||
169 | * @param target_system System ID |
||
170 | * @param target_component Component ID |
||
171 | * @param session 0: stop, 1: start or keep it up //Session control e.g. show/hide lens |
||
172 | * @param zoom_pos 1 to N //Zoom's absolute position (0 means ignore) |
||
173 | * @param zoom_step -100 to 100 //Zooming step value to offset zoom from the current position |
||
174 | * @param focus_lock 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus |
||
175 | * @param shot 0: ignore, 1: shot or start filming |
||
176 | * @param command_id Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once |
||
177 | * @param extra_param Extra parameters enumeration (0 means ignore) |
||
178 | * @param extra_value Correspondent value to given extra_param |
||
179 | */ |
||
180 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
||
181 | |||
182 | static inline void mavlink_msg_digicam_control_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t session, uint8_t zoom_pos, int8_t zoom_step, uint8_t focus_lock, uint8_t shot, uint8_t command_id, uint8_t extra_param, float extra_value) |
||
183 | { |
||
184 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
||
185 | char buf[13]; |
||
186 | _mav_put_uint8_t(buf, 0, target_system); |
||
187 | _mav_put_uint8_t(buf, 1, target_component); |
||
188 | _mav_put_uint8_t(buf, 2, session); |
||
189 | _mav_put_uint8_t(buf, 3, zoom_pos); |
||
190 | _mav_put_int8_t(buf, 4, zoom_step); |
||
191 | _mav_put_uint8_t(buf, 5, focus_lock); |
||
192 | _mav_put_uint8_t(buf, 6, shot); |
||
193 | _mav_put_uint8_t(buf, 7, command_id); |
||
194 | _mav_put_uint8_t(buf, 8, extra_param); |
||
195 | _mav_put_float(buf, 9, extra_value); |
||
196 | |||
197 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONTROL, buf, 13); |
||
198 | #else |
||
199 | mavlink_digicam_control_t packet; |
||
200 | packet.target_system = target_system; |
||
201 | packet.target_component = target_component; |
||
202 | packet.session = session; |
||
203 | packet.zoom_pos = zoom_pos; |
||
204 | packet.zoom_step = zoom_step; |
||
205 | packet.focus_lock = focus_lock; |
||
206 | packet.shot = shot; |
||
207 | packet.command_id = command_id; |
||
208 | packet.extra_param = extra_param; |
||
209 | packet.extra_value = extra_value; |
||
210 | |||
211 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DIGICAM_CONTROL, (const char *)&packet, 13); |
||
212 | #endif |
||
213 | } |
||
214 | |||
215 | #endif |
||
216 | |||
217 | // MESSAGE DIGICAM_CONTROL UNPACKING |
||
218 | |||
219 | |||
220 | /** |
||
221 | * @brief Get field target_system from digicam_control message |
||
222 | * |
||
223 | * @return System ID |
||
224 | */ |
||
225 | static inline uint8_t mavlink_msg_digicam_control_get_target_system(const mavlink_message_t* msg) |
||
226 | { |
||
227 | return _MAV_RETURN_uint8_t(msg, 0); |
||
228 | } |
||
229 | |||
230 | /** |
||
231 | * @brief Get field target_component from digicam_control message |
||
232 | * |
||
233 | * @return Component ID |
||
234 | */ |
||
235 | static inline uint8_t mavlink_msg_digicam_control_get_target_component(const mavlink_message_t* msg) |
||
236 | { |
||
237 | return _MAV_RETURN_uint8_t(msg, 1); |
||
238 | } |
||
239 | |||
240 | /** |
||
241 | * @brief Get field session from digicam_control message |
||
242 | * |
||
243 | * @return 0: stop, 1: start or keep it up //Session control e.g. show/hide lens |
||
244 | */ |
||
245 | static inline uint8_t mavlink_msg_digicam_control_get_session(const mavlink_message_t* msg) |
||
246 | { |
||
247 | return _MAV_RETURN_uint8_t(msg, 2); |
||
248 | } |
||
249 | |||
250 | /** |
||
251 | * @brief Get field zoom_pos from digicam_control message |
||
252 | * |
||
253 | * @return 1 to N //Zoom's absolute position (0 means ignore) |
||
254 | */ |
||
255 | static inline uint8_t mavlink_msg_digicam_control_get_zoom_pos(const mavlink_message_t* msg) |
||
256 | { |
||
257 | return _MAV_RETURN_uint8_t(msg, 3); |
||
258 | } |
||
259 | |||
260 | /** |
||
261 | * @brief Get field zoom_step from digicam_control message |
||
262 | * |
||
263 | * @return -100 to 100 //Zooming step value to offset zoom from the current position |
||
264 | */ |
||
265 | static inline int8_t mavlink_msg_digicam_control_get_zoom_step(const mavlink_message_t* msg) |
||
266 | { |
||
267 | return _MAV_RETURN_int8_t(msg, 4); |
||
268 | } |
||
269 | |||
270 | /** |
||
271 | * @brief Get field focus_lock from digicam_control message |
||
272 | * |
||
273 | * @return 0: unlock focus or keep unlocked, 1: lock focus or keep locked, 3: re-lock focus |
||
274 | */ |
||
275 | static inline uint8_t mavlink_msg_digicam_control_get_focus_lock(const mavlink_message_t* msg) |
||
276 | { |
||
277 | return _MAV_RETURN_uint8_t(msg, 5); |
||
278 | } |
||
279 | |||
280 | /** |
||
281 | * @brief Get field shot from digicam_control message |
||
282 | * |
||
283 | * @return 0: ignore, 1: shot or start filming |
||
284 | */ |
||
285 | static inline uint8_t mavlink_msg_digicam_control_get_shot(const mavlink_message_t* msg) |
||
286 | { |
||
287 | return _MAV_RETURN_uint8_t(msg, 6); |
||
288 | } |
||
289 | |||
290 | /** |
||
291 | * @brief Get field command_id from digicam_control message |
||
292 | * |
||
293 | * @return Command Identity (incremental loop: 0 to 255)//A command sent multiple times will be executed or pooled just once |
||
294 | */ |
||
295 | static inline uint8_t mavlink_msg_digicam_control_get_command_id(const mavlink_message_t* msg) |
||
296 | { |
||
297 | return _MAV_RETURN_uint8_t(msg, 7); |
||
298 | } |
||
299 | |||
300 | /** |
||
301 | * @brief Get field extra_param from digicam_control message |
||
302 | * |
||
303 | * @return Extra parameters enumeration (0 means ignore) |
||
304 | */ |
||
305 | static inline uint8_t mavlink_msg_digicam_control_get_extra_param(const mavlink_message_t* msg) |
||
306 | { |
||
307 | return _MAV_RETURN_uint8_t(msg, 8); |
||
308 | } |
||
309 | |||
310 | /** |
||
311 | * @brief Get field extra_value from digicam_control message |
||
312 | * |
||
313 | * @return Correspondent value to given extra_param |
||
314 | */ |
||
315 | static inline float mavlink_msg_digicam_control_get_extra_value(const mavlink_message_t* msg) |
||
316 | { |
||
317 | return _MAV_RETURN_float(msg, 9); |
||
318 | } |
||
319 | |||
320 | /** |
||
321 | * @brief Decode a digicam_control message into a struct |
||
322 | * |
||
323 | * @param msg The message to decode |
||
324 | * @param digicam_control C-struct to decode the message contents into |
||
325 | */ |
||
326 | static inline void mavlink_msg_digicam_control_decode(const mavlink_message_t* msg, mavlink_digicam_control_t* digicam_control) |
||
327 | { |
||
328 | #if MAVLINK_NEED_BYTE_SWAP |
||
329 | digicam_control->target_system = mavlink_msg_digicam_control_get_target_system(msg); |
||
330 | digicam_control->target_component = mavlink_msg_digicam_control_get_target_component(msg); |
||
331 | digicam_control->session = mavlink_msg_digicam_control_get_session(msg); |
||
332 | digicam_control->zoom_pos = mavlink_msg_digicam_control_get_zoom_pos(msg); |
||
333 | digicam_control->zoom_step = mavlink_msg_digicam_control_get_zoom_step(msg); |
||
334 | digicam_control->focus_lock = mavlink_msg_digicam_control_get_focus_lock(msg); |
||
335 | digicam_control->shot = mavlink_msg_digicam_control_get_shot(msg); |
||
336 | digicam_control->command_id = mavlink_msg_digicam_control_get_command_id(msg); |
||
337 | digicam_control->extra_param = mavlink_msg_digicam_control_get_extra_param(msg); |
||
338 | digicam_control->extra_value = mavlink_msg_digicam_control_get_extra_value(msg); |
||
339 | #else |
||
340 | memcpy(digicam_control, _MAV_PAYLOAD(msg), 13); |
||
341 | #endif |
||
342 | } |