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