source: flair-src/trunk/tools/Controller/Mavlink/src/include/common/mavlink_msg_hil_rc_inputs_raw.h @ 88

Last change on this file since 88 was 88, checked in by Sanahuja Guillaume, 5 years ago

m

File size: 24.4 KB
Line 
1// MESSAGE HIL_RC_INPUTS_RAW PACKING
2
3#define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW 92
4
5typedef struct MAVLINK_PACKED __mavlink_hil_rc_inputs_raw_t
6{
7 uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/
8 uint16_t chan1_raw; /*< RC channel 1 value, in microseconds*/
9 uint16_t chan2_raw; /*< RC channel 2 value, in microseconds*/
10 uint16_t chan3_raw; /*< RC channel 3 value, in microseconds*/
11 uint16_t chan4_raw; /*< RC channel 4 value, in microseconds*/
12 uint16_t chan5_raw; /*< RC channel 5 value, in microseconds*/
13 uint16_t chan6_raw; /*< RC channel 6 value, in microseconds*/
14 uint16_t chan7_raw; /*< RC channel 7 value, in microseconds*/
15 uint16_t chan8_raw; /*< RC channel 8 value, in microseconds*/
16 uint16_t chan9_raw; /*< RC channel 9 value, in microseconds*/
17 uint16_t chan10_raw; /*< RC channel 10 value, in microseconds*/
18 uint16_t chan11_raw; /*< RC channel 11 value, in microseconds*/
19 uint16_t chan12_raw; /*< RC channel 12 value, in microseconds*/
20 uint8_t rssi; /*< Receive signal strength indicator, 0: 0%, 255: 100%*/
21} mavlink_hil_rc_inputs_raw_t;
22
23#define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN 33
24#define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN 33
25#define MAVLINK_MSG_ID_92_LEN 33
26#define MAVLINK_MSG_ID_92_MIN_LEN 33
27
28#define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC 54
29#define MAVLINK_MSG_ID_92_CRC 54
30
31
32
33#if MAVLINK_COMMAND_24BIT
34#define MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW { \
35        92, \
36        "HIL_RC_INPUTS_RAW", \
37        14, \
38        {  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_rc_inputs_raw_t, time_usec) }, \
39         { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_hil_rc_inputs_raw_t, chan1_raw) }, \
40         { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_hil_rc_inputs_raw_t, chan2_raw) }, \
41         { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_hil_rc_inputs_raw_t, chan3_raw) }, \
42         { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_hil_rc_inputs_raw_t, chan4_raw) }, \
43         { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_hil_rc_inputs_raw_t, chan5_raw) }, \
44         { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_hil_rc_inputs_raw_t, chan6_raw) }, \
45         { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_hil_rc_inputs_raw_t, chan7_raw) }, \
46         { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_hil_rc_inputs_raw_t, chan8_raw) }, \
47         { "chan9_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_hil_rc_inputs_raw_t, chan9_raw) }, \
48         { "chan10_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_hil_rc_inputs_raw_t, chan10_raw) }, \
49         { "chan11_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_hil_rc_inputs_raw_t, chan11_raw) }, \
50         { "chan12_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_hil_rc_inputs_raw_t, chan12_raw) }, \
51         { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_hil_rc_inputs_raw_t, rssi) }, \
52         } \
53}
54#else
55#define MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW { \
56        "HIL_RC_INPUTS_RAW", \
57        14, \
58        {  { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_rc_inputs_raw_t, time_usec) }, \
59         { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_hil_rc_inputs_raw_t, chan1_raw) }, \
60         { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_hil_rc_inputs_raw_t, chan2_raw) }, \
61         { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_hil_rc_inputs_raw_t, chan3_raw) }, \
62         { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_hil_rc_inputs_raw_t, chan4_raw) }, \
63         { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_hil_rc_inputs_raw_t, chan5_raw) }, \
64         { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_hil_rc_inputs_raw_t, chan6_raw) }, \
65         { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_hil_rc_inputs_raw_t, chan7_raw) }, \
66         { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_hil_rc_inputs_raw_t, chan8_raw) }, \
67         { "chan9_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_hil_rc_inputs_raw_t, chan9_raw) }, \
68         { "chan10_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_hil_rc_inputs_raw_t, chan10_raw) }, \
69         { "chan11_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_hil_rc_inputs_raw_t, chan11_raw) }, \
70         { "chan12_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_hil_rc_inputs_raw_t, chan12_raw) }, \
71         { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_hil_rc_inputs_raw_t, rssi) }, \
72         } \
73}
74#endif
75
76/**
77 * @brief Pack a hil_rc_inputs_raw message
78 * @param system_id ID of this system
79 * @param component_id ID of this component (e.g. 200 for IMU)
80 * @param msg The MAVLink message to compress the data into
81 *
82 * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
83 * @param chan1_raw RC channel 1 value, in microseconds
84 * @param chan2_raw RC channel 2 value, in microseconds
85 * @param chan3_raw RC channel 3 value, in microseconds
86 * @param chan4_raw RC channel 4 value, in microseconds
87 * @param chan5_raw RC channel 5 value, in microseconds
88 * @param chan6_raw RC channel 6 value, in microseconds
89 * @param chan7_raw RC channel 7 value, in microseconds
90 * @param chan8_raw RC channel 8 value, in microseconds
91 * @param chan9_raw RC channel 9 value, in microseconds
92 * @param chan10_raw RC channel 10 value, in microseconds
93 * @param chan11_raw RC channel 11 value, in microseconds
94 * @param chan12_raw RC channel 12 value, in microseconds
95 * @param rssi Receive signal strength indicator, 0: 0%, 255: 100%
96 * @return length of the message in bytes (excluding serial stream start sign)
97 */
98static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
99                                                       uint64_t time_usec, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint8_t rssi)
100{
101#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
102        char buf[MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN];
103        _mav_put_uint64_t(buf, 0, time_usec);
104        _mav_put_uint16_t(buf, 8, chan1_raw);
105        _mav_put_uint16_t(buf, 10, chan2_raw);
106        _mav_put_uint16_t(buf, 12, chan3_raw);
107        _mav_put_uint16_t(buf, 14, chan4_raw);
108        _mav_put_uint16_t(buf, 16, chan5_raw);
109        _mav_put_uint16_t(buf, 18, chan6_raw);
110        _mav_put_uint16_t(buf, 20, chan7_raw);
111        _mav_put_uint16_t(buf, 22, chan8_raw);
112        _mav_put_uint16_t(buf, 24, chan9_raw);
113        _mav_put_uint16_t(buf, 26, chan10_raw);
114        _mav_put_uint16_t(buf, 28, chan11_raw);
115        _mav_put_uint16_t(buf, 30, chan12_raw);
116        _mav_put_uint8_t(buf, 32, rssi);
117
118        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
119#else
120        mavlink_hil_rc_inputs_raw_t packet;
121        packet.time_usec = time_usec;
122        packet.chan1_raw = chan1_raw;
123        packet.chan2_raw = chan2_raw;
124        packet.chan3_raw = chan3_raw;
125        packet.chan4_raw = chan4_raw;
126        packet.chan5_raw = chan5_raw;
127        packet.chan6_raw = chan6_raw;
128        packet.chan7_raw = chan7_raw;
129        packet.chan8_raw = chan8_raw;
130        packet.chan9_raw = chan9_raw;
131        packet.chan10_raw = chan10_raw;
132        packet.chan11_raw = chan11_raw;
133        packet.chan12_raw = chan12_raw;
134        packet.rssi = rssi;
135
136        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
137#endif
138
139        msg->msgid = MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW;
140    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
141}
142
143/**
144 * @brief Pack a hil_rc_inputs_raw message on a channel
145 * @param system_id ID of this system
146 * @param component_id ID of this component (e.g. 200 for IMU)
147 * @param chan The MAVLink channel this message will be sent over
148 * @param msg The MAVLink message to compress the data into
149 * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
150 * @param chan1_raw RC channel 1 value, in microseconds
151 * @param chan2_raw RC channel 2 value, in microseconds
152 * @param chan3_raw RC channel 3 value, in microseconds
153 * @param chan4_raw RC channel 4 value, in microseconds
154 * @param chan5_raw RC channel 5 value, in microseconds
155 * @param chan6_raw RC channel 6 value, in microseconds
156 * @param chan7_raw RC channel 7 value, in microseconds
157 * @param chan8_raw RC channel 8 value, in microseconds
158 * @param chan9_raw RC channel 9 value, in microseconds
159 * @param chan10_raw RC channel 10 value, in microseconds
160 * @param chan11_raw RC channel 11 value, in microseconds
161 * @param chan12_raw RC channel 12 value, in microseconds
162 * @param rssi Receive signal strength indicator, 0: 0%, 255: 100%
163 * @return length of the message in bytes (excluding serial stream start sign)
164 */
165static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
166                                                           mavlink_message_t* msg,
167                                                           uint64_t time_usec,uint16_t chan1_raw,uint16_t chan2_raw,uint16_t chan3_raw,uint16_t chan4_raw,uint16_t chan5_raw,uint16_t chan6_raw,uint16_t chan7_raw,uint16_t chan8_raw,uint16_t chan9_raw,uint16_t chan10_raw,uint16_t chan11_raw,uint16_t chan12_raw,uint8_t rssi)
168{
169#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
170        char buf[MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN];
171        _mav_put_uint64_t(buf, 0, time_usec);
172        _mav_put_uint16_t(buf, 8, chan1_raw);
173        _mav_put_uint16_t(buf, 10, chan2_raw);
174        _mav_put_uint16_t(buf, 12, chan3_raw);
175        _mav_put_uint16_t(buf, 14, chan4_raw);
176        _mav_put_uint16_t(buf, 16, chan5_raw);
177        _mav_put_uint16_t(buf, 18, chan6_raw);
178        _mav_put_uint16_t(buf, 20, chan7_raw);
179        _mav_put_uint16_t(buf, 22, chan8_raw);
180        _mav_put_uint16_t(buf, 24, chan9_raw);
181        _mav_put_uint16_t(buf, 26, chan10_raw);
182        _mav_put_uint16_t(buf, 28, chan11_raw);
183        _mav_put_uint16_t(buf, 30, chan12_raw);
184        _mav_put_uint8_t(buf, 32, rssi);
185
186        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
187#else
188        mavlink_hil_rc_inputs_raw_t packet;
189        packet.time_usec = time_usec;
190        packet.chan1_raw = chan1_raw;
191        packet.chan2_raw = chan2_raw;
192        packet.chan3_raw = chan3_raw;
193        packet.chan4_raw = chan4_raw;
194        packet.chan5_raw = chan5_raw;
195        packet.chan6_raw = chan6_raw;
196        packet.chan7_raw = chan7_raw;
197        packet.chan8_raw = chan8_raw;
198        packet.chan9_raw = chan9_raw;
199        packet.chan10_raw = chan10_raw;
200        packet.chan11_raw = chan11_raw;
201        packet.chan12_raw = chan12_raw;
202        packet.rssi = rssi;
203
204        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
205#endif
206
207        msg->msgid = MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW;
208    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
209}
210
211/**
212 * @brief Encode a hil_rc_inputs_raw struct
213 *
214 * @param system_id ID of this system
215 * @param component_id ID of this component (e.g. 200 for IMU)
216 * @param msg The MAVLink message to compress the data into
217 * @param hil_rc_inputs_raw C-struct to read the message contents from
218 */
219static inline uint16_t mavlink_msg_hil_rc_inputs_raw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_hil_rc_inputs_raw_t* hil_rc_inputs_raw)
220{
221        return mavlink_msg_hil_rc_inputs_raw_pack(system_id, component_id, msg, hil_rc_inputs_raw->time_usec, hil_rc_inputs_raw->chan1_raw, hil_rc_inputs_raw->chan2_raw, hil_rc_inputs_raw->chan3_raw, hil_rc_inputs_raw->chan4_raw, hil_rc_inputs_raw->chan5_raw, hil_rc_inputs_raw->chan6_raw, hil_rc_inputs_raw->chan7_raw, hil_rc_inputs_raw->chan8_raw, hil_rc_inputs_raw->chan9_raw, hil_rc_inputs_raw->chan10_raw, hil_rc_inputs_raw->chan11_raw, hil_rc_inputs_raw->chan12_raw, hil_rc_inputs_raw->rssi);
222}
223
224/**
225 * @brief Encode a hil_rc_inputs_raw struct on a channel
226 *
227 * @param system_id ID of this system
228 * @param component_id ID of this component (e.g. 200 for IMU)
229 * @param chan The MAVLink channel this message will be sent over
230 * @param msg The MAVLink message to compress the data into
231 * @param hil_rc_inputs_raw C-struct to read the message contents from
232 */
233static inline uint16_t mavlink_msg_hil_rc_inputs_raw_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_hil_rc_inputs_raw_t* hil_rc_inputs_raw)
234{
235        return mavlink_msg_hil_rc_inputs_raw_pack_chan(system_id, component_id, chan, msg, hil_rc_inputs_raw->time_usec, hil_rc_inputs_raw->chan1_raw, hil_rc_inputs_raw->chan2_raw, hil_rc_inputs_raw->chan3_raw, hil_rc_inputs_raw->chan4_raw, hil_rc_inputs_raw->chan5_raw, hil_rc_inputs_raw->chan6_raw, hil_rc_inputs_raw->chan7_raw, hil_rc_inputs_raw->chan8_raw, hil_rc_inputs_raw->chan9_raw, hil_rc_inputs_raw->chan10_raw, hil_rc_inputs_raw->chan11_raw, hil_rc_inputs_raw->chan12_raw, hil_rc_inputs_raw->rssi);
236}
237
238/**
239 * @brief Send a hil_rc_inputs_raw message
240 * @param chan MAVLink channel to send the message
241 *
242 * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
243 * @param chan1_raw RC channel 1 value, in microseconds
244 * @param chan2_raw RC channel 2 value, in microseconds
245 * @param chan3_raw RC channel 3 value, in microseconds
246 * @param chan4_raw RC channel 4 value, in microseconds
247 * @param chan5_raw RC channel 5 value, in microseconds
248 * @param chan6_raw RC channel 6 value, in microseconds
249 * @param chan7_raw RC channel 7 value, in microseconds
250 * @param chan8_raw RC channel 8 value, in microseconds
251 * @param chan9_raw RC channel 9 value, in microseconds
252 * @param chan10_raw RC channel 10 value, in microseconds
253 * @param chan11_raw RC channel 11 value, in microseconds
254 * @param chan12_raw RC channel 12 value, in microseconds
255 * @param rssi Receive signal strength indicator, 0: 0%, 255: 100%
256 */
257#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
258
259static inline void mavlink_msg_hil_rc_inputs_raw_send(mavlink_channel_t chan, uint64_t time_usec, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint8_t rssi)
260{
261#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
262        char buf[MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN];
263        _mav_put_uint64_t(buf, 0, time_usec);
264        _mav_put_uint16_t(buf, 8, chan1_raw);
265        _mav_put_uint16_t(buf, 10, chan2_raw);
266        _mav_put_uint16_t(buf, 12, chan3_raw);
267        _mav_put_uint16_t(buf, 14, chan4_raw);
268        _mav_put_uint16_t(buf, 16, chan5_raw);
269        _mav_put_uint16_t(buf, 18, chan6_raw);
270        _mav_put_uint16_t(buf, 20, chan7_raw);
271        _mav_put_uint16_t(buf, 22, chan8_raw);
272        _mav_put_uint16_t(buf, 24, chan9_raw);
273        _mav_put_uint16_t(buf, 26, chan10_raw);
274        _mav_put_uint16_t(buf, 28, chan11_raw);
275        _mav_put_uint16_t(buf, 30, chan12_raw);
276        _mav_put_uint8_t(buf, 32, rssi);
277
278    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
279#else
280        mavlink_hil_rc_inputs_raw_t packet;
281        packet.time_usec = time_usec;
282        packet.chan1_raw = chan1_raw;
283        packet.chan2_raw = chan2_raw;
284        packet.chan3_raw = chan3_raw;
285        packet.chan4_raw = chan4_raw;
286        packet.chan5_raw = chan5_raw;
287        packet.chan6_raw = chan6_raw;
288        packet.chan7_raw = chan7_raw;
289        packet.chan8_raw = chan8_raw;
290        packet.chan9_raw = chan9_raw;
291        packet.chan10_raw = chan10_raw;
292        packet.chan11_raw = chan11_raw;
293        packet.chan12_raw = chan12_raw;
294        packet.rssi = rssi;
295
296    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)&packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
297#endif
298}
299
300/**
301 * @brief Send a hil_rc_inputs_raw message
302 * @param chan MAVLink channel to send the message
303 * @param struct The MAVLink struct to serialize
304 */
305static inline void mavlink_msg_hil_rc_inputs_raw_send_struct(mavlink_channel_t chan, const mavlink_hil_rc_inputs_raw_t* hil_rc_inputs_raw)
306{
307#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
308    mavlink_msg_hil_rc_inputs_raw_send(chan, hil_rc_inputs_raw->time_usec, hil_rc_inputs_raw->chan1_raw, hil_rc_inputs_raw->chan2_raw, hil_rc_inputs_raw->chan3_raw, hil_rc_inputs_raw->chan4_raw, hil_rc_inputs_raw->chan5_raw, hil_rc_inputs_raw->chan6_raw, hil_rc_inputs_raw->chan7_raw, hil_rc_inputs_raw->chan8_raw, hil_rc_inputs_raw->chan9_raw, hil_rc_inputs_raw->chan10_raw, hil_rc_inputs_raw->chan11_raw, hil_rc_inputs_raw->chan12_raw, hil_rc_inputs_raw->rssi);
309#else
310    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)hil_rc_inputs_raw, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
311#endif
312}
313
314#if MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
315/*
316  This varient of _send() can be used to save stack space by re-using
317  memory from the receive buffer.  The caller provides a
318  mavlink_message_t which is the size of a full mavlink message. This
319  is usually the receive buffer for the channel, and allows a reply to an
320  incoming message with minimum stack space usage.
321 */
322static inline void mavlink_msg_hil_rc_inputs_raw_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint64_t time_usec, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint8_t rssi)
323{
324#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
325        char *buf = (char *)msgbuf;
326        _mav_put_uint64_t(buf, 0, time_usec);
327        _mav_put_uint16_t(buf, 8, chan1_raw);
328        _mav_put_uint16_t(buf, 10, chan2_raw);
329        _mav_put_uint16_t(buf, 12, chan3_raw);
330        _mav_put_uint16_t(buf, 14, chan4_raw);
331        _mav_put_uint16_t(buf, 16, chan5_raw);
332        _mav_put_uint16_t(buf, 18, chan6_raw);
333        _mav_put_uint16_t(buf, 20, chan7_raw);
334        _mav_put_uint16_t(buf, 22, chan8_raw);
335        _mav_put_uint16_t(buf, 24, chan9_raw);
336        _mav_put_uint16_t(buf, 26, chan10_raw);
337        _mav_put_uint16_t(buf, 28, chan11_raw);
338        _mav_put_uint16_t(buf, 30, chan12_raw);
339        _mav_put_uint8_t(buf, 32, rssi);
340
341    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
342#else
343        mavlink_hil_rc_inputs_raw_t *packet = (mavlink_hil_rc_inputs_raw_t *)msgbuf;
344        packet->time_usec = time_usec;
345        packet->chan1_raw = chan1_raw;
346        packet->chan2_raw = chan2_raw;
347        packet->chan3_raw = chan3_raw;
348        packet->chan4_raw = chan4_raw;
349        packet->chan5_raw = chan5_raw;
350        packet->chan6_raw = chan6_raw;
351        packet->chan7_raw = chan7_raw;
352        packet->chan8_raw = chan8_raw;
353        packet->chan9_raw = chan9_raw;
354        packet->chan10_raw = chan10_raw;
355        packet->chan11_raw = chan11_raw;
356        packet->chan12_raw = chan12_raw;
357        packet->rssi = rssi;
358
359    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
360#endif
361}
362#endif
363
364#endif
365
366// MESSAGE HIL_RC_INPUTS_RAW UNPACKING
367
368
369/**
370 * @brief Get field time_usec from hil_rc_inputs_raw message
371 *
372 * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot)
373 */
374static inline uint64_t mavlink_msg_hil_rc_inputs_raw_get_time_usec(const mavlink_message_t* msg)
375{
376        return _MAV_RETURN_uint64_t(msg,  0);
377}
378
379/**
380 * @brief Get field chan1_raw from hil_rc_inputs_raw message
381 *
382 * @return RC channel 1 value, in microseconds
383 */
384static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan1_raw(const mavlink_message_t* msg)
385{
386        return _MAV_RETURN_uint16_t(msg,  8);
387}
388
389/**
390 * @brief Get field chan2_raw from hil_rc_inputs_raw message
391 *
392 * @return RC channel 2 value, in microseconds
393 */
394static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan2_raw(const mavlink_message_t* msg)
395{
396        return _MAV_RETURN_uint16_t(msg,  10);
397}
398
399/**
400 * @brief Get field chan3_raw from hil_rc_inputs_raw message
401 *
402 * @return RC channel 3 value, in microseconds
403 */
404static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan3_raw(const mavlink_message_t* msg)
405{
406        return _MAV_RETURN_uint16_t(msg,  12);
407}
408
409/**
410 * @brief Get field chan4_raw from hil_rc_inputs_raw message
411 *
412 * @return RC channel 4 value, in microseconds
413 */
414static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan4_raw(const mavlink_message_t* msg)
415{
416        return _MAV_RETURN_uint16_t(msg,  14);
417}
418
419/**
420 * @brief Get field chan5_raw from hil_rc_inputs_raw message
421 *
422 * @return RC channel 5 value, in microseconds
423 */
424static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan5_raw(const mavlink_message_t* msg)
425{
426        return _MAV_RETURN_uint16_t(msg,  16);
427}
428
429/**
430 * @brief Get field chan6_raw from hil_rc_inputs_raw message
431 *
432 * @return RC channel 6 value, in microseconds
433 */
434static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan6_raw(const mavlink_message_t* msg)
435{
436        return _MAV_RETURN_uint16_t(msg,  18);
437}
438
439/**
440 * @brief Get field chan7_raw from hil_rc_inputs_raw message
441 *
442 * @return RC channel 7 value, in microseconds
443 */
444static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan7_raw(const mavlink_message_t* msg)
445{
446        return _MAV_RETURN_uint16_t(msg,  20);
447}
448
449/**
450 * @brief Get field chan8_raw from hil_rc_inputs_raw message
451 *
452 * @return RC channel 8 value, in microseconds
453 */
454static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan8_raw(const mavlink_message_t* msg)
455{
456        return _MAV_RETURN_uint16_t(msg,  22);
457}
458
459/**
460 * @brief Get field chan9_raw from hil_rc_inputs_raw message
461 *
462 * @return RC channel 9 value, in microseconds
463 */
464static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan9_raw(const mavlink_message_t* msg)
465{
466        return _MAV_RETURN_uint16_t(msg,  24);
467}
468
469/**
470 * @brief Get field chan10_raw from hil_rc_inputs_raw message
471 *
472 * @return RC channel 10 value, in microseconds
473 */
474static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan10_raw(const mavlink_message_t* msg)
475{
476        return _MAV_RETURN_uint16_t(msg,  26);
477}
478
479/**
480 * @brief Get field chan11_raw from hil_rc_inputs_raw message
481 *
482 * @return RC channel 11 value, in microseconds
483 */
484static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan11_raw(const mavlink_message_t* msg)
485{
486        return _MAV_RETURN_uint16_t(msg,  28);
487}
488
489/**
490 * @brief Get field chan12_raw from hil_rc_inputs_raw message
491 *
492 * @return RC channel 12 value, in microseconds
493 */
494static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan12_raw(const mavlink_message_t* msg)
495{
496        return _MAV_RETURN_uint16_t(msg,  30);
497}
498
499/**
500 * @brief Get field rssi from hil_rc_inputs_raw message
501 *
502 * @return Receive signal strength indicator, 0: 0%, 255: 100%
503 */
504static inline uint8_t mavlink_msg_hil_rc_inputs_raw_get_rssi(const mavlink_message_t* msg)
505{
506        return _MAV_RETURN_uint8_t(msg,  32);
507}
508
509/**
510 * @brief Decode a hil_rc_inputs_raw message into a struct
511 *
512 * @param msg The message to decode
513 * @param hil_rc_inputs_raw C-struct to decode the message contents into
514 */
515static inline void mavlink_msg_hil_rc_inputs_raw_decode(const mavlink_message_t* msg, mavlink_hil_rc_inputs_raw_t* hil_rc_inputs_raw)
516{
517#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
518        hil_rc_inputs_raw->time_usec = mavlink_msg_hil_rc_inputs_raw_get_time_usec(msg);
519        hil_rc_inputs_raw->chan1_raw = mavlink_msg_hil_rc_inputs_raw_get_chan1_raw(msg);
520        hil_rc_inputs_raw->chan2_raw = mavlink_msg_hil_rc_inputs_raw_get_chan2_raw(msg);
521        hil_rc_inputs_raw->chan3_raw = mavlink_msg_hil_rc_inputs_raw_get_chan3_raw(msg);
522        hil_rc_inputs_raw->chan4_raw = mavlink_msg_hil_rc_inputs_raw_get_chan4_raw(msg);
523        hil_rc_inputs_raw->chan5_raw = mavlink_msg_hil_rc_inputs_raw_get_chan5_raw(msg);
524        hil_rc_inputs_raw->chan6_raw = mavlink_msg_hil_rc_inputs_raw_get_chan6_raw(msg);
525        hil_rc_inputs_raw->chan7_raw = mavlink_msg_hil_rc_inputs_raw_get_chan7_raw(msg);
526        hil_rc_inputs_raw->chan8_raw = mavlink_msg_hil_rc_inputs_raw_get_chan8_raw(msg);
527        hil_rc_inputs_raw->chan9_raw = mavlink_msg_hil_rc_inputs_raw_get_chan9_raw(msg);
528        hil_rc_inputs_raw->chan10_raw = mavlink_msg_hil_rc_inputs_raw_get_chan10_raw(msg);
529        hil_rc_inputs_raw->chan11_raw = mavlink_msg_hil_rc_inputs_raw_get_chan11_raw(msg);
530        hil_rc_inputs_raw->chan12_raw = mavlink_msg_hil_rc_inputs_raw_get_chan12_raw(msg);
531        hil_rc_inputs_raw->rssi = mavlink_msg_hil_rc_inputs_raw_get_rssi(msg);
532#else
533        uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN? msg->len : MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN;
534        memset(hil_rc_inputs_raw, 0, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
535        memcpy(hil_rc_inputs_raw, _MAV_PAYLOAD(msg), len);
536#endif
537}
Note: See TracBrowser for help on using the repository browser.