1 // MESSAGE RC_CHANNELS_RAW PACKING
3 #define MAVLINK_MSG_ID_RC_CHANNELS_RAW 35
5 typedef struct __mavlink_rc_channels_raw_t
7 uint32_t time_boot_ms
; ///< Timestamp (milliseconds since system boot)
8 uint16_t chan1_raw
; ///< RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
9 uint16_t chan2_raw
; ///< RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
10 uint16_t chan3_raw
; ///< RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
11 uint16_t chan4_raw
; ///< RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
12 uint16_t chan5_raw
; ///< RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
13 uint16_t chan6_raw
; ///< RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
14 uint16_t chan7_raw
; ///< RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
15 uint16_t chan8_raw
; ///< RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
16 uint8_t port
; ///< Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
17 uint8_t rssi
; ///< Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
18 } mavlink_rc_channels_raw_t
;
20 #define MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN 22
21 #define MAVLINK_MSG_ID_35_LEN 22
23 #define MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC 244
24 #define MAVLINK_MSG_ID_35_CRC 244
28 #define MAVLINK_MESSAGE_INFO_RC_CHANNELS_RAW { \
31 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_raw_t, time_boot_ms) }, \
32 { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_raw_t, chan1_raw) }, \
33 { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_raw_t, chan2_raw) }, \
34 { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_raw_t, chan3_raw) }, \
35 { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_raw_t, chan4_raw) }, \
36 { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_raw_t, chan5_raw) }, \
37 { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_raw_t, chan6_raw) }, \
38 { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_rc_channels_raw_t, chan7_raw) }, \
39 { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_rc_channels_raw_t, chan8_raw) }, \
40 { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_rc_channels_raw_t, port) }, \
41 { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_rc_channels_raw_t, rssi) }, \
47 * @brief Pack a rc_channels_raw message
48 * @param system_id ID of this system
49 * @param component_id ID of this component (e.g. 200 for IMU)
50 * @param msg The MAVLink message to compress the data into
52 * @param time_boot_ms Timestamp (milliseconds since system boot)
53 * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
54 * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
55 * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
56 * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
57 * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
58 * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
59 * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
60 * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
61 * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
62 * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
63 * @return length of the message in bytes (excluding serial stream start sign)
65 static inline uint16_t mavlink_msg_rc_channels_raw_pack(uint8_t system_id
, uint8_t component_id
, mavlink_message_t
* msg
,
66 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
)
68 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
69 char buf
[MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN
];
70 _mav_put_uint32_t(buf
, 0, time_boot_ms
);
71 _mav_put_uint16_t(buf
, 4, chan1_raw
);
72 _mav_put_uint16_t(buf
, 6, chan2_raw
);
73 _mav_put_uint16_t(buf
, 8, chan3_raw
);
74 _mav_put_uint16_t(buf
, 10, chan4_raw
);
75 _mav_put_uint16_t(buf
, 12, chan5_raw
);
76 _mav_put_uint16_t(buf
, 14, chan6_raw
);
77 _mav_put_uint16_t(buf
, 16, chan7_raw
);
78 _mav_put_uint16_t(buf
, 18, chan8_raw
);
79 _mav_put_uint8_t(buf
, 20, port
);
80 _mav_put_uint8_t(buf
, 21, rssi
);
82 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), buf
, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN
);
84 mavlink_rc_channels_raw_t packet
;
85 packet
.time_boot_ms
= time_boot_ms
;
86 packet
.chan1_raw
= chan1_raw
;
87 packet
.chan2_raw
= chan2_raw
;
88 packet
.chan3_raw
= chan3_raw
;
89 packet
.chan4_raw
= chan4_raw
;
90 packet
.chan5_raw
= chan5_raw
;
91 packet
.chan6_raw
= chan6_raw
;
92 packet
.chan7_raw
= chan7_raw
;
93 packet
.chan8_raw
= chan8_raw
;
97 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN
);
100 msg
->msgid
= MAVLINK_MSG_ID_RC_CHANNELS_RAW
;
101 #if MAVLINK_CRC_EXTRA
102 return mavlink_finalize_message(msg
, system_id
, component_id
, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN
, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC
);
104 return mavlink_finalize_message(msg
, system_id
, component_id
, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN
);
109 * @brief Pack a rc_channels_raw message on a channel
110 * @param system_id ID of this system
111 * @param component_id ID of this component (e.g. 200 for IMU)
112 * @param chan The MAVLink channel this message will be sent over
113 * @param msg The MAVLink message to compress the data into
114 * @param time_boot_ms Timestamp (milliseconds since system boot)
115 * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
116 * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
117 * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
118 * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
119 * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
120 * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
121 * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
122 * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
123 * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
124 * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
125 * @return length of the message in bytes (excluding serial stream start sign)
127 static inline uint16_t mavlink_msg_rc_channels_raw_pack_chan(uint8_t system_id
, uint8_t component_id
, uint8_t chan
,
128 mavlink_message_t
* msg
,
129 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
)
131 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
132 char buf
[MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN
];
133 _mav_put_uint32_t(buf
, 0, time_boot_ms
);
134 _mav_put_uint16_t(buf
, 4, chan1_raw
);
135 _mav_put_uint16_t(buf
, 6, chan2_raw
);
136 _mav_put_uint16_t(buf
, 8, chan3_raw
);
137 _mav_put_uint16_t(buf
, 10, chan4_raw
);
138 _mav_put_uint16_t(buf
, 12, chan5_raw
);
139 _mav_put_uint16_t(buf
, 14, chan6_raw
);
140 _mav_put_uint16_t(buf
, 16, chan7_raw
);
141 _mav_put_uint16_t(buf
, 18, chan8_raw
);
142 _mav_put_uint8_t(buf
, 20, port
);
143 _mav_put_uint8_t(buf
, 21, rssi
);
145 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), buf
, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN
);
147 mavlink_rc_channels_raw_t packet
;
148 packet
.time_boot_ms
= time_boot_ms
;
149 packet
.chan1_raw
= chan1_raw
;
150 packet
.chan2_raw
= chan2_raw
;
151 packet
.chan3_raw
= chan3_raw
;
152 packet
.chan4_raw
= chan4_raw
;
153 packet
.chan5_raw
= chan5_raw
;
154 packet
.chan6_raw
= chan6_raw
;
155 packet
.chan7_raw
= chan7_raw
;
156 packet
.chan8_raw
= chan8_raw
;
160 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN
);
163 msg
->msgid
= MAVLINK_MSG_ID_RC_CHANNELS_RAW
;
164 #if MAVLINK_CRC_EXTRA
165 return mavlink_finalize_message_chan(msg
, system_id
, component_id
, chan
, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN
, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC
);
167 return mavlink_finalize_message_chan(msg
, system_id
, component_id
, chan
, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN
);
172 * @brief Encode a rc_channels_raw struct
174 * @param system_id ID of this system
175 * @param component_id ID of this component (e.g. 200 for IMU)
176 * @param msg The MAVLink message to compress the data into
177 * @param rc_channels_raw C-struct to read the message contents from
179 static 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
)
181 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
);
185 * @brief Encode a rc_channels_raw struct on a channel
187 * @param system_id ID of this system
188 * @param component_id ID of this component (e.g. 200 for IMU)
189 * @param chan The MAVLink channel this message will be sent over
190 * @param msg The MAVLink message to compress the data into
191 * @param rc_channels_raw C-struct to read the message contents from
193 static 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
)
195 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
);
199 * @brief Send a rc_channels_raw message
200 * @param chan MAVLink channel to send the message
202 * @param time_boot_ms Timestamp (milliseconds since system boot)
203 * @param port Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
204 * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
205 * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
206 * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
207 * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
208 * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
209 * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
210 * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
211 * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
212 * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
214 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
216 static 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
)
218 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
219 char buf
[MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN
];
220 _mav_put_uint32_t(buf
, 0, time_boot_ms
);
221 _mav_put_uint16_t(buf
, 4, chan1_raw
);
222 _mav_put_uint16_t(buf
, 6, chan2_raw
);
223 _mav_put_uint16_t(buf
, 8, chan3_raw
);
224 _mav_put_uint16_t(buf
, 10, chan4_raw
);
225 _mav_put_uint16_t(buf
, 12, chan5_raw
);
226 _mav_put_uint16_t(buf
, 14, chan6_raw
);
227 _mav_put_uint16_t(buf
, 16, chan7_raw
);
228 _mav_put_uint16_t(buf
, 18, chan8_raw
);
229 _mav_put_uint8_t(buf
, 20, port
);
230 _mav_put_uint8_t(buf
, 21, rssi
);
232 #if MAVLINK_CRC_EXTRA
233 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_RC_CHANNELS_RAW
, buf
, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN
, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC
);
235 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_RC_CHANNELS_RAW
, buf
, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN
);
238 mavlink_rc_channels_raw_t packet
;
239 packet
.time_boot_ms
= time_boot_ms
;
240 packet
.chan1_raw
= chan1_raw
;
241 packet
.chan2_raw
= chan2_raw
;
242 packet
.chan3_raw
= chan3_raw
;
243 packet
.chan4_raw
= chan4_raw
;
244 packet
.chan5_raw
= chan5_raw
;
245 packet
.chan6_raw
= chan6_raw
;
246 packet
.chan7_raw
= chan7_raw
;
247 packet
.chan8_raw
= chan8_raw
;
251 #if MAVLINK_CRC_EXTRA
252 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_RC_CHANNELS_RAW
, (const char *)&packet
, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN
, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC
);
254 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_RC_CHANNELS_RAW
, (const char *)&packet
, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN
);
259 #if MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
261 This varient of _send() can be used to save stack space by re-using
262 memory from the receive buffer. The caller provides a
263 mavlink_message_t which is the size of a full mavlink message. This
264 is usually the receive buffer for the channel, and allows a reply to an
265 incoming message with minimum stack space usage.
267 static 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
)
269 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
270 char *buf
= (char *)msgbuf
;
271 _mav_put_uint32_t(buf
, 0, time_boot_ms
);
272 _mav_put_uint16_t(buf
, 4, chan1_raw
);
273 _mav_put_uint16_t(buf
, 6, chan2_raw
);
274 _mav_put_uint16_t(buf
, 8, chan3_raw
);
275 _mav_put_uint16_t(buf
, 10, chan4_raw
);
276 _mav_put_uint16_t(buf
, 12, chan5_raw
);
277 _mav_put_uint16_t(buf
, 14, chan6_raw
);
278 _mav_put_uint16_t(buf
, 16, chan7_raw
);
279 _mav_put_uint16_t(buf
, 18, chan8_raw
);
280 _mav_put_uint8_t(buf
, 20, port
);
281 _mav_put_uint8_t(buf
, 21, rssi
);
283 #if MAVLINK_CRC_EXTRA
284 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_RC_CHANNELS_RAW
, buf
, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN
, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC
);
286 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_RC_CHANNELS_RAW
, buf
, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN
);
289 mavlink_rc_channels_raw_t
*packet
= (mavlink_rc_channels_raw_t
*)msgbuf
;
290 packet
->time_boot_ms
= time_boot_ms
;
291 packet
->chan1_raw
= chan1_raw
;
292 packet
->chan2_raw
= chan2_raw
;
293 packet
->chan3_raw
= chan3_raw
;
294 packet
->chan4_raw
= chan4_raw
;
295 packet
->chan5_raw
= chan5_raw
;
296 packet
->chan6_raw
= chan6_raw
;
297 packet
->chan7_raw
= chan7_raw
;
298 packet
->chan8_raw
= chan8_raw
;
302 #if MAVLINK_CRC_EXTRA
303 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_RC_CHANNELS_RAW
, (const char *)packet
, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN
, MAVLINK_MSG_ID_RC_CHANNELS_RAW_CRC
);
305 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_RC_CHANNELS_RAW
, (const char *)packet
, MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN
);
313 // MESSAGE RC_CHANNELS_RAW UNPACKING
317 * @brief Get field time_boot_ms from rc_channels_raw message
319 * @return Timestamp (milliseconds since system boot)
321 static inline uint32_t mavlink_msg_rc_channels_raw_get_time_boot_ms(const mavlink_message_t
* msg
)
323 return _MAV_RETURN_uint32_t(msg
, 0);
327 * @brief Get field port from rc_channels_raw message
329 * @return Servo output port (set of 8 outputs = 1 port). Most MAVs will just use one, but this allows for more than 8 servos.
331 static inline uint8_t mavlink_msg_rc_channels_raw_get_port(const mavlink_message_t
* msg
)
333 return _MAV_RETURN_uint8_t(msg
, 20);
337 * @brief Get field chan1_raw from rc_channels_raw message
339 * @return RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
341 static inline uint16_t mavlink_msg_rc_channels_raw_get_chan1_raw(const mavlink_message_t
* msg
)
343 return _MAV_RETURN_uint16_t(msg
, 4);
347 * @brief Get field chan2_raw from rc_channels_raw message
349 * @return RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
351 static inline uint16_t mavlink_msg_rc_channels_raw_get_chan2_raw(const mavlink_message_t
* msg
)
353 return _MAV_RETURN_uint16_t(msg
, 6);
357 * @brief Get field chan3_raw from rc_channels_raw message
359 * @return RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
361 static inline uint16_t mavlink_msg_rc_channels_raw_get_chan3_raw(const mavlink_message_t
* msg
)
363 return _MAV_RETURN_uint16_t(msg
, 8);
367 * @brief Get field chan4_raw from rc_channels_raw message
369 * @return RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
371 static inline uint16_t mavlink_msg_rc_channels_raw_get_chan4_raw(const mavlink_message_t
* msg
)
373 return _MAV_RETURN_uint16_t(msg
, 10);
377 * @brief Get field chan5_raw from rc_channels_raw message
379 * @return RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
381 static inline uint16_t mavlink_msg_rc_channels_raw_get_chan5_raw(const mavlink_message_t
* msg
)
383 return _MAV_RETURN_uint16_t(msg
, 12);
387 * @brief Get field chan6_raw from rc_channels_raw message
389 * @return RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
391 static inline uint16_t mavlink_msg_rc_channels_raw_get_chan6_raw(const mavlink_message_t
* msg
)
393 return _MAV_RETURN_uint16_t(msg
, 14);
397 * @brief Get field chan7_raw from rc_channels_raw message
399 * @return RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
401 static inline uint16_t mavlink_msg_rc_channels_raw_get_chan7_raw(const mavlink_message_t
* msg
)
403 return _MAV_RETURN_uint16_t(msg
, 16);
407 * @brief Get field chan8_raw from rc_channels_raw message
409 * @return RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
411 static inline uint16_t mavlink_msg_rc_channels_raw_get_chan8_raw(const mavlink_message_t
* msg
)
413 return _MAV_RETURN_uint16_t(msg
, 18);
417 * @brief Get field rssi from rc_channels_raw message
419 * @return Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
421 static inline uint8_t mavlink_msg_rc_channels_raw_get_rssi(const mavlink_message_t
* msg
)
423 return _MAV_RETURN_uint8_t(msg
, 21);
427 * @brief Decode a rc_channels_raw message into a struct
429 * @param msg The message to decode
430 * @param rc_channels_raw C-struct to decode the message contents into
432 static inline void mavlink_msg_rc_channels_raw_decode(const mavlink_message_t
* msg
, mavlink_rc_channels_raw_t
* rc_channels_raw
)
434 #if MAVLINK_NEED_BYTE_SWAP
435 rc_channels_raw
->time_boot_ms
= mavlink_msg_rc_channels_raw_get_time_boot_ms(msg
);
436 rc_channels_raw
->chan1_raw
= mavlink_msg_rc_channels_raw_get_chan1_raw(msg
);
437 rc_channels_raw
->chan2_raw
= mavlink_msg_rc_channels_raw_get_chan2_raw(msg
);
438 rc_channels_raw
->chan3_raw
= mavlink_msg_rc_channels_raw_get_chan3_raw(msg
);
439 rc_channels_raw
->chan4_raw
= mavlink_msg_rc_channels_raw_get_chan4_raw(msg
);
440 rc_channels_raw
->chan5_raw
= mavlink_msg_rc_channels_raw_get_chan5_raw(msg
);
441 rc_channels_raw
->chan6_raw
= mavlink_msg_rc_channels_raw_get_chan6_raw(msg
);
442 rc_channels_raw
->chan7_raw
= mavlink_msg_rc_channels_raw_get_chan7_raw(msg
);
443 rc_channels_raw
->chan8_raw
= mavlink_msg_rc_channels_raw_get_chan8_raw(msg
);
444 rc_channels_raw
->port
= mavlink_msg_rc_channels_raw_get_port(msg
);
445 rc_channels_raw
->rssi
= mavlink_msg_rc_channels_raw_get_rssi(msg
);
447 memcpy(rc_channels_raw
, _MAV_PAYLOAD(msg
), MAVLINK_MSG_ID_RC_CHANNELS_RAW_LEN
);