Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_rc_channels_raw.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE RC_CHANNELS_RAW PACKING
3
4#define MAVLINK_MSG_ID_RC_CHANNELS_RAW 35
5
6
8 uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
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 uint8_t port; /*< Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.*/
18 uint8_t rssi; /*< Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown.*/
19} mavlink_rc_channels_raw_t;
20
21#define MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN 22
22#define MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN 22
23#define MAVLINK_MSG_ID_35_LEN 22
24#define MAVLINK_MSG_ID_35_MIN_LEN 22
25
26#define MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC 244
27#define MAVLINK_MSG_ID_35_CRC 244
28
29
30
31#if MAVLINK_COMMAND_24BIT
32#define MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW {
33 35,
34 "RC_CHANNELS_RAW",
35 11,
36 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_raw_t, time_boot_ms) },
37 { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_rc_channels_raw_t, port) },
38 { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_raw_t, chan1_raw) },
39 { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_raw_t, chan2_raw) },
40 { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_raw_t, chan3_raw) },
41 { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_raw_t, chan4_raw) },
42 { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_raw_t, chan5_raw) },
43 { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_raw_t, chan6_raw) },
44 { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_rc_channels_raw_t, chan7_raw) },
45 { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_rc_channels_raw_t, chan8_raw) },
46 { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_rc_channels_raw_t, rssi) },
47 } \
48}
49#else
50#define MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW {
51 "RC_CHANNELS_RAW",
52 11,
53 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_raw_t, time_boot_ms) },
54 { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_rc_channels_raw_t, port) },
55 { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_raw_t, chan1_raw) },
56 { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_raw_t, chan2_raw) },
57 { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_raw_t, chan3_raw) },
58 { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_raw_t, chan4_raw) },
59 { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_raw_t, chan5_raw) },
60 { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_raw_t, chan6_raw) },
61 { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_rc_channels_raw_t, chan7_raw) },
62 { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_rc_channels_raw_t, chan8_raw) },
63 { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_rc_channels_raw_t, rssi) },
64 } \
65}
66#endif
67
68/**
69 * @brief Pack a rc_channels_raw message
70 * @param system_id ID of this system
71 * @param component_id ID of this component (e.g. 200 for IMU)
72 * @param msg The MAVLink message to compress the data into
73 *
74 * @param time_boot_ms [ms] Timestamp (time since system boot).
75 * @param port Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.
76 * @param chan1_raw [us] RC channel 1 value.
77 * @param chan2_raw [us] RC channel 2 value.
78 * @param chan3_raw [us] RC channel 3 value.
79 * @param chan4_raw [us] RC channel 4 value.
80 * @param chan5_raw [us] RC channel 5 value.
81 * @param chan6_raw [us] RC channel 6 value.
82 * @param chan7_raw [us] RC channel 7 value.
83 * @param chan8_raw [us] RC channel 8 value.
84 * @param rssi Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown.
85 * @return length of the message in bytes (excluding serial stream start sign)
86 */
87static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
88 uint32_t time_boot_ms, uint8_t port, 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, uint8_t rssi)
89{
90#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
92 _mav_put_uint32_t(buf, 0, time_boot_ms);
93 _mav_put_uint16_t(buf, 4, chan1_raw);
94 _mav_put_uint16_t(buf, 6, chan2_raw);
95 _mav_put_uint16_t(buf, 8, chan3_raw);
96 _mav_put_uint16_t(buf, 10, chan4_raw);
97 _mav_put_uint16_t(buf, 12, chan5_raw);
98 _mav_put_uint16_t(buf, 14, chan6_raw);
99 _mav_put_uint16_t(buf, 16, chan7_raw);
100 _mav_put_uint16_t(buf, 18, chan8_raw);
101 _mav_put_uint8_t(buf, 20, port);
102 _mav_put_uint8_t(buf, 21, rssi);
103
104 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN);
105#else
106 mavlink_rc_channels_raw_t packet;
107 packet.time_boot_ms = time_boot_ms;
108 packet.chan1_raw = chan1_raw;
109 packet.chan2_raw = chan2_raw;
110 packet.chan3_raw = chan3_raw;
111 packet.chan4_raw = chan4_raw;
112 packet.chan5_raw = chan5_raw;
113 packet.chan6_raw = chan6_raw;
114 packet.chan7_raw = chan7_raw;
115 packet.chan8_raw = chan8_raw;
116 packet.port = port;
117 packet.rssi = rssi;
118
119 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN);
120#endif
121
123 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC);
124}
125
126/**
127 * @brief Pack a rc_channels_raw message
128 * @param system_id ID of this system
129 * @param component_id ID of this component (e.g. 200 for IMU)
130 * @param status MAVLink status structure
131 * @param msg The MAVLink message to compress the data into
132 *
133 * @param time_boot_ms [ms] Timestamp (time since system boot).
134 * @param port Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.
135 * @param chan1_raw [us] RC channel 1 value.
136 * @param chan2_raw [us] RC channel 2 value.
137 * @param chan3_raw [us] RC channel 3 value.
138 * @param chan4_raw [us] RC channel 4 value.
139 * @param chan5_raw [us] RC channel 5 value.
140 * @param chan6_raw [us] RC channel 6 value.
141 * @param chan7_raw [us] RC channel 7 value.
142 * @param chan8_raw [us] RC channel 8 value.
143 * @param rssi Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown.
144 * @return length of the message in bytes (excluding serial stream start sign)
145 */
146static inline uint16_t mavlink_msg_rc_channels_raw_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
147 uint32_t time_boot_ms, uint8_t port, 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, uint8_t rssi)
148{
149#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
151 _mav_put_uint32_t(buf, 0, time_boot_ms);
152 _mav_put_uint16_t(buf, 4, chan1_raw);
153 _mav_put_uint16_t(buf, 6, chan2_raw);
154 _mav_put_uint16_t(buf, 8, chan3_raw);
155 _mav_put_uint16_t(buf, 10, chan4_raw);
156 _mav_put_uint16_t(buf, 12, chan5_raw);
157 _mav_put_uint16_t(buf, 14, chan6_raw);
158 _mav_put_uint16_t(buf, 16, chan7_raw);
159 _mav_put_uint16_t(buf, 18, chan8_raw);
160 _mav_put_uint8_t(buf, 20, port);
161 _mav_put_uint8_t(buf, 21, rssi);
162
163 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN);
164#else
165 mavlink_rc_channels_raw_t packet;
166 packet.time_boot_ms = time_boot_ms;
167 packet.chan1_raw = chan1_raw;
168 packet.chan2_raw = chan2_raw;
169 packet.chan3_raw = chan3_raw;
170 packet.chan4_raw = chan4_raw;
171 packet.chan5_raw = chan5_raw;
172 packet.chan6_raw = chan6_raw;
173 packet.chan7_raw = chan7_raw;
174 packet.chan8_raw = chan8_raw;
175 packet.port = port;
176 packet.rssi = rssi;
177
178 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN);
179#endif
180
182#if MAVLINK_CRC_EXTRA
183 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC);
184#else
185 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN);
186#endif
187}
188
189/**
190 * @brief Pack a rc_channels_raw message on a channel
191 * @param system_id ID of this system
192 * @param component_id ID of this component (e.g. 200 for IMU)
193 * @param chan The MAVLink channel this message will be sent over
194 * @param msg The MAVLink message to compress the data into
195 * @param time_boot_ms [ms] Timestamp (time since system boot).
196 * @param port Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.
197 * @param chan1_raw [us] RC channel 1 value.
198 * @param chan2_raw [us] RC channel 2 value.
199 * @param chan3_raw [us] RC channel 3 value.
200 * @param chan4_raw [us] RC channel 4 value.
201 * @param chan5_raw [us] RC channel 5 value.
202 * @param chan6_raw [us] RC channel 6 value.
203 * @param chan7_raw [us] RC channel 7 value.
204 * @param chan8_raw [us] RC channel 8 value.
205 * @param rssi Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown.
206 * @return length of the message in bytes (excluding serial stream start sign)
207 */
208static inline uint16_t mavlink_msg_rc_channels_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
209 mavlink_message_t* msg,
210 uint32_t time_boot_ms,uint8_t port,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,uint8_t rssi)
211{
212#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
214 _mav_put_uint32_t(buf, 0, time_boot_ms);
215 _mav_put_uint16_t(buf, 4, chan1_raw);
216 _mav_put_uint16_t(buf, 6, chan2_raw);
217 _mav_put_uint16_t(buf, 8, chan3_raw);
218 _mav_put_uint16_t(buf, 10, chan4_raw);
219 _mav_put_uint16_t(buf, 12, chan5_raw);
220 _mav_put_uint16_t(buf, 14, chan6_raw);
221 _mav_put_uint16_t(buf, 16, chan7_raw);
222 _mav_put_uint16_t(buf, 18, chan8_raw);
223 _mav_put_uint8_t(buf, 20, port);
224 _mav_put_uint8_t(buf, 21, rssi);
225
226 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN);
227#else
228 mavlink_rc_channels_raw_t packet;
229 packet.time_boot_ms = time_boot_ms;
230 packet.chan1_raw = chan1_raw;
231 packet.chan2_raw = chan2_raw;
232 packet.chan3_raw = chan3_raw;
233 packet.chan4_raw = chan4_raw;
234 packet.chan5_raw = chan5_raw;
235 packet.chan6_raw = chan6_raw;
236 packet.chan7_raw = chan7_raw;
237 packet.chan8_raw = chan8_raw;
238 packet.port = port;
239 packet.rssi = rssi;
240
241 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN);
242#endif
243
245 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC);
246}
247
248/**
249 * @brief Encode a rc_channels_raw struct
250 *
251 * @param system_id ID of this system
252 * @param component_id ID of this component (e.g. 200 for IMU)
253 * @param msg The MAVLink message to compress the data into
254 * @param rc_channels_raw C-struct to read the message contents from
255 */
256static inline uint16_t mavlink_msg_rc_channels_raw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rc_channels_raw_t* rc_channels_raw)
257{
258 return mavlink_msg_rc_channels_raw_pack(system_id, component_id, msg, rc_channels_raw->time_boot_ms, rc_channels_raw->port, rc_channels_raw->chan1_raw, rc_channels_raw->chan2_raw, rc_channels_raw->chan3_raw, rc_channels_raw->chan4_raw, rc_channels_raw->chan5_raw, rc_channels_raw->chan6_raw, rc_channels_raw->chan7_raw, rc_channels_raw->chan8_raw, rc_channels_raw->rssi);
259}
260
261/**
262 * @brief Encode a rc_channels_raw struct on a channel
263 *
264 * @param system_id ID of this system
265 * @param component_id ID of this component (e.g. 200 for IMU)
266 * @param chan The MAVLink channel this message will be sent over
267 * @param msg The MAVLink message to compress the data into
268 * @param rc_channels_raw C-struct to read the message contents from
269 */
270static inline uint16_t mavlink_msg_rc_channels_raw_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rc_channels_raw_t* rc_channels_raw)
271{
272 return mavlink_msg_rc_channels_raw_pack_chan(system_id, component_id, chan, msg, rc_channels_raw->time_boot_ms, rc_channels_raw->port, rc_channels_raw->chan1_raw, rc_channels_raw->chan2_raw, rc_channels_raw->chan3_raw, rc_channels_raw->chan4_raw, rc_channels_raw->chan5_raw, rc_channels_raw->chan6_raw, rc_channels_raw->chan7_raw, rc_channels_raw->chan8_raw, rc_channels_raw->rssi);
273}
274
275/**
276 * @brief Encode a rc_channels_raw struct with provided status structure
277 *
278 * @param system_id ID of this system
279 * @param component_id ID of this component (e.g. 200 for IMU)
280 * @param status MAVLink status structure
281 * @param msg The MAVLink message to compress the data into
282 * @param rc_channels_raw C-struct to read the message contents from
283 */
284static inline uint16_t mavlink_msg_rc_channels_raw_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_rc_channels_raw_t* rc_channels_raw)
285{
286 return mavlink_msg_rc_channels_raw_pack_status(system_id, component_id, _status, msg, rc_channels_raw->time_boot_ms, rc_channels_raw->port, rc_channels_raw->chan1_raw, rc_channels_raw->chan2_raw, rc_channels_raw->chan3_raw, rc_channels_raw->chan4_raw, rc_channels_raw->chan5_raw, rc_channels_raw->chan6_raw, rc_channels_raw->chan7_raw, rc_channels_raw->chan8_raw, rc_channels_raw->rssi);
287}
288
289/**
290 * @brief Send a rc_channels_raw message
291 * @param chan MAVLink channel to send the message
292 *
293 * @param time_boot_ms [ms] Timestamp (time since system boot).
294 * @param port Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.
295 * @param chan1_raw [us] RC channel 1 value.
296 * @param chan2_raw [us] RC channel 2 value.
297 * @param chan3_raw [us] RC channel 3 value.
298 * @param chan4_raw [us] RC channel 4 value.
299 * @param chan5_raw [us] RC channel 5 value.
300 * @param chan6_raw [us] RC channel 6 value.
301 * @param chan7_raw [us] RC channel 7 value.
302 * @param chan8_raw [us] RC channel 8 value.
303 * @param rssi Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown.
304 */
305#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
306
307static inline void mavlink_msg_rc_channels_raw_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t port, 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, uint8_t rssi)
308{
309#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
310 char buf[MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN];
311 _mav_put_uint32_t(buf, 0, time_boot_ms);
312 _mav_put_uint16_t(buf, 4, chan1_raw);
313 _mav_put_uint16_t(buf, 6, chan2_raw);
314 _mav_put_uint16_t(buf, 8, chan3_raw);
315 _mav_put_uint16_t(buf, 10, chan4_raw);
316 _mav_put_uint16_t(buf, 12, chan5_raw);
317 _mav_put_uint16_t(buf, 14, chan6_raw);
318 _mav_put_uint16_t(buf, 16, chan7_raw);
319 _mav_put_uint16_t(buf, 18, chan8_raw);
320 _mav_put_uint8_t(buf, 20, port);
321 _mav_put_uint8_t(buf, 21, rssi);
322
323 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, buf, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC);
324#else
325 mavlink_rc_channels_raw_t packet;
326 packet.time_boot_ms = time_boot_ms;
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.port = port;
336 packet.rssi = rssi;
337
338 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC);
339#endif
340}
341
342/**
343 * @brief Send a rc_channels_raw message
344 * @param chan MAVLink channel to send the message
345 * @param struct The MAVLink struct to serialize
346 */
347static inline void mavlink_msg_rc_channels_raw_send_struct(mavlink_channel_t chan, const mavlink_rc_channels_raw_t* rc_channels_raw)
348{
349#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
350 mavlink_msg_rc_channels_raw_send(chan, rc_channels_raw->time_boot_ms, rc_channels_raw->port, rc_channels_raw->chan1_raw, rc_channels_raw->chan2_raw, rc_channels_raw->chan3_raw, rc_channels_raw->chan4_raw, rc_channels_raw->chan5_raw, rc_channels_raw->chan6_raw, rc_channels_raw->chan7_raw, rc_channels_raw->chan8_raw, rc_channels_raw->rssi);
351#else
352 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, (const char *)rc_channels_raw, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC);
353#endif
354}
355
356#if MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
357/*
358 This variant of _send() can be used to save stack space by reusing
359 memory from the receive buffer. The caller provides a
360 mavlink_message_t which is the size of a full mavlink message. This
361 is usually the receive buffer for the channel, and allows a reply to an
362 incoming message with minimum stack space usage.
363 */
364static inline void mavlink_msg_rc_channels_raw_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t port, 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, uint8_t rssi)
365{
366#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
367 char *buf = (char *)msgbuf;
368 _mav_put_uint32_t(buf, 0, time_boot_ms);
369 _mav_put_uint16_t(buf, 4, chan1_raw);
370 _mav_put_uint16_t(buf, 6, chan2_raw);
371 _mav_put_uint16_t(buf, 8, chan3_raw);
372 _mav_put_uint16_t(buf, 10, chan4_raw);
373 _mav_put_uint16_t(buf, 12, chan5_raw);
374 _mav_put_uint16_t(buf, 14, chan6_raw);
375 _mav_put_uint16_t(buf, 16, chan7_raw);
376 _mav_put_uint16_t(buf, 18, chan8_raw);
377 _mav_put_uint8_t(buf, 20, port);
378 _mav_put_uint8_t(buf, 21, rssi);
379
380 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, buf, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC);
381#else
382 mavlink_rc_channels_raw_t *packet = (mavlink_rc_channels_raw_t *)msgbuf;
383 packet->time_boot_ms = time_boot_ms;
384 packet->chan1_raw = chan1_raw;
385 packet->chan2_raw = chan2_raw;
386 packet->chan3_raw = chan3_raw;
387 packet->chan4_raw = chan4_raw;
388 packet->chan5_raw = chan5_raw;
389 packet->chan6_raw = chan6_raw;
390 packet->chan7_raw = chan7_raw;
391 packet->chan8_raw = chan8_raw;
392 packet->port = port;
393 packet->rssi = rssi;
394
395 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_RAW, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC);
396#endif
397}
398#endif
399
400#endif
401
402// MESSAGE RC_CHANNELS_RAW UNPACKING
403
404
405/**
406 * @brief Get field time_boot_ms from rc_channels_raw message
407 *
408 * @return [ms] Timestamp (time since system boot).
409 */
410static inline uint32_t mavlink_msg_rc_channels_raw_get_time_boot_ms(const mavlink_message_t* msg)
411{
412 return _MAV_RETURN_uint32_t(msg, 0);
413}
414
415/**
416 * @brief Get field port from rc_channels_raw message
417 *
418 * @return Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.
419 */
420static inline uint8_t mavlink_msg_rc_channels_raw_get_port(const mavlink_message_t* msg)
421{
422 return _MAV_RETURN_uint8_t(msg, 20);
423}
424
425/**
426 * @brief Get field chan1_raw from rc_channels_raw message
427 *
428 * @return [us] RC channel 1 value.
429 */
430static inline uint16_t mavlink_msg_rc_channels_raw_get_chan1_raw(const mavlink_message_t* msg)
431{
432 return _MAV_RETURN_uint16_t(msg, 4);
433}
434
435/**
436 * @brief Get field chan2_raw from rc_channels_raw message
437 *
438 * @return [us] RC channel 2 value.
439 */
440static inline uint16_t mavlink_msg_rc_channels_raw_get_chan2_raw(const mavlink_message_t* msg)
441{
442 return _MAV_RETURN_uint16_t(msg, 6);
443}
444
445/**
446 * @brief Get field chan3_raw from rc_channels_raw message
447 *
448 * @return [us] RC channel 3 value.
449 */
450static inline uint16_t mavlink_msg_rc_channels_raw_get_chan3_raw(const mavlink_message_t* msg)
451{
452 return _MAV_RETURN_uint16_t(msg, 8);
453}
454
455/**
456 * @brief Get field chan4_raw from rc_channels_raw message
457 *
458 * @return [us] RC channel 4 value.
459 */
460static inline uint16_t mavlink_msg_rc_channels_raw_get_chan4_raw(const mavlink_message_t* msg)
461{
462 return _MAV_RETURN_uint16_t(msg, 10);
463}
464
465/**
466 * @brief Get field chan5_raw from rc_channels_raw message
467 *
468 * @return [us] RC channel 5 value.
469 */
470static inline uint16_t mavlink_msg_rc_channels_raw_get_chan5_raw(const mavlink_message_t* msg)
471{
472 return _MAV_RETURN_uint16_t(msg, 12);
473}
474
475/**
476 * @brief Get field chan6_raw from rc_channels_raw message
477 *
478 * @return [us] RC channel 6 value.
479 */
480static inline uint16_t mavlink_msg_rc_channels_raw_get_chan6_raw(const mavlink_message_t* msg)
481{
482 return _MAV_RETURN_uint16_t(msg, 14);
483}
484
485/**
486 * @brief Get field chan7_raw from rc_channels_raw message
487 *
488 * @return [us] RC channel 7 value.
489 */
490static inline uint16_t mavlink_msg_rc_channels_raw_get_chan7_raw(const mavlink_message_t* msg)
491{
492 return _MAV_RETURN_uint16_t(msg, 16);
493}
494
495/**
496 * @brief Get field chan8_raw from rc_channels_raw message
497 *
498 * @return [us] RC channel 8 value.
499 */
500static inline uint16_t mavlink_msg_rc_channels_raw_get_chan8_raw(const mavlink_message_t* msg)
501{
502 return _MAV_RETURN_uint16_t(msg, 18);
503}
504
505/**
506 * @brief Get field rssi from rc_channels_raw message
507 *
508 * @return Receive signal strength indicator in device-dependent units/scale. Values: [0-254], UINT8_MAX: invalid/unknown.
509 */
510static inline uint8_t mavlink_msg_rc_channels_raw_get_rssi(const mavlink_message_t* msg)
511{
512 return _MAV_RETURN_uint8_t(msg, 21);
513}
514
515/**
516 * @brief Decode a rc_channels_raw message into a struct
517 *
518 * @param msg The message to decode
519 * @param rc_channels_raw C-struct to decode the message contents into
520 */
521static inline void mavlink_msg_rc_channels_raw_decode(const mavlink_message_t* msg, mavlink_rc_channels_raw_t* rc_channels_raw)
522{
523#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
524 rc_channels_raw->time_boot_ms = mavlink_msg_rc_channels_raw_get_time_boot_ms(msg);
525 rc_channels_raw->chan1_raw = mavlink_msg_rc_channels_raw_get_chan1_raw(msg);
526 rc_channels_raw->chan2_raw = mavlink_msg_rc_channels_raw_get_chan2_raw(msg);
527 rc_channels_raw->chan3_raw = mavlink_msg_rc_channels_raw_get_chan3_raw(msg);
528 rc_channels_raw->chan4_raw = mavlink_msg_rc_channels_raw_get_chan4_raw(msg);
529 rc_channels_raw->chan5_raw = mavlink_msg_rc_channels_raw_get_chan5_raw(msg);
530 rc_channels_raw->chan6_raw = mavlink_msg_rc_channels_raw_get_chan6_raw(msg);
531 rc_channels_raw->chan7_raw = mavlink_msg_rc_channels_raw_get_chan7_raw(msg);
532 rc_channels_raw->chan8_raw = mavlink_msg_rc_channels_raw_get_chan8_raw(msg);
533 rc_channels_raw->port = mavlink_msg_rc_channels_raw_get_port(msg);
534 rc_channels_raw->rssi = mavlink_msg_rc_channels_raw_get_rssi(msg);
535#else
536 uint8_t len = msg->len < MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN? msg->len : MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN;
537 memset(rc_channels_raw, 0, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN);
538 memcpy(rc_channels_raw, _MAV_PAYLOAD(msg), len);
539#endif
540}