1 // MESSAGE RC_CHANNELS_SCALED PACKING
3 #define MAVLINK_MSG_ID_RC_CHANNELS_SCALED 34
5 typedef struct __mavlink_rc_channels_scaled_t
7 uint32_t time_boot_ms
; ///< Timestamp (milliseconds since system boot)
8 int16_t chan1_scaled
; ///< RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
9 int16_t chan2_scaled
; ///< RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
10 int16_t chan3_scaled
; ///< RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
11 int16_t chan4_scaled
; ///< RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
12 int16_t chan5_scaled
; ///< RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
13 int16_t chan6_scaled
; ///< RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
14 int16_t chan7_scaled
; ///< RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
15 int16_t chan8_scaled
; ///< RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
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_scaled_t
;
20 #define MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN 22
21 #define MAVLINK_MSG_ID_34_LEN 22
23 #define MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC 237
24 #define MAVLINK_MSG_ID_34_CRC 237
28 #define MAVLINK_MESSAGE_INFO_RC_CHANNELS_SCALED { \
29 "RC_CHANNELS_SCALED", \
31 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_scaled_t, time_boot_ms) }, \
32 { "chan1_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 4, offsetof(mavlink_rc_channels_scaled_t, chan1_scaled) }, \
33 { "chan2_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 6, offsetof(mavlink_rc_channels_scaled_t, chan2_scaled) }, \
34 { "chan3_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 8, offsetof(mavlink_rc_channels_scaled_t, chan3_scaled) }, \
35 { "chan4_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 10, offsetof(mavlink_rc_channels_scaled_t, chan4_scaled) }, \
36 { "chan5_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 12, offsetof(mavlink_rc_channels_scaled_t, chan5_scaled) }, \
37 { "chan6_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_rc_channels_scaled_t, chan6_scaled) }, \
38 { "chan7_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_rc_channels_scaled_t, chan7_scaled) }, \
39 { "chan8_scaled", NULL, MAVLINK_TYPE_INT16_T, 0, 18, offsetof(mavlink_rc_channels_scaled_t, chan8_scaled) }, \
40 { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_rc_channels_scaled_t, port) }, \
41 { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 21, offsetof(mavlink_rc_channels_scaled_t, rssi) }, \
47 * @brief Pack a rc_channels_scaled 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_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
55 * @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
56 * @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
57 * @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
58 * @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
59 * @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
60 * @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
61 * @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
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_scaled_pack(uint8_t system_id
, uint8_t component_id
, mavlink_message_t
* msg
,
66 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
)
68 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
69 char buf
[MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN
];
70 _mav_put_uint32_t(buf
, 0, time_boot_ms
);
71 _mav_put_int16_t(buf
, 4, chan1_scaled
);
72 _mav_put_int16_t(buf
, 6, chan2_scaled
);
73 _mav_put_int16_t(buf
, 8, chan3_scaled
);
74 _mav_put_int16_t(buf
, 10, chan4_scaled
);
75 _mav_put_int16_t(buf
, 12, chan5_scaled
);
76 _mav_put_int16_t(buf
, 14, chan6_scaled
);
77 _mav_put_int16_t(buf
, 16, chan7_scaled
);
78 _mav_put_int16_t(buf
, 18, chan8_scaled
);
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_SCALED_LEN
);
84 mavlink_rc_channels_scaled_t packet
;
85 packet
.time_boot_ms
= time_boot_ms
;
86 packet
.chan1_scaled
= chan1_scaled
;
87 packet
.chan2_scaled
= chan2_scaled
;
88 packet
.chan3_scaled
= chan3_scaled
;
89 packet
.chan4_scaled
= chan4_scaled
;
90 packet
.chan5_scaled
= chan5_scaled
;
91 packet
.chan6_scaled
= chan6_scaled
;
92 packet
.chan7_scaled
= chan7_scaled
;
93 packet
.chan8_scaled
= chan8_scaled
;
97 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN
);
100 msg
->msgid
= MAVLINK_MSG_ID_RC_CHANNELS_SCALED
;
101 #if MAVLINK_CRC_EXTRA
102 return mavlink_finalize_message(msg
, system_id
, component_id
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC
);
104 return mavlink_finalize_message(msg
, system_id
, component_id
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN
);
109 * @brief Pack a rc_channels_scaled 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_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
117 * @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
118 * @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
119 * @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
120 * @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
121 * @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
122 * @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
123 * @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
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_scaled_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
,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
)
131 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
132 char buf
[MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN
];
133 _mav_put_uint32_t(buf
, 0, time_boot_ms
);
134 _mav_put_int16_t(buf
, 4, chan1_scaled
);
135 _mav_put_int16_t(buf
, 6, chan2_scaled
);
136 _mav_put_int16_t(buf
, 8, chan3_scaled
);
137 _mav_put_int16_t(buf
, 10, chan4_scaled
);
138 _mav_put_int16_t(buf
, 12, chan5_scaled
);
139 _mav_put_int16_t(buf
, 14, chan6_scaled
);
140 _mav_put_int16_t(buf
, 16, chan7_scaled
);
141 _mav_put_int16_t(buf
, 18, chan8_scaled
);
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_SCALED_LEN
);
147 mavlink_rc_channels_scaled_t packet
;
148 packet
.time_boot_ms
= time_boot_ms
;
149 packet
.chan1_scaled
= chan1_scaled
;
150 packet
.chan2_scaled
= chan2_scaled
;
151 packet
.chan3_scaled
= chan3_scaled
;
152 packet
.chan4_scaled
= chan4_scaled
;
153 packet
.chan5_scaled
= chan5_scaled
;
154 packet
.chan6_scaled
= chan6_scaled
;
155 packet
.chan7_scaled
= chan7_scaled
;
156 packet
.chan8_scaled
= chan8_scaled
;
160 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN
);
163 msg
->msgid
= MAVLINK_MSG_ID_RC_CHANNELS_SCALED
;
164 #if MAVLINK_CRC_EXTRA
165 return mavlink_finalize_message_chan(msg
, system_id
, component_id
, chan
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC
);
167 return mavlink_finalize_message_chan(msg
, system_id
, component_id
, chan
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN
);
172 * @brief Encode a rc_channels_scaled 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_scaled C-struct to read the message contents from
179 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
)
181 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
);
185 * @brief Encode a rc_channels_scaled 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_scaled C-struct to read the message contents from
193 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
)
195 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
);
199 * @brief Send a rc_channels_scaled 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_scaled RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
205 * @param chan2_scaled RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
206 * @param chan3_scaled RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
207 * @param chan4_scaled RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
208 * @param chan5_scaled RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
209 * @param chan6_scaled RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
210 * @param chan7_scaled RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
211 * @param chan8_scaled RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
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_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
)
218 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
219 char buf
[MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN
];
220 _mav_put_uint32_t(buf
, 0, time_boot_ms
);
221 _mav_put_int16_t(buf
, 4, chan1_scaled
);
222 _mav_put_int16_t(buf
, 6, chan2_scaled
);
223 _mav_put_int16_t(buf
, 8, chan3_scaled
);
224 _mav_put_int16_t(buf
, 10, chan4_scaled
);
225 _mav_put_int16_t(buf
, 12, chan5_scaled
);
226 _mav_put_int16_t(buf
, 14, chan6_scaled
);
227 _mav_put_int16_t(buf
, 16, chan7_scaled
);
228 _mav_put_int16_t(buf
, 18, chan8_scaled
);
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_SCALED
, buf
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC
);
235 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED
, buf
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN
);
238 mavlink_rc_channels_scaled_t packet
;
239 packet
.time_boot_ms
= time_boot_ms
;
240 packet
.chan1_scaled
= chan1_scaled
;
241 packet
.chan2_scaled
= chan2_scaled
;
242 packet
.chan3_scaled
= chan3_scaled
;
243 packet
.chan4_scaled
= chan4_scaled
;
244 packet
.chan5_scaled
= chan5_scaled
;
245 packet
.chan6_scaled
= chan6_scaled
;
246 packet
.chan7_scaled
= chan7_scaled
;
247 packet
.chan8_scaled
= chan8_scaled
;
251 #if MAVLINK_CRC_EXTRA
252 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED
, (const char *)&packet
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC
);
254 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED
, (const char *)&packet
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN
);
259 #if MAVLINK_MSG_ID_RC_CHANNELS_SCALED_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_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
)
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_int16_t(buf
, 4, chan1_scaled
);
273 _mav_put_int16_t(buf
, 6, chan2_scaled
);
274 _mav_put_int16_t(buf
, 8, chan3_scaled
);
275 _mav_put_int16_t(buf
, 10, chan4_scaled
);
276 _mav_put_int16_t(buf
, 12, chan5_scaled
);
277 _mav_put_int16_t(buf
, 14, chan6_scaled
);
278 _mav_put_int16_t(buf
, 16, chan7_scaled
);
279 _mav_put_int16_t(buf
, 18, chan8_scaled
);
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_SCALED
, buf
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC
);
286 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED
, buf
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN
);
289 mavlink_rc_channels_scaled_t
*packet
= (mavlink_rc_channels_scaled_t
*)msgbuf
;
290 packet
->time_boot_ms
= time_boot_ms
;
291 packet
->chan1_scaled
= chan1_scaled
;
292 packet
->chan2_scaled
= chan2_scaled
;
293 packet
->chan3_scaled
= chan3_scaled
;
294 packet
->chan4_scaled
= chan4_scaled
;
295 packet
->chan5_scaled
= chan5_scaled
;
296 packet
->chan6_scaled
= chan6_scaled
;
297 packet
->chan7_scaled
= chan7_scaled
;
298 packet
->chan8_scaled
= chan8_scaled
;
302 #if MAVLINK_CRC_EXTRA
303 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED
, (const char *)packet
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_CRC
);
305 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED
, (const char *)packet
, MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN
);
313 // MESSAGE RC_CHANNELS_SCALED UNPACKING
317 * @brief Get field time_boot_ms from rc_channels_scaled message
319 * @return Timestamp (milliseconds since system boot)
321 static inline uint32_t mavlink_msg_rc_channels_scaled_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_scaled 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_scaled_get_port(const mavlink_message_t
* msg
)
333 return _MAV_RETURN_uint8_t(msg
, 20);
337 * @brief Get field chan1_scaled from rc_channels_scaled message
339 * @return RC channel 1 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
341 static inline int16_t mavlink_msg_rc_channels_scaled_get_chan1_scaled(const mavlink_message_t
* msg
)
343 return _MAV_RETURN_int16_t(msg
, 4);
347 * @brief Get field chan2_scaled from rc_channels_scaled message
349 * @return RC channel 2 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
351 static inline int16_t mavlink_msg_rc_channels_scaled_get_chan2_scaled(const mavlink_message_t
* msg
)
353 return _MAV_RETURN_int16_t(msg
, 6);
357 * @brief Get field chan3_scaled from rc_channels_scaled message
359 * @return RC channel 3 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
361 static inline int16_t mavlink_msg_rc_channels_scaled_get_chan3_scaled(const mavlink_message_t
* msg
)
363 return _MAV_RETURN_int16_t(msg
, 8);
367 * @brief Get field chan4_scaled from rc_channels_scaled message
369 * @return RC channel 4 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
371 static inline int16_t mavlink_msg_rc_channels_scaled_get_chan4_scaled(const mavlink_message_t
* msg
)
373 return _MAV_RETURN_int16_t(msg
, 10);
377 * @brief Get field chan5_scaled from rc_channels_scaled message
379 * @return RC channel 5 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
381 static inline int16_t mavlink_msg_rc_channels_scaled_get_chan5_scaled(const mavlink_message_t
* msg
)
383 return _MAV_RETURN_int16_t(msg
, 12);
387 * @brief Get field chan6_scaled from rc_channels_scaled message
389 * @return RC channel 6 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
391 static inline int16_t mavlink_msg_rc_channels_scaled_get_chan6_scaled(const mavlink_message_t
* msg
)
393 return _MAV_RETURN_int16_t(msg
, 14);
397 * @brief Get field chan7_scaled from rc_channels_scaled message
399 * @return RC channel 7 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
401 static inline int16_t mavlink_msg_rc_channels_scaled_get_chan7_scaled(const mavlink_message_t
* msg
)
403 return _MAV_RETURN_int16_t(msg
, 16);
407 * @brief Get field chan8_scaled from rc_channels_scaled message
409 * @return RC channel 8 value scaled, (-100%) -10000, (0%) 0, (100%) 10000, (invalid) INT16_MAX.
411 static inline int16_t mavlink_msg_rc_channels_scaled_get_chan8_scaled(const mavlink_message_t
* msg
)
413 return _MAV_RETURN_int16_t(msg
, 18);
417 * @brief Get field rssi from rc_channels_scaled message
419 * @return Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
421 static inline uint8_t mavlink_msg_rc_channels_scaled_get_rssi(const mavlink_message_t
* msg
)
423 return _MAV_RETURN_uint8_t(msg
, 21);
427 * @brief Decode a rc_channels_scaled message into a struct
429 * @param msg The message to decode
430 * @param rc_channels_scaled C-struct to decode the message contents into
432 static inline void mavlink_msg_rc_channels_scaled_decode(const mavlink_message_t
* msg
, mavlink_rc_channels_scaled_t
* rc_channels_scaled
)
434 #if MAVLINK_NEED_BYTE_SWAP
435 rc_channels_scaled
->time_boot_ms
= mavlink_msg_rc_channels_scaled_get_time_boot_ms(msg
);
436 rc_channels_scaled
->chan1_scaled
= mavlink_msg_rc_channels_scaled_get_chan1_scaled(msg
);
437 rc_channels_scaled
->chan2_scaled
= mavlink_msg_rc_channels_scaled_get_chan2_scaled(msg
);
438 rc_channels_scaled
->chan3_scaled
= mavlink_msg_rc_channels_scaled_get_chan3_scaled(msg
);
439 rc_channels_scaled
->chan4_scaled
= mavlink_msg_rc_channels_scaled_get_chan4_scaled(msg
);
440 rc_channels_scaled
->chan5_scaled
= mavlink_msg_rc_channels_scaled_get_chan5_scaled(msg
);
441 rc_channels_scaled
->chan6_scaled
= mavlink_msg_rc_channels_scaled_get_chan6_scaled(msg
);
442 rc_channels_scaled
->chan7_scaled
= mavlink_msg_rc_channels_scaled_get_chan7_scaled(msg
);
443 rc_channels_scaled
->chan8_scaled
= mavlink_msg_rc_channels_scaled_get_chan8_scaled(msg
);
444 rc_channels_scaled
->port
= mavlink_msg_rc_channels_scaled_get_port(msg
);
445 rc_channels_scaled
->rssi
= mavlink_msg_rc_channels_scaled_get_rssi(msg
);
447 memcpy(rc_channels_scaled
, _MAV_PAYLOAD(msg
), MAVLINK_MSG_ID_RC_CHANNELS_SCALED_LEN
);