RflySimSDK v3.08
RflySimSDK说明文档
载入中...
搜索中...
未找到
mavlink_msg_serial_udb_extra_f21.h
1#pragma once
2// MESSAGE SERIAL_UDB_EXTRA_F21 PACKING
3
4#define MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21 187
5
6MAVPACKED(
7typedef struct __mavlink_serial_udb_extra_f21_t {
8 int16_t sue_accel_x_offset; /*< SUE X accelerometer offset*/
9 int16_t sue_accel_y_offset; /*< SUE Y accelerometer offset*/
10 int16_t sue_accel_z_offset; /*< SUE Z accelerometer offset*/
11 int16_t sue_gyro_x_offset; /*< SUE X gyro offset*/
12 int16_t sue_gyro_y_offset; /*< SUE Y gyro offset*/
13 int16_t sue_gyro_z_offset; /*< SUE Z gyro offset*/
14}) mavlink_serial_udb_extra_f21_t;
15
16#define MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_LEN 12
17#define MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_MIN_LEN 12
18#define MAVLINK_MSG_ID_187_LEN 12
19#define MAVLINK_MSG_ID_187_MIN_LEN 12
20
21#define MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_CRC 134
22#define MAVLINK_MSG_ID_187_CRC 134
23
24
25
26#if MAVLINK_COMMAND_24BIT
27#define MAVLINK_MESSAGE_INFO_SERIAL_UDB_EXTRA_F21 { \
28 187, \
29 "SERIAL_UDB_EXTRA_F21", \
30 6, \
31 { { "sue_accel_x_offset", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_serial_udb_extra_f21_t, sue_accel_x_offset) }, \
32 { "sue_accel_y_offset", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_serial_udb_extra_f21_t, sue_accel_y_offset) }, \
33 { "sue_accel_z_offset", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_serial_udb_extra_f21_t, sue_accel_z_offset) }, \
34 { "sue_gyro_x_offset", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_serial_udb_extra_f21_t, sue_gyro_x_offset) }, \
35 { "sue_gyro_y_offset", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_serial_udb_extra_f21_t, sue_gyro_y_offset) }, \
36 { "sue_gyro_z_offset", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_serial_udb_extra_f21_t, sue_gyro_z_offset) }, \
37 } \
38}
39#else
40#define MAVLINK_MESSAGE_INFO_SERIAL_UDB_EXTRA_F21 { \
41 "SERIAL_UDB_EXTRA_F21", \
42 6, \
43 { { "sue_accel_x_offset", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_serial_udb_extra_f21_t, sue_accel_x_offset) }, \
44 { "sue_accel_y_offset", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_serial_udb_extra_f21_t, sue_accel_y_offset) }, \
45 { "sue_accel_z_offset", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_serial_udb_extra_f21_t, sue_accel_z_offset) }, \
46 { "sue_gyro_x_offset", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_serial_udb_extra_f21_t, sue_gyro_x_offset) }, \
47 { "sue_gyro_y_offset", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_serial_udb_extra_f21_t, sue_gyro_y_offset) }, \
48 { "sue_gyro_z_offset", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_serial_udb_extra_f21_t, sue_gyro_z_offset) }, \
49 } \
50}
51#endif
52
53/**
54 * @brief Pack a serial_udb_extra_f21 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 sue_accel_x_offset SUE X accelerometer offset
60 * @param sue_accel_y_offset SUE Y accelerometer offset
61 * @param sue_accel_z_offset SUE Z accelerometer offset
62 * @param sue_gyro_x_offset SUE X gyro offset
63 * @param sue_gyro_y_offset SUE Y gyro offset
64 * @param sue_gyro_z_offset SUE Z gyro offset
65 * @return length of the message in bytes (excluding serial stream start sign)
66 */
67static inline uint16_t mavlink_msg_serial_udb_extra_f21_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
68 int16_t sue_accel_x_offset, int16_t sue_accel_y_offset, int16_t sue_accel_z_offset, int16_t sue_gyro_x_offset, int16_t sue_gyro_y_offset, int16_t sue_gyro_z_offset)
69{
70#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
71 char buf[MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_LEN];
72 _mav_put_int16_t(buf, 0, sue_accel_x_offset);
73 _mav_put_int16_t(buf, 2, sue_accel_y_offset);
74 _mav_put_int16_t(buf, 4, sue_accel_z_offset);
75 _mav_put_int16_t(buf, 6, sue_gyro_x_offset);
76 _mav_put_int16_t(buf, 8, sue_gyro_y_offset);
77 _mav_put_int16_t(buf, 10, sue_gyro_z_offset);
78
79 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_LEN);
80#else
81 mavlink_serial_udb_extra_f21_t packet;
82 packet.sue_accel_x_offset = sue_accel_x_offset;
83 packet.sue_accel_y_offset = sue_accel_y_offset;
84 packet.sue_accel_z_offset = sue_accel_z_offset;
85 packet.sue_gyro_x_offset = sue_gyro_x_offset;
86 packet.sue_gyro_y_offset = sue_gyro_y_offset;
87 packet.sue_gyro_z_offset = sue_gyro_z_offset;
88
89 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_LEN);
90#endif
91
92 msg->msgid = MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21;
93 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_MIN_LEN, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_LEN, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_CRC);
94}
95
96/**
97 * @brief Pack a serial_udb_extra_f21 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 sue_accel_x_offset SUE X accelerometer offset
103 * @param sue_accel_y_offset SUE Y accelerometer offset
104 * @param sue_accel_z_offset SUE Z accelerometer offset
105 * @param sue_gyro_x_offset SUE X gyro offset
106 * @param sue_gyro_y_offset SUE Y gyro offset
107 * @param sue_gyro_z_offset SUE Z gyro offset
108 * @return length of the message in bytes (excluding serial stream start sign)
109 */
110static inline uint16_t mavlink_msg_serial_udb_extra_f21_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
111 mavlink_message_t* msg,
112 int16_t sue_accel_x_offset,int16_t sue_accel_y_offset,int16_t sue_accel_z_offset,int16_t sue_gyro_x_offset,int16_t sue_gyro_y_offset,int16_t sue_gyro_z_offset)
113{
114#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
115 char buf[MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_LEN];
116 _mav_put_int16_t(buf, 0, sue_accel_x_offset);
117 _mav_put_int16_t(buf, 2, sue_accel_y_offset);
118 _mav_put_int16_t(buf, 4, sue_accel_z_offset);
119 _mav_put_int16_t(buf, 6, sue_gyro_x_offset);
120 _mav_put_int16_t(buf, 8, sue_gyro_y_offset);
121 _mav_put_int16_t(buf, 10, sue_gyro_z_offset);
122
123 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_LEN);
124#else
125 mavlink_serial_udb_extra_f21_t packet;
126 packet.sue_accel_x_offset = sue_accel_x_offset;
127 packet.sue_accel_y_offset = sue_accel_y_offset;
128 packet.sue_accel_z_offset = sue_accel_z_offset;
129 packet.sue_gyro_x_offset = sue_gyro_x_offset;
130 packet.sue_gyro_y_offset = sue_gyro_y_offset;
131 packet.sue_gyro_z_offset = sue_gyro_z_offset;
132
133 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_LEN);
134#endif
135
136 msg->msgid = MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21;
137 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_MIN_LEN, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_LEN, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_CRC);
138}
139
140/**
141 * @brief Encode a serial_udb_extra_f21 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 serial_udb_extra_f21 C-struct to read the message contents from
147 */
148static inline uint16_t mavlink_msg_serial_udb_extra_f21_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_serial_udb_extra_f21_t* serial_udb_extra_f21)
149{
150 return mavlink_msg_serial_udb_extra_f21_pack(system_id, component_id, msg, serial_udb_extra_f21->sue_accel_x_offset, serial_udb_extra_f21->sue_accel_y_offset, serial_udb_extra_f21->sue_accel_z_offset, serial_udb_extra_f21->sue_gyro_x_offset, serial_udb_extra_f21->sue_gyro_y_offset, serial_udb_extra_f21->sue_gyro_z_offset);
151}
152
153/**
154 * @brief Encode a serial_udb_extra_f21 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 serial_udb_extra_f21 C-struct to read the message contents from
161 */
162static inline uint16_t mavlink_msg_serial_udb_extra_f21_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_serial_udb_extra_f21_t* serial_udb_extra_f21)
163{
164 return mavlink_msg_serial_udb_extra_f21_pack_chan(system_id, component_id, chan, msg, serial_udb_extra_f21->sue_accel_x_offset, serial_udb_extra_f21->sue_accel_y_offset, serial_udb_extra_f21->sue_accel_z_offset, serial_udb_extra_f21->sue_gyro_x_offset, serial_udb_extra_f21->sue_gyro_y_offset, serial_udb_extra_f21->sue_gyro_z_offset);
165}
166
167/**
168 * @brief Send a serial_udb_extra_f21 message
169 * @param chan MAVLink channel to send the message
170 *
171 * @param sue_accel_x_offset SUE X accelerometer offset
172 * @param sue_accel_y_offset SUE Y accelerometer offset
173 * @param sue_accel_z_offset SUE Z accelerometer offset
174 * @param sue_gyro_x_offset SUE X gyro offset
175 * @param sue_gyro_y_offset SUE Y gyro offset
176 * @param sue_gyro_z_offset SUE Z gyro offset
177 */
178#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
179
180static inline void mavlink_msg_serial_udb_extra_f21_send(mavlink_channel_t chan, int16_t sue_accel_x_offset, int16_t sue_accel_y_offset, int16_t sue_accel_z_offset, int16_t sue_gyro_x_offset, int16_t sue_gyro_y_offset, int16_t sue_gyro_z_offset)
181{
182#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
183 char buf[MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_LEN];
184 _mav_put_int16_t(buf, 0, sue_accel_x_offset);
185 _mav_put_int16_t(buf, 2, sue_accel_y_offset);
186 _mav_put_int16_t(buf, 4, sue_accel_z_offset);
187 _mav_put_int16_t(buf, 6, sue_gyro_x_offset);
188 _mav_put_int16_t(buf, 8, sue_gyro_y_offset);
189 _mav_put_int16_t(buf, 10, sue_gyro_z_offset);
190
191 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21, buf, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_MIN_LEN, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_LEN, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_CRC);
192#else
193 mavlink_serial_udb_extra_f21_t packet;
194 packet.sue_accel_x_offset = sue_accel_x_offset;
195 packet.sue_accel_y_offset = sue_accel_y_offset;
196 packet.sue_accel_z_offset = sue_accel_z_offset;
197 packet.sue_gyro_x_offset = sue_gyro_x_offset;
198 packet.sue_gyro_y_offset = sue_gyro_y_offset;
199 packet.sue_gyro_z_offset = sue_gyro_z_offset;
200
201 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21, (const char *)&packet, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_MIN_LEN, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_LEN, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_CRC);
202#endif
203}
204
205/**
206 * @brief Send a serial_udb_extra_f21 message
207 * @param chan MAVLink channel to send the message
208 * @param struct The MAVLink struct to serialize
209 */
210static inline void mavlink_msg_serial_udb_extra_f21_send_struct(mavlink_channel_t chan, const mavlink_serial_udb_extra_f21_t* serial_udb_extra_f21)
211{
212#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
213 mavlink_msg_serial_udb_extra_f21_send(chan, serial_udb_extra_f21->sue_accel_x_offset, serial_udb_extra_f21->sue_accel_y_offset, serial_udb_extra_f21->sue_accel_z_offset, serial_udb_extra_f21->sue_gyro_x_offset, serial_udb_extra_f21->sue_gyro_y_offset, serial_udb_extra_f21->sue_gyro_z_offset);
214#else
215 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21, (const char *)serial_udb_extra_f21, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_MIN_LEN, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_LEN, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_CRC);
216#endif
217}
218
219#if MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_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_serial_udb_extra_f21_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int16_t sue_accel_x_offset, int16_t sue_accel_y_offset, int16_t sue_accel_z_offset, int16_t sue_gyro_x_offset, int16_t sue_gyro_y_offset, int16_t sue_gyro_z_offset)
228{
229#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
230 char *buf = (char *)msgbuf;
231 _mav_put_int16_t(buf, 0, sue_accel_x_offset);
232 _mav_put_int16_t(buf, 2, sue_accel_y_offset);
233 _mav_put_int16_t(buf, 4, sue_accel_z_offset);
234 _mav_put_int16_t(buf, 6, sue_gyro_x_offset);
235 _mav_put_int16_t(buf, 8, sue_gyro_y_offset);
236 _mav_put_int16_t(buf, 10, sue_gyro_z_offset);
237
238 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21, buf, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_MIN_LEN, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_LEN, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_CRC);
239#else
240 mavlink_serial_udb_extra_f21_t *packet = (mavlink_serial_udb_extra_f21_t *)msgbuf;
241 packet->sue_accel_x_offset = sue_accel_x_offset;
242 packet->sue_accel_y_offset = sue_accel_y_offset;
243 packet->sue_accel_z_offset = sue_accel_z_offset;
244 packet->sue_gyro_x_offset = sue_gyro_x_offset;
245 packet->sue_gyro_y_offset = sue_gyro_y_offset;
246 packet->sue_gyro_z_offset = sue_gyro_z_offset;
247
248 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21, (const char *)packet, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_MIN_LEN, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_LEN, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_CRC);
249#endif
250}
251#endif
252
253#endif
254
255// MESSAGE SERIAL_UDB_EXTRA_F21 UNPACKING
256
257
258/**
259 * @brief Get field sue_accel_x_offset from serial_udb_extra_f21 message
260 *
261 * @return SUE X accelerometer offset
262 */
263static inline int16_t mavlink_msg_serial_udb_extra_f21_get_sue_accel_x_offset(const mavlink_message_t* msg)
264{
265 return _MAV_RETURN_int16_t(msg, 0);
266}
267
268/**
269 * @brief Get field sue_accel_y_offset from serial_udb_extra_f21 message
270 *
271 * @return SUE Y accelerometer offset
272 */
273static inline int16_t mavlink_msg_serial_udb_extra_f21_get_sue_accel_y_offset(const mavlink_message_t* msg)
274{
275 return _MAV_RETURN_int16_t(msg, 2);
276}
277
278/**
279 * @brief Get field sue_accel_z_offset from serial_udb_extra_f21 message
280 *
281 * @return SUE Z accelerometer offset
282 */
283static inline int16_t mavlink_msg_serial_udb_extra_f21_get_sue_accel_z_offset(const mavlink_message_t* msg)
284{
285 return _MAV_RETURN_int16_t(msg, 4);
286}
287
288/**
289 * @brief Get field sue_gyro_x_offset from serial_udb_extra_f21 message
290 *
291 * @return SUE X gyro offset
292 */
293static inline int16_t mavlink_msg_serial_udb_extra_f21_get_sue_gyro_x_offset(const mavlink_message_t* msg)
294{
295 return _MAV_RETURN_int16_t(msg, 6);
296}
297
298/**
299 * @brief Get field sue_gyro_y_offset from serial_udb_extra_f21 message
300 *
301 * @return SUE Y gyro offset
302 */
303static inline int16_t mavlink_msg_serial_udb_extra_f21_get_sue_gyro_y_offset(const mavlink_message_t* msg)
304{
305 return _MAV_RETURN_int16_t(msg, 8);
306}
307
308/**
309 * @brief Get field sue_gyro_z_offset from serial_udb_extra_f21 message
310 *
311 * @return SUE Z gyro offset
312 */
313static inline int16_t mavlink_msg_serial_udb_extra_f21_get_sue_gyro_z_offset(const mavlink_message_t* msg)
314{
315 return _MAV_RETURN_int16_t(msg, 10);
316}
317
318/**
319 * @brief Decode a serial_udb_extra_f21 message into a struct
320 *
321 * @param msg The message to decode
322 * @param serial_udb_extra_f21 C-struct to decode the message contents into
323 */
324static inline void mavlink_msg_serial_udb_extra_f21_decode(const mavlink_message_t* msg, mavlink_serial_udb_extra_f21_t* serial_udb_extra_f21)
325{
326#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
327 serial_udb_extra_f21->sue_accel_x_offset = mavlink_msg_serial_udb_extra_f21_get_sue_accel_x_offset(msg);
328 serial_udb_extra_f21->sue_accel_y_offset = mavlink_msg_serial_udb_extra_f21_get_sue_accel_y_offset(msg);
329 serial_udb_extra_f21->sue_accel_z_offset = mavlink_msg_serial_udb_extra_f21_get_sue_accel_z_offset(msg);
330 serial_udb_extra_f21->sue_gyro_x_offset = mavlink_msg_serial_udb_extra_f21_get_sue_gyro_x_offset(msg);
331 serial_udb_extra_f21->sue_gyro_y_offset = mavlink_msg_serial_udb_extra_f21_get_sue_gyro_y_offset(msg);
332 serial_udb_extra_f21->sue_gyro_z_offset = mavlink_msg_serial_udb_extra_f21_get_sue_gyro_z_offset(msg);
333#else
334 uint8_t len = msg->len < MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_LEN? msg->len : MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_LEN;
335 memset(serial_udb_extra_f21, 0, MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_LEN);
336 memcpy(serial_udb_extra_f21, _MAV_PAYLOAD(msg), len);
337#endif
338}