source: flair-src/branches/mavlink/tools/Controller/Mavlink/src/include/common/mavlink_msg_command_int.h@ 75

Last change on this file since 75 was 75, checked in by Thomas Fuhrmann, 8 years ago

Change the version of mavlink generated messages and rename it to include

File size: 21.1 KB
Line 
1// MESSAGE COMMAND_INT PACKING
2
3#define MAVLINK_MSG_ID_COMMAND_INT 75
4
5typedef struct MAVLINK_PACKED __mavlink_command_int_t
6{
7 float param1; /*< PARAM1, see MAV_CMD enum*/
8 float param2; /*< PARAM2, see MAV_CMD enum*/
9 float param3; /*< PARAM3, see MAV_CMD enum*/
10 float param4; /*< PARAM4, see MAV_CMD enum*/
11 int32_t x; /*< PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7*/
12 int32_t y; /*< PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7*/
13 float z; /*< PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.*/
14 uint16_t command; /*< The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs*/
15 uint8_t target_system; /*< System ID*/
16 uint8_t target_component; /*< Component ID*/
17 uint8_t frame; /*< The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h*/
18 uint8_t current; /*< false:0, true:1*/
19 uint8_t autocontinue; /*< autocontinue to next wp*/
20} mavlink_command_int_t;
21
22#define MAVLINK_MSG_ID_COMMAND_INT_LEN 35
23#define MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN 35
24#define MAVLINK_MSG_ID_75_LEN 35
25#define MAVLINK_MSG_ID_75_MIN_LEN 35
26
27#define MAVLINK_MSG_ID_COMMAND_INT_CRC 158
28#define MAVLINK_MSG_ID_75_CRC 158
29
30
31
32#if MAVLINK_COMMAND_24BIT
33#define MAVLINK_MESSAGE_INFO_COMMAND_INT { \
34 75, \
35 "COMMAND_INT", \
36 13, \
37 { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_int_t, param1) }, \
38 { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_int_t, param2) }, \
39 { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_int_t, param3) }, \
40 { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_int_t, param4) }, \
41 { "x", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_command_int_t, x) }, \
42 { "y", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_command_int_t, y) }, \
43 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_int_t, z) }, \
44 { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_int_t, command) }, \
45 { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_int_t, target_system) }, \
46 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_int_t, target_component) }, \
47 { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_int_t, frame) }, \
48 { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_command_int_t, current) }, \
49 { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_command_int_t, autocontinue) }, \
50 } \
51}
52#else
53#define MAVLINK_MESSAGE_INFO_COMMAND_INT { \
54 "COMMAND_INT", \
55 13, \
56 { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_int_t, param1) }, \
57 { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_int_t, param2) }, \
58 { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_int_t, param3) }, \
59 { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_int_t, param4) }, \
60 { "x", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_command_int_t, x) }, \
61 { "y", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_command_int_t, y) }, \
62 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_int_t, z) }, \
63 { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_int_t, command) }, \
64 { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_int_t, target_system) }, \
65 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_int_t, target_component) }, \
66 { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_int_t, frame) }, \
67 { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_command_int_t, current) }, \
68 { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_command_int_t, autocontinue) }, \
69 } \
70}
71#endif
72
73/**
74 * @brief Pack a command_int message
75 * @param system_id ID of this system
76 * @param component_id ID of this component (e.g. 200 for IMU)
77 * @param msg The MAVLink message to compress the data into
78 *
79 * @param target_system System ID
80 * @param target_component Component ID
81 * @param frame The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h
82 * @param command The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs
83 * @param current false:0, true:1
84 * @param autocontinue autocontinue to next wp
85 * @param param1 PARAM1, see MAV_CMD enum
86 * @param param2 PARAM2, see MAV_CMD enum
87 * @param param3 PARAM3, see MAV_CMD enum
88 * @param param4 PARAM4, see MAV_CMD enum
89 * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
90 * @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
91 * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
92 * @return length of the message in bytes (excluding serial stream start sign)
93 */
94static inline uint16_t mavlink_msg_command_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
95 uint8_t target_system, uint8_t target_component, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z)
96{
97#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
98 char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN];
99 _mav_put_float(buf, 0, param1);
100 _mav_put_float(buf, 4, param2);
101 _mav_put_float(buf, 8, param3);
102 _mav_put_float(buf, 12, param4);
103 _mav_put_int32_t(buf, 16, x);
104 _mav_put_int32_t(buf, 20, y);
105 _mav_put_float(buf, 24, z);
106 _mav_put_uint16_t(buf, 28, command);
107 _mav_put_uint8_t(buf, 30, target_system);
108 _mav_put_uint8_t(buf, 31, target_component);
109 _mav_put_uint8_t(buf, 32, frame);
110 _mav_put_uint8_t(buf, 33, current);
111 _mav_put_uint8_t(buf, 34, autocontinue);
112
113 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_INT_LEN);
114#else
115 mavlink_command_int_t packet;
116 packet.param1 = param1;
117 packet.param2 = param2;
118 packet.param3 = param3;
119 packet.param4 = param4;
120 packet.x = x;
121 packet.y = y;
122 packet.z = z;
123 packet.command = command;
124 packet.target_system = target_system;
125 packet.target_component = target_component;
126 packet.frame = frame;
127 packet.current = current;
128 packet.autocontinue = autocontinue;
129
130 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_INT_LEN);
131#endif
132
133 msg->msgid = MAVLINK_MSG_ID_COMMAND_INT;
134 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
135}
136
137/**
138 * @brief Pack a command_int message on a channel
139 * @param system_id ID of this system
140 * @param component_id ID of this component (e.g. 200 for IMU)
141 * @param chan The MAVLink channel this message will be sent over
142 * @param msg The MAVLink message to compress the data into
143 * @param target_system System ID
144 * @param target_component Component ID
145 * @param frame The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h
146 * @param command The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs
147 * @param current false:0, true:1
148 * @param autocontinue autocontinue to next wp
149 * @param param1 PARAM1, see MAV_CMD enum
150 * @param param2 PARAM2, see MAV_CMD enum
151 * @param param3 PARAM3, see MAV_CMD enum
152 * @param param4 PARAM4, see MAV_CMD enum
153 * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
154 * @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
155 * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
156 * @return length of the message in bytes (excluding serial stream start sign)
157 */
158static inline uint16_t mavlink_msg_command_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
159 mavlink_message_t* msg,
160 uint8_t target_system,uint8_t target_component,uint8_t frame,uint16_t command,uint8_t current,uint8_t autocontinue,float param1,float param2,float param3,float param4,int32_t x,int32_t y,float z)
161{
162#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
163 char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN];
164 _mav_put_float(buf, 0, param1);
165 _mav_put_float(buf, 4, param2);
166 _mav_put_float(buf, 8, param3);
167 _mav_put_float(buf, 12, param4);
168 _mav_put_int32_t(buf, 16, x);
169 _mav_put_int32_t(buf, 20, y);
170 _mav_put_float(buf, 24, z);
171 _mav_put_uint16_t(buf, 28, command);
172 _mav_put_uint8_t(buf, 30, target_system);
173 _mav_put_uint8_t(buf, 31, target_component);
174 _mav_put_uint8_t(buf, 32, frame);
175 _mav_put_uint8_t(buf, 33, current);
176 _mav_put_uint8_t(buf, 34, autocontinue);
177
178 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_INT_LEN);
179#else
180 mavlink_command_int_t packet;
181 packet.param1 = param1;
182 packet.param2 = param2;
183 packet.param3 = param3;
184 packet.param4 = param4;
185 packet.x = x;
186 packet.y = y;
187 packet.z = z;
188 packet.command = command;
189 packet.target_system = target_system;
190 packet.target_component = target_component;
191 packet.frame = frame;
192 packet.current = current;
193 packet.autocontinue = autocontinue;
194
195 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_INT_LEN);
196#endif
197
198 msg->msgid = MAVLINK_MSG_ID_COMMAND_INT;
199 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
200}
201
202/**
203 * @brief Encode a command_int struct
204 *
205 * @param system_id ID of this system
206 * @param component_id ID of this component (e.g. 200 for IMU)
207 * @param msg The MAVLink message to compress the data into
208 * @param command_int C-struct to read the message contents from
209 */
210static inline uint16_t mavlink_msg_command_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_command_int_t* command_int)
211{
212 return mavlink_msg_command_int_pack(system_id, component_id, msg, command_int->target_system, command_int->target_component, command_int->frame, command_int->command, command_int->current, command_int->autocontinue, command_int->param1, command_int->param2, command_int->param3, command_int->param4, command_int->x, command_int->y, command_int->z);
213}
214
215/**
216 * @brief Encode a command_int struct on a channel
217 *
218 * @param system_id ID of this system
219 * @param component_id ID of this component (e.g. 200 for IMU)
220 * @param chan The MAVLink channel this message will be sent over
221 * @param msg The MAVLink message to compress the data into
222 * @param command_int C-struct to read the message contents from
223 */
224static inline uint16_t mavlink_msg_command_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_command_int_t* command_int)
225{
226 return mavlink_msg_command_int_pack_chan(system_id, component_id, chan, msg, command_int->target_system, command_int->target_component, command_int->frame, command_int->command, command_int->current, command_int->autocontinue, command_int->param1, command_int->param2, command_int->param3, command_int->param4, command_int->x, command_int->y, command_int->z);
227}
228
229/**
230 * @brief Send a command_int message
231 * @param chan MAVLink channel to send the message
232 *
233 * @param target_system System ID
234 * @param target_component Component ID
235 * @param frame The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h
236 * @param command The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs
237 * @param current false:0, true:1
238 * @param autocontinue autocontinue to next wp
239 * @param param1 PARAM1, see MAV_CMD enum
240 * @param param2 PARAM2, see MAV_CMD enum
241 * @param param3 PARAM3, see MAV_CMD enum
242 * @param param4 PARAM4, see MAV_CMD enum
243 * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
244 * @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
245 * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
246 */
247#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
248
249static inline void mavlink_msg_command_int_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z)
250{
251#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
252 char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN];
253 _mav_put_float(buf, 0, param1);
254 _mav_put_float(buf, 4, param2);
255 _mav_put_float(buf, 8, param3);
256 _mav_put_float(buf, 12, param4);
257 _mav_put_int32_t(buf, 16, x);
258 _mav_put_int32_t(buf, 20, y);
259 _mav_put_float(buf, 24, z);
260 _mav_put_uint16_t(buf, 28, command);
261 _mav_put_uint8_t(buf, 30, target_system);
262 _mav_put_uint8_t(buf, 31, target_component);
263 _mav_put_uint8_t(buf, 32, frame);
264 _mav_put_uint8_t(buf, 33, current);
265 _mav_put_uint8_t(buf, 34, autocontinue);
266
267 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, buf, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
268#else
269 mavlink_command_int_t packet;
270 packet.param1 = param1;
271 packet.param2 = param2;
272 packet.param3 = param3;
273 packet.param4 = param4;
274 packet.x = x;
275 packet.y = y;
276 packet.z = z;
277 packet.command = command;
278 packet.target_system = target_system;
279 packet.target_component = target_component;
280 packet.frame = frame;
281 packet.current = current;
282 packet.autocontinue = autocontinue;
283
284 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
285#endif
286}
287
288/**
289 * @brief Send a command_int message
290 * @param chan MAVLink channel to send the message
291 * @param struct The MAVLink struct to serialize
292 */
293static inline void mavlink_msg_command_int_send_struct(mavlink_channel_t chan, const mavlink_command_int_t* command_int)
294{
295#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
296 mavlink_msg_command_int_send(chan, command_int->target_system, command_int->target_component, command_int->frame, command_int->command, command_int->current, command_int->autocontinue, command_int->param1, command_int->param2, command_int->param3, command_int->param4, command_int->x, command_int->y, command_int->z);
297#else
298 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)command_int, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
299#endif
300}
301
302#if MAVLINK_MSG_ID_COMMAND_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
303/*
304 This varient of _send() can be used to save stack space by re-using
305 memory from the receive buffer. The caller provides a
306 mavlink_message_t which is the size of a full mavlink message. This
307 is usually the receive buffer for the channel, and allows a reply to an
308 incoming message with minimum stack space usage.
309 */
310static inline void mavlink_msg_command_int_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t frame, uint16_t command, uint8_t current, uint8_t autocontinue, float param1, float param2, float param3, float param4, int32_t x, int32_t y, float z)
311{
312#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
313 char *buf = (char *)msgbuf;
314 _mav_put_float(buf, 0, param1);
315 _mav_put_float(buf, 4, param2);
316 _mav_put_float(buf, 8, param3);
317 _mav_put_float(buf, 12, param4);
318 _mav_put_int32_t(buf, 16, x);
319 _mav_put_int32_t(buf, 20, y);
320 _mav_put_float(buf, 24, z);
321 _mav_put_uint16_t(buf, 28, command);
322 _mav_put_uint8_t(buf, 30, target_system);
323 _mav_put_uint8_t(buf, 31, target_component);
324 _mav_put_uint8_t(buf, 32, frame);
325 _mav_put_uint8_t(buf, 33, current);
326 _mav_put_uint8_t(buf, 34, autocontinue);
327
328 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, buf, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
329#else
330 mavlink_command_int_t *packet = (mavlink_command_int_t *)msgbuf;
331 packet->param1 = param1;
332 packet->param2 = param2;
333 packet->param3 = param3;
334 packet->param4 = param4;
335 packet->x = x;
336 packet->y = y;
337 packet->z = z;
338 packet->command = command;
339 packet->target_system = target_system;
340 packet->target_component = target_component;
341 packet->frame = frame;
342 packet->current = current;
343 packet->autocontinue = autocontinue;
344
345 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)packet, MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
346#endif
347}
348#endif
349
350#endif
351
352// MESSAGE COMMAND_INT UNPACKING
353
354
355/**
356 * @brief Get field target_system from command_int message
357 *
358 * @return System ID
359 */
360static inline uint8_t mavlink_msg_command_int_get_target_system(const mavlink_message_t* msg)
361{
362 return _MAV_RETURN_uint8_t(msg, 30);
363}
364
365/**
366 * @brief Get field target_component from command_int message
367 *
368 * @return Component ID
369 */
370static inline uint8_t mavlink_msg_command_int_get_target_component(const mavlink_message_t* msg)
371{
372 return _MAV_RETURN_uint8_t(msg, 31);
373}
374
375/**
376 * @brief Get field frame from command_int message
377 *
378 * @return The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h
379 */
380static inline uint8_t mavlink_msg_command_int_get_frame(const mavlink_message_t* msg)
381{
382 return _MAV_RETURN_uint8_t(msg, 32);
383}
384
385/**
386 * @brief Get field command from command_int message
387 *
388 * @return The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs
389 */
390static inline uint16_t mavlink_msg_command_int_get_command(const mavlink_message_t* msg)
391{
392 return _MAV_RETURN_uint16_t(msg, 28);
393}
394
395/**
396 * @brief Get field current from command_int message
397 *
398 * @return false:0, true:1
399 */
400static inline uint8_t mavlink_msg_command_int_get_current(const mavlink_message_t* msg)
401{
402 return _MAV_RETURN_uint8_t(msg, 33);
403}
404
405/**
406 * @brief Get field autocontinue from command_int message
407 *
408 * @return autocontinue to next wp
409 */
410static inline uint8_t mavlink_msg_command_int_get_autocontinue(const mavlink_message_t* msg)
411{
412 return _MAV_RETURN_uint8_t(msg, 34);
413}
414
415/**
416 * @brief Get field param1 from command_int message
417 *
418 * @return PARAM1, see MAV_CMD enum
419 */
420static inline float mavlink_msg_command_int_get_param1(const mavlink_message_t* msg)
421{
422 return _MAV_RETURN_float(msg, 0);
423}
424
425/**
426 * @brief Get field param2 from command_int message
427 *
428 * @return PARAM2, see MAV_CMD enum
429 */
430static inline float mavlink_msg_command_int_get_param2(const mavlink_message_t* msg)
431{
432 return _MAV_RETURN_float(msg, 4);
433}
434
435/**
436 * @brief Get field param3 from command_int message
437 *
438 * @return PARAM3, see MAV_CMD enum
439 */
440static inline float mavlink_msg_command_int_get_param3(const mavlink_message_t* msg)
441{
442 return _MAV_RETURN_float(msg, 8);
443}
444
445/**
446 * @brief Get field param4 from command_int message
447 *
448 * @return PARAM4, see MAV_CMD enum
449 */
450static inline float mavlink_msg_command_int_get_param4(const mavlink_message_t* msg)
451{
452 return _MAV_RETURN_float(msg, 12);
453}
454
455/**
456 * @brief Get field x from command_int message
457 *
458 * @return PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
459 */
460static inline int32_t mavlink_msg_command_int_get_x(const mavlink_message_t* msg)
461{
462 return _MAV_RETURN_int32_t(msg, 16);
463}
464
465/**
466 * @brief Get field y from command_int message
467 *
468 * @return PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
469 */
470static inline int32_t mavlink_msg_command_int_get_y(const mavlink_message_t* msg)
471{
472 return _MAV_RETURN_int32_t(msg, 20);
473}
474
475/**
476 * @brief Get field z from command_int message
477 *
478 * @return PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
479 */
480static inline float mavlink_msg_command_int_get_z(const mavlink_message_t* msg)
481{
482 return _MAV_RETURN_float(msg, 24);
483}
484
485/**
486 * @brief Decode a command_int message into a struct
487 *
488 * @param msg The message to decode
489 * @param command_int C-struct to decode the message contents into
490 */
491static inline void mavlink_msg_command_int_decode(const mavlink_message_t* msg, mavlink_command_int_t* command_int)
492{
493#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
494 command_int->param1 = mavlink_msg_command_int_get_param1(msg);
495 command_int->param2 = mavlink_msg_command_int_get_param2(msg);
496 command_int->param3 = mavlink_msg_command_int_get_param3(msg);
497 command_int->param4 = mavlink_msg_command_int_get_param4(msg);
498 command_int->x = mavlink_msg_command_int_get_x(msg);
499 command_int->y = mavlink_msg_command_int_get_y(msg);
500 command_int->z = mavlink_msg_command_int_get_z(msg);
501 command_int->command = mavlink_msg_command_int_get_command(msg);
502 command_int->target_system = mavlink_msg_command_int_get_target_system(msg);
503 command_int->target_component = mavlink_msg_command_int_get_target_component(msg);
504 command_int->frame = mavlink_msg_command_int_get_frame(msg);
505 command_int->current = mavlink_msg_command_int_get_current(msg);
506 command_int->autocontinue = mavlink_msg_command_int_get_autocontinue(msg);
507#else
508 uint8_t len = msg->len < MAVLINK_MSG_ID_COMMAND_INT_LEN? msg->len : MAVLINK_MSG_ID_COMMAND_INT_LEN;
509 memset(command_int, 0, MAVLINK_MSG_ID_COMMAND_INT_LEN);
510 memcpy(command_int, _MAV_PAYLOAD(msg), len);
511#endif
512}
Note: See TracBrowser for help on using the repository browser.