RflySimSDK v3.08
RflySimSDK说明文档
载入中...
搜索中...
未找到
mavlink_msg_mount_configure.h
1#pragma once
2// MESSAGE MOUNT_CONFIGURE PACKING
3
4#define MAVLINK_MSG_ID_MOUNT_CONFIGURE 156
5
6MAVPACKED(
7typedef struct __mavlink_mount_configure_t {
8 uint8_t target_system; /*< System ID*/
9 uint8_t target_component; /*< Component ID*/
10 uint8_t mount_mode; /*< mount operating mode (see MAV_MOUNT_MODE enum)*/
11 uint8_t stab_roll; /*< (1 = yes, 0 = no)*/
12 uint8_t stab_pitch; /*< (1 = yes, 0 = no)*/
13 uint8_t stab_yaw; /*< (1 = yes, 0 = no)*/
14}) mavlink_mount_configure_t;
15
16#define MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN 6
17#define MAVLINK_MSG_ID_MOUNT_CONFIGURE_MIN_LEN 6
18#define MAVLINK_MSG_ID_156_LEN 6
19#define MAVLINK_MSG_ID_156_MIN_LEN 6
20
21#define MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC 19
22#define MAVLINK_MSG_ID_156_CRC 19
23
24
25
26#if MAVLINK_COMMAND_24BIT
27#define MAVLINK_MESSAGE_INFO_MOUNT_CONFIGURE { \
28 156, \
29 "MOUNT_CONFIGURE", \
30 6, \
31 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mount_configure_t, target_system) }, \
32 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mount_configure_t, target_component) }, \
33 { "mount_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mount_configure_t, mount_mode) }, \
34 { "stab_roll", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mount_configure_t, stab_roll) }, \
35 { "stab_pitch", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mount_configure_t, stab_pitch) }, \
36 { "stab_yaw", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mount_configure_t, stab_yaw) }, \
37 } \
38}
39#else
40#define MAVLINK_MESSAGE_INFO_MOUNT_CONFIGURE { \
41 "MOUNT_CONFIGURE", \
42 6, \
43 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mount_configure_t, target_system) }, \
44 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mount_configure_t, target_component) }, \
45 { "mount_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mount_configure_t, mount_mode) }, \
46 { "stab_roll", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mount_configure_t, stab_roll) }, \
47 { "stab_pitch", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mount_configure_t, stab_pitch) }, \
48 { "stab_yaw", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mount_configure_t, stab_yaw) }, \
49 } \
50}
51#endif
52
53/**
54 * @brief Pack a mount_configure message
55 * @param system_id ID of this system
56 * @param component_id ID of this component (e.g. 200 for IMU)
57 * @param msg The MAVLink message to compress the data into
58 *
59 * @param target_system System ID
60 * @param target_component Component ID
61 * @param mount_mode mount operating mode (see MAV_MOUNT_MODE enum)
62 * @param stab_roll (1 = yes, 0 = no)
63 * @param stab_pitch (1 = yes, 0 = no)
64 * @param stab_yaw (1 = yes, 0 = no)
65 * @return length of the message in bytes (excluding serial stream start sign)
66 */
67static inline uint16_t mavlink_msg_mount_configure_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
68 uint8_t target_system, uint8_t target_component, uint8_t mount_mode, uint8_t stab_roll, uint8_t stab_pitch, uint8_t stab_yaw)
69{
70#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
71 char buf[MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN];
72 _mav_put_uint8_t(buf, 0, target_system);
73 _mav_put_uint8_t(buf, 1, target_component);
74 _mav_put_uint8_t(buf, 2, mount_mode);
75 _mav_put_uint8_t(buf, 3, stab_roll);
76 _mav_put_uint8_t(buf, 4, stab_pitch);
77 _mav_put_uint8_t(buf, 5, stab_yaw);
78
79 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN);
80#else
81 mavlink_mount_configure_t packet;
82 packet.target_system = target_system;
83 packet.target_component = target_component;
84 packet.mount_mode = mount_mode;
85 packet.stab_roll = stab_roll;
86 packet.stab_pitch = stab_pitch;
87 packet.stab_yaw = stab_yaw;
88
89 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN);
90#endif
91
92 msg->msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE;
93 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MOUNT_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC);
94}
95
96/**
97 * @brief Pack a mount_configure message on a channel
98 * @param system_id ID of this system
99 * @param component_id ID of this component (e.g. 200 for IMU)
100 * @param chan The MAVLink channel this message will be sent over
101 * @param msg The MAVLink message to compress the data into
102 * @param target_system System ID
103 * @param target_component Component ID
104 * @param mount_mode mount operating mode (see MAV_MOUNT_MODE enum)
105 * @param stab_roll (1 = yes, 0 = no)
106 * @param stab_pitch (1 = yes, 0 = no)
107 * @param stab_yaw (1 = yes, 0 = no)
108 * @return length of the message in bytes (excluding serial stream start sign)
109 */
110static inline uint16_t mavlink_msg_mount_configure_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
111 mavlink_message_t* msg,
112 uint8_t target_system,uint8_t target_component,uint8_t mount_mode,uint8_t stab_roll,uint8_t stab_pitch,uint8_t stab_yaw)
113{
114#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
115 char buf[MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN];
116 _mav_put_uint8_t(buf, 0, target_system);
117 _mav_put_uint8_t(buf, 1, target_component);
118 _mav_put_uint8_t(buf, 2, mount_mode);
119 _mav_put_uint8_t(buf, 3, stab_roll);
120 _mav_put_uint8_t(buf, 4, stab_pitch);
121 _mav_put_uint8_t(buf, 5, stab_yaw);
122
123 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN);
124#else
125 mavlink_mount_configure_t packet;
126 packet.target_system = target_system;
127 packet.target_component = target_component;
128 packet.mount_mode = mount_mode;
129 packet.stab_roll = stab_roll;
130 packet.stab_pitch = stab_pitch;
131 packet.stab_yaw = stab_yaw;
132
133 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN);
134#endif
135
136 msg->msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE;
137 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC);
138}
139
140/**
141 * @brief Encode a mount_configure struct
142 *
143 * @param system_id ID of this system
144 * @param component_id ID of this component (e.g. 200 for IMU)
145 * @param msg The MAVLink message to compress the data into
146 * @param mount_configure C-struct to read the message contents from
147 */
148static inline uint16_t mavlink_msg_mount_configure_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mount_configure_t* mount_configure)
149{
150 return mavlink_msg_mount_configure_pack(system_id, component_id, msg, mount_configure->target_system, mount_configure->target_component, mount_configure->mount_mode, mount_configure->stab_roll, mount_configure->stab_pitch, mount_configure->stab_yaw);
151}
152
153/**
154 * @brief Encode a mount_configure struct on a channel
155 *
156 * @param system_id ID of this system
157 * @param component_id ID of this component (e.g. 200 for IMU)
158 * @param chan The MAVLink channel this message will be sent over
159 * @param msg The MAVLink message to compress the data into
160 * @param mount_configure C-struct to read the message contents from
161 */
162static inline uint16_t mavlink_msg_mount_configure_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mount_configure_t* mount_configure)
163{
164 return mavlink_msg_mount_configure_pack_chan(system_id, component_id, chan, msg, mount_configure->target_system, mount_configure->target_component, mount_configure->mount_mode, mount_configure->stab_roll, mount_configure->stab_pitch, mount_configure->stab_yaw);
165}
166
167/**
168 * @brief Send a mount_configure message
169 * @param chan MAVLink channel to send the message
170 *
171 * @param target_system System ID
172 * @param target_component Component ID
173 * @param mount_mode mount operating mode (see MAV_MOUNT_MODE enum)
174 * @param stab_roll (1 = yes, 0 = no)
175 * @param stab_pitch (1 = yes, 0 = no)
176 * @param stab_yaw (1 = yes, 0 = no)
177 */
178#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
179
180static inline void mavlink_msg_mount_configure_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mount_mode, uint8_t stab_roll, uint8_t stab_pitch, uint8_t stab_yaw)
181{
182#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
183 char buf[MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN];
184 _mav_put_uint8_t(buf, 0, target_system);
185 _mav_put_uint8_t(buf, 1, target_component);
186 _mav_put_uint8_t(buf, 2, mount_mode);
187 _mav_put_uint8_t(buf, 3, stab_roll);
188 _mav_put_uint8_t(buf, 4, stab_pitch);
189 _mav_put_uint8_t(buf, 5, stab_yaw);
190
191 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, buf, MAVLINK_MSG_ID_MOUNT_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC);
192#else
193 mavlink_mount_configure_t packet;
194 packet.target_system = target_system;
195 packet.target_component = target_component;
196 packet.mount_mode = mount_mode;
197 packet.stab_roll = stab_roll;
198 packet.stab_pitch = stab_pitch;
199 packet.stab_yaw = stab_yaw;
200
201 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, (const char *)&packet, MAVLINK_MSG_ID_MOUNT_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC);
202#endif
203}
204
205/**
206 * @brief Send a mount_configure message
207 * @param chan MAVLink channel to send the message
208 * @param struct The MAVLink struct to serialize
209 */
210static inline void mavlink_msg_mount_configure_send_struct(mavlink_channel_t chan, const mavlink_mount_configure_t* mount_configure)
211{
212#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
213 mavlink_msg_mount_configure_send(chan, mount_configure->target_system, mount_configure->target_component, mount_configure->mount_mode, mount_configure->stab_roll, mount_configure->stab_pitch, mount_configure->stab_yaw);
214#else
215 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, (const char *)mount_configure, MAVLINK_MSG_ID_MOUNT_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC);
216#endif
217}
218
219#if MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
220/*
221 This varient of _send() can be used to save stack space by re-using
222 memory from the receive buffer. The caller provides a
223 mavlink_message_t which is the size of a full mavlink message. This
224 is usually the receive buffer for the channel, and allows a reply to an
225 incoming message with minimum stack space usage.
226 */
227static inline void mavlink_msg_mount_configure_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mount_mode, uint8_t stab_roll, uint8_t stab_pitch, uint8_t stab_yaw)
228{
229#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
230 char *buf = (char *)msgbuf;
231 _mav_put_uint8_t(buf, 0, target_system);
232 _mav_put_uint8_t(buf, 1, target_component);
233 _mav_put_uint8_t(buf, 2, mount_mode);
234 _mav_put_uint8_t(buf, 3, stab_roll);
235 _mav_put_uint8_t(buf, 4, stab_pitch);
236 _mav_put_uint8_t(buf, 5, stab_yaw);
237
238 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, buf, MAVLINK_MSG_ID_MOUNT_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC);
239#else
240 mavlink_mount_configure_t *packet = (mavlink_mount_configure_t *)msgbuf;
241 packet->target_system = target_system;
242 packet->target_component = target_component;
243 packet->mount_mode = mount_mode;
244 packet->stab_roll = stab_roll;
245 packet->stab_pitch = stab_pitch;
246 packet->stab_yaw = stab_yaw;
247
248 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, (const char *)packet, MAVLINK_MSG_ID_MOUNT_CONFIGURE_MIN_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC);
249#endif
250}
251#endif
252
253#endif
254
255// MESSAGE MOUNT_CONFIGURE UNPACKING
256
257
258/**
259 * @brief Get field target_system from mount_configure message
260 *
261 * @return System ID
262 */
263static inline uint8_t mavlink_msg_mount_configure_get_target_system(const mavlink_message_t* msg)
264{
265 return _MAV_RETURN_uint8_t(msg, 0);
266}
267
268/**
269 * @brief Get field target_component from mount_configure message
270 *
271 * @return Component ID
272 */
273static inline uint8_t mavlink_msg_mount_configure_get_target_component(const mavlink_message_t* msg)
274{
275 return _MAV_RETURN_uint8_t(msg, 1);
276}
277
278/**
279 * @brief Get field mount_mode from mount_configure message
280 *
281 * @return mount operating mode (see MAV_MOUNT_MODE enum)
282 */
283static inline uint8_t mavlink_msg_mount_configure_get_mount_mode(const mavlink_message_t* msg)
284{
285 return _MAV_RETURN_uint8_t(msg, 2);
286}
287
288/**
289 * @brief Get field stab_roll from mount_configure message
290 *
291 * @return (1 = yes, 0 = no)
292 */
293static inline uint8_t mavlink_msg_mount_configure_get_stab_roll(const mavlink_message_t* msg)
294{
295 return _MAV_RETURN_uint8_t(msg, 3);
296}
297
298/**
299 * @brief Get field stab_pitch from mount_configure message
300 *
301 * @return (1 = yes, 0 = no)
302 */
303static inline uint8_t mavlink_msg_mount_configure_get_stab_pitch(const mavlink_message_t* msg)
304{
305 return _MAV_RETURN_uint8_t(msg, 4);
306}
307
308/**
309 * @brief Get field stab_yaw from mount_configure message
310 *
311 * @return (1 = yes, 0 = no)
312 */
313static inline uint8_t mavlink_msg_mount_configure_get_stab_yaw(const mavlink_message_t* msg)
314{
315 return _MAV_RETURN_uint8_t(msg, 5);
316}
317
318/**
319 * @brief Decode a mount_configure message into a struct
320 *
321 * @param msg The message to decode
322 * @param mount_configure C-struct to decode the message contents into
323 */
324static inline void mavlink_msg_mount_configure_decode(const mavlink_message_t* msg, mavlink_mount_configure_t* mount_configure)
325{
326#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
327 mount_configure->target_system = mavlink_msg_mount_configure_get_target_system(msg);
328 mount_configure->target_component = mavlink_msg_mount_configure_get_target_component(msg);
329 mount_configure->mount_mode = mavlink_msg_mount_configure_get_mount_mode(msg);
330 mount_configure->stab_roll = mavlink_msg_mount_configure_get_stab_roll(msg);
331 mount_configure->stab_pitch = mavlink_msg_mount_configure_get_stab_pitch(msg);
332 mount_configure->stab_yaw = mavlink_msg_mount_configure_get_stab_yaw(msg);
333#else
334 uint8_t len = msg->len < MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN? msg->len : MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN;
335 memset(mount_configure, 0, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN);
336 memcpy(mount_configure, _MAV_PAYLOAD(msg), len);
337#endif
338}