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