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