Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_mission_current.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE MISSION_CURRENT PACKING
3
4#define MAVLINK_MSG_ID_MISSION_CURRENT 42
5
6MAVPACKED(
7typedef struct __mavlink_mission_current_t {
8 uint16_t seq; /*< Sequence*/
9 uint16_t total; /*< Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle.*/
10 uint8_t mission_state; /*< Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported.*/
11 uint8_t mission_mode; /*< Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode).*/
12 uint32_t mission_id; /*< Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK).*/
13 uint32_t fence_id; /*< Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK).*/
14 uint32_t rally_points_id; /*< Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK).*/
15}) mavlink_mission_current_t;
16
17#define MAVLINK_MSG_ID_MISSION_CURRENT_LEN 18
18#define MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN 2
19#define MAVLINK_MSG_ID_42_LEN 18
20#define MAVLINK_MSG_ID_42_MIN_LEN 2
21
22#define MAVLINK_MSG_ID_MISSION_CURRENT_CRC 28
23#define MAVLINK_MSG_ID_42_CRC 28
24
25
26
27#if MAVLINK_COMMAND_24BIT
28#define MAVLINK_MESSAGE_INFO_MISSION_CURRENT {
29 42,
30 "MISSION_CURRENT",
31 7,
32 { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_current_t, seq) },
33 { "total", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_mission_current_t, total) },
34 { "mission_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_current_t, mission_state) },
35 { "mission_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_current_t, mission_mode) },
36 { "mission_id", NULL, MAVLINK_TYPE_UINT32_T, 0, 6, offsetof(mavlink_mission_current_t, mission_id) },
37 { "fence_id", NULL, MAVLINK_TYPE_UINT32_T, 0, 10, offsetof(mavlink_mission_current_t, fence_id) },
38 { "rally_points_id", NULL, MAVLINK_TYPE_UINT32_T, 0, 14, offsetof(mavlink_mission_current_t, rally_points_id) },
39 } \
40}
41#else
42#define MAVLINK_MESSAGE_INFO_MISSION_CURRENT {
43 "MISSION_CURRENT",
44 7,
45 { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_current_t, seq) },
46 { "total", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_mission_current_t, total) },
47 { "mission_state", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_current_t, mission_state) },
48 { "mission_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_current_t, mission_mode) },
49 { "mission_id", NULL, MAVLINK_TYPE_UINT32_T, 0, 6, offsetof(mavlink_mission_current_t, mission_id) },
50 { "fence_id", NULL, MAVLINK_TYPE_UINT32_T, 0, 10, offsetof(mavlink_mission_current_t, fence_id) },
51 { "rally_points_id", NULL, MAVLINK_TYPE_UINT32_T, 0, 14, offsetof(mavlink_mission_current_t, rally_points_id) },
52 } \
53}
54#endif
55
56/**
57 * @brief Pack a mission_current message
58 * @param system_id ID of this system
59 * @param component_id ID of this component (e.g. 200 for IMU)
60 * @param msg The MAVLink message to compress the data into
61 *
62 * @param seq Sequence
63 * @param total Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle.
64 * @param mission_state Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported.
65 * @param mission_mode Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode).
66 * @param mission_id Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK).
67 * @param fence_id Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK).
68 * @param rally_points_id Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK).
69 * @return length of the message in bytes (excluding serial stream start sign)
70 */
71static inline uint16_t mavlink_msg_mission_current_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
72 uint16_t seq, uint16_t total, uint8_t mission_state, uint8_t mission_mode, uint32_t mission_id, uint32_t fence_id, uint32_t rally_points_id)
73{
74#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
76 _mav_put_uint16_t(buf, 0, seq);
77 _mav_put_uint16_t(buf, 2, total);
78 _mav_put_uint8_t(buf, 4, mission_state);
79 _mav_put_uint8_t(buf, 5, mission_mode);
80 _mav_put_uint32_t(buf, 6, mission_id);
81 _mav_put_uint32_t(buf, 10, fence_id);
82 _mav_put_uint32_t(buf, 14, rally_points_id);
83
84 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_CURRENT_LEN);
85#else
86 mavlink_mission_current_t packet;
87 packet.seq = seq;
88 packet.total = total;
89 packet.mission_state = mission_state;
90 packet.mission_mode = mission_mode;
91 packet.mission_id = mission_id;
92 packet.fence_id = fence_id;
93 packet.rally_points_id = rally_points_id;
94
95 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_CURRENT_LEN);
96#endif
97
99 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC);
100}
101
102/**
103 * @brief Pack a mission_current message
104 * @param system_id ID of this system
105 * @param component_id ID of this component (e.g. 200 for IMU)
106 * @param status MAVLink status structure
107 * @param msg The MAVLink message to compress the data into
108 *
109 * @param seq Sequence
110 * @param total Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle.
111 * @param mission_state Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported.
112 * @param mission_mode Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode).
113 * @param mission_id Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK).
114 * @param fence_id Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK).
115 * @param rally_points_id Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK).
116 * @return length of the message in bytes (excluding serial stream start sign)
117 */
118static inline uint16_t mavlink_msg_mission_current_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
119 uint16_t seq, uint16_t total, uint8_t mission_state, uint8_t mission_mode, uint32_t mission_id, uint32_t fence_id, uint32_t rally_points_id)
120{
121#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
123 _mav_put_uint16_t(buf, 0, seq);
124 _mav_put_uint16_t(buf, 2, total);
125 _mav_put_uint8_t(buf, 4, mission_state);
126 _mav_put_uint8_t(buf, 5, mission_mode);
127 _mav_put_uint32_t(buf, 6, mission_id);
128 _mav_put_uint32_t(buf, 10, fence_id);
129 _mav_put_uint32_t(buf, 14, rally_points_id);
130
131 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_CURRENT_LEN);
132#else
133 mavlink_mission_current_t packet;
134 packet.seq = seq;
135 packet.total = total;
136 packet.mission_state = mission_state;
137 packet.mission_mode = mission_mode;
138 packet.mission_id = mission_id;
139 packet.fence_id = fence_id;
140 packet.rally_points_id = rally_points_id;
141
142 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_CURRENT_LEN);
143#endif
144
146#if MAVLINK_CRC_EXTRA
147 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC);
148#else
149 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN);
150#endif
151}
152
153/**
154 * @brief Pack a mission_current message on a channel
155 * @param system_id ID of this system
156 * @param component_id ID of this component (e.g. 200 for IMU)
157 * @param chan The MAVLink channel this message will be sent over
158 * @param msg The MAVLink message to compress the data into
159 * @param seq Sequence
160 * @param total Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle.
161 * @param mission_state Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported.
162 * @param mission_mode Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode).
163 * @param mission_id Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK).
164 * @param fence_id Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK).
165 * @param rally_points_id Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK).
166 * @return length of the message in bytes (excluding serial stream start sign)
167 */
168static inline uint16_t mavlink_msg_mission_current_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
169 mavlink_message_t* msg,
170 uint16_t seq,uint16_t total,uint8_t mission_state,uint8_t mission_mode,uint32_t mission_id,uint32_t fence_id,uint32_t rally_points_id)
171{
172#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
174 _mav_put_uint16_t(buf, 0, seq);
175 _mav_put_uint16_t(buf, 2, total);
176 _mav_put_uint8_t(buf, 4, mission_state);
177 _mav_put_uint8_t(buf, 5, mission_mode);
178 _mav_put_uint32_t(buf, 6, mission_id);
179 _mav_put_uint32_t(buf, 10, fence_id);
180 _mav_put_uint32_t(buf, 14, rally_points_id);
181
182 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_CURRENT_LEN);
183#else
184 mavlink_mission_current_t packet;
185 packet.seq = seq;
186 packet.total = total;
187 packet.mission_state = mission_state;
188 packet.mission_mode = mission_mode;
189 packet.mission_id = mission_id;
190 packet.fence_id = fence_id;
191 packet.rally_points_id = rally_points_id;
192
193 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_CURRENT_LEN);
194#endif
195
197 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC);
198}
199
200/**
201 * @brief Encode a mission_current struct
202 *
203 * @param system_id ID of this system
204 * @param component_id ID of this component (e.g. 200 for IMU)
205 * @param msg The MAVLink message to compress the data into
206 * @param mission_current C-struct to read the message contents from
207 */
208static inline uint16_t mavlink_msg_mission_current_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_current_t* mission_current)
209{
210 return mavlink_msg_mission_current_pack(system_id, component_id, msg, mission_current->seq, mission_current->total, mission_current->mission_state, mission_current->mission_mode, mission_current->mission_id, mission_current->fence_id, mission_current->rally_points_id);
211}
212
213/**
214 * @brief Encode a mission_current struct on a channel
215 *
216 * @param system_id ID of this system
217 * @param component_id ID of this component (e.g. 200 for IMU)
218 * @param chan The MAVLink channel this message will be sent over
219 * @param msg The MAVLink message to compress the data into
220 * @param mission_current C-struct to read the message contents from
221 */
222static inline uint16_t mavlink_msg_mission_current_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_current_t* mission_current)
223{
224 return mavlink_msg_mission_current_pack_chan(system_id, component_id, chan, msg, mission_current->seq, mission_current->total, mission_current->mission_state, mission_current->mission_mode, mission_current->mission_id, mission_current->fence_id, mission_current->rally_points_id);
225}
226
227/**
228 * @brief Encode a mission_current struct with provided status structure
229 *
230 * @param system_id ID of this system
231 * @param component_id ID of this component (e.g. 200 for IMU)
232 * @param status MAVLink status structure
233 * @param msg The MAVLink message to compress the data into
234 * @param mission_current C-struct to read the message contents from
235 */
236static inline uint16_t mavlink_msg_mission_current_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_mission_current_t* mission_current)
237{
238 return mavlink_msg_mission_current_pack_status(system_id, component_id, _status, msg, mission_current->seq, mission_current->total, mission_current->mission_state, mission_current->mission_mode, mission_current->mission_id, mission_current->fence_id, mission_current->rally_points_id);
239}
240
241/**
242 * @brief Send a mission_current message
243 * @param chan MAVLink channel to send the message
244 *
245 * @param seq Sequence
246 * @param total Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle.
247 * @param mission_state Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported.
248 * @param mission_mode Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode).
249 * @param mission_id Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK).
250 * @param fence_id Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK).
251 * @param rally_points_id Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK).
252 */
253#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
254
255static inline void mavlink_msg_mission_current_send(mavlink_channel_t chan, uint16_t seq, uint16_t total, uint8_t mission_state, uint8_t mission_mode, uint32_t mission_id, uint32_t fence_id, uint32_t rally_points_id)
256{
257#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
258 char buf[MAVLINK_MSG_ID_MISSION_CURRENT_LEN];
259 _mav_put_uint16_t(buf, 0, seq);
260 _mav_put_uint16_t(buf, 2, total);
261 _mav_put_uint8_t(buf, 4, mission_state);
262 _mav_put_uint8_t(buf, 5, mission_mode);
263 _mav_put_uint32_t(buf, 6, mission_id);
264 _mav_put_uint32_t(buf, 10, fence_id);
265 _mav_put_uint32_t(buf, 14, rally_points_id);
266
267 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, buf, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC);
268#else
269 mavlink_mission_current_t packet;
270 packet.seq = seq;
271 packet.total = total;
272 packet.mission_state = mission_state;
273 packet.mission_mode = mission_mode;
274 packet.mission_id = mission_id;
275 packet.fence_id = fence_id;
276 packet.rally_points_id = rally_points_id;
277
278 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, (const char *)&packet, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC);
279#endif
280}
281
282/**
283 * @brief Send a mission_current message
284 * @param chan MAVLink channel to send the message
285 * @param struct The MAVLink struct to serialize
286 */
287static inline void mavlink_msg_mission_current_send_struct(mavlink_channel_t chan, const mavlink_mission_current_t* mission_current)
288{
289#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
290 mavlink_msg_mission_current_send(chan, mission_current->seq, mission_current->total, mission_current->mission_state, mission_current->mission_mode, mission_current->mission_id, mission_current->fence_id, mission_current->rally_points_id);
291#else
292 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, (const char *)mission_current, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC);
293#endif
294}
295
296#if MAVLINK_MSG_ID_MISSION_CURRENT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
297/*
298 This variant of _send() can be used to save stack space by reusing
299 memory from the receive buffer. The caller provides a
300 mavlink_message_t which is the size of a full mavlink message. This
301 is usually the receive buffer for the channel, and allows a reply to an
302 incoming message with minimum stack space usage.
303 */
304static inline void mavlink_msg_mission_current_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t seq, uint16_t total, uint8_t mission_state, uint8_t mission_mode, uint32_t mission_id, uint32_t fence_id, uint32_t rally_points_id)
305{
306#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
307 char *buf = (char *)msgbuf;
308 _mav_put_uint16_t(buf, 0, seq);
309 _mav_put_uint16_t(buf, 2, total);
310 _mav_put_uint8_t(buf, 4, mission_state);
311 _mav_put_uint8_t(buf, 5, mission_mode);
312 _mav_put_uint32_t(buf, 6, mission_id);
313 _mav_put_uint32_t(buf, 10, fence_id);
314 _mav_put_uint32_t(buf, 14, rally_points_id);
315
316 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, buf, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC);
317#else
318 mavlink_mission_current_t *packet = (mavlink_mission_current_t *)msgbuf;
319 packet->seq = seq;
320 packet->total = total;
321 packet->mission_state = mission_state;
322 packet->mission_mode = mission_mode;
323 packet->mission_id = mission_id;
324 packet->fence_id = fence_id;
325 packet->rally_points_id = rally_points_id;
326
327 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CURRENT, (const char *)packet, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_LEN, MAVLINK_MSG_ID_MISSION_CURRENT_CRC);
328#endif
329}
330#endif
331
332#endif
333
334// MESSAGE MISSION_CURRENT UNPACKING
335
336
337/**
338 * @brief Get field seq from mission_current message
339 *
340 * @return Sequence
341 */
342static inline uint16_t mavlink_msg_mission_current_get_seq(const mavlink_message_t* msg)
343{
344 return _MAV_RETURN_uint16_t(msg, 0);
345}
346
347/**
348 * @brief Get field total from mission_current message
349 *
350 * @return Total number of mission items on vehicle (on last item, sequence == total). If the autopilot stores its home location as part of the mission this will be excluded from the total. 0: Not supported, UINT16_MAX if no mission is present on the vehicle.
351 */
352static inline uint16_t mavlink_msg_mission_current_get_total(const mavlink_message_t* msg)
353{
354 return _MAV_RETURN_uint16_t(msg, 2);
355}
356
357/**
358 * @brief Get field mission_state from mission_current message
359 *
360 * @return Mission state machine state. MISSION_STATE_UNKNOWN if state reporting not supported.
361 */
362static inline uint8_t mavlink_msg_mission_current_get_mission_state(const mavlink_message_t* msg)
363{
364 return _MAV_RETURN_uint8_t(msg, 4);
365}
366
367/**
368 * @brief Get field mission_mode from mission_current message
369 *
370 * @return Vehicle is in a mode that can execute mission items or suspended. 0: Unknown, 1: In mission mode, 2: Suspended (not in mission mode).
371 */
372static inline uint8_t mavlink_msg_mission_current_get_mission_mode(const mavlink_message_t* msg)
373{
374 return _MAV_RETURN_uint8_t(msg, 5);
375}
376
377/**
378 * @brief Get field mission_id from mission_current message
379 *
380 * @return Id of current on-vehicle mission plan, or 0 if IDs are not supported or there is no mission loaded. GCS can use this to track changes to the mission plan type. The same value is returned on mission upload (in the MISSION_ACK).
381 */
382static inline uint32_t mavlink_msg_mission_current_get_mission_id(const mavlink_message_t* msg)
383{
384 return _MAV_RETURN_uint32_t(msg, 6);
385}
386
387/**
388 * @brief Get field fence_id from mission_current message
389 *
390 * @return Id of current on-vehicle fence plan, or 0 if IDs are not supported or there is no fence loaded. GCS can use this to track changes to the fence plan type. The same value is returned on fence upload (in the MISSION_ACK).
391 */
392static inline uint32_t mavlink_msg_mission_current_get_fence_id(const mavlink_message_t* msg)
393{
394 return _MAV_RETURN_uint32_t(msg, 10);
395}
396
397/**
398 * @brief Get field rally_points_id from mission_current message
399 *
400 * @return Id of current on-vehicle rally point plan, or 0 if IDs are not supported or there are no rally points loaded. GCS can use this to track changes to the rally point plan type. The same value is returned on rally point upload (in the MISSION_ACK).
401 */
402static inline uint32_t mavlink_msg_mission_current_get_rally_points_id(const mavlink_message_t* msg)
403{
404 return _MAV_RETURN_uint32_t(msg, 14);
405}
406
407/**
408 * @brief Decode a mission_current message into a struct
409 *
410 * @param msg The message to decode
411 * @param mission_current C-struct to decode the message contents into
412 */
413static inline void mavlink_msg_mission_current_decode(const mavlink_message_t* msg, mavlink_mission_current_t* mission_current)
414{
415#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
416 mission_current->seq = mavlink_msg_mission_current_get_seq(msg);
417 mission_current->total = mavlink_msg_mission_current_get_total(msg);
418 mission_current->mission_state = mavlink_msg_mission_current_get_mission_state(msg);
419 mission_current->mission_mode = mavlink_msg_mission_current_get_mission_mode(msg);
420 mission_current->mission_id = mavlink_msg_mission_current_get_mission_id(msg);
421 mission_current->fence_id = mavlink_msg_mission_current_get_fence_id(msg);
422 mission_current->rally_points_id = mavlink_msg_mission_current_get_rally_points_id(msg);
423#else
424 uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_CURRENT_LEN? msg->len : MAVLINK_MSG_ID_MISSION_CURRENT_LEN;
425 memset(mission_current, 0, MAVLINK_MSG_ID_MISSION_CURRENT_LEN);
426 memcpy(mission_current, _MAV_PAYLOAD(msg), len);
427#endif
428}