[GYRO] Refactor gyro driver for dual-gyro support
[inav.git] / lib / main / MAVLink / common / mavlink_msg_rc_channels_override.h
blob970e9269350abb60fa1dafa34f26e9ddc598bb1e
1 #pragma once
2 // MESSAGE RC_CHANNELS_OVERRIDE PACKING
4 #define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE 70
6 MAVPACKED(
7 typedef struct __mavlink_rc_channels_override_t {
8 uint16_t chan1_raw; /*< RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
9 uint16_t chan2_raw; /*< RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
10 uint16_t chan3_raw; /*< RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
11 uint16_t chan4_raw; /*< RC channel 4 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
12 uint16_t chan5_raw; /*< RC channel 5 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
13 uint16_t chan6_raw; /*< RC channel 6 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
14 uint16_t chan7_raw; /*< RC channel 7 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
15 uint16_t chan8_raw; /*< RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
16 uint8_t target_system; /*< System ID*/
17 uint8_t target_component; /*< Component ID*/
18 }) mavlink_rc_channels_override_t;
20 #define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN 18
21 #define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN 18
22 #define MAVLINK_MSG_ID_70_LEN 18
23 #define MAVLINK_MSG_ID_70_MIN_LEN 18
25 #define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC 124
26 #define MAVLINK_MSG_ID_70_CRC 124
30 #if MAVLINK_COMMAND_24BIT
31 #define MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE { \
32 70, \
33 "RC_CHANNELS_OVERRIDE", \
34 10, \
35 { { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_rc_channels_override_t, chan1_raw) }, \
36 { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_rc_channels_override_t, chan2_raw) }, \
37 { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_override_t, chan3_raw) }, \
38 { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_override_t, chan4_raw) }, \
39 { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_override_t, chan5_raw) }, \
40 { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_override_t, chan6_raw) }, \
41 { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_override_t, chan7_raw) }, \
42 { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_override_t, chan8_raw) }, \
43 { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_rc_channels_override_t, target_system) }, \
44 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_rc_channels_override_t, target_component) }, \
45 } \
47 #else
48 #define MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE { \
49 "RC_CHANNELS_OVERRIDE", \
50 10, \
51 { { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_rc_channels_override_t, chan1_raw) }, \
52 { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_rc_channels_override_t, chan2_raw) }, \
53 { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_override_t, chan3_raw) }, \
54 { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_override_t, chan4_raw) }, \
55 { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_override_t, chan5_raw) }, \
56 { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_override_t, chan6_raw) }, \
57 { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_override_t, chan7_raw) }, \
58 { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_override_t, chan8_raw) }, \
59 { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_rc_channels_override_t, target_system) }, \
60 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_rc_channels_override_t, target_component) }, \
61 } \
63 #endif
65 /**
66 * @brief Pack a rc_channels_override message
67 * @param system_id ID of this system
68 * @param component_id ID of this component (e.g. 200 for IMU)
69 * @param msg The MAVLink message to compress the data into
71 * @param target_system System ID
72 * @param target_component Component ID
73 * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field.
74 * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field.
75 * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field.
76 * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX means to ignore this field.
77 * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX means to ignore this field.
78 * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX means to ignore this field.
79 * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX means to ignore this field.
80 * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field.
81 * @return length of the message in bytes (excluding serial stream start sign)
83 static inline uint16_t mavlink_msg_rc_channels_override_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
84 uint8_t target_system, uint8_t target_component, 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)
86 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
87 char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN];
88 _mav_put_uint16_t(buf, 0, chan1_raw);
89 _mav_put_uint16_t(buf, 2, chan2_raw);
90 _mav_put_uint16_t(buf, 4, chan3_raw);
91 _mav_put_uint16_t(buf, 6, chan4_raw);
92 _mav_put_uint16_t(buf, 8, chan5_raw);
93 _mav_put_uint16_t(buf, 10, chan6_raw);
94 _mav_put_uint16_t(buf, 12, chan7_raw);
95 _mav_put_uint16_t(buf, 14, chan8_raw);
96 _mav_put_uint8_t(buf, 16, target_system);
97 _mav_put_uint8_t(buf, 17, target_component);
99 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
100 #else
101 mavlink_rc_channels_override_t packet;
102 packet.chan1_raw = chan1_raw;
103 packet.chan2_raw = chan2_raw;
104 packet.chan3_raw = chan3_raw;
105 packet.chan4_raw = chan4_raw;
106 packet.chan5_raw = chan5_raw;
107 packet.chan6_raw = chan6_raw;
108 packet.chan7_raw = chan7_raw;
109 packet.chan8_raw = chan8_raw;
110 packet.target_system = target_system;
111 packet.target_component = target_component;
113 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
114 #endif
116 msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE;
117 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
121 * @brief Pack a rc_channels_override message on a channel
122 * @param system_id ID of this system
123 * @param component_id ID of this component (e.g. 200 for IMU)
124 * @param chan The MAVLink channel this message will be sent over
125 * @param msg The MAVLink message to compress the data into
126 * @param target_system System ID
127 * @param target_component Component ID
128 * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field.
129 * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field.
130 * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field.
131 * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX means to ignore this field.
132 * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX means to ignore this field.
133 * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX means to ignore this field.
134 * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX means to ignore this field.
135 * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field.
136 * @return length of the message in bytes (excluding serial stream start sign)
138 static inline uint16_t mavlink_msg_rc_channels_override_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
139 mavlink_message_t* msg,
140 uint8_t target_system,uint8_t target_component,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)
142 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
143 char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN];
144 _mav_put_uint16_t(buf, 0, chan1_raw);
145 _mav_put_uint16_t(buf, 2, chan2_raw);
146 _mav_put_uint16_t(buf, 4, chan3_raw);
147 _mav_put_uint16_t(buf, 6, chan4_raw);
148 _mav_put_uint16_t(buf, 8, chan5_raw);
149 _mav_put_uint16_t(buf, 10, chan6_raw);
150 _mav_put_uint16_t(buf, 12, chan7_raw);
151 _mav_put_uint16_t(buf, 14, chan8_raw);
152 _mav_put_uint8_t(buf, 16, target_system);
153 _mav_put_uint8_t(buf, 17, target_component);
155 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
156 #else
157 mavlink_rc_channels_override_t packet;
158 packet.chan1_raw = chan1_raw;
159 packet.chan2_raw = chan2_raw;
160 packet.chan3_raw = chan3_raw;
161 packet.chan4_raw = chan4_raw;
162 packet.chan5_raw = chan5_raw;
163 packet.chan6_raw = chan6_raw;
164 packet.chan7_raw = chan7_raw;
165 packet.chan8_raw = chan8_raw;
166 packet.target_system = target_system;
167 packet.target_component = target_component;
169 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
170 #endif
172 msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE;
173 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
177 * @brief Encode a rc_channels_override struct
179 * @param system_id ID of this system
180 * @param component_id ID of this component (e.g. 200 for IMU)
181 * @param msg The MAVLink message to compress the data into
182 * @param rc_channels_override C-struct to read the message contents from
184 static inline uint16_t mavlink_msg_rc_channels_override_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rc_channels_override_t* rc_channels_override)
186 return mavlink_msg_rc_channels_override_pack(system_id, component_id, msg, rc_channels_override->target_system, rc_channels_override->target_component, rc_channels_override->chan1_raw, rc_channels_override->chan2_raw, rc_channels_override->chan3_raw, rc_channels_override->chan4_raw, rc_channels_override->chan5_raw, rc_channels_override->chan6_raw, rc_channels_override->chan7_raw, rc_channels_override->chan8_raw);
190 * @brief Encode a rc_channels_override struct on a channel
192 * @param system_id ID of this system
193 * @param component_id ID of this component (e.g. 200 for IMU)
194 * @param chan The MAVLink channel this message will be sent over
195 * @param msg The MAVLink message to compress the data into
196 * @param rc_channels_override C-struct to read the message contents from
198 static inline uint16_t mavlink_msg_rc_channels_override_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rc_channels_override_t* rc_channels_override)
200 return mavlink_msg_rc_channels_override_pack_chan(system_id, component_id, chan, msg, rc_channels_override->target_system, rc_channels_override->target_component, rc_channels_override->chan1_raw, rc_channels_override->chan2_raw, rc_channels_override->chan3_raw, rc_channels_override->chan4_raw, rc_channels_override->chan5_raw, rc_channels_override->chan6_raw, rc_channels_override->chan7_raw, rc_channels_override->chan8_raw);
204 * @brief Send a rc_channels_override message
205 * @param chan MAVLink channel to send the message
207 * @param target_system System ID
208 * @param target_component Component ID
209 * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field.
210 * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field.
211 * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field.
212 * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX means to ignore this field.
213 * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX means to ignore this field.
214 * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX means to ignore this field.
215 * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX means to ignore this field.
216 * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field.
218 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
220 static inline void mavlink_msg_rc_channels_override_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, 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)
222 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
223 char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN];
224 _mav_put_uint16_t(buf, 0, chan1_raw);
225 _mav_put_uint16_t(buf, 2, chan2_raw);
226 _mav_put_uint16_t(buf, 4, chan3_raw);
227 _mav_put_uint16_t(buf, 6, chan4_raw);
228 _mav_put_uint16_t(buf, 8, chan5_raw);
229 _mav_put_uint16_t(buf, 10, chan6_raw);
230 _mav_put_uint16_t(buf, 12, chan7_raw);
231 _mav_put_uint16_t(buf, 14, chan8_raw);
232 _mav_put_uint8_t(buf, 16, target_system);
233 _mav_put_uint8_t(buf, 17, target_component);
235 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
236 #else
237 mavlink_rc_channels_override_t packet;
238 packet.chan1_raw = chan1_raw;
239 packet.chan2_raw = chan2_raw;
240 packet.chan3_raw = chan3_raw;
241 packet.chan4_raw = chan4_raw;
242 packet.chan5_raw = chan5_raw;
243 packet.chan6_raw = chan6_raw;
244 packet.chan7_raw = chan7_raw;
245 packet.chan8_raw = chan8_raw;
246 packet.target_system = target_system;
247 packet.target_component = target_component;
249 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
250 #endif
254 * @brief Send a rc_channels_override message
255 * @param chan MAVLink channel to send the message
256 * @param struct The MAVLink struct to serialize
258 static inline void mavlink_msg_rc_channels_override_send_struct(mavlink_channel_t chan, const mavlink_rc_channels_override_t* rc_channels_override)
260 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
261 mavlink_msg_rc_channels_override_send(chan, rc_channels_override->target_system, rc_channels_override->target_component, rc_channels_override->chan1_raw, rc_channels_override->chan2_raw, rc_channels_override->chan3_raw, rc_channels_override->chan4_raw, rc_channels_override->chan5_raw, rc_channels_override->chan6_raw, rc_channels_override->chan7_raw, rc_channels_override->chan8_raw);
262 #else
263 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)rc_channels_override, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
264 #endif
267 #if MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
269 This varient of _send() can be used to save stack space by re-using
270 memory from the receive buffer. The caller provides a
271 mavlink_message_t which is the size of a full mavlink message. This
272 is usually the receive buffer for the channel, and allows a reply to an
273 incoming message with minimum stack space usage.
275 static inline void mavlink_msg_rc_channels_override_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, 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)
277 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
278 char *buf = (char *)msgbuf;
279 _mav_put_uint16_t(buf, 0, chan1_raw);
280 _mav_put_uint16_t(buf, 2, chan2_raw);
281 _mav_put_uint16_t(buf, 4, chan3_raw);
282 _mav_put_uint16_t(buf, 6, chan4_raw);
283 _mav_put_uint16_t(buf, 8, chan5_raw);
284 _mav_put_uint16_t(buf, 10, chan6_raw);
285 _mav_put_uint16_t(buf, 12, chan7_raw);
286 _mav_put_uint16_t(buf, 14, chan8_raw);
287 _mav_put_uint8_t(buf, 16, target_system);
288 _mav_put_uint8_t(buf, 17, target_component);
290 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
291 #else
292 mavlink_rc_channels_override_t *packet = (mavlink_rc_channels_override_t *)msgbuf;
293 packet->chan1_raw = chan1_raw;
294 packet->chan2_raw = chan2_raw;
295 packet->chan3_raw = chan3_raw;
296 packet->chan4_raw = chan4_raw;
297 packet->chan5_raw = chan5_raw;
298 packet->chan6_raw = chan6_raw;
299 packet->chan7_raw = chan7_raw;
300 packet->chan8_raw = chan8_raw;
301 packet->target_system = target_system;
302 packet->target_component = target_component;
304 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
305 #endif
307 #endif
309 #endif
311 // MESSAGE RC_CHANNELS_OVERRIDE UNPACKING
315 * @brief Get field target_system from rc_channels_override message
317 * @return System ID
319 static inline uint8_t mavlink_msg_rc_channels_override_get_target_system(const mavlink_message_t* msg)
321 return _MAV_RETURN_uint8_t(msg, 16);
325 * @brief Get field target_component from rc_channels_override message
327 * @return Component ID
329 static inline uint8_t mavlink_msg_rc_channels_override_get_target_component(const mavlink_message_t* msg)
331 return _MAV_RETURN_uint8_t(msg, 17);
335 * @brief Get field chan1_raw from rc_channels_override message
337 * @return RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field.
339 static inline uint16_t mavlink_msg_rc_channels_override_get_chan1_raw(const mavlink_message_t* msg)
341 return _MAV_RETURN_uint16_t(msg, 0);
345 * @brief Get field chan2_raw from rc_channels_override message
347 * @return RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field.
349 static inline uint16_t mavlink_msg_rc_channels_override_get_chan2_raw(const mavlink_message_t* msg)
351 return _MAV_RETURN_uint16_t(msg, 2);
355 * @brief Get field chan3_raw from rc_channels_override message
357 * @return RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field.
359 static inline uint16_t mavlink_msg_rc_channels_override_get_chan3_raw(const mavlink_message_t* msg)
361 return _MAV_RETURN_uint16_t(msg, 4);
365 * @brief Get field chan4_raw from rc_channels_override message
367 * @return RC channel 4 value, in microseconds. A value of UINT16_MAX means to ignore this field.
369 static inline uint16_t mavlink_msg_rc_channels_override_get_chan4_raw(const mavlink_message_t* msg)
371 return _MAV_RETURN_uint16_t(msg, 6);
375 * @brief Get field chan5_raw from rc_channels_override message
377 * @return RC channel 5 value, in microseconds. A value of UINT16_MAX means to ignore this field.
379 static inline uint16_t mavlink_msg_rc_channels_override_get_chan5_raw(const mavlink_message_t* msg)
381 return _MAV_RETURN_uint16_t(msg, 8);
385 * @brief Get field chan6_raw from rc_channels_override message
387 * @return RC channel 6 value, in microseconds. A value of UINT16_MAX means to ignore this field.
389 static inline uint16_t mavlink_msg_rc_channels_override_get_chan6_raw(const mavlink_message_t* msg)
391 return _MAV_RETURN_uint16_t(msg, 10);
395 * @brief Get field chan7_raw from rc_channels_override message
397 * @return RC channel 7 value, in microseconds. A value of UINT16_MAX means to ignore this field.
399 static inline uint16_t mavlink_msg_rc_channels_override_get_chan7_raw(const mavlink_message_t* msg)
401 return _MAV_RETURN_uint16_t(msg, 12);
405 * @brief Get field chan8_raw from rc_channels_override message
407 * @return RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field.
409 static inline uint16_t mavlink_msg_rc_channels_override_get_chan8_raw(const mavlink_message_t* msg)
411 return _MAV_RETURN_uint16_t(msg, 14);
415 * @brief Decode a rc_channels_override message into a struct
417 * @param msg The message to decode
418 * @param rc_channels_override C-struct to decode the message contents into
420 static inline void mavlink_msg_rc_channels_override_decode(const mavlink_message_t* msg, mavlink_rc_channels_override_t* rc_channels_override)
422 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
423 rc_channels_override->chan1_raw = mavlink_msg_rc_channels_override_get_chan1_raw(msg);
424 rc_channels_override->chan2_raw = mavlink_msg_rc_channels_override_get_chan2_raw(msg);
425 rc_channels_override->chan3_raw = mavlink_msg_rc_channels_override_get_chan3_raw(msg);
426 rc_channels_override->chan4_raw = mavlink_msg_rc_channels_override_get_chan4_raw(msg);
427 rc_channels_override->chan5_raw = mavlink_msg_rc_channels_override_get_chan5_raw(msg);
428 rc_channels_override->chan6_raw = mavlink_msg_rc_channels_override_get_chan6_raw(msg);
429 rc_channels_override->chan7_raw = mavlink_msg_rc_channels_override_get_chan7_raw(msg);
430 rc_channels_override->chan8_raw = mavlink_msg_rc_channels_override_get_chan8_raw(msg);
431 rc_channels_override->target_system = mavlink_msg_rc_channels_override_get_target_system(msg);
432 rc_channels_override->target_component = mavlink_msg_rc_channels_override_get_target_component(msg);
433 #else
434 uint8_t len = msg->len < MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN? msg->len : MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN;
435 memset(rc_channels_override, 0, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
436 memcpy(rc_channels_override, _MAV_PAYLOAD(msg), len);
437 #endif