Move telemetry displayport init and cms device registering
[betaflight.git] / lib / main / MAVLink / common / mavlink_msg_command_int.h
blob4713d01e1cb8273e04bd6be13d672c88693e5f06
1 // MESSAGE COMMAND_INT PACKING
3 #define MAVLINK_MSG_ID_COMMAND_INT 75
5 typedef struct __mavlink_command_int_t
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 int32_t x; ///< PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
12 int32_t y; ///< PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
13 float z; ///< PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
14 uint16_t command; ///< The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs
15 uint8_t target_system; ///< System ID
16 uint8_t target_component; ///< Component ID
17 uint8_t frame; ///< The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h
18 uint8_t current; ///< false:0, true:1
19 uint8_t autocontinue; ///< autocontinue to next wp
20 } mavlink_command_int_t;
22 #define MAVLINK_MSG_ID_COMMAND_INT_LEN 35
23 #define MAVLINK_MSG_ID_75_LEN 35
25 #define MAVLINK_MSG_ID_COMMAND_INT_CRC 158
26 #define MAVLINK_MSG_ID_75_CRC 158
30 #define MAVLINK_MESSAGE_INFO_COMMAND_INT { \
31 "COMMAND_INT", \
32 13, \
33 { { "param1", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_command_int_t, param1) }, \
34 { "param2", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_command_int_t, param2) }, \
35 { "param3", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_command_int_t, param3) }, \
36 { "param4", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_command_int_t, param4) }, \
37 { "x", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_command_int_t, x) }, \
38 { "y", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_command_int_t, y) }, \
39 { "z", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_command_int_t, z) }, \
40 { "command", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_command_int_t, command) }, \
41 { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_command_int_t, target_system) }, \
42 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_command_int_t, target_component) }, \
43 { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_command_int_t, frame) }, \
44 { "current", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_command_int_t, current) }, \
45 { "autocontinue", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_command_int_t, autocontinue) }, \
46 } \
50 /**
51 * @brief Pack a command_int message
52 * @param system_id ID of this system
53 * @param component_id ID of this component (e.g. 200 for IMU)
54 * @param msg The MAVLink message to compress the data into
56 * @param target_system System ID
57 * @param target_component Component ID
58 * @param frame The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h
59 * @param command The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs
60 * @param current false:0, true:1
61 * @param autocontinue autocontinue to next wp
62 * @param param1 PARAM1, see MAV_CMD enum
63 * @param param2 PARAM2, see MAV_CMD enum
64 * @param param3 PARAM3, see MAV_CMD enum
65 * @param param4 PARAM4, see MAV_CMD enum
66 * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
67 * @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
68 * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
69 * @return length of the message in bytes (excluding serial stream start sign)
71 static inline uint16_t mavlink_msg_command_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
72 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)
74 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
75 char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN];
76 _mav_put_float(buf, 0, param1);
77 _mav_put_float(buf, 4, param2);
78 _mav_put_float(buf, 8, param3);
79 _mav_put_float(buf, 12, param4);
80 _mav_put_int32_t(buf, 16, x);
81 _mav_put_int32_t(buf, 20, y);
82 _mav_put_float(buf, 24, z);
83 _mav_put_uint16_t(buf, 28, command);
84 _mav_put_uint8_t(buf, 30, target_system);
85 _mav_put_uint8_t(buf, 31, target_component);
86 _mav_put_uint8_t(buf, 32, frame);
87 _mav_put_uint8_t(buf, 33, current);
88 _mav_put_uint8_t(buf, 34, autocontinue);
90 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_INT_LEN);
91 #else
92 mavlink_command_int_t packet;
93 packet.param1 = param1;
94 packet.param2 = param2;
95 packet.param3 = param3;
96 packet.param4 = param4;
97 packet.x = x;
98 packet.y = y;
99 packet.z = z;
100 packet.command = command;
101 packet.target_system = target_system;
102 packet.target_component = target_component;
103 packet.frame = frame;
104 packet.current = current;
105 packet.autocontinue = autocontinue;
107 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_INT_LEN);
108 #endif
110 msg->msgid = MAVLINK_MSG_ID_COMMAND_INT;
111 #if MAVLINK_CRC_EXTRA
112 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
113 #else
114 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_COMMAND_INT_LEN);
115 #endif
119 * @brief Pack a command_int message on a channel
120 * @param system_id ID of this system
121 * @param component_id ID of this component (e.g. 200 for IMU)
122 * @param chan The MAVLink channel this message will be sent over
123 * @param msg The MAVLink message to compress the data into
124 * @param target_system System ID
125 * @param target_component Component ID
126 * @param frame The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h
127 * @param command The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs
128 * @param current false:0, true:1
129 * @param autocontinue autocontinue to next wp
130 * @param param1 PARAM1, see MAV_CMD enum
131 * @param param2 PARAM2, see MAV_CMD enum
132 * @param param3 PARAM3, see MAV_CMD enum
133 * @param param4 PARAM4, see MAV_CMD enum
134 * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
135 * @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
136 * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
137 * @return length of the message in bytes (excluding serial stream start sign)
139 static inline uint16_t mavlink_msg_command_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
140 mavlink_message_t* msg,
141 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)
143 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
144 char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN];
145 _mav_put_float(buf, 0, param1);
146 _mav_put_float(buf, 4, param2);
147 _mav_put_float(buf, 8, param3);
148 _mav_put_float(buf, 12, param4);
149 _mav_put_int32_t(buf, 16, x);
150 _mav_put_int32_t(buf, 20, y);
151 _mav_put_float(buf, 24, z);
152 _mav_put_uint16_t(buf, 28, command);
153 _mav_put_uint8_t(buf, 30, target_system);
154 _mav_put_uint8_t(buf, 31, target_component);
155 _mav_put_uint8_t(buf, 32, frame);
156 _mav_put_uint8_t(buf, 33, current);
157 _mav_put_uint8_t(buf, 34, autocontinue);
159 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMMAND_INT_LEN);
160 #else
161 mavlink_command_int_t packet;
162 packet.param1 = param1;
163 packet.param2 = param2;
164 packet.param3 = param3;
165 packet.param4 = param4;
166 packet.x = x;
167 packet.y = y;
168 packet.z = z;
169 packet.command = command;
170 packet.target_system = target_system;
171 packet.target_component = target_component;
172 packet.frame = frame;
173 packet.current = current;
174 packet.autocontinue = autocontinue;
176 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMMAND_INT_LEN);
177 #endif
179 msg->msgid = MAVLINK_MSG_ID_COMMAND_INT;
180 #if MAVLINK_CRC_EXTRA
181 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
182 #else
183 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_COMMAND_INT_LEN);
184 #endif
188 * @brief Encode a command_int struct
190 * @param system_id ID of this system
191 * @param component_id ID of this component (e.g. 200 for IMU)
192 * @param msg The MAVLink message to compress the data into
193 * @param command_int C-struct to read the message contents from
195 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)
197 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);
201 * @brief Encode a command_int struct on a channel
203 * @param system_id ID of this system
204 * @param component_id ID of this component (e.g. 200 for IMU)
205 * @param chan The MAVLink channel this message will be sent over
206 * @param msg The MAVLink message to compress the data into
207 * @param command_int C-struct to read the message contents from
209 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)
211 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);
215 * @brief Send a command_int message
216 * @param chan MAVLink channel to send the message
218 * @param target_system System ID
219 * @param target_component Component ID
220 * @param frame The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h
221 * @param command The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs
222 * @param current false:0, true:1
223 * @param autocontinue autocontinue to next wp
224 * @param param1 PARAM1, see MAV_CMD enum
225 * @param param2 PARAM2, see MAV_CMD enum
226 * @param param3 PARAM3, see MAV_CMD enum
227 * @param param4 PARAM4, see MAV_CMD enum
228 * @param x PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
229 * @param y PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
230 * @param z PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
232 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
234 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)
236 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
237 char buf[MAVLINK_MSG_ID_COMMAND_INT_LEN];
238 _mav_put_float(buf, 0, param1);
239 _mav_put_float(buf, 4, param2);
240 _mav_put_float(buf, 8, param3);
241 _mav_put_float(buf, 12, param4);
242 _mav_put_int32_t(buf, 16, x);
243 _mav_put_int32_t(buf, 20, y);
244 _mav_put_float(buf, 24, z);
245 _mav_put_uint16_t(buf, 28, command);
246 _mav_put_uint8_t(buf, 30, target_system);
247 _mav_put_uint8_t(buf, 31, target_component);
248 _mav_put_uint8_t(buf, 32, frame);
249 _mav_put_uint8_t(buf, 33, current);
250 _mav_put_uint8_t(buf, 34, autocontinue);
252 #if MAVLINK_CRC_EXTRA
253 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, buf, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
254 #else
255 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, buf, MAVLINK_MSG_ID_COMMAND_INT_LEN);
256 #endif
257 #else
258 mavlink_command_int_t packet;
259 packet.param1 = param1;
260 packet.param2 = param2;
261 packet.param3 = param3;
262 packet.param4 = param4;
263 packet.x = x;
264 packet.y = y;
265 packet.z = z;
266 packet.command = command;
267 packet.target_system = target_system;
268 packet.target_component = target_component;
269 packet.frame = frame;
270 packet.current = current;
271 packet.autocontinue = autocontinue;
273 #if MAVLINK_CRC_EXTRA
274 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
275 #else
276 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)&packet, MAVLINK_MSG_ID_COMMAND_INT_LEN);
277 #endif
278 #endif
281 #if MAVLINK_MSG_ID_COMMAND_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
283 This varient of _send() can be used to save stack space by re-using
284 memory from the receive buffer. The caller provides a
285 mavlink_message_t which is the size of a full mavlink message. This
286 is usually the receive buffer for the channel, and allows a reply to an
287 incoming message with minimum stack space usage.
289 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)
291 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
292 char *buf = (char *)msgbuf;
293 _mav_put_float(buf, 0, param1);
294 _mav_put_float(buf, 4, param2);
295 _mav_put_float(buf, 8, param3);
296 _mav_put_float(buf, 12, param4);
297 _mav_put_int32_t(buf, 16, x);
298 _mav_put_int32_t(buf, 20, y);
299 _mav_put_float(buf, 24, z);
300 _mav_put_uint16_t(buf, 28, command);
301 _mav_put_uint8_t(buf, 30, target_system);
302 _mav_put_uint8_t(buf, 31, target_component);
303 _mav_put_uint8_t(buf, 32, frame);
304 _mav_put_uint8_t(buf, 33, current);
305 _mav_put_uint8_t(buf, 34, autocontinue);
307 #if MAVLINK_CRC_EXTRA
308 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, buf, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
309 #else
310 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, buf, MAVLINK_MSG_ID_COMMAND_INT_LEN);
311 #endif
312 #else
313 mavlink_command_int_t *packet = (mavlink_command_int_t *)msgbuf;
314 packet->param1 = param1;
315 packet->param2 = param2;
316 packet->param3 = param3;
317 packet->param4 = param4;
318 packet->x = x;
319 packet->y = y;
320 packet->z = z;
321 packet->command = command;
322 packet->target_system = target_system;
323 packet->target_component = target_component;
324 packet->frame = frame;
325 packet->current = current;
326 packet->autocontinue = autocontinue;
328 #if MAVLINK_CRC_EXTRA
329 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)packet, MAVLINK_MSG_ID_COMMAND_INT_LEN, MAVLINK_MSG_ID_COMMAND_INT_CRC);
330 #else
331 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMMAND_INT, (const char *)packet, MAVLINK_MSG_ID_COMMAND_INT_LEN);
332 #endif
333 #endif
335 #endif
337 #endif
339 // MESSAGE COMMAND_INT UNPACKING
343 * @brief Get field target_system from command_int message
345 * @return System ID
347 static inline uint8_t mavlink_msg_command_int_get_target_system(const mavlink_message_t* msg)
349 return _MAV_RETURN_uint8_t(msg, 30);
353 * @brief Get field target_component from command_int message
355 * @return Component ID
357 static inline uint8_t mavlink_msg_command_int_get_target_component(const mavlink_message_t* msg)
359 return _MAV_RETURN_uint8_t(msg, 31);
363 * @brief Get field frame from command_int message
365 * @return The coordinate system of the COMMAND. see MAV_FRAME in mavlink_types.h
367 static inline uint8_t mavlink_msg_command_int_get_frame(const mavlink_message_t* msg)
369 return _MAV_RETURN_uint8_t(msg, 32);
373 * @brief Get field command from command_int message
375 * @return The scheduled action for the mission item. see MAV_CMD in common.xml MAVLink specs
377 static inline uint16_t mavlink_msg_command_int_get_command(const mavlink_message_t* msg)
379 return _MAV_RETURN_uint16_t(msg, 28);
383 * @brief Get field current from command_int message
385 * @return false:0, true:1
387 static inline uint8_t mavlink_msg_command_int_get_current(const mavlink_message_t* msg)
389 return _MAV_RETURN_uint8_t(msg, 33);
393 * @brief Get field autocontinue from command_int message
395 * @return autocontinue to next wp
397 static inline uint8_t mavlink_msg_command_int_get_autocontinue(const mavlink_message_t* msg)
399 return _MAV_RETURN_uint8_t(msg, 34);
403 * @brief Get field param1 from command_int message
405 * @return PARAM1, see MAV_CMD enum
407 static inline float mavlink_msg_command_int_get_param1(const mavlink_message_t* msg)
409 return _MAV_RETURN_float(msg, 0);
413 * @brief Get field param2 from command_int message
415 * @return PARAM2, see MAV_CMD enum
417 static inline float mavlink_msg_command_int_get_param2(const mavlink_message_t* msg)
419 return _MAV_RETURN_float(msg, 4);
423 * @brief Get field param3 from command_int message
425 * @return PARAM3, see MAV_CMD enum
427 static inline float mavlink_msg_command_int_get_param3(const mavlink_message_t* msg)
429 return _MAV_RETURN_float(msg, 8);
433 * @brief Get field param4 from command_int message
435 * @return PARAM4, see MAV_CMD enum
437 static inline float mavlink_msg_command_int_get_param4(const mavlink_message_t* msg)
439 return _MAV_RETURN_float(msg, 12);
443 * @brief Get field x from command_int message
445 * @return PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7
447 static inline int32_t mavlink_msg_command_int_get_x(const mavlink_message_t* msg)
449 return _MAV_RETURN_int32_t(msg, 16);
453 * @brief Get field y from command_int message
455 * @return PARAM6 / local: y position in meters * 1e4, global: longitude in degrees * 10^7
457 static inline int32_t mavlink_msg_command_int_get_y(const mavlink_message_t* msg)
459 return _MAV_RETURN_int32_t(msg, 20);
463 * @brief Get field z from command_int message
465 * @return PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
467 static inline float mavlink_msg_command_int_get_z(const mavlink_message_t* msg)
469 return _MAV_RETURN_float(msg, 24);
473 * @brief Decode a command_int message into a struct
475 * @param msg The message to decode
476 * @param command_int C-struct to decode the message contents into
478 static inline void mavlink_msg_command_int_decode(const mavlink_message_t* msg, mavlink_command_int_t* command_int)
480 #if MAVLINK_NEED_BYTE_SWAP
481 command_int->param1 = mavlink_msg_command_int_get_param1(msg);
482 command_int->param2 = mavlink_msg_command_int_get_param2(msg);
483 command_int->param3 = mavlink_msg_command_int_get_param3(msg);
484 command_int->param4 = mavlink_msg_command_int_get_param4(msg);
485 command_int->x = mavlink_msg_command_int_get_x(msg);
486 command_int->y = mavlink_msg_command_int_get_y(msg);
487 command_int->z = mavlink_msg_command_int_get_z(msg);
488 command_int->command = mavlink_msg_command_int_get_command(msg);
489 command_int->target_system = mavlink_msg_command_int_get_target_system(msg);
490 command_int->target_component = mavlink_msg_command_int_get_target_component(msg);
491 command_int->frame = mavlink_msg_command_int_get_frame(msg);
492 command_int->current = mavlink_msg_command_int_get_current(msg);
493 command_int->autocontinue = mavlink_msg_command_int_get_autocontinue(msg);
494 #else
495 memcpy(command_int, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_COMMAND_INT_LEN);
496 #endif