RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
mavlink_msg_mission_request_list.h
1#pragma once
2// MESSAGE MISSION_REQUEST_LIST PACKING
3
4#define MAVLINK_MSG_ID_MISSION_REQUEST_LIST 43
5
6MAVPACKED(
7typedef struct __mavlink_mission_request_list_t {
8 uint8_t target_system; /*< System ID*/
9 uint8_t target_component; /*< Component ID*/
10 uint8_t mission_type; /*< Mission type, see MAV_MISSION_TYPE*/
11}) mavlink_mission_request_list_t;
12
13#define MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN 3
14#define MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN 2
15#define MAVLINK_MSG_ID_43_LEN 3
16#define MAVLINK_MSG_ID_43_MIN_LEN 2
17
18#define MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC 132
19#define MAVLINK_MSG_ID_43_CRC 132
20
21
22
23#if MAVLINK_COMMAND_24BIT
24#define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST { \
25 43, \
26 "MISSION_REQUEST_LIST", \
27 3, \
28 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_request_list_t, target_system) }, \
29 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_request_list_t, target_component) }, \
30 { "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_list_t, mission_type) }, \
31 } \
32}
33#else
34#define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_LIST { \
35 "MISSION_REQUEST_LIST", \
36 3, \
37 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_request_list_t, target_system) }, \
38 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_request_list_t, target_component) }, \
39 { "mission_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mission_request_list_t, mission_type) }, \
40 } \
41}
42#endif
43
55static inline uint16_t mavlink_msg_mission_request_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
56 uint8_t target_system, uint8_t target_component, uint8_t mission_type)
57{
58#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
59 char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN];
60 _mav_put_uint8_t(buf, 0, target_system);
61 _mav_put_uint8_t(buf, 1, target_component);
62 _mav_put_uint8_t(buf, 2, mission_type);
63
64 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN);
65#else
66 mavlink_mission_request_list_t packet;
67 packet.target_system = target_system;
68 packet.target_component = target_component;
69 packet.mission_type = mission_type;
70
71 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN);
72#endif
73
74 msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST;
75 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC);
76}
77
89static inline uint16_t mavlink_msg_mission_request_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
90 mavlink_message_t* msg,
91 uint8_t target_system,uint8_t target_component,uint8_t mission_type)
92{
93#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
94 char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN];
95 _mav_put_uint8_t(buf, 0, target_system);
96 _mav_put_uint8_t(buf, 1, target_component);
97 _mav_put_uint8_t(buf, 2, mission_type);
98
99 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN);
100#else
101 mavlink_mission_request_list_t packet;
102 packet.target_system = target_system;
103 packet.target_component = target_component;
104 packet.mission_type = mission_type;
105
106 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN);
107#endif
108
109 msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_LIST;
110 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC);
111}
112
121static inline uint16_t mavlink_msg_mission_request_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_request_list_t* mission_request_list)
122{
123 return mavlink_msg_mission_request_list_pack(system_id, component_id, msg, mission_request_list->target_system, mission_request_list->target_component, mission_request_list->mission_type);
124}
125
135static inline uint16_t mavlink_msg_mission_request_list_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_request_list_t* mission_request_list)
136{
137 return mavlink_msg_mission_request_list_pack_chan(system_id, component_id, chan, msg, mission_request_list->target_system, mission_request_list->target_component, mission_request_list->mission_type);
138}
139
148#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
149
150static inline void mavlink_msg_mission_request_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mission_type)
151{
152#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
153 char buf[MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN];
154 _mav_put_uint8_t(buf, 0, target_system);
155 _mav_put_uint8_t(buf, 1, target_component);
156 _mav_put_uint8_t(buf, 2, mission_type);
157
158 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC);
159#else
160 mavlink_mission_request_list_t packet;
161 packet.target_system = target_system;
162 packet.target_component = target_component;
163 packet.mission_type = mission_type;
164
165 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC);
166#endif
167}
168
174static inline void mavlink_msg_mission_request_list_send_struct(mavlink_channel_t chan, const mavlink_mission_request_list_t* mission_request_list)
175{
176#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
177 mavlink_msg_mission_request_list_send(chan, mission_request_list->target_system, mission_request_list->target_component, mission_request_list->mission_type);
178#else
179 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, (const char *)mission_request_list, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC);
180#endif
181}
182
183#if MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
184/*
185 This varient of _send() can be used to save stack space by re-using
186 memory from the receive buffer. The caller provides a
187 mavlink_message_t which is the size of a full mavlink message. This
188 is usually the receive buffer for the channel, and allows a reply to an
189 incoming message with minimum stack space usage.
190 */
191static inline void mavlink_msg_mission_request_list_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mission_type)
192{
193#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
194 char *buf = (char *)msgbuf;
195 _mav_put_uint8_t(buf, 0, target_system);
196 _mav_put_uint8_t(buf, 1, target_component);
197 _mav_put_uint8_t(buf, 2, mission_type);
198
199 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, buf, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC);
200#else
201 mavlink_mission_request_list_t *packet = (mavlink_mission_request_list_t *)msgbuf;
202 packet->target_system = target_system;
203 packet->target_component = target_component;
204 packet->mission_type = mission_type;
205
206 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_LIST, (const char *)packet, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_CRC);
207#endif
208}
209#endif
210
211#endif
212
213// MESSAGE MISSION_REQUEST_LIST UNPACKING
214
215
221static inline uint8_t mavlink_msg_mission_request_list_get_target_system(const mavlink_message_t* msg)
222{
223 return _MAV_RETURN_uint8_t(msg, 0);
224}
225
231static inline uint8_t mavlink_msg_mission_request_list_get_target_component(const mavlink_message_t* msg)
232{
233 return _MAV_RETURN_uint8_t(msg, 1);
234}
235
241static inline uint8_t mavlink_msg_mission_request_list_get_mission_type(const mavlink_message_t* msg)
242{
243 return _MAV_RETURN_uint8_t(msg, 2);
244}
245
252static inline void mavlink_msg_mission_request_list_decode(const mavlink_message_t* msg, mavlink_mission_request_list_t* mission_request_list)
253{
254#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
255 mission_request_list->target_system = mavlink_msg_mission_request_list_get_target_system(msg);
256 mission_request_list->target_component = mavlink_msg_mission_request_list_get_target_component(msg);
257 mission_request_list->mission_type = mavlink_msg_mission_request_list_get_mission_type(msg);
258#else
259 uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN? msg->len : MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN;
260 memset(mission_request_list, 0, MAVLINK_MSG_ID_MISSION_REQUEST_LIST_LEN);
261 memcpy(mission_request_list, _MAV_PAYLOAD(msg), len);
262#endif
263}