2 // MESSAGE MISSION_ITEM PACKING
4 #define MAVLINK_MSG_ID_MISSION_ITEM 39
7 typedef struct __mavlink_mission_item_t
{
8 float param1
; /*< PARAM1, see MAV_CMD enum*/
9 float param2
; /*< PARAM2, see MAV_CMD enum*/
10 float param3
; /*< PARAM3, see MAV_CMD enum*/
11 float param4
; /*< PARAM4, see MAV_CMD enum*/
12 float x
; /*< PARAM5 / local: X coordinate, global: latitude*/
13 float y
; /*< PARAM6 / local: Y coordinate, global: longitude*/
14 float z
; /*< PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame).*/
15 uint16_t seq
; /*< Sequence*/
16 uint16_t command
; /*< The scheduled action for the waypoint.*/
17 uint8_t target_system
; /*< System ID*/
18 uint8_t target_component
; /*< Component ID*/
19 uint8_t frame
; /*< The coordinate system of the waypoint.*/
20 uint8_t current
; /*< false:0, true:1*/
21 uint8_t autocontinue
; /*< Autocontinue to next waypoint*/
22 uint8_t mission_type
; /*< Mission type.*/
23 } mavlink_mission_item_t
;
25 #define MAVLINK_MSG_ID_MISSION_ITEM_LEN 38
26 #define MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN 37
27 #define MAVLINK_MSG_ID_39_LEN 38
28 #define MAVLINK_MSG_ID_39_MIN_LEN 37
30 #define MAVLINK_MSG_ID_MISSION_ITEM_CRC 254
31 #define MAVLINK_MSG_ID_39_CRC 254
35 #if MAVLINK_COMMAND_24BIT
36 #define MAVLINK_MESSAGE_INFO_MISSION_ITEM { \
40 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_mission_item_t, target_system) }, \
41 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_mission_item_t, target_component) }, \
42 { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_mission_item_t, seq) }, \
43 { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_mission_item_t, frame) }, \
44 { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_mission_item_t, command) }, \
45 { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_mission_item_t, current) }, \
46 { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_mission_item_t, autocontinue) }, \
47 { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_t, param1) }, \
48 { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mission_item_t, param2) }, \
49 { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mission_item_t, param3) }, \
50 { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mission_item_t, param4) }, \
51 { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_mission_item_t, x) }, \
52 { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_mission_item_t, y) }, \
53 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_mission_item_t, z) }, \
54 { "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_mission_item_t, mission_type) }, \
58 #define MAVLINK_MESSAGE_INFO_MISSION_ITEM { \
61 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_mission_item_t, target_system) }, \
62 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_mission_item_t, target_component) }, \
63 { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_mission_item_t, seq) }, \
64 { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_mission_item_t, frame) }, \
65 { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_mission_item_t, command) }, \
66 { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_mission_item_t, current) }, \
67 { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_mission_item_t, autocontinue) }, \
68 { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mission_item_t, param1) }, \
69 { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mission_item_t, param2) }, \
70 { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mission_item_t, param3) }, \
71 { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_mission_item_t, param4) }, \
72 { "x", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_mission_item_t, x) }, \
73 { "y", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_mission_item_t, y) }, \
74 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_mission_item_t, z) }, \
75 { "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 37, offsetof(mavlink_mission_item_t, mission_type) }, \
81 * @brief Pack a mission_item message
82 * @param system_id ID of this system
83 * @param component_id ID of this component (e.g. 200 for IMU)
84 * @param msg The MAVLink message to compress the data into
86 * @param target_system System ID
87 * @param target_component Component ID
89 * @param frame The coordinate system of the waypoint.
90 * @param command The scheduled action for the waypoint.
91 * @param current false:0, true:1
92 * @param autocontinue Autocontinue to next waypoint
93 * @param param1 PARAM1, see MAV_CMD enum
94 * @param param2 PARAM2, see MAV_CMD enum
95 * @param param3 PARAM3, see MAV_CMD enum
96 * @param param4 PARAM4, see MAV_CMD enum
97 * @param x PARAM5 / local: X coordinate, global: latitude
98 * @param y PARAM6 / local: Y coordinate, global: longitude
99 * @param z PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame).
100 * @param mission_type Mission type.
101 * @return length of the message in bytes (excluding serial stream start sign)
103 static inline uint16_t mavlink_msg_mission_item_pack(uint8_t system_id
, uint8_t component_id
, mavlink_message_t
* msg
,
104 uint8_t target_system
, uint8_t target_component
, uint16_t seq
, uint8_t frame
, uint16_t command
, uint8_t current
, uint8_t autocontinue
, float param1
, float param2
, float param3
, float param4
, float x
, float y
, float z
, uint8_t mission_type
)
106 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
107 char buf
[MAVLINK_MSG_ID_MISSION_ITEM_LEN
];
108 _mav_put_float(buf
, 0, param1
);
109 _mav_put_float(buf
, 4, param2
);
110 _mav_put_float(buf
, 8, param3
);
111 _mav_put_float(buf
, 12, param4
);
112 _mav_put_float(buf
, 16, x
);
113 _mav_put_float(buf
, 20, y
);
114 _mav_put_float(buf
, 24, z
);
115 _mav_put_uint16_t(buf
, 28, seq
);
116 _mav_put_uint16_t(buf
, 30, command
);
117 _mav_put_uint8_t(buf
, 32, target_system
);
118 _mav_put_uint8_t(buf
, 33, target_component
);
119 _mav_put_uint8_t(buf
, 34, frame
);
120 _mav_put_uint8_t(buf
, 35, current
);
121 _mav_put_uint8_t(buf
, 36, autocontinue
);
122 _mav_put_uint8_t(buf
, 37, mission_type
);
124 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), buf
, MAVLINK_MSG_ID_MISSION_ITEM_LEN
);
126 mavlink_mission_item_t packet
;
127 packet
.param1
= param1
;
128 packet
.param2
= param2
;
129 packet
.param3
= param3
;
130 packet
.param4
= param4
;
135 packet
.command
= command
;
136 packet
.target_system
= target_system
;
137 packet
.target_component
= target_component
;
138 packet
.frame
= frame
;
139 packet
.current
= current
;
140 packet
.autocontinue
= autocontinue
;
141 packet
.mission_type
= mission_type
;
143 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_MISSION_ITEM_LEN
);
146 msg
->msgid
= MAVLINK_MSG_ID_MISSION_ITEM
;
147 return mavlink_finalize_message(msg
, system_id
, component_id
, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN
, MAVLINK_MSG_ID_MISSION_ITEM_LEN
, MAVLINK_MSG_ID_MISSION_ITEM_CRC
);
151 * @brief Pack a mission_item message on a channel
152 * @param system_id ID of this system
153 * @param component_id ID of this component (e.g. 200 for IMU)
154 * @param chan The MAVLink channel this message will be sent over
155 * @param msg The MAVLink message to compress the data into
156 * @param target_system System ID
157 * @param target_component Component ID
158 * @param seq Sequence
159 * @param frame The coordinate system of the waypoint.
160 * @param command The scheduled action for the waypoint.
161 * @param current false:0, true:1
162 * @param autocontinue Autocontinue to next waypoint
163 * @param param1 PARAM1, see MAV_CMD enum
164 * @param param2 PARAM2, see MAV_CMD enum
165 * @param param3 PARAM3, see MAV_CMD enum
166 * @param param4 PARAM4, see MAV_CMD enum
167 * @param x PARAM5 / local: X coordinate, global: latitude
168 * @param y PARAM6 / local: Y coordinate, global: longitude
169 * @param z PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame).
170 * @param mission_type Mission type.
171 * @return length of the message in bytes (excluding serial stream start sign)
173 static inline uint16_t mavlink_msg_mission_item_pack_chan(uint8_t system_id
, uint8_t component_id
, uint8_t chan
,
174 mavlink_message_t
* msg
,
175 uint8_t target_system
,uint8_t target_component
,uint16_t seq
,uint8_t frame
,uint16_t command
,uint8_t current
,uint8_t autocontinue
,float param1
,float param2
,float param3
,float param4
,float x
,float y
,float z
,uint8_t mission_type
)
177 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
178 char buf
[MAVLINK_MSG_ID_MISSION_ITEM_LEN
];
179 _mav_put_float(buf
, 0, param1
);
180 _mav_put_float(buf
, 4, param2
);
181 _mav_put_float(buf
, 8, param3
);
182 _mav_put_float(buf
, 12, param4
);
183 _mav_put_float(buf
, 16, x
);
184 _mav_put_float(buf
, 20, y
);
185 _mav_put_float(buf
, 24, z
);
186 _mav_put_uint16_t(buf
, 28, seq
);
187 _mav_put_uint16_t(buf
, 30, command
);
188 _mav_put_uint8_t(buf
, 32, target_system
);
189 _mav_put_uint8_t(buf
, 33, target_component
);
190 _mav_put_uint8_t(buf
, 34, frame
);
191 _mav_put_uint8_t(buf
, 35, current
);
192 _mav_put_uint8_t(buf
, 36, autocontinue
);
193 _mav_put_uint8_t(buf
, 37, mission_type
);
195 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), buf
, MAVLINK_MSG_ID_MISSION_ITEM_LEN
);
197 mavlink_mission_item_t packet
;
198 packet
.param1
= param1
;
199 packet
.param2
= param2
;
200 packet
.param3
= param3
;
201 packet
.param4
= param4
;
206 packet
.command
= command
;
207 packet
.target_system
= target_system
;
208 packet
.target_component
= target_component
;
209 packet
.frame
= frame
;
210 packet
.current
= current
;
211 packet
.autocontinue
= autocontinue
;
212 packet
.mission_type
= mission_type
;
214 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_MISSION_ITEM_LEN
);
217 msg
->msgid
= MAVLINK_MSG_ID_MISSION_ITEM
;
218 return mavlink_finalize_message_chan(msg
, system_id
, component_id
, chan
, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN
, MAVLINK_MSG_ID_MISSION_ITEM_LEN
, MAVLINK_MSG_ID_MISSION_ITEM_CRC
);
222 * @brief Encode a mission_item struct
224 * @param system_id ID of this system
225 * @param component_id ID of this component (e.g. 200 for IMU)
226 * @param msg The MAVLink message to compress the data into
227 * @param mission_item C-struct to read the message contents from
229 static inline uint16_t mavlink_msg_mission_item_encode(uint8_t system_id
, uint8_t component_id
, mavlink_message_t
* msg
, const mavlink_mission_item_t
* mission_item
)
231 return mavlink_msg_mission_item_pack(system_id
, component_id
, msg
, mission_item
->target_system
, mission_item
->target_component
, mission_item
->seq
, mission_item
->frame
, mission_item
->command
, mission_item
->current
, mission_item
->autocontinue
, mission_item
->param1
, mission_item
->param2
, mission_item
->param3
, mission_item
->param4
, mission_item
->x
, mission_item
->y
, mission_item
->z
, mission_item
->mission_type
);
235 * @brief Encode a mission_item struct on a channel
237 * @param system_id ID of this system
238 * @param component_id ID of this component (e.g. 200 for IMU)
239 * @param chan The MAVLink channel this message will be sent over
240 * @param msg The MAVLink message to compress the data into
241 * @param mission_item C-struct to read the message contents from
243 static inline uint16_t mavlink_msg_mission_item_encode_chan(uint8_t system_id
, uint8_t component_id
, uint8_t chan
, mavlink_message_t
* msg
, const mavlink_mission_item_t
* mission_item
)
245 return mavlink_msg_mission_item_pack_chan(system_id
, component_id
, chan
, msg
, mission_item
->target_system
, mission_item
->target_component
, mission_item
->seq
, mission_item
->frame
, mission_item
->command
, mission_item
->current
, mission_item
->autocontinue
, mission_item
->param1
, mission_item
->param2
, mission_item
->param3
, mission_item
->param4
, mission_item
->x
, mission_item
->y
, mission_item
->z
, mission_item
->mission_type
);
249 * @brief Send a mission_item message
250 * @param chan MAVLink channel to send the message
252 * @param target_system System ID
253 * @param target_component Component ID
254 * @param seq Sequence
255 * @param frame The coordinate system of the waypoint.
256 * @param command The scheduled action for the waypoint.
257 * @param current false:0, true:1
258 * @param autocontinue Autocontinue to next waypoint
259 * @param param1 PARAM1, see MAV_CMD enum
260 * @param param2 PARAM2, see MAV_CMD enum
261 * @param param3 PARAM3, see MAV_CMD enum
262 * @param param4 PARAM4, see MAV_CMD enum
263 * @param x PARAM5 / local: X coordinate, global: latitude
264 * @param y PARAM6 / local: Y coordinate, global: longitude
265 * @param z PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame).
266 * @param mission_type Mission type.
268 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
270 static inline void mavlink_msg_mission_item_send(mavlink_channel_t chan
, uint8_t target_system
, uint8_t target_component
, uint16_t seq
, uint8_t frame
, uint16_t command
, uint8_t current
, uint8_t autocontinue
, float param1
, float param2
, float param3
, float param4
, float x
, float y
, float z
, uint8_t mission_type
)
272 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
273 char buf
[MAVLINK_MSG_ID_MISSION_ITEM_LEN
];
274 _mav_put_float(buf
, 0, param1
);
275 _mav_put_float(buf
, 4, param2
);
276 _mav_put_float(buf
, 8, param3
);
277 _mav_put_float(buf
, 12, param4
);
278 _mav_put_float(buf
, 16, x
);
279 _mav_put_float(buf
, 20, y
);
280 _mav_put_float(buf
, 24, z
);
281 _mav_put_uint16_t(buf
, 28, seq
);
282 _mav_put_uint16_t(buf
, 30, command
);
283 _mav_put_uint8_t(buf
, 32, target_system
);
284 _mav_put_uint8_t(buf
, 33, target_component
);
285 _mav_put_uint8_t(buf
, 34, frame
);
286 _mav_put_uint8_t(buf
, 35, current
);
287 _mav_put_uint8_t(buf
, 36, autocontinue
);
288 _mav_put_uint8_t(buf
, 37, mission_type
);
290 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_MISSION_ITEM
, buf
, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN
, MAVLINK_MSG_ID_MISSION_ITEM_LEN
, MAVLINK_MSG_ID_MISSION_ITEM_CRC
);
292 mavlink_mission_item_t packet
;
293 packet
.param1
= param1
;
294 packet
.param2
= param2
;
295 packet
.param3
= param3
;
296 packet
.param4
= param4
;
301 packet
.command
= command
;
302 packet
.target_system
= target_system
;
303 packet
.target_component
= target_component
;
304 packet
.frame
= frame
;
305 packet
.current
= current
;
306 packet
.autocontinue
= autocontinue
;
307 packet
.mission_type
= mission_type
;
309 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_MISSION_ITEM
, (const char *)&packet
, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN
, MAVLINK_MSG_ID_MISSION_ITEM_LEN
, MAVLINK_MSG_ID_MISSION_ITEM_CRC
);
314 * @brief Send a mission_item message
315 * @param chan MAVLink channel to send the message
316 * @param struct The MAVLink struct to serialize
318 static inline void mavlink_msg_mission_item_send_struct(mavlink_channel_t chan
, const mavlink_mission_item_t
* mission_item
)
320 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
321 mavlink_msg_mission_item_send(chan
, mission_item
->target_system
, mission_item
->target_component
, mission_item
->seq
, mission_item
->frame
, mission_item
->command
, mission_item
->current
, mission_item
->autocontinue
, mission_item
->param1
, mission_item
->param2
, mission_item
->param3
, mission_item
->param4
, mission_item
->x
, mission_item
->y
, mission_item
->z
, mission_item
->mission_type
);
323 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_MISSION_ITEM
, (const char *)mission_item
, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN
, MAVLINK_MSG_ID_MISSION_ITEM_LEN
, MAVLINK_MSG_ID_MISSION_ITEM_CRC
);
327 #if MAVLINK_MSG_ID_MISSION_ITEM_LEN <= MAVLINK_MAX_PAYLOAD_LEN
329 This varient of _send() can be used to save stack space by re-using
330 memory from the receive buffer. The caller provides a
331 mavlink_message_t which is the size of a full mavlink message. This
332 is usually the receive buffer for the channel, and allows a reply to an
333 incoming message with minimum stack space usage.
335 static inline void mavlink_msg_mission_item_send_buf(mavlink_message_t
*msgbuf
, mavlink_channel_t chan
, uint8_t target_system
, uint8_t target_component
, uint16_t seq
, uint8_t frame
, uint16_t command
, uint8_t current
, uint8_t autocontinue
, float param1
, float param2
, float param3
, float param4
, float x
, float y
, float z
, uint8_t mission_type
)
337 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
338 char *buf
= (char *)msgbuf
;
339 _mav_put_float(buf
, 0, param1
);
340 _mav_put_float(buf
, 4, param2
);
341 _mav_put_float(buf
, 8, param3
);
342 _mav_put_float(buf
, 12, param4
);
343 _mav_put_float(buf
, 16, x
);
344 _mav_put_float(buf
, 20, y
);
345 _mav_put_float(buf
, 24, z
);
346 _mav_put_uint16_t(buf
, 28, seq
);
347 _mav_put_uint16_t(buf
, 30, command
);
348 _mav_put_uint8_t(buf
, 32, target_system
);
349 _mav_put_uint8_t(buf
, 33, target_component
);
350 _mav_put_uint8_t(buf
, 34, frame
);
351 _mav_put_uint8_t(buf
, 35, current
);
352 _mav_put_uint8_t(buf
, 36, autocontinue
);
353 _mav_put_uint8_t(buf
, 37, mission_type
);
355 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_MISSION_ITEM
, buf
, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN
, MAVLINK_MSG_ID_MISSION_ITEM_LEN
, MAVLINK_MSG_ID_MISSION_ITEM_CRC
);
357 mavlink_mission_item_t
*packet
= (mavlink_mission_item_t
*)msgbuf
;
358 packet
->param1
= param1
;
359 packet
->param2
= param2
;
360 packet
->param3
= param3
;
361 packet
->param4
= param4
;
366 packet
->command
= command
;
367 packet
->target_system
= target_system
;
368 packet
->target_component
= target_component
;
369 packet
->frame
= frame
;
370 packet
->current
= current
;
371 packet
->autocontinue
= autocontinue
;
372 packet
->mission_type
= mission_type
;
374 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_MISSION_ITEM
, (const char *)packet
, MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN
, MAVLINK_MSG_ID_MISSION_ITEM_LEN
, MAVLINK_MSG_ID_MISSION_ITEM_CRC
);
381 // MESSAGE MISSION_ITEM UNPACKING
385 * @brief Get field target_system from mission_item message
389 static inline uint8_t mavlink_msg_mission_item_get_target_system(const mavlink_message_t
* msg
)
391 return _MAV_RETURN_uint8_t(msg
, 32);
395 * @brief Get field target_component from mission_item message
397 * @return Component ID
399 static inline uint8_t mavlink_msg_mission_item_get_target_component(const mavlink_message_t
* msg
)
401 return _MAV_RETURN_uint8_t(msg
, 33);
405 * @brief Get field seq from mission_item message
409 static inline uint16_t mavlink_msg_mission_item_get_seq(const mavlink_message_t
* msg
)
411 return _MAV_RETURN_uint16_t(msg
, 28);
415 * @brief Get field frame from mission_item message
417 * @return The coordinate system of the waypoint.
419 static inline uint8_t mavlink_msg_mission_item_get_frame(const mavlink_message_t
* msg
)
421 return _MAV_RETURN_uint8_t(msg
, 34);
425 * @brief Get field command from mission_item message
427 * @return The scheduled action for the waypoint.
429 static inline uint16_t mavlink_msg_mission_item_get_command(const mavlink_message_t
* msg
)
431 return _MAV_RETURN_uint16_t(msg
, 30);
435 * @brief Get field current from mission_item message
437 * @return false:0, true:1
439 static inline uint8_t mavlink_msg_mission_item_get_current(const mavlink_message_t
* msg
)
441 return _MAV_RETURN_uint8_t(msg
, 35);
445 * @brief Get field autocontinue from mission_item message
447 * @return Autocontinue to next waypoint
449 static inline uint8_t mavlink_msg_mission_item_get_autocontinue(const mavlink_message_t
* msg
)
451 return _MAV_RETURN_uint8_t(msg
, 36);
455 * @brief Get field param1 from mission_item message
457 * @return PARAM1, see MAV_CMD enum
459 static inline float mavlink_msg_mission_item_get_param1(const mavlink_message_t
* msg
)
461 return _MAV_RETURN_float(msg
, 0);
465 * @brief Get field param2 from mission_item message
467 * @return PARAM2, see MAV_CMD enum
469 static inline float mavlink_msg_mission_item_get_param2(const mavlink_message_t
* msg
)
471 return _MAV_RETURN_float(msg
, 4);
475 * @brief Get field param3 from mission_item message
477 * @return PARAM3, see MAV_CMD enum
479 static inline float mavlink_msg_mission_item_get_param3(const mavlink_message_t
* msg
)
481 return _MAV_RETURN_float(msg
, 8);
485 * @brief Get field param4 from mission_item message
487 * @return PARAM4, see MAV_CMD enum
489 static inline float mavlink_msg_mission_item_get_param4(const mavlink_message_t
* msg
)
491 return _MAV_RETURN_float(msg
, 12);
495 * @brief Get field x from mission_item message
497 * @return PARAM5 / local: X coordinate, global: latitude
499 static inline float mavlink_msg_mission_item_get_x(const mavlink_message_t
* msg
)
501 return _MAV_RETURN_float(msg
, 16);
505 * @brief Get field y from mission_item message
507 * @return PARAM6 / local: Y coordinate, global: longitude
509 static inline float mavlink_msg_mission_item_get_y(const mavlink_message_t
* msg
)
511 return _MAV_RETURN_float(msg
, 20);
515 * @brief Get field z from mission_item message
517 * @return PARAM7 / local: Z coordinate, global: altitude (relative or absolute, depending on frame).
519 static inline float mavlink_msg_mission_item_get_z(const mavlink_message_t
* msg
)
521 return _MAV_RETURN_float(msg
, 24);
525 * @brief Get field mission_type from mission_item message
527 * @return Mission type.
529 static inline uint8_t mavlink_msg_mission_item_get_mission_type(const mavlink_message_t
* msg
)
531 return _MAV_RETURN_uint8_t(msg
, 37);
535 * @brief Decode a mission_item message into a struct
537 * @param msg The message to decode
538 * @param mission_item C-struct to decode the message contents into
540 static inline void mavlink_msg_mission_item_decode(const mavlink_message_t
* msg
, mavlink_mission_item_t
* mission_item
)
542 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
543 mission_item
->param1
= mavlink_msg_mission_item_get_param1(msg
);
544 mission_item
->param2
= mavlink_msg_mission_item_get_param2(msg
);
545 mission_item
->param3
= mavlink_msg_mission_item_get_param3(msg
);
546 mission_item
->param4
= mavlink_msg_mission_item_get_param4(msg
);
547 mission_item
->x
= mavlink_msg_mission_item_get_x(msg
);
548 mission_item
->y
= mavlink_msg_mission_item_get_y(msg
);
549 mission_item
->z
= mavlink_msg_mission_item_get_z(msg
);
550 mission_item
->seq
= mavlink_msg_mission_item_get_seq(msg
);
551 mission_item
->command
= mavlink_msg_mission_item_get_command(msg
);
552 mission_item
->target_system
= mavlink_msg_mission_item_get_target_system(msg
);
553 mission_item
->target_component
= mavlink_msg_mission_item_get_target_component(msg
);
554 mission_item
->frame
= mavlink_msg_mission_item_get_frame(msg
);
555 mission_item
->current
= mavlink_msg_mission_item_get_current(msg
);
556 mission_item
->autocontinue
= mavlink_msg_mission_item_get_autocontinue(msg
);
557 mission_item
->mission_type
= mavlink_msg_mission_item_get_mission_type(msg
);
559 uint8_t len
= msg
->len
< MAVLINK_MSG_ID_MISSION_ITEM_LEN
? msg
->len
: MAVLINK_MSG_ID_MISSION_ITEM_LEN
;
560 memset(mission_item
, 0, MAVLINK_MSG_ID_MISSION_ITEM_LEN
);
561 memcpy(mission_item
, _MAV_PAYLOAD(msg
), len
);