Merge pull request #10476 from radiolinkW/RADIOLINKF722
[inav.git] / lib / main / MAVLink / common / mavlink_msg_rc_channels_scaled.h
blob9d516d1ccc059289b3e5d1e994a35e2bf050765a
1 #pragma once
2 // MESSAGE RC_CHANNELS_SCALED PACKING
4 #define MAVLINK_MSG_ID_RC_CHANNELS_SCALED 34
7 typedef struct __mavlink_rc_channels_scaled_t {
8 uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
9 int16_t chan1_scaled; /*< RC channel 1 value scaled.*/
10 int16_t chan2_scaled; /*< RC channel 2 value scaled.*/
11 int16_t chan3_scaled; /*< RC channel 3 value scaled.*/
12 int16_t chan4_scaled; /*< RC channel 4 value scaled.*/
13 int16_t chan5_scaled; /*< RC channel 5 value scaled.*/
14 int16_t chan6_scaled; /*< RC channel 6 value scaled.*/
15 int16_t chan7_scaled; /*< RC channel 7 value scaled.*/
16 int16_t chan8_scaled; /*< RC channel 8 value scaled.*/
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], 255: invalid/unknown.*/
19 } mavlink_rc_channels_scaled_t;
21 #define MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN 22
22 #define MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN 22
23 #define MAVLINK_MSG_ID_34_LEN 22
24 #define MAVLINK_MSG_ID_34_MIN_LEN 22
26 #define MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC 237
27 #define MAVLINK_MSG_ID_34_CRC 237
31 #if MAVLINK_COMMAND_24BIT
32 #define MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED { \
33 34, \
34 "RC_CHANNELS_SCALED", \
35 11, \
36 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_scaled_t, time_boot_ms) }, \
37 { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_rc_channels_scaled_t, port) }, \
38 { "chan1_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_rc_channels_scaled_t, chan1_scaled) }, \
39 { "chan2_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_rc_channels_scaled_t, chan2_scaled) }, \
40 { "chan3_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_rc_channels_scaled_t, chan3_scaled) }, \
41 { "chan4_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_rc_channels_scaled_t, chan4_scaled) }, \
42 { "chan5_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_rc_channels_scaled_t, chan5_scaled) }, \
43 { "chan6_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_rc_channels_scaled_t, chan6_scaled) }, \
44 { "chan7_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_rc_channels_scaled_t, chan7_scaled) }, \
45 { "chan8_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_rc_channels_scaled_t, chan8_scaled) }, \
46 { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_rc_channels_scaled_t, rssi) }, \
47 } \
49 #else
50 #define MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED { \
51 "RC_CHANNELS_SCALED", \
52 11, \
53 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_scaled_t, time_boot_ms) }, \
54 { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_rc_channels_scaled_t, port) }, \
55 { "chan1_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_rc_channels_scaled_t, chan1_scaled) }, \
56 { "chan2_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_rc_channels_scaled_t, chan2_scaled) }, \
57 { "chan3_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_rc_channels_scaled_t, chan3_scaled) }, \
58 { "chan4_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_rc_channels_scaled_t, chan4_scaled) }, \
59 { "chan5_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_rc_channels_scaled_t, chan5_scaled) }, \
60 { "chan6_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_rc_channels_scaled_t, chan6_scaled) }, \
61 { "chan7_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_rc_channels_scaled_t, chan7_scaled) }, \
62 { "chan8_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_rc_channels_scaled_t, chan8_scaled) }, \
63 { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_rc_channels_scaled_t, rssi) }, \
64 } \
66 #endif
68 /**
69 * @brief Pack a rc_channels_scaled 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
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_scaled RC channel 1 value scaled.
77 * @param chan2_scaled RC channel 2 value scaled.
78 * @param chan3_scaled RC channel 3 value scaled.
79 * @param chan4_scaled RC channel 4 value scaled.
80 * @param chan5_scaled RC channel 5 value scaled.
81 * @param chan6_scaled RC channel 6 value scaled.
82 * @param chan7_scaled RC channel 7 value scaled.
83 * @param chan8_scaled RC channel 8 value scaled.
84 * @param rssi Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown.
85 * @return length of the message in bytes (excluding serial stream start sign)
87 static inline uint16_t mavlink_msg_rc_channels_scaled_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
88 uint32_t time_boot_ms, uint8_t port, int16_t chan1_scaled, int16_t chan2_scaled, int16_t chan3_scaled, int16_t chan4_scaled, int16_t chan5_scaled, int16_t chan6_scaled, int16_t chan7_scaled, int16_t chan8_scaled, uint8_t rssi)
90 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
91 char buf[MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN];
92 _mav_put_uint32_t(buf, 0, time_boot_ms);
93 _mav_put_int16_t(buf, 4, chan1_scaled);
94 _mav_put_int16_t(buf, 6, chan2_scaled);
95 _mav_put_int16_t(buf, 8, chan3_scaled);
96 _mav_put_int16_t(buf, 10, chan4_scaled);
97 _mav_put_int16_t(buf, 12, chan5_scaled);
98 _mav_put_int16_t(buf, 14, chan6_scaled);
99 _mav_put_int16_t(buf, 16, chan7_scaled);
100 _mav_put_int16_t(buf, 18, chan8_scaled);
101 _mav_put_uint8_t(buf, 20, port);
102 _mav_put_uint8_t(buf, 21, rssi);
104 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN);
105 #else
106 mavlink_rc_channels_scaled_t packet;
107 packet.time_boot_ms = time_boot_ms;
108 packet.chan1_scaled = chan1_scaled;
109 packet.chan2_scaled = chan2_scaled;
110 packet.chan3_scaled = chan3_scaled;
111 packet.chan4_scaled = chan4_scaled;
112 packet.chan5_scaled = chan5_scaled;
113 packet.chan6_scaled = chan6_scaled;
114 packet.chan7_scaled = chan7_scaled;
115 packet.chan8_scaled = chan8_scaled;
116 packet.port = port;
117 packet.rssi = rssi;
119 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN);
120 #endif
122 msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED;
123 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC);
127 * @brief Pack a rc_channels_scaled message on a channel
128 * @param system_id ID of this system
129 * @param component_id ID of this component (e.g. 200 for IMU)
130 * @param chan The MAVLink channel this message will be sent over
131 * @param msg The MAVLink message to compress the data into
132 * @param time_boot_ms [ms] Timestamp (time since system boot).
133 * @param port Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.
134 * @param chan1_scaled RC channel 1 value scaled.
135 * @param chan2_scaled RC channel 2 value scaled.
136 * @param chan3_scaled RC channel 3 value scaled.
137 * @param chan4_scaled RC channel 4 value scaled.
138 * @param chan5_scaled RC channel 5 value scaled.
139 * @param chan6_scaled RC channel 6 value scaled.
140 * @param chan7_scaled RC channel 7 value scaled.
141 * @param chan8_scaled RC channel 8 value scaled.
142 * @param rssi Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown.
143 * @return length of the message in bytes (excluding serial stream start sign)
145 static inline uint16_t mavlink_msg_rc_channels_scaled_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
146 mavlink_message_t* msg,
147 uint32_t time_boot_ms,uint8_t port,int16_t chan1_scaled,int16_t chan2_scaled,int16_t chan3_scaled,int16_t chan4_scaled,int16_t chan5_scaled,int16_t chan6_scaled,int16_t chan7_scaled,int16_t chan8_scaled,uint8_t rssi)
149 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
150 char buf[MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN];
151 _mav_put_uint32_t(buf, 0, time_boot_ms);
152 _mav_put_int16_t(buf, 4, chan1_scaled);
153 _mav_put_int16_t(buf, 6, chan2_scaled);
154 _mav_put_int16_t(buf, 8, chan3_scaled);
155 _mav_put_int16_t(buf, 10, chan4_scaled);
156 _mav_put_int16_t(buf, 12, chan5_scaled);
157 _mav_put_int16_t(buf, 14, chan6_scaled);
158 _mav_put_int16_t(buf, 16, chan7_scaled);
159 _mav_put_int16_t(buf, 18, chan8_scaled);
160 _mav_put_uint8_t(buf, 20, port);
161 _mav_put_uint8_t(buf, 21, rssi);
163 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN);
164 #else
165 mavlink_rc_channels_scaled_t packet;
166 packet.time_boot_ms = time_boot_ms;
167 packet.chan1_scaled = chan1_scaled;
168 packet.chan2_scaled = chan2_scaled;
169 packet.chan3_scaled = chan3_scaled;
170 packet.chan4_scaled = chan4_scaled;
171 packet.chan5_scaled = chan5_scaled;
172 packet.chan6_scaled = chan6_scaled;
173 packet.chan7_scaled = chan7_scaled;
174 packet.chan8_scaled = chan8_scaled;
175 packet.port = port;
176 packet.rssi = rssi;
178 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN);
179 #endif
181 msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_SCALED;
182 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC);
186 * @brief Encode a rc_channels_scaled struct
188 * @param system_id ID of this system
189 * @param component_id ID of this component (e.g. 200 for IMU)
190 * @param msg The MAVLink message to compress the data into
191 * @param rc_channels_scaled C-struct to read the message contents from
193 static inline uint16_t mavlink_msg_rc_channels_scaled_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rc_channels_scaled_t* rc_channels_scaled)
195 return mavlink_msg_rc_channels_scaled_pack(system_id, component_id, msg, rc_channels_scaled->time_boot_ms, rc_channels_scaled->port, rc_channels_scaled->chan1_scaled, rc_channels_scaled->chan2_scaled, rc_channels_scaled->chan3_scaled, rc_channels_scaled->chan4_scaled, rc_channels_scaled->chan5_scaled, rc_channels_scaled->chan6_scaled, rc_channels_scaled->chan7_scaled, rc_channels_scaled->chan8_scaled, rc_channels_scaled->rssi);
199 * @brief Encode a rc_channels_scaled struct on a channel
201 * @param system_id ID of this system
202 * @param component_id ID of this component (e.g. 200 for IMU)
203 * @param chan The MAVLink channel this message will be sent over
204 * @param msg The MAVLink message to compress the data into
205 * @param rc_channels_scaled C-struct to read the message contents from
207 static inline uint16_t mavlink_msg_rc_channels_scaled_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rc_channels_scaled_t* rc_channels_scaled)
209 return mavlink_msg_rc_channels_scaled_pack_chan(system_id, component_id, chan, msg, rc_channels_scaled->time_boot_ms, rc_channels_scaled->port, rc_channels_scaled->chan1_scaled, rc_channels_scaled->chan2_scaled, rc_channels_scaled->chan3_scaled, rc_channels_scaled->chan4_scaled, rc_channels_scaled->chan5_scaled, rc_channels_scaled->chan6_scaled, rc_channels_scaled->chan7_scaled, rc_channels_scaled->chan8_scaled, rc_channels_scaled->rssi);
213 * @brief Send a rc_channels_scaled message
214 * @param chan MAVLink channel to send the message
216 * @param time_boot_ms [ms] Timestamp (time since system boot).
217 * @param port Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.
218 * @param chan1_scaled RC channel 1 value scaled.
219 * @param chan2_scaled RC channel 2 value scaled.
220 * @param chan3_scaled RC channel 3 value scaled.
221 * @param chan4_scaled RC channel 4 value scaled.
222 * @param chan5_scaled RC channel 5 value scaled.
223 * @param chan6_scaled RC channel 6 value scaled.
224 * @param chan7_scaled RC channel 7 value scaled.
225 * @param chan8_scaled RC channel 8 value scaled.
226 * @param rssi Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown.
228 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
230 static inline void mavlink_msg_rc_channels_scaled_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t port, int16_t chan1_scaled, int16_t chan2_scaled, int16_t chan3_scaled, int16_t chan4_scaled, int16_t chan5_scaled, int16_t chan6_scaled, int16_t chan7_scaled, int16_t chan8_scaled, uint8_t rssi)
232 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
233 char buf[MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN];
234 _mav_put_uint32_t(buf, 0, time_boot_ms);
235 _mav_put_int16_t(buf, 4, chan1_scaled);
236 _mav_put_int16_t(buf, 6, chan2_scaled);
237 _mav_put_int16_t(buf, 8, chan3_scaled);
238 _mav_put_int16_t(buf, 10, chan4_scaled);
239 _mav_put_int16_t(buf, 12, chan5_scaled);
240 _mav_put_int16_t(buf, 14, chan6_scaled);
241 _mav_put_int16_t(buf, 16, chan7_scaled);
242 _mav_put_int16_t(buf, 18, chan8_scaled);
243 _mav_put_uint8_t(buf, 20, port);
244 _mav_put_uint8_t(buf, 21, rssi);
246 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, buf, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC);
247 #else
248 mavlink_rc_channels_scaled_t packet;
249 packet.time_boot_ms = time_boot_ms;
250 packet.chan1_scaled = chan1_scaled;
251 packet.chan2_scaled = chan2_scaled;
252 packet.chan3_scaled = chan3_scaled;
253 packet.chan4_scaled = chan4_scaled;
254 packet.chan5_scaled = chan5_scaled;
255 packet.chan6_scaled = chan6_scaled;
256 packet.chan7_scaled = chan7_scaled;
257 packet.chan8_scaled = chan8_scaled;
258 packet.port = port;
259 packet.rssi = rssi;
261 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC);
262 #endif
266 * @brief Send a rc_channels_scaled message
267 * @param chan MAVLink channel to send the message
268 * @param struct The MAVLink struct to serialize
270 static inline void mavlink_msg_rc_channels_scaled_send_struct(mavlink_channel_t chan, const mavlink_rc_channels_scaled_t* rc_channels_scaled)
272 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
273 mavlink_msg_rc_channels_scaled_send(chan, rc_channels_scaled->time_boot_ms, rc_channels_scaled->port, rc_channels_scaled->chan1_scaled, rc_channels_scaled->chan2_scaled, rc_channels_scaled->chan3_scaled, rc_channels_scaled->chan4_scaled, rc_channels_scaled->chan5_scaled, rc_channels_scaled->chan6_scaled, rc_channels_scaled->chan7_scaled, rc_channels_scaled->chan8_scaled, rc_channels_scaled->rssi);
274 #else
275 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, (const char *)rc_channels_scaled, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC);
276 #endif
279 #if MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN <= MAVLINK_MAX_PAYLOAD_LEN
281 This varient of _send() can be used to save stack space by re-using
282 memory from the receive buffer. The caller provides a
283 mavlink_message_t which is the size of a full mavlink message. This
284 is usually the receive buffer for the channel, and allows a reply to an
285 incoming message with minimum stack space usage.
287 static inline void mavlink_msg_rc_channels_scaled_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t port, int16_t chan1_scaled, int16_t chan2_scaled, int16_t chan3_scaled, int16_t chan4_scaled, int16_t chan5_scaled, int16_t chan6_scaled, int16_t chan7_scaled, int16_t chan8_scaled, uint8_t rssi)
289 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
290 char *buf = (char *)msgbuf;
291 _mav_put_uint32_t(buf, 0, time_boot_ms);
292 _mav_put_int16_t(buf, 4, chan1_scaled);
293 _mav_put_int16_t(buf, 6, chan2_scaled);
294 _mav_put_int16_t(buf, 8, chan3_scaled);
295 _mav_put_int16_t(buf, 10, chan4_scaled);
296 _mav_put_int16_t(buf, 12, chan5_scaled);
297 _mav_put_int16_t(buf, 14, chan6_scaled);
298 _mav_put_int16_t(buf, 16, chan7_scaled);
299 _mav_put_int16_t(buf, 18, chan8_scaled);
300 _mav_put_uint8_t(buf, 20, port);
301 _mav_put_uint8_t(buf, 21, rssi);
303 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, buf, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC);
304 #else
305 mavlink_rc_channels_scaled_t *packet = (mavlink_rc_channels_scaled_t *)msgbuf;
306 packet->time_boot_ms = time_boot_ms;
307 packet->chan1_scaled = chan1_scaled;
308 packet->chan2_scaled = chan2_scaled;
309 packet->chan3_scaled = chan3_scaled;
310 packet->chan4_scaled = chan4_scaled;
311 packet->chan5_scaled = chan5_scaled;
312 packet->chan6_scaled = chan6_scaled;
313 packet->chan7_scaled = chan7_scaled;
314 packet->chan8_scaled = chan8_scaled;
315 packet->port = port;
316 packet->rssi = rssi;
318 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_SCALED, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC);
319 #endif
321 #endif
323 #endif
325 // MESSAGE RC_CHANNELS_SCALED UNPACKING
329 * @brief Get field time_boot_ms from rc_channels_scaled message
331 * @return [ms] Timestamp (time since system boot).
333 static inline uint32_t mavlink_msg_rc_channels_scaled_get_time_boot_ms(const mavlink_message_t* msg)
335 return _MAV_RETURN_uint32_t(msg, 0);
339 * @brief Get field port from rc_channels_scaled message
341 * @return Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.
343 static inline uint8_t mavlink_msg_rc_channels_scaled_get_port(const mavlink_message_t* msg)
345 return _MAV_RETURN_uint8_t(msg, 20);
349 * @brief Get field chan1_scaled from rc_channels_scaled message
351 * @return RC channel 1 value scaled.
353 static inline int16_t mavlink_msg_rc_channels_scaled_get_chan1_scaled(const mavlink_message_t* msg)
355 return _MAV_RETURN_int16_t(msg, 4);
359 * @brief Get field chan2_scaled from rc_channels_scaled message
361 * @return RC channel 2 value scaled.
363 static inline int16_t mavlink_msg_rc_channels_scaled_get_chan2_scaled(const mavlink_message_t* msg)
365 return _MAV_RETURN_int16_t(msg, 6);
369 * @brief Get field chan3_scaled from rc_channels_scaled message
371 * @return RC channel 3 value scaled.
373 static inline int16_t mavlink_msg_rc_channels_scaled_get_chan3_scaled(const mavlink_message_t* msg)
375 return _MAV_RETURN_int16_t(msg, 8);
379 * @brief Get field chan4_scaled from rc_channels_scaled message
381 * @return RC channel 4 value scaled.
383 static inline int16_t mavlink_msg_rc_channels_scaled_get_chan4_scaled(const mavlink_message_t* msg)
385 return _MAV_RETURN_int16_t(msg, 10);
389 * @brief Get field chan5_scaled from rc_channels_scaled message
391 * @return RC channel 5 value scaled.
393 static inline int16_t mavlink_msg_rc_channels_scaled_get_chan5_scaled(const mavlink_message_t* msg)
395 return _MAV_RETURN_int16_t(msg, 12);
399 * @brief Get field chan6_scaled from rc_channels_scaled message
401 * @return RC channel 6 value scaled.
403 static inline int16_t mavlink_msg_rc_channels_scaled_get_chan6_scaled(const mavlink_message_t* msg)
405 return _MAV_RETURN_int16_t(msg, 14);
409 * @brief Get field chan7_scaled from rc_channels_scaled message
411 * @return RC channel 7 value scaled.
413 static inline int16_t mavlink_msg_rc_channels_scaled_get_chan7_scaled(const mavlink_message_t* msg)
415 return _MAV_RETURN_int16_t(msg, 16);
419 * @brief Get field chan8_scaled from rc_channels_scaled message
421 * @return RC channel 8 value scaled.
423 static inline int16_t mavlink_msg_rc_channels_scaled_get_chan8_scaled(const mavlink_message_t* msg)
425 return _MAV_RETURN_int16_t(msg, 18);
429 * @brief Get field rssi from rc_channels_scaled message
431 * @return Receive signal strength indicator in device-dependent units/scale. Values: [0-254], 255: invalid/unknown.
433 static inline uint8_t mavlink_msg_rc_channels_scaled_get_rssi(const mavlink_message_t* msg)
435 return _MAV_RETURN_uint8_t(msg, 21);
439 * @brief Decode a rc_channels_scaled message into a struct
441 * @param msg The message to decode
442 * @param rc_channels_scaled C-struct to decode the message contents into
444 static inline void mavlink_msg_rc_channels_scaled_decode(const mavlink_message_t* msg, mavlink_rc_channels_scaled_t* rc_channels_scaled)
446 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
447 rc_channels_scaled->time_boot_ms = mavlink_msg_rc_channels_scaled_get_time_boot_ms(msg);
448 rc_channels_scaled->chan1_scaled = mavlink_msg_rc_channels_scaled_get_chan1_scaled(msg);
449 rc_channels_scaled->chan2_scaled = mavlink_msg_rc_channels_scaled_get_chan2_scaled(msg);
450 rc_channels_scaled->chan3_scaled = mavlink_msg_rc_channels_scaled_get_chan3_scaled(msg);
451 rc_channels_scaled->chan4_scaled = mavlink_msg_rc_channels_scaled_get_chan4_scaled(msg);
452 rc_channels_scaled->chan5_scaled = mavlink_msg_rc_channels_scaled_get_chan5_scaled(msg);
453 rc_channels_scaled->chan6_scaled = mavlink_msg_rc_channels_scaled_get_chan6_scaled(msg);
454 rc_channels_scaled->chan7_scaled = mavlink_msg_rc_channels_scaled_get_chan7_scaled(msg);
455 rc_channels_scaled->chan8_scaled = mavlink_msg_rc_channels_scaled_get_chan8_scaled(msg);
456 rc_channels_scaled->port = mavlink_msg_rc_channels_scaled_get_port(msg);
457 rc_channels_scaled->rssi = mavlink_msg_rc_channels_scaled_get_rssi(msg);
458 #else
459 uint8_t len = msg->len < MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN? msg->len : MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN;
460 memset(rc_channels_scaled, 0, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN);
461 memcpy(rc_channels_scaled, _MAV_PAYLOAD(msg), len);
462 #endif