Merge remote-tracking branch 'upstream/master' into abo_fw_alt_vel_control
[inav.git] / lib / main / MAVLink / common / mavlink_msg_command_int.h
bloba23f50895c21378331144438e782b214e0595c3f
1 #pragma once
2 // MESSAGE COMMAND_INT PACKING
4 #define MAVLINK_MSG_ID_COMMAND_INT 75
7 typedef 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;
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
28 #define MAVLINK_MSG_ID_COMMAND_INT_CRC 158
29 #define MAVLINK_MSG_ID_75_CRC 158
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 } \
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 } \
72 #endif
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
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)
95 static 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)
98 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
99 char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN];
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);
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;
131 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_INT_LEN);
132 #endif
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);
139 * @brief Pack a command_int message on a channel
140 * @param system_id ID of this system
141 * @param component_id ID of this component (e.g. 200 for IMU)
142 * @param chan The MAVLink channel this message will be sent over
143 * @param msg The MAVLink message to compress the data into
144 * @param target_system System ID
145 * @param target_component Component ID
146 * @param frame The coordinate system of the COMMAND.
147 * @param command The scheduled action for the mission item.
148 * @param current Not used.
149 * @param autocontinue Not used (set 0).
150 * @param param1 PARAM1, see MAV_CMD enum
151 * @param param2 PARAM2, see MAV_CMD enum
152 * @param param3 PARAM3, see MAV_CMD enum
153 * @param param4 PARAM4, see MAV_CMD enum
154 * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
155 * @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
156 * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame).
157 * @return length of the message in bytes (excluding serial stream start sign)
159 static inline uint16_t mavlink_msg_command_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
160 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)
163 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
164 char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN];
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);
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;
196 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_INT_LEN);
197 #endif
199 msg->msgid = MAVLINK_MSG_ID_COMMAND_INT;
200 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);
204 * @brief Encode a command_int struct
206 * @param system_id ID of this system
207 * @param component_id ID of this component (e.g. 200 for IMU)
208 * @param msg The MAVLink message to compress the data into
209 * @param command_int C-struct to read the message contents from
211 static 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)
213 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);
217 * @brief Encode a command_int struct on a channel
219 * @param system_id ID of this system
220 * @param component_id ID of this component (e.g. 200 for IMU)
221 * @param chan The MAVLink channel this message will be sent over
222 * @param msg The MAVLink message to compress the data into
223 * @param command_int C-struct to read the message contents from
225 static 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)
227 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);
231 * @brief Send a command_int message
232 * @param chan MAVLink channel to send the message
234 * @param target_system System ID
235 * @param target_component Component ID
236 * @param frame The coordinate system of the COMMAND.
237 * @param command The scheduled action for the mission item.
238 * @param current Not used.
239 * @param autocontinue Not used (set 0).
240 * @param param1 PARAM1, see MAV_CMD enum
241 * @param param2 PARAM2, see MAV_CMD enum
242 * @param param3 PARAM3, see MAV_CMD enum
243 * @param param4 PARAM4, see MAV_CMD enum
244 * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
245 * @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
246 * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame).
248 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
250 static 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)
252 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
253 char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN];
254 _mav_put_float(buf, 0, param1);
255 _mav_put_float(buf, 4, param2);
256 _mav_put_float(buf, 8, param3);
257 _mav_put_float(buf, 12, param4);
258 _mav_put_int32_t(buf, 16, x);
259 _mav_put_int32_t(buf, 20, y);
260 _mav_put_float(buf, 24, z);
261 _mav_put_uint16_t(buf, 28, command);
262 _mav_put_uint8_t(buf, 30, target_system);
263 _mav_put_uint8_t(buf, 31, target_component);
264 _mav_put_uint8_t(buf, 32, frame);
265 _mav_put_uint8_t(buf, 33, current);
266 _mav_put_uint8_t(buf, 34, autocontinue);
268 _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);
269 #else
270 mavlink_command_int_t packet;
271 packet.param1 = param1;
272 packet.param2 = param2;
273 packet.param3 = param3;
274 packet.param4 = param4;
275 packet.x = x;
276 packet.y = y;
277 packet.z = z;
278 packet.command = command;
279 packet.target_system = target_system;
280 packet.target_component = target_component;
281 packet.frame = frame;
282 packet.current = current;
283 packet.autocontinue = autocontinue;
285 _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);
286 #endif
290 * @brief Send a command_int message
291 * @param chan MAVLink channel to send the message
292 * @param struct The MAVLink struct to serialize
294 static inline void mavlink_msg_command_int_send_struct(mavlink_channel_t chan, const mavlink_command_int_t* command_int)
296 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
297 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);
298 #else
299 _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);
300 #endif
303 #if MAVLINK_MSG_ID_COMMAND_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
305 This varient of _send() can be used to save stack space by re-using
306 memory from the receive buffer. The caller provides a
307 mavlink_message_t which is the size of a full mavlink message. This
308 is usually the receive buffer for the channel, and allows a reply to an
309 incoming message with minimum stack space usage.
311 static 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)
313 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
314 char *buf = (char *)msgbuf;
315 _mav_put_float(buf, 0, param1);
316 _mav_put_float(buf, 4, param2);
317 _mav_put_float(buf, 8, param3);
318 _mav_put_float(buf, 12, param4);
319 _mav_put_int32_t(buf, 16, x);
320 _mav_put_int32_t(buf, 20, y);
321 _mav_put_float(buf, 24, z);
322 _mav_put_uint16_t(buf, 28, command);
323 _mav_put_uint8_t(buf, 30, target_system);
324 _mav_put_uint8_t(buf, 31, target_component);
325 _mav_put_uint8_t(buf, 32, frame);
326 _mav_put_uint8_t(buf, 33, current);
327 _mav_put_uint8_t(buf, 34, autocontinue);
329 _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);
330 #else
331 mavlink_command_int_t *packet = (mavlink_command_int_t *)msgbuf;
332 packet->param1 = param1;
333 packet->param2 = param2;
334 packet->param3 = param3;
335 packet->param4 = param4;
336 packet->x = x;
337 packet->y = y;
338 packet->z = z;
339 packet->command = command;
340 packet->target_system = target_system;
341 packet->target_component = target_component;
342 packet->frame = frame;
343 packet->current = current;
344 packet->autocontinue = autocontinue;
346 _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);
347 #endif
349 #endif
351 #endif
353 // MESSAGE COMMAND_INT UNPACKING
357 * @brief Get field target_system from command_int message
359 * @return System ID
361 static inline uint8_t mavlink_msg_command_int_get_target_system(const mavlink_message_t* msg)
363 return _MAV_RETURN_uint8_t(msg, 30);
367 * @brief Get field target_component from command_int message
369 * @return Component ID
371 static inline uint8_t mavlink_msg_command_int_get_target_component(const mavlink_message_t* msg)
373 return _MAV_RETURN_uint8_t(msg, 31);
377 * @brief Get field frame from command_int message
379 * @return The coordinate system of the COMMAND.
381 static inline uint8_t mavlink_msg_command_int_get_frame(const mavlink_message_t* msg)
383 return _MAV_RETURN_uint8_t(msg, 32);
387 * @brief Get field command from command_int message
389 * @return The scheduled action for the mission item.
391 static inline uint16_t mavlink_msg_command_int_get_command(const mavlink_message_t* msg)
393 return _MAV_RETURN_uint16_t(msg, 28);
397 * @brief Get field current from command_int message
399 * @return Not used.
401 static inline uint8_t mavlink_msg_command_int_get_current(const mavlink_message_t* msg)
403 return _MAV_RETURN_uint8_t(msg, 33);
407 * @brief Get field autocontinue from command_int message
409 * @return Not used (set 0).
411 static inline uint8_t mavlink_msg_command_int_get_autocontinue(const mavlink_message_t* msg)
413 return _MAV_RETURN_uint8_t(msg, 34);
417 * @brief Get field param1 from command_int message
419 * @return PARAM1, see MAV_CMD enum
421 static inline float mavlink_msg_command_int_get_param1(const mavlink_message_t* msg)
423 return _MAV_RETURN_float(msg, 0);
427 * @brief Get field param2 from command_int message
429 * @return PARAM2, see MAV_CMD enum
431 static inline float mavlink_msg_command_int_get_param2(const mavlink_message_t* msg)
433 return _MAV_RETURN_float(msg, 4);
437 * @brief Get field param3 from command_int message
439 * @return PARAM3, see MAV_CMD enum
441 static inline float mavlink_msg_command_int_get_param3(const mavlink_message_t* msg)
443 return _MAV_RETURN_float(msg, 8);
447 * @brief Get field param4 from command_int message
449 * @return PARAM4, see MAV_CMD enum
451 static inline float mavlink_msg_command_int_get_param4(const mavlink_message_t* msg)
453 return _MAV_RETURN_float(msg, 12);
457 * @brief Get field x from command_int message
459 * @return PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
461 static inline int32_t mavlink_msg_command_int_get_x(const mavlink_message_t* msg)
463 return _MAV_RETURN_int32_t(msg, 16);
467 * @brief Get field y from command_int message
469 * @return PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
471 static inline int32_t mavlink_msg_command_int_get_y(const mavlink_message_t* msg)
473 return _MAV_RETURN_int32_t(msg, 20);
477 * @brief Get field z from command_int message
479 * @return PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame).
481 static inline float mavlink_msg_command_int_get_z(const mavlink_message_t* msg)
483 return _MAV_RETURN_float(msg, 24);
487 * @brief Decode a command_int message into a struct
489 * @param msg The message to decode
490 * @param command_int C-struct to decode the message contents into
492 static inline void mavlink_msg_command_int_decode(const mavlink_message_t* msg, mavlink_command_int_t* command_int)
494 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
495 command_int->param1 = mavlink_msg_command_int_get_param1(msg);
496 command_int->param2 = mavlink_msg_command_int_get_param2(msg);
497 command_int->param3 = mavlink_msg_command_int_get_param3(msg);
498 command_int->param4 = mavlink_msg_command_int_get_param4(msg);
499 command_int->x = mavlink_msg_command_int_get_x(msg);
500 command_int->y = mavlink_msg_command_int_get_y(msg);
501 command_int->z = mavlink_msg_command_int_get_z(msg);
502 command_int->command = mavlink_msg_command_int_get_command(msg);
503 command_int->target_system = mavlink_msg_command_int_get_target_system(msg);
504 command_int->target_component = mavlink_msg_command_int_get_target_component(msg);
505 command_int->frame = mavlink_msg_command_int_get_frame(msg);
506 command_int->current = mavlink_msg_command_int_get_current(msg);
507 command_int->autocontinue = mavlink_msg_command_int_get_autocontinue(msg);
508 #else
509 uint8_t len = msg->len < MAVLINK_MSG_ID_COMMAND_INT_LEN? msg->len : MAVLINK_MSG_ID_COMMAND_INT_LEN;
510 memset(command_int, 0, MAVLINK_MSG_ID_COMMAND_INT_LEN);
511 memcpy(command_int, _MAV_PAYLOAD(msg), len);
512 #endif