Move telemetry displayport init and cms device registering
[betaflight.git] / lib / main / MAVLink / common / mavlink_msg_mission_item_reached.h
blob9dfa2804337eef4f3826406a52095467cf465b65
1 // MESSAGE MISSION_ITEM_REACHED PACKING
3 #define MAVLINK_MSG_ID_MISSION_ITEM_REACHED 46
5 typedef struct __mavlink_mission_item_reached_t
7 uint16_t seq; ///< Sequence
8 } mavlink_mission_item_reached_t;
10 #define MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN 2
11 #define MAVLINK_MSG_ID_46_LEN 2
13 #define MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC 11
14 #define MAVLINK_MSG_ID_46_CRC 11
18 #define MAVLINK_MESSAGE_INFO_MISSION_ITEM_REACHED { \
19 "MISSION_ITEM_REACHED", \
20 1, \
21 { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_item_reached_t, seq) }, \
22 } \
26 /**
27 * @brief Pack a mission_item_reached message
28 * @param system_id ID of this system
29 * @param component_id ID of this component (e.g. 200 for IMU)
30 * @param msg The MAVLink message to compress the data into
32 * @param seq Sequence
33 * @return length of the message in bytes (excluding serial stream start sign)
35 static inline uint16_t mavlink_msg_mission_item_reached_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
36 uint16_t seq)
38 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
39 char buf[MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN];
40 _mav_put_uint16_t(buf, 0, seq);
42 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN);
43 #else
44 mavlink_mission_item_reached_t packet;
45 packet.seq = seq;
47 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN);
48 #endif
50 msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED;
51 #if MAVLINK_CRC_EXTRA
52 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC);
53 #else
54 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN);
55 #endif
58 /**
59 * @brief Pack a mission_item_reached message on a channel
60 * @param system_id ID of this system
61 * @param component_id ID of this component (e.g. 200 for IMU)
62 * @param chan The MAVLink channel this message will be sent over
63 * @param msg The MAVLink message to compress the data into
64 * @param seq Sequence
65 * @return length of the message in bytes (excluding serial stream start sign)
67 static inline uint16_t mavlink_msg_mission_item_reached_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
68 mavlink_message_t* msg,
69 uint16_t seq)
71 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
72 char buf[MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN];
73 _mav_put_uint16_t(buf, 0, seq);
75 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN);
76 #else
77 mavlink_mission_item_reached_t packet;
78 packet.seq = seq;
80 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN);
81 #endif
83 msg->msgid = MAVLINK_MSG_ID_MISSION_ITEM_REACHED;
84 #if MAVLINK_CRC_EXTRA
85 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC);
86 #else
87 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN);
88 #endif
91 /**
92 * @brief Encode a mission_item_reached struct
94 * @param system_id ID of this system
95 * @param component_id ID of this component (e.g. 200 for IMU)
96 * @param msg The MAVLink message to compress the data into
97 * @param mission_item_reached C-struct to read the message contents from
99 static inline uint16_t mavlink_msg_mission_item_reached_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_item_reached_t* mission_item_reached)
101 return mavlink_msg_mission_item_reached_pack(system_id, component_id, msg, mission_item_reached->seq);
105 * @brief Encode a mission_item_reached struct on a channel
107 * @param system_id ID of this system
108 * @param component_id ID of this component (e.g. 200 for IMU)
109 * @param chan The MAVLink channel this message will be sent over
110 * @param msg The MAVLink message to compress the data into
111 * @param mission_item_reached C-struct to read the message contents from
113 static inline uint16_t mavlink_msg_mission_item_reached_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_item_reached_t* mission_item_reached)
115 return mavlink_msg_mission_item_reached_pack_chan(system_id, component_id, chan, msg, mission_item_reached->seq);
119 * @brief Send a mission_item_reached message
120 * @param chan MAVLink channel to send the message
122 * @param seq Sequence
124 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
126 static inline void mavlink_msg_mission_item_reached_send(mavlink_channel_t chan, uint16_t seq)
128 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
129 char buf[MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN];
130 _mav_put_uint16_t(buf, 0, seq);
132 #if MAVLINK_CRC_EXTRA
133 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC);
134 #else
135 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN);
136 #endif
137 #else
138 mavlink_mission_item_reached_t packet;
139 packet.seq = seq;
141 #if MAVLINK_CRC_EXTRA
142 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC);
143 #else
144 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, (const char *)&packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN);
145 #endif
146 #endif
149 #if MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN <= MAVLINK_MAX_PAYLOAD_LEN
151 This varient of _send() can be used to save stack space by re-using
152 memory from the receive buffer. The caller provides a
153 mavlink_message_t which is the size of a full mavlink message. This
154 is usually the receive buffer for the channel, and allows a reply to an
155 incoming message with minimum stack space usage.
157 static inline void mavlink_msg_mission_item_reached_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t seq)
159 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
160 char *buf = (char *)msgbuf;
161 _mav_put_uint16_t(buf, 0, seq);
163 #if MAVLINK_CRC_EXTRA
164 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC);
165 #else
166 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, buf, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN);
167 #endif
168 #else
169 mavlink_mission_item_reached_t *packet = (mavlink_mission_item_reached_t *)msgbuf;
170 packet->seq = seq;
172 #if MAVLINK_CRC_EXTRA
173 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, (const char *)packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_CRC);
174 #else
175 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_ITEM_REACHED, (const char *)packet, MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN);
176 #endif
177 #endif
179 #endif
181 #endif
183 // MESSAGE MISSION_ITEM_REACHED UNPACKING
187 * @brief Get field seq from mission_item_reached message
189 * @return Sequence
191 static inline uint16_t mavlink_msg_mission_item_reached_get_seq(const mavlink_message_t* msg)
193 return _MAV_RETURN_uint16_t(msg, 0);
197 * @brief Decode a mission_item_reached message into a struct
199 * @param msg The message to decode
200 * @param mission_item_reached C-struct to decode the message contents into
202 static inline void mavlink_msg_mission_item_reached_decode(const mavlink_message_t* msg, mavlink_mission_item_reached_t* mission_item_reached)
204 #if MAVLINK_NEED_BYTE_SWAP
205 mission_item_reached->seq = mavlink_msg_mission_item_reached_get_seq(msg);
206 #else
207 memcpy(mission_item_reached, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_ITEM_REACHED_LEN);
208 #endif