1 | // MESSAGE MISSION_REQUEST_PARTIAL_LIST PACKING |
---|
2 | |
---|
3 | #define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST 37 |
---|
4 | |
---|
5 | MAVPACKED( |
---|
6 | typedef struct __mavlink_mission_request_partial_list_t { |
---|
7 | int16_t start_index; /*< Start index, 0 by default*/ |
---|
8 | int16_t end_index; /*< End index, -1 by default (-1: send list to end). Else a valid index of the list*/ |
---|
9 | uint8_t target_system; /*< System ID*/ |
---|
10 | uint8_t target_component; /*< Component ID*/ |
---|
11 | }) mavlink_mission_request_partial_list_t; |
---|
12 | |
---|
13 | #define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN 6 |
---|
14 | #define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN 6 |
---|
15 | #define MAVLINK_MSG_ID_37_LEN 6 |
---|
16 | #define MAVLINK_MSG_ID_37_MIN_LEN 6 |
---|
17 | |
---|
18 | #define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC 212 |
---|
19 | #define MAVLINK_MSG_ID_37_CRC 212 |
---|
20 | |
---|
21 | |
---|
22 | |
---|
23 | #if MAVLINK_COMMAND_24BIT |
---|
24 | #define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_PARTIAL_LIST { \ |
---|
25 | 37, \ |
---|
26 | "MISSION_REQUEST_PARTIAL_LIST", \ |
---|
27 | 4, \ |
---|
28 | { { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_request_partial_list_t, start_index) }, \ |
---|
29 | { "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_request_partial_list_t, end_index) }, \ |
---|
30 | { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_request_partial_list_t, target_system) }, \ |
---|
31 | { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_request_partial_list_t, target_component) }, \ |
---|
32 | } \ |
---|
33 | } |
---|
34 | #else |
---|
35 | #define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_PARTIAL_LIST { \ |
---|
36 | "MISSION_REQUEST_PARTIAL_LIST", \ |
---|
37 | 4, \ |
---|
38 | { { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_request_partial_list_t, start_index) }, \ |
---|
39 | { "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_request_partial_list_t, end_index) }, \ |
---|
40 | { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_request_partial_list_t, target_system) }, \ |
---|
41 | { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_request_partial_list_t, target_component) }, \ |
---|
42 | } \ |
---|
43 | } |
---|
44 | #endif |
---|
45 | |
---|
46 | /** |
---|
47 | * @brief Pack a mission_request_partial_list message |
---|
48 | * @param system_id ID of this system |
---|
49 | * @param component_id ID of this component (e.g. 200 for IMU) |
---|
50 | * @param msg The MAVLink message to compress the data into |
---|
51 | * |
---|
52 | * @param target_system System ID |
---|
53 | * @param target_component Component ID |
---|
54 | * @param start_index Start index, 0 by default |
---|
55 | * @param end_index End index, -1 by default (-1: send list to end). Else a valid index of the list |
---|
56 | * @return length of the message in bytes (excluding serial stream start sign) |
---|
57 | */ |
---|
58 | static inline uint16_t mavlink_msg_mission_request_partial_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, |
---|
59 | uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index) |
---|
60 | { |
---|
61 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
---|
62 | char buf[MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN]; |
---|
63 | _mav_put_int16_t(buf, 0, start_index); |
---|
64 | _mav_put_int16_t(buf, 2, end_index); |
---|
65 | _mav_put_uint8_t(buf, 4, target_system); |
---|
66 | _mav_put_uint8_t(buf, 5, target_component); |
---|
67 | |
---|
68 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); |
---|
69 | #else |
---|
70 | mavlink_mission_request_partial_list_t packet; |
---|
71 | packet.start_index = start_index; |
---|
72 | packet.end_index = end_index; |
---|
73 | packet.target_system = target_system; |
---|
74 | packet.target_component = target_component; |
---|
75 | |
---|
76 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); |
---|
77 | #endif |
---|
78 | |
---|
79 | msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST; |
---|
80 | return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); |
---|
81 | } |
---|
82 | |
---|
83 | /** |
---|
84 | * @brief Pack a mission_request_partial_list message on a channel |
---|
85 | * @param system_id ID of this system |
---|
86 | * @param component_id ID of this component (e.g. 200 for IMU) |
---|
87 | * @param chan The MAVLink channel this message will be sent over |
---|
88 | * @param msg The MAVLink message to compress the data into |
---|
89 | * @param target_system System ID |
---|
90 | * @param target_component Component ID |
---|
91 | * @param start_index Start index, 0 by default |
---|
92 | * @param end_index End index, -1 by default (-1: send list to end). Else a valid index of the list |
---|
93 | * @return length of the message in bytes (excluding serial stream start sign) |
---|
94 | */ |
---|
95 | static inline uint16_t mavlink_msg_mission_request_partial_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, |
---|
96 | mavlink_message_t* msg, |
---|
97 | uint8_t target_system,uint8_t target_component,int16_t start_index,int16_t end_index) |
---|
98 | { |
---|
99 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
---|
100 | char buf[MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN]; |
---|
101 | _mav_put_int16_t(buf, 0, start_index); |
---|
102 | _mav_put_int16_t(buf, 2, end_index); |
---|
103 | _mav_put_uint8_t(buf, 4, target_system); |
---|
104 | _mav_put_uint8_t(buf, 5, target_component); |
---|
105 | |
---|
106 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); |
---|
107 | #else |
---|
108 | mavlink_mission_request_partial_list_t packet; |
---|
109 | packet.start_index = start_index; |
---|
110 | packet.end_index = end_index; |
---|
111 | packet.target_system = target_system; |
---|
112 | packet.target_component = target_component; |
---|
113 | |
---|
114 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); |
---|
115 | #endif |
---|
116 | |
---|
117 | msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST; |
---|
118 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); |
---|
119 | } |
---|
120 | |
---|
121 | /** |
---|
122 | * @brief Encode a mission_request_partial_list struct |
---|
123 | * |
---|
124 | * @param system_id ID of this system |
---|
125 | * @param component_id ID of this component (e.g. 200 for IMU) |
---|
126 | * @param msg The MAVLink message to compress the data into |
---|
127 | * @param mission_request_partial_list C-struct to read the message contents from |
---|
128 | */ |
---|
129 | static inline uint16_t mavlink_msg_mission_request_partial_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_request_partial_list_t* mission_request_partial_list) |
---|
130 | { |
---|
131 | return mavlink_msg_mission_request_partial_list_pack(system_id, component_id, msg, mission_request_partial_list->target_system, mission_request_partial_list->target_component, mission_request_partial_list->start_index, mission_request_partial_list->end_index); |
---|
132 | } |
---|
133 | |
---|
134 | /** |
---|
135 | * @brief Encode a mission_request_partial_list struct on a channel |
---|
136 | * |
---|
137 | * @param system_id ID of this system |
---|
138 | * @param component_id ID of this component (e.g. 200 for IMU) |
---|
139 | * @param chan The MAVLink channel this message will be sent over |
---|
140 | * @param msg The MAVLink message to compress the data into |
---|
141 | * @param mission_request_partial_list C-struct to read the message contents from |
---|
142 | */ |
---|
143 | static inline uint16_t mavlink_msg_mission_request_partial_list_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_request_partial_list_t* mission_request_partial_list) |
---|
144 | { |
---|
145 | return mavlink_msg_mission_request_partial_list_pack_chan(system_id, component_id, chan, msg, mission_request_partial_list->target_system, mission_request_partial_list->target_component, mission_request_partial_list->start_index, mission_request_partial_list->end_index); |
---|
146 | } |
---|
147 | |
---|
148 | /** |
---|
149 | * @brief Send a mission_request_partial_list message |
---|
150 | * @param chan MAVLink channel to send the message |
---|
151 | * |
---|
152 | * @param target_system System ID |
---|
153 | * @param target_component Component ID |
---|
154 | * @param start_index Start index, 0 by default |
---|
155 | * @param end_index End index, -1 by default (-1: send list to end). Else a valid index of the list |
---|
156 | */ |
---|
157 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
---|
158 | |
---|
159 | static inline void mavlink_msg_mission_request_partial_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index) |
---|
160 | { |
---|
161 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
---|
162 | char buf[MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN]; |
---|
163 | _mav_put_int16_t(buf, 0, start_index); |
---|
164 | _mav_put_int16_t(buf, 2, end_index); |
---|
165 | _mav_put_uint8_t(buf, 4, target_system); |
---|
166 | _mav_put_uint8_t(buf, 5, target_component); |
---|
167 | |
---|
168 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); |
---|
169 | #else |
---|
170 | mavlink_mission_request_partial_list_t packet; |
---|
171 | packet.start_index = start_index; |
---|
172 | packet.end_index = end_index; |
---|
173 | packet.target_system = target_system; |
---|
174 | packet.target_component = target_component; |
---|
175 | |
---|
176 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); |
---|
177 | #endif |
---|
178 | } |
---|
179 | |
---|
180 | /** |
---|
181 | * @brief Send a mission_request_partial_list message |
---|
182 | * @param chan MAVLink channel to send the message |
---|
183 | * @param struct The MAVLink struct to serialize |
---|
184 | */ |
---|
185 | static inline void mavlink_msg_mission_request_partial_list_send_struct(mavlink_channel_t chan, const mavlink_mission_request_partial_list_t* mission_request_partial_list) |
---|
186 | { |
---|
187 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
---|
188 | mavlink_msg_mission_request_partial_list_send(chan, mission_request_partial_list->target_system, mission_request_partial_list->target_component, mission_request_partial_list->start_index, mission_request_partial_list->end_index); |
---|
189 | #else |
---|
190 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, (const char *)mission_request_partial_list, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); |
---|
191 | #endif |
---|
192 | } |
---|
193 | |
---|
194 | #if MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN <= MAVLINK_MAX_PAYLOAD_LEN |
---|
195 | /* |
---|
196 | This varient of _send() can be used to save stack space by re-using |
---|
197 | memory from the receive buffer. The caller provides a |
---|
198 | mavlink_message_t which is the size of a full mavlink message. This |
---|
199 | is usually the receive buffer for the channel, and allows a reply to an |
---|
200 | incoming message with minimum stack space usage. |
---|
201 | */ |
---|
202 | static inline void mavlink_msg_mission_request_partial_list_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index) |
---|
203 | { |
---|
204 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
---|
205 | char *buf = (char *)msgbuf; |
---|
206 | _mav_put_int16_t(buf, 0, start_index); |
---|
207 | _mav_put_int16_t(buf, 2, end_index); |
---|
208 | _mav_put_uint8_t(buf, 4, target_system); |
---|
209 | _mav_put_uint8_t(buf, 5, target_component); |
---|
210 | |
---|
211 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); |
---|
212 | #else |
---|
213 | mavlink_mission_request_partial_list_t *packet = (mavlink_mission_request_partial_list_t *)msgbuf; |
---|
214 | packet->start_index = start_index; |
---|
215 | packet->end_index = end_index; |
---|
216 | packet->target_system = target_system; |
---|
217 | packet->target_component = target_component; |
---|
218 | |
---|
219 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, (const char *)packet, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_CRC); |
---|
220 | #endif |
---|
221 | } |
---|
222 | #endif |
---|
223 | |
---|
224 | #endif |
---|
225 | |
---|
226 | // MESSAGE MISSION_REQUEST_PARTIAL_LIST UNPACKING |
---|
227 | |
---|
228 | |
---|
229 | /** |
---|
230 | * @brief Get field target_system from mission_request_partial_list message |
---|
231 | * |
---|
232 | * @return System ID |
---|
233 | */ |
---|
234 | static inline uint8_t mavlink_msg_mission_request_partial_list_get_target_system(const mavlink_message_t* msg) |
---|
235 | { |
---|
236 | return _MAV_RETURN_uint8_t(msg, 4); |
---|
237 | } |
---|
238 | |
---|
239 | /** |
---|
240 | * @brief Get field target_component from mission_request_partial_list message |
---|
241 | * |
---|
242 | * @return Component ID |
---|
243 | */ |
---|
244 | static inline uint8_t mavlink_msg_mission_request_partial_list_get_target_component(const mavlink_message_t* msg) |
---|
245 | { |
---|
246 | return _MAV_RETURN_uint8_t(msg, 5); |
---|
247 | } |
---|
248 | |
---|
249 | /** |
---|
250 | * @brief Get field start_index from mission_request_partial_list message |
---|
251 | * |
---|
252 | * @return Start index, 0 by default |
---|
253 | */ |
---|
254 | static inline int16_t mavlink_msg_mission_request_partial_list_get_start_index(const mavlink_message_t* msg) |
---|
255 | { |
---|
256 | return _MAV_RETURN_int16_t(msg, 0); |
---|
257 | } |
---|
258 | |
---|
259 | /** |
---|
260 | * @brief Get field end_index from mission_request_partial_list message |
---|
261 | * |
---|
262 | * @return End index, -1 by default (-1: send list to end). Else a valid index of the list |
---|
263 | */ |
---|
264 | static inline int16_t mavlink_msg_mission_request_partial_list_get_end_index(const mavlink_message_t* msg) |
---|
265 | { |
---|
266 | return _MAV_RETURN_int16_t(msg, 2); |
---|
267 | } |
---|
268 | |
---|
269 | /** |
---|
270 | * @brief Decode a mission_request_partial_list message into a struct |
---|
271 | * |
---|
272 | * @param msg The message to decode |
---|
273 | * @param mission_request_partial_list C-struct to decode the message contents into |
---|
274 | */ |
---|
275 | static inline void mavlink_msg_mission_request_partial_list_decode(const mavlink_message_t* msg, mavlink_mission_request_partial_list_t* mission_request_partial_list) |
---|
276 | { |
---|
277 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
---|
278 | mission_request_partial_list->start_index = mavlink_msg_mission_request_partial_list_get_start_index(msg); |
---|
279 | mission_request_partial_list->end_index = mavlink_msg_mission_request_partial_list_get_end_index(msg); |
---|
280 | mission_request_partial_list->target_system = mavlink_msg_mission_request_partial_list_get_target_system(msg); |
---|
281 | mission_request_partial_list->target_component = mavlink_msg_mission_request_partial_list_get_target_component(msg); |
---|
282 | #else |
---|
283 | uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN? msg->len : MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN; |
---|
284 | memset(mission_request_partial_list, 0, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN); |
---|
285 | memcpy(mission_request_partial_list, _MAV_PAYLOAD(msg), len); |
---|
286 | #endif |
---|
287 | } |
---|