NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mavlink_msg_hil_rc_inputs_raw.h
Go to the documentation of this file.
1 // MESSAGE HIL_RC_INPUTS_RAW PACKING
2 
3 #define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW 92
4 
6 {
7  uint64_t time_usec;
8  uint16_t chan1_raw;
9  uint16_t chan2_raw;
10  uint16_t chan3_raw;
11  uint16_t chan4_raw;
12  uint16_t chan5_raw;
13  uint16_t chan6_raw;
14  uint16_t chan7_raw;
15  uint16_t chan8_raw;
16  uint16_t chan9_raw;
17  uint16_t chan10_raw;
18  uint16_t chan11_raw;
19  uint16_t chan12_raw;
20  uint8_t rssi;
22 
23 #define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN 33
24 #define MAVLINK_MSG_ID_92_LEN 33
25 
26 #define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC 54
27 #define MAVLINK_MSG_ID_92_CRC 54
28 
29 
30 
31 #define MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW { \
32  "HIL_RC_INPUTS_RAW", \
33  14, \
34  { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_rc_inputs_raw_t, time_usec) }, \
35  { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_hil_rc_inputs_raw_t, chan1_raw) }, \
36  { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_hil_rc_inputs_raw_t, chan2_raw) }, \
37  { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_hil_rc_inputs_raw_t, chan3_raw) }, \
38  { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_hil_rc_inputs_raw_t, chan4_raw) }, \
39  { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_hil_rc_inputs_raw_t, chan5_raw) }, \
40  { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_hil_rc_inputs_raw_t, chan6_raw) }, \
41  { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_hil_rc_inputs_raw_t, chan7_raw) }, \
42  { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_hil_rc_inputs_raw_t, chan8_raw) }, \
43  { "chan9_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_hil_rc_inputs_raw_t, chan9_raw) }, \
44  { "chan10_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_hil_rc_inputs_raw_t, chan10_raw) }, \
45  { "chan11_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_hil_rc_inputs_raw_t, chan11_raw) }, \
46  { "chan12_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_hil_rc_inputs_raw_t, chan12_raw) }, \
47  { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_hil_rc_inputs_raw_t, rssi) }, \
48  } \
49 }
50 
51 
74 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
75  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)
76 {
77 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
79  _mav_put_uint64_t(buf, 0, time_usec);
80  _mav_put_uint16_t(buf, 8, chan1_raw);
81  _mav_put_uint16_t(buf, 10, chan2_raw);
82  _mav_put_uint16_t(buf, 12, chan3_raw);
83  _mav_put_uint16_t(buf, 14, chan4_raw);
84  _mav_put_uint16_t(buf, 16, chan5_raw);
85  _mav_put_uint16_t(buf, 18, chan6_raw);
86  _mav_put_uint16_t(buf, 20, chan7_raw);
87  _mav_put_uint16_t(buf, 22, chan8_raw);
88  _mav_put_uint16_t(buf, 24, chan9_raw);
89  _mav_put_uint16_t(buf, 26, chan10_raw);
90  _mav_put_uint16_t(buf, 28, chan11_raw);
91  _mav_put_uint16_t(buf, 30, chan12_raw);
92  _mav_put_uint8_t(buf, 32, rssi);
93 
95 #else
97  packet.time_usec = time_usec;
98  packet.chan1_raw = chan1_raw;
99  packet.chan2_raw = chan2_raw;
100  packet.chan3_raw = chan3_raw;
101  packet.chan4_raw = chan4_raw;
102  packet.chan5_raw = chan5_raw;
103  packet.chan6_raw = chan6_raw;
104  packet.chan7_raw = chan7_raw;
105  packet.chan8_raw = chan8_raw;
106  packet.chan9_raw = chan9_raw;
107  packet.chan10_raw = chan10_raw;
108  packet.chan11_raw = chan11_raw;
109  packet.chan12_raw = chan12_raw;
110  packet.rssi = rssi;
111 
113 #endif
114 
116 #if MAVLINK_CRC_EXTRA
118 #else
119  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
120 #endif
121 }
122 
145 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
146  mavlink_message_t* msg,
147  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)
148 {
149 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
151  _mav_put_uint64_t(buf, 0, time_usec);
152  _mav_put_uint16_t(buf, 8, chan1_raw);
153  _mav_put_uint16_t(buf, 10, chan2_raw);
154  _mav_put_uint16_t(buf, 12, chan3_raw);
155  _mav_put_uint16_t(buf, 14, chan4_raw);
156  _mav_put_uint16_t(buf, 16, chan5_raw);
157  _mav_put_uint16_t(buf, 18, chan6_raw);
158  _mav_put_uint16_t(buf, 20, chan7_raw);
159  _mav_put_uint16_t(buf, 22, chan8_raw);
160  _mav_put_uint16_t(buf, 24, chan9_raw);
161  _mav_put_uint16_t(buf, 26, chan10_raw);
162  _mav_put_uint16_t(buf, 28, chan11_raw);
163  _mav_put_uint16_t(buf, 30, chan12_raw);
164  _mav_put_uint8_t(buf, 32, rssi);
165 
167 #else
169  packet.time_usec = time_usec;
170  packet.chan1_raw = chan1_raw;
171  packet.chan2_raw = chan2_raw;
172  packet.chan3_raw = chan3_raw;
173  packet.chan4_raw = chan4_raw;
174  packet.chan5_raw = chan5_raw;
175  packet.chan6_raw = chan6_raw;
176  packet.chan7_raw = chan7_raw;
177  packet.chan8_raw = chan8_raw;
178  packet.chan9_raw = chan9_raw;
179  packet.chan10_raw = chan10_raw;
180  packet.chan11_raw = chan11_raw;
181  packet.chan12_raw = chan12_raw;
182  packet.rssi = rssi;
183 
185 #endif
186 
188 #if MAVLINK_CRC_EXTRA
190 #else
191  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
192 #endif
193 }
194 
203 static 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)
204 {
205  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);
206 }
207 
217 static 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)
218 {
219  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);
220 }
221 
241 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
242 
243 static 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)
244 {
245 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
247  _mav_put_uint64_t(buf, 0, time_usec);
248  _mav_put_uint16_t(buf, 8, chan1_raw);
249  _mav_put_uint16_t(buf, 10, chan2_raw);
250  _mav_put_uint16_t(buf, 12, chan3_raw);
251  _mav_put_uint16_t(buf, 14, chan4_raw);
252  _mav_put_uint16_t(buf, 16, chan5_raw);
253  _mav_put_uint16_t(buf, 18, chan6_raw);
254  _mav_put_uint16_t(buf, 20, chan7_raw);
255  _mav_put_uint16_t(buf, 22, chan8_raw);
256  _mav_put_uint16_t(buf, 24, chan9_raw);
257  _mav_put_uint16_t(buf, 26, chan10_raw);
258  _mav_put_uint16_t(buf, 28, chan11_raw);
259  _mav_put_uint16_t(buf, 30, chan12_raw);
260  _mav_put_uint8_t(buf, 32, rssi);
261 
262 #if MAVLINK_CRC_EXTRA
264 #else
265  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
266 #endif
267 #else
269  packet.time_usec = time_usec;
270  packet.chan1_raw = chan1_raw;
271  packet.chan2_raw = chan2_raw;
272  packet.chan3_raw = chan3_raw;
273  packet.chan4_raw = chan4_raw;
274  packet.chan5_raw = chan5_raw;
275  packet.chan6_raw = chan6_raw;
276  packet.chan7_raw = chan7_raw;
277  packet.chan8_raw = chan8_raw;
278  packet.chan9_raw = chan9_raw;
279  packet.chan10_raw = chan10_raw;
280  packet.chan11_raw = chan11_raw;
281  packet.chan12_raw = chan12_raw;
282  packet.rssi = rssi;
283 
284 #if MAVLINK_CRC_EXTRA
285  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)&packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
286 #else
287  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)&packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
288 #endif
289 #endif
290 }
291 
292 #if MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
293 /*
294  This varient of _send() can be used to save stack space by re-using
295  memory from the receive buffer. The caller provides a
296  mavlink_message_t which is the size of a full mavlink message. This
297  is usually the receive buffer for the channel, and allows a reply to an
298  incoming message with minimum stack space usage.
299  */
300 static 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)
301 {
302 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
303  char *buf = (char *)msgbuf;
304  _mav_put_uint64_t(buf, 0, time_usec);
305  _mav_put_uint16_t(buf, 8, chan1_raw);
306  _mav_put_uint16_t(buf, 10, chan2_raw);
307  _mav_put_uint16_t(buf, 12, chan3_raw);
308  _mav_put_uint16_t(buf, 14, chan4_raw);
309  _mav_put_uint16_t(buf, 16, chan5_raw);
310  _mav_put_uint16_t(buf, 18, chan6_raw);
311  _mav_put_uint16_t(buf, 20, chan7_raw);
312  _mav_put_uint16_t(buf, 22, chan8_raw);
313  _mav_put_uint16_t(buf, 24, chan9_raw);
314  _mav_put_uint16_t(buf, 26, chan10_raw);
315  _mav_put_uint16_t(buf, 28, chan11_raw);
316  _mav_put_uint16_t(buf, 30, chan12_raw);
317  _mav_put_uint8_t(buf, 32, rssi);
318 
319 #if MAVLINK_CRC_EXTRA
321 #else
322  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
323 #endif
324 #else
326  packet->time_usec = time_usec;
327  packet->chan1_raw = chan1_raw;
328  packet->chan2_raw = chan2_raw;
329  packet->chan3_raw = chan3_raw;
330  packet->chan4_raw = chan4_raw;
331  packet->chan5_raw = chan5_raw;
332  packet->chan6_raw = chan6_raw;
333  packet->chan7_raw = chan7_raw;
334  packet->chan8_raw = chan8_raw;
335  packet->chan9_raw = chan9_raw;
336  packet->chan10_raw = chan10_raw;
337  packet->chan11_raw = chan11_raw;
338  packet->chan12_raw = chan12_raw;
339  packet->rssi = rssi;
340 
341 #if MAVLINK_CRC_EXTRA
342  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC);
343 #else
344  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW, (const char *)packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
345 #endif
346 #endif
347 }
348 #endif
349 
350 #endif
351 
352 // MESSAGE HIL_RC_INPUTS_RAW UNPACKING
353 
354 
360 static inline uint64_t mavlink_msg_hil_rc_inputs_raw_get_time_usec(const mavlink_message_t* msg)
361 {
362  return _MAV_RETURN_uint64_t(msg, 0);
363 }
364 
370 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan1_raw(const mavlink_message_t* msg)
371 {
372  return _MAV_RETURN_uint16_t(msg, 8);
373 }
374 
380 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan2_raw(const mavlink_message_t* msg)
381 {
382  return _MAV_RETURN_uint16_t(msg, 10);
383 }
384 
390 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan3_raw(const mavlink_message_t* msg)
391 {
392  return _MAV_RETURN_uint16_t(msg, 12);
393 }
394 
400 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan4_raw(const mavlink_message_t* msg)
401 {
402  return _MAV_RETURN_uint16_t(msg, 14);
403 }
404 
410 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan5_raw(const mavlink_message_t* msg)
411 {
412  return _MAV_RETURN_uint16_t(msg, 16);
413 }
414 
420 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan6_raw(const mavlink_message_t* msg)
421 {
422  return _MAV_RETURN_uint16_t(msg, 18);
423 }
424 
430 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan7_raw(const mavlink_message_t* msg)
431 {
432  return _MAV_RETURN_uint16_t(msg, 20);
433 }
434 
440 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan8_raw(const mavlink_message_t* msg)
441 {
442  return _MAV_RETURN_uint16_t(msg, 22);
443 }
444 
450 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan9_raw(const mavlink_message_t* msg)
451 {
452  return _MAV_RETURN_uint16_t(msg, 24);
453 }
454 
460 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan10_raw(const mavlink_message_t* msg)
461 {
462  return _MAV_RETURN_uint16_t(msg, 26);
463 }
464 
470 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan11_raw(const mavlink_message_t* msg)
471 {
472  return _MAV_RETURN_uint16_t(msg, 28);
473 }
474 
480 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan12_raw(const mavlink_message_t* msg)
481 {
482  return _MAV_RETURN_uint16_t(msg, 30);
483 }
484 
490 static inline uint8_t mavlink_msg_hil_rc_inputs_raw_get_rssi(const mavlink_message_t* msg)
491 {
492  return _MAV_RETURN_uint8_t(msg, 32);
493 }
494 
501 static inline void mavlink_msg_hil_rc_inputs_raw_decode(const mavlink_message_t* msg, mavlink_hil_rc_inputs_raw_t* hil_rc_inputs_raw)
502 {
503 #if MAVLINK_NEED_BYTE_SWAP
504  hil_rc_inputs_raw->time_usec = mavlink_msg_hil_rc_inputs_raw_get_time_usec(msg);
505  hil_rc_inputs_raw->chan1_raw = mavlink_msg_hil_rc_inputs_raw_get_chan1_raw(msg);
506  hil_rc_inputs_raw->chan2_raw = mavlink_msg_hil_rc_inputs_raw_get_chan2_raw(msg);
507  hil_rc_inputs_raw->chan3_raw = mavlink_msg_hil_rc_inputs_raw_get_chan3_raw(msg);
508  hil_rc_inputs_raw->chan4_raw = mavlink_msg_hil_rc_inputs_raw_get_chan4_raw(msg);
509  hil_rc_inputs_raw->chan5_raw = mavlink_msg_hil_rc_inputs_raw_get_chan5_raw(msg);
510  hil_rc_inputs_raw->chan6_raw = mavlink_msg_hil_rc_inputs_raw_get_chan6_raw(msg);
511  hil_rc_inputs_raw->chan7_raw = mavlink_msg_hil_rc_inputs_raw_get_chan7_raw(msg);
512  hil_rc_inputs_raw->chan8_raw = mavlink_msg_hil_rc_inputs_raw_get_chan8_raw(msg);
513  hil_rc_inputs_raw->chan9_raw = mavlink_msg_hil_rc_inputs_raw_get_chan9_raw(msg);
514  hil_rc_inputs_raw->chan10_raw = mavlink_msg_hil_rc_inputs_raw_get_chan10_raw(msg);
515  hil_rc_inputs_raw->chan11_raw = mavlink_msg_hil_rc_inputs_raw_get_chan11_raw(msg);
516  hil_rc_inputs_raw->chan12_raw = mavlink_msg_hil_rc_inputs_raw_get_chan12_raw(msg);
517  hil_rc_inputs_raw->rssi = mavlink_msg_hil_rc_inputs_raw_get_rssi(msg);
518 #else
519  memcpy(hil_rc_inputs_raw, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
520 #endif
521 }
#define _MAV_RETURN_uint8_t(msg, wire_offset)
Definition: protocol.h:238
#define _mav_put_uint8_t(buf, wire_offset, b)
Definition: protocol.h:134
#define _mav_put_uint64_t(buf, wire_offset, b)
Definition: protocol.h:143
#define _mav_put_uint16_t(buf, wire_offset, b)
Definition: protocol.h:139