Merge remote-tracking branch 'upstream/master' into abo_fw_alt_vel_control
[inav.git] / lib / main / MAVLink / common / mavlink_msg_hil_rc_inputs_raw.h
blob28ce091ab83b997af91acb82908598633a96e203
1 #pragma once
2 // MESSAGE HIL_RC_INPUTS_RAW PACKING
4 #define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW 92
7 typedef struct __mavlink_hil_rc_inputs_raw_t {
8 uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/
9 uint16_t chan1_raw; /*< [us] RC channel 1 value*/
10 uint16_t chan2_raw; /*< [us] RC channel 2 value*/
11 uint16_t chan3_raw; /*< [us] RC channel 3 value*/
12 uint16_t chan4_raw; /*< [us] RC channel 4 value*/
13 uint16_t chan5_raw; /*< [us] RC channel 5 value*/
14 uint16_t chan6_raw; /*< [us] RC channel 6 value*/
15 uint16_t chan7_raw; /*< [us] RC channel 7 value*/
16 uint16_t chan8_raw; /*< [us] RC channel 8 value*/
17 uint16_t chan9_raw; /*< [us] RC channel 9 value*/
18 uint16_t chan10_raw; /*< [us] RC channel 10 value*/
19 uint16_t chan11_raw; /*< [us] RC channel 11 value*/
20 uint16_t chan12_raw; /*< [us] RC channel 12 value*/
21 uint8_t rssi; /*< Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown.*/
22 } mavlink_hil_rc_inputs_raw_t;
24 #define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN 33
25 #define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN 33
26 #define MAVLINK_MSG_ID_92_LEN 33
27 #define MAVLINK_MSG_ID_92_MIN_LEN 33
29 #define MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_CRC 54
30 #define MAVLINK_MSG_ID_92_CRC 54
34 #if MAVLINK_COMMAND_24BIT
35 #define MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW { \
36 92, \
37 "HIL_RC_INPUTS_RAW", \
38 14, \
39 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_rc_inputs_raw_t, time_usec) }, \
40 { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_hil_rc_inputs_raw_t, chan1_raw) }, \
41 { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_hil_rc_inputs_raw_t, chan2_raw) }, \
42 { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_hil_rc_inputs_raw_t, chan3_raw) }, \
43 { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_hil_rc_inputs_raw_t, chan4_raw) }, \
44 { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_hil_rc_inputs_raw_t, chan5_raw) }, \
45 { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_hil_rc_inputs_raw_t, chan6_raw) }, \
46 { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_hil_rc_inputs_raw_t, chan7_raw) }, \
47 { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_hil_rc_inputs_raw_t, chan8_raw) }, \
48 { "chan9_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_hil_rc_inputs_raw_t, chan9_raw) }, \
49 { "chan10_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_hil_rc_inputs_raw_t, chan10_raw) }, \
50 { "chan11_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_hil_rc_inputs_raw_t, chan11_raw) }, \
51 { "chan12_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_hil_rc_inputs_raw_t, chan12_raw) }, \
52 { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_hil_rc_inputs_raw_t, rssi) }, \
53 } \
55 #else
56 #define MAVLINK_MESSAGE_INFO_HIL_RC_INPUTS_RAW { \
57 "HIL_RC_INPUTS_RAW", \
58 14, \
59 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_rc_inputs_raw_t, time_usec) }, \
60 { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_hil_rc_inputs_raw_t, chan1_raw) }, \
61 { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_hil_rc_inputs_raw_t, chan2_raw) }, \
62 { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_hil_rc_inputs_raw_t, chan3_raw) }, \
63 { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_hil_rc_inputs_raw_t, chan4_raw) }, \
64 { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_hil_rc_inputs_raw_t, chan5_raw) }, \
65 { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_hil_rc_inputs_raw_t, chan6_raw) }, \
66 { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_hil_rc_inputs_raw_t, chan7_raw) }, \
67 { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_hil_rc_inputs_raw_t, chan8_raw) }, \
68 { "chan9_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_hil_rc_inputs_raw_t, chan9_raw) }, \
69 { "chan10_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_hil_rc_inputs_raw_t, chan10_raw) }, \
70 { "chan11_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_hil_rc_inputs_raw_t, chan11_raw) }, \
71 { "chan12_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_hil_rc_inputs_raw_t, chan12_raw) }, \
72 { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_hil_rc_inputs_raw_t, rssi) }, \
73 } \
75 #endif
77 /**
78 * @brief Pack a hil_rc_inputs_raw message
79 * @param system_id ID of this system
80 * @param component_id ID of this component (e.g. 200 for IMU)
81 * @param msg The MAVLink message to compress the data into
83 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
84 * @param chan1_raw [us] RC channel 1 value
85 * @param chan2_raw [us] RC channel 2 value
86 * @param chan3_raw [us] RC channel 3 value
87 * @param chan4_raw [us] RC channel 4 value
88 * @param chan5_raw [us] RC channel 5 value
89 * @param chan6_raw [us] RC channel 6 value
90 * @param chan7_raw [us] RC channel 7 value
91 * @param chan8_raw [us] RC channel 8 value
92 * @param chan9_raw [us] RC channel 9 value
93 * @param chan10_raw [us] RC channel 10 value
94 * @param chan11_raw [us] RC channel 11 value
95 * @param chan12_raw [us] RC channel 12 value
96 * @param rssi Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown.
97 * @return length of the message in bytes (excluding serial stream start sign)
99 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
100 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)
102 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
103 char buf[MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN];
104 _mav_put_uint64_t(buf, 0, time_usec);
105 _mav_put_uint16_t(buf, 8, chan1_raw);
106 _mav_put_uint16_t(buf, 10, chan2_raw);
107 _mav_put_uint16_t(buf, 12, chan3_raw);
108 _mav_put_uint16_t(buf, 14, chan4_raw);
109 _mav_put_uint16_t(buf, 16, chan5_raw);
110 _mav_put_uint16_t(buf, 18, chan6_raw);
111 _mav_put_uint16_t(buf, 20, chan7_raw);
112 _mav_put_uint16_t(buf, 22, chan8_raw);
113 _mav_put_uint16_t(buf, 24, chan9_raw);
114 _mav_put_uint16_t(buf, 26, chan10_raw);
115 _mav_put_uint16_t(buf, 28, chan11_raw);
116 _mav_put_uint16_t(buf, 30, chan12_raw);
117 _mav_put_uint8_t(buf, 32, rssi);
119 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
120 #else
121 mavlink_hil_rc_inputs_raw_t packet;
122 packet.time_usec = time_usec;
123 packet.chan1_raw = chan1_raw;
124 packet.chan2_raw = chan2_raw;
125 packet.chan3_raw = chan3_raw;
126 packet.chan4_raw = chan4_raw;
127 packet.chan5_raw = chan5_raw;
128 packet.chan6_raw = chan6_raw;
129 packet.chan7_raw = chan7_raw;
130 packet.chan8_raw = chan8_raw;
131 packet.chan9_raw = chan9_raw;
132 packet.chan10_raw = chan10_raw;
133 packet.chan11_raw = chan11_raw;
134 packet.chan12_raw = chan12_raw;
135 packet.rssi = rssi;
137 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
138 #endif
140 msg->msgid = MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW;
141 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);
145 * @brief Pack a hil_rc_inputs_raw message on a channel
146 * @param system_id ID of this system
147 * @param component_id ID of this component (e.g. 200 for IMU)
148 * @param chan The MAVLink channel this message will be sent over
149 * @param msg The MAVLink message to compress the data into
150 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
151 * @param chan1_raw [us] RC channel 1 value
152 * @param chan2_raw [us] RC channel 2 value
153 * @param chan3_raw [us] RC channel 3 value
154 * @param chan4_raw [us] RC channel 4 value
155 * @param chan5_raw [us] RC channel 5 value
156 * @param chan6_raw [us] RC channel 6 value
157 * @param chan7_raw [us] RC channel 7 value
158 * @param chan8_raw [us] RC channel 8 value
159 * @param chan9_raw [us] RC channel 9 value
160 * @param chan10_raw [us] RC channel 10 value
161 * @param chan11_raw [us] RC channel 11 value
162 * @param chan12_raw [us] RC channel 12 value
163 * @param rssi Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown.
164 * @return length of the message in bytes (excluding serial stream start sign)
166 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
167 mavlink_message_t* msg,
168 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)
170 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
171 char buf[MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN];
172 _mav_put_uint64_t(buf, 0, time_usec);
173 _mav_put_uint16_t(buf, 8, chan1_raw);
174 _mav_put_uint16_t(buf, 10, chan2_raw);
175 _mav_put_uint16_t(buf, 12, chan3_raw);
176 _mav_put_uint16_t(buf, 14, chan4_raw);
177 _mav_put_uint16_t(buf, 16, chan5_raw);
178 _mav_put_uint16_t(buf, 18, chan6_raw);
179 _mav_put_uint16_t(buf, 20, chan7_raw);
180 _mav_put_uint16_t(buf, 22, chan8_raw);
181 _mav_put_uint16_t(buf, 24, chan9_raw);
182 _mav_put_uint16_t(buf, 26, chan10_raw);
183 _mav_put_uint16_t(buf, 28, chan11_raw);
184 _mav_put_uint16_t(buf, 30, chan12_raw);
185 _mav_put_uint8_t(buf, 32, rssi);
187 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
188 #else
189 mavlink_hil_rc_inputs_raw_t packet;
190 packet.time_usec = time_usec;
191 packet.chan1_raw = chan1_raw;
192 packet.chan2_raw = chan2_raw;
193 packet.chan3_raw = chan3_raw;
194 packet.chan4_raw = chan4_raw;
195 packet.chan5_raw = chan5_raw;
196 packet.chan6_raw = chan6_raw;
197 packet.chan7_raw = chan7_raw;
198 packet.chan8_raw = chan8_raw;
199 packet.chan9_raw = chan9_raw;
200 packet.chan10_raw = chan10_raw;
201 packet.chan11_raw = chan11_raw;
202 packet.chan12_raw = chan12_raw;
203 packet.rssi = rssi;
205 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
206 #endif
208 msg->msgid = MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW;
209 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);
213 * @brief Encode a hil_rc_inputs_raw struct
215 * @param system_id ID of this system
216 * @param component_id ID of this component (e.g. 200 for IMU)
217 * @param msg The MAVLink message to compress the data into
218 * @param hil_rc_inputs_raw C-struct to read the message contents from
220 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)
222 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);
226 * @brief Encode a hil_rc_inputs_raw struct on a channel
228 * @param system_id ID of this system
229 * @param component_id ID of this component (e.g. 200 for IMU)
230 * @param chan The MAVLink channel this message will be sent over
231 * @param msg The MAVLink message to compress the data into
232 * @param hil_rc_inputs_raw C-struct to read the message contents from
234 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)
236 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);
240 * @brief Send a hil_rc_inputs_raw message
241 * @param chan MAVLink channel to send the message
243 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
244 * @param chan1_raw [us] RC channel 1 value
245 * @param chan2_raw [us] RC channel 2 value
246 * @param chan3_raw [us] RC channel 3 value
247 * @param chan4_raw [us] RC channel 4 value
248 * @param chan5_raw [us] RC channel 5 value
249 * @param chan6_raw [us] RC channel 6 value
250 * @param chan7_raw [us] RC channel 7 value
251 * @param chan8_raw [us] RC channel 8 value
252 * @param chan9_raw [us] RC channel 9 value
253 * @param chan10_raw [us] RC channel 10 value
254 * @param chan11_raw [us] RC channel 11 value
255 * @param chan12_raw [us] RC channel 12 value
256 * @param rssi Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown.
258 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
260 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)
262 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
263 char buf[MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN];
264 _mav_put_uint64_t(buf, 0, time_usec);
265 _mav_put_uint16_t(buf, 8, chan1_raw);
266 _mav_put_uint16_t(buf, 10, chan2_raw);
267 _mav_put_uint16_t(buf, 12, chan3_raw);
268 _mav_put_uint16_t(buf, 14, chan4_raw);
269 _mav_put_uint16_t(buf, 16, chan5_raw);
270 _mav_put_uint16_t(buf, 18, chan6_raw);
271 _mav_put_uint16_t(buf, 20, chan7_raw);
272 _mav_put_uint16_t(buf, 22, chan8_raw);
273 _mav_put_uint16_t(buf, 24, chan9_raw);
274 _mav_put_uint16_t(buf, 26, chan10_raw);
275 _mav_put_uint16_t(buf, 28, chan11_raw);
276 _mav_put_uint16_t(buf, 30, chan12_raw);
277 _mav_put_uint8_t(buf, 32, rssi);
279 _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);
280 #else
281 mavlink_hil_rc_inputs_raw_t packet;
282 packet.time_usec = time_usec;
283 packet.chan1_raw = chan1_raw;
284 packet.chan2_raw = chan2_raw;
285 packet.chan3_raw = chan3_raw;
286 packet.chan4_raw = chan4_raw;
287 packet.chan5_raw = chan5_raw;
288 packet.chan6_raw = chan6_raw;
289 packet.chan7_raw = chan7_raw;
290 packet.chan8_raw = chan8_raw;
291 packet.chan9_raw = chan9_raw;
292 packet.chan10_raw = chan10_raw;
293 packet.chan11_raw = chan11_raw;
294 packet.chan12_raw = chan12_raw;
295 packet.rssi = rssi;
297 _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);
298 #endif
302 * @brief Send a hil_rc_inputs_raw message
303 * @param chan MAVLink channel to send the message
304 * @param struct The MAVLink struct to serialize
306 static 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)
308 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
309 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);
310 #else
311 _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);
312 #endif
315 #if MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
317 This varient of _send() can be used to save stack space by re-using
318 memory from the receive buffer. The caller provides a
319 mavlink_message_t which is the size of a full mavlink message. This
320 is usually the receive buffer for the channel, and allows a reply to an
321 incoming message with minimum stack space usage.
323 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)
325 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
326 char *buf = (char *)msgbuf;
327 _mav_put_uint64_t(buf, 0, time_usec);
328 _mav_put_uint16_t(buf, 8, chan1_raw);
329 _mav_put_uint16_t(buf, 10, chan2_raw);
330 _mav_put_uint16_t(buf, 12, chan3_raw);
331 _mav_put_uint16_t(buf, 14, chan4_raw);
332 _mav_put_uint16_t(buf, 16, chan5_raw);
333 _mav_put_uint16_t(buf, 18, chan6_raw);
334 _mav_put_uint16_t(buf, 20, chan7_raw);
335 _mav_put_uint16_t(buf, 22, chan8_raw);
336 _mav_put_uint16_t(buf, 24, chan9_raw);
337 _mav_put_uint16_t(buf, 26, chan10_raw);
338 _mav_put_uint16_t(buf, 28, chan11_raw);
339 _mav_put_uint16_t(buf, 30, chan12_raw);
340 _mav_put_uint8_t(buf, 32, rssi);
342 _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);
343 #else
344 mavlink_hil_rc_inputs_raw_t *packet = (mavlink_hil_rc_inputs_raw_t *)msgbuf;
345 packet->time_usec = time_usec;
346 packet->chan1_raw = chan1_raw;
347 packet->chan2_raw = chan2_raw;
348 packet->chan3_raw = chan3_raw;
349 packet->chan4_raw = chan4_raw;
350 packet->chan5_raw = chan5_raw;
351 packet->chan6_raw = chan6_raw;
352 packet->chan7_raw = chan7_raw;
353 packet->chan8_raw = chan8_raw;
354 packet->chan9_raw = chan9_raw;
355 packet->chan10_raw = chan10_raw;
356 packet->chan11_raw = chan11_raw;
357 packet->chan12_raw = chan12_raw;
358 packet->rssi = rssi;
360 _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);
361 #endif
363 #endif
365 #endif
367 // MESSAGE HIL_RC_INPUTS_RAW UNPACKING
371 * @brief Get field time_usec from hil_rc_inputs_raw message
373 * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
375 static inline uint64_t mavlink_msg_hil_rc_inputs_raw_get_time_usec(const mavlink_message_t* msg)
377 return _MAV_RETURN_uint64_t(msg, 0);
381 * @brief Get field chan1_raw from hil_rc_inputs_raw message
383 * @return [us] RC channel 1 value
385 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan1_raw(const mavlink_message_t* msg)
387 return _MAV_RETURN_uint16_t(msg, 8);
391 * @brief Get field chan2_raw from hil_rc_inputs_raw message
393 * @return [us] RC channel 2 value
395 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan2_raw(const mavlink_message_t* msg)
397 return _MAV_RETURN_uint16_t(msg, 10);
401 * @brief Get field chan3_raw from hil_rc_inputs_raw message
403 * @return [us] RC channel 3 value
405 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan3_raw(const mavlink_message_t* msg)
407 return _MAV_RETURN_uint16_t(msg, 12);
411 * @brief Get field chan4_raw from hil_rc_inputs_raw message
413 * @return [us] RC channel 4 value
415 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan4_raw(const mavlink_message_t* msg)
417 return _MAV_RETURN_uint16_t(msg, 14);
421 * @brief Get field chan5_raw from hil_rc_inputs_raw message
423 * @return [us] RC channel 5 value
425 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan5_raw(const mavlink_message_t* msg)
427 return _MAV_RETURN_uint16_t(msg, 16);
431 * @brief Get field chan6_raw from hil_rc_inputs_raw message
433 * @return [us] RC channel 6 value
435 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan6_raw(const mavlink_message_t* msg)
437 return _MAV_RETURN_uint16_t(msg, 18);
441 * @brief Get field chan7_raw from hil_rc_inputs_raw message
443 * @return [us] RC channel 7 value
445 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan7_raw(const mavlink_message_t* msg)
447 return _MAV_RETURN_uint16_t(msg, 20);
451 * @brief Get field chan8_raw from hil_rc_inputs_raw message
453 * @return [us] RC channel 8 value
455 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan8_raw(const mavlink_message_t* msg)
457 return _MAV_RETURN_uint16_t(msg, 22);
461 * @brief Get field chan9_raw from hil_rc_inputs_raw message
463 * @return [us] RC channel 9 value
465 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan9_raw(const mavlink_message_t* msg)
467 return _MAV_RETURN_uint16_t(msg, 24);
471 * @brief Get field chan10_raw from hil_rc_inputs_raw message
473 * @return [us] RC channel 10 value
475 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan10_raw(const mavlink_message_t* msg)
477 return _MAV_RETURN_uint16_t(msg, 26);
481 * @brief Get field chan11_raw from hil_rc_inputs_raw message
483 * @return [us] RC channel 11 value
485 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan11_raw(const mavlink_message_t* msg)
487 return _MAV_RETURN_uint16_t(msg, 28);
491 * @brief Get field chan12_raw from hil_rc_inputs_raw message
493 * @return [us] RC channel 12 value
495 static inline uint16_t mavlink_msg_hil_rc_inputs_raw_get_chan12_raw(const mavlink_message_t* msg)
497 return _MAV_RETURN_uint16_t(msg, 30);
501 * @brief Get field rssi from hil_rc_inputs_raw message
503 * @return Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown.
505 static inline uint8_t mavlink_msg_hil_rc_inputs_raw_get_rssi(const mavlink_message_t* msg)
507 return _MAV_RETURN_uint8_t(msg, 32);
511 * @brief Decode a hil_rc_inputs_raw message into a struct
513 * @param msg The message to decode
514 * @param hil_rc_inputs_raw C-struct to decode the message contents into
516 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)
518 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
519 hil_rc_inputs_raw->time_usec = mavlink_msg_hil_rc_inputs_raw_get_time_usec(msg);
520 hil_rc_inputs_raw->chan1_raw = mavlink_msg_hil_rc_inputs_raw_get_chan1_raw(msg);
521 hil_rc_inputs_raw->chan2_raw = mavlink_msg_hil_rc_inputs_raw_get_chan2_raw(msg);
522 hil_rc_inputs_raw->chan3_raw = mavlink_msg_hil_rc_inputs_raw_get_chan3_raw(msg);
523 hil_rc_inputs_raw->chan4_raw = mavlink_msg_hil_rc_inputs_raw_get_chan4_raw(msg);
524 hil_rc_inputs_raw->chan5_raw = mavlink_msg_hil_rc_inputs_raw_get_chan5_raw(msg);
525 hil_rc_inputs_raw->chan6_raw = mavlink_msg_hil_rc_inputs_raw_get_chan6_raw(msg);
526 hil_rc_inputs_raw->chan7_raw = mavlink_msg_hil_rc_inputs_raw_get_chan7_raw(msg);
527 hil_rc_inputs_raw->chan8_raw = mavlink_msg_hil_rc_inputs_raw_get_chan8_raw(msg);
528 hil_rc_inputs_raw->chan9_raw = mavlink_msg_hil_rc_inputs_raw_get_chan9_raw(msg);
529 hil_rc_inputs_raw->chan10_raw = mavlink_msg_hil_rc_inputs_raw_get_chan10_raw(msg);
530 hil_rc_inputs_raw->chan11_raw = mavlink_msg_hil_rc_inputs_raw_get_chan11_raw(msg);
531 hil_rc_inputs_raw->chan12_raw = mavlink_msg_hil_rc_inputs_raw_get_chan12_raw(msg);
532 hil_rc_inputs_raw->rssi = mavlink_msg_hil_rc_inputs_raw_get_rssi(msg);
533 #else
534 uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN? msg->len : MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN;
535 memset(hil_rc_inputs_raw, 0, MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_LEN);
536 memcpy(hil_rc_inputs_raw, _MAV_PAYLOAD(msg), len);
537 #endif