1 | // MESSAGE RC_CHANNELS PACKING
|
---|
2 |
|
---|
3 | #define MAVLINK_MSG_ID_RC_CHANNELS 65
|
---|
4 |
|
---|
5 | typedef struct MAVLINK_PACKED __mavlink_rc_channels_t
|
---|
6 | {
|
---|
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 | uint16_t chan9_raw; /*< RC channel 9 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
|
---|
17 | uint16_t chan10_raw; /*< RC channel 10 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
|
---|
18 | uint16_t chan11_raw; /*< RC channel 11 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
|
---|
19 | uint16_t chan12_raw; /*< RC channel 12 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
|
---|
20 | uint16_t chan13_raw; /*< RC channel 13 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
|
---|
21 | uint16_t chan14_raw; /*< RC channel 14 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
|
---|
22 | uint16_t chan15_raw; /*< RC channel 15 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
|
---|
23 | uint16_t chan16_raw; /*< RC channel 16 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
|
---|
24 | uint16_t chan17_raw; /*< RC channel 17 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
|
---|
25 | uint16_t chan18_raw; /*< RC channel 18 value, in microseconds. A value of UINT16_MAX implies the channel is unused.*/
|
---|
26 | uint8_t chancount; /*< Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available.*/
|
---|
27 | uint8_t rssi; /*< Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.*/
|
---|
28 | } mavlink_rc_channels_t;
|
---|
29 |
|
---|
30 | #define MAVLINK_MSG_ID_RC_CHANNELS_LEN 42
|
---|
31 | #define MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN 42
|
---|
32 | #define MAVLINK_MSG_ID_65_LEN 42
|
---|
33 | #define MAVLINK_MSG_ID_65_MIN_LEN 42
|
---|
34 |
|
---|
35 | #define MAVLINK_MSG_ID_RC_CHANNELS_CRC 118
|
---|
36 | #define MAVLINK_MSG_ID_65_CRC 118
|
---|
37 |
|
---|
38 |
|
---|
39 |
|
---|
40 | #if MAVLINK_COMMAND_24BIT
|
---|
41 | #define MAVLINK_MESSAGE_INFO_RC_CHANNELS { \
|
---|
42 | 65, \
|
---|
43 | "RC_CHANNELS", \
|
---|
44 | 21, \
|
---|
45 | { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_t, time_boot_ms) }, \
|
---|
46 | { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_t, chan1_raw) }, \
|
---|
47 | { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_t, chan2_raw) }, \
|
---|
48 | { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_t, chan3_raw) }, \
|
---|
49 | { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_t, chan4_raw) }, \
|
---|
50 | { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_t, chan5_raw) }, \
|
---|
51 | { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_t, chan6_raw) }, \
|
---|
52 | { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_rc_channels_t, chan7_raw) }, \
|
---|
53 | { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_rc_channels_t, chan8_raw) }, \
|
---|
54 | { "chan9_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_rc_channels_t, chan9_raw) }, \
|
---|
55 | { "chan10_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_rc_channels_t, chan10_raw) }, \
|
---|
56 | { "chan11_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_rc_channels_t, chan11_raw) }, \
|
---|
57 | { "chan12_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_rc_channels_t, chan12_raw) }, \
|
---|
58 | { "chan13_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_rc_channels_t, chan13_raw) }, \
|
---|
59 | { "chan14_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_rc_channels_t, chan14_raw) }, \
|
---|
60 | { "chan15_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_rc_channels_t, chan15_raw) }, \
|
---|
61 | { "chan16_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_rc_channels_t, chan16_raw) }, \
|
---|
62 | { "chan17_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 36, offsetof(mavlink_rc_channels_t, chan17_raw) }, \
|
---|
63 | { "chan18_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 38, offsetof(mavlink_rc_channels_t, chan18_raw) }, \
|
---|
64 | { "chancount", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_rc_channels_t, chancount) }, \
|
---|
65 | { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_rc_channels_t, rssi) }, \
|
---|
66 | } \
|
---|
67 | }
|
---|
68 | #else
|
---|
69 | #define MAVLINK_MESSAGE_INFO_RC_CHANNELS { \
|
---|
70 | "RC_CHANNELS", \
|
---|
71 | 21, \
|
---|
72 | { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_rc_channels_t, time_boot_ms) }, \
|
---|
73 | { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_t, chan1_raw) }, \
|
---|
74 | { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_t, chan2_raw) }, \
|
---|
75 | { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_t, chan3_raw) }, \
|
---|
76 | { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_t, chan4_raw) }, \
|
---|
77 | { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_t, chan5_raw) }, \
|
---|
78 | { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_t, chan6_raw) }, \
|
---|
79 | { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_rc_channels_t, chan7_raw) }, \
|
---|
80 | { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_rc_channels_t, chan8_raw) }, \
|
---|
81 | { "chan9_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_rc_channels_t, chan9_raw) }, \
|
---|
82 | { "chan10_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_rc_channels_t, chan10_raw) }, \
|
---|
83 | { "chan11_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_rc_channels_t, chan11_raw) }, \
|
---|
84 | { "chan12_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_rc_channels_t, chan12_raw) }, \
|
---|
85 | { "chan13_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_rc_channels_t, chan13_raw) }, \
|
---|
86 | { "chan14_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_rc_channels_t, chan14_raw) }, \
|
---|
87 | { "chan15_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_rc_channels_t, chan15_raw) }, \
|
---|
88 | { "chan16_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_rc_channels_t, chan16_raw) }, \
|
---|
89 | { "chan17_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 36, offsetof(mavlink_rc_channels_t, chan17_raw) }, \
|
---|
90 | { "chan18_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 38, offsetof(mavlink_rc_channels_t, chan18_raw) }, \
|
---|
91 | { "chancount", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_rc_channels_t, chancount) }, \
|
---|
92 | { "rssi", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_rc_channels_t, rssi) }, \
|
---|
93 | } \
|
---|
94 | }
|
---|
95 | #endif
|
---|
96 |
|
---|
97 | /**
|
---|
98 | * @brief Pack a rc_channels message
|
---|
99 | * @param system_id ID of this system
|
---|
100 | * @param component_id ID of this component (e.g. 200 for IMU)
|
---|
101 | * @param msg The MAVLink message to compress the data into
|
---|
102 | *
|
---|
103 | * @param time_boot_ms Timestamp (milliseconds since system boot)
|
---|
104 | * @param chancount Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available.
|
---|
105 | * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
106 | * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
107 | * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
108 | * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
109 | * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
110 | * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
111 | * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
112 | * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
113 | * @param chan9_raw RC channel 9 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
114 | * @param chan10_raw RC channel 10 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
115 | * @param chan11_raw RC channel 11 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
116 | * @param chan12_raw RC channel 12 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
117 | * @param chan13_raw RC channel 13 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
118 | * @param chan14_raw RC channel 14 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
119 | * @param chan15_raw RC channel 15 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
120 | * @param chan16_raw RC channel 16 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
121 | * @param chan17_raw RC channel 17 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
122 | * @param chan18_raw RC channel 18 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
123 | * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
|
---|
124 | * @return length of the message in bytes (excluding serial stream start sign)
|
---|
125 | */
|
---|
126 | static inline uint16_t mavlink_msg_rc_channels_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
|
---|
127 | uint32_t time_boot_ms, uint8_t chancount, 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, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint16_t chan13_raw, uint16_t chan14_raw, uint16_t chan15_raw, uint16_t chan16_raw, uint16_t chan17_raw, uint16_t chan18_raw, uint8_t rssi)
|
---|
128 | {
|
---|
129 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
---|
130 | char buf[MAVLINK_MSG_ID_RC_CHANNELS_LEN];
|
---|
131 | _mav_put_uint32_t(buf, 0, time_boot_ms);
|
---|
132 | _mav_put_uint16_t(buf, 4, chan1_raw);
|
---|
133 | _mav_put_uint16_t(buf, 6, chan2_raw);
|
---|
134 | _mav_put_uint16_t(buf, 8, chan3_raw);
|
---|
135 | _mav_put_uint16_t(buf, 10, chan4_raw);
|
---|
136 | _mav_put_uint16_t(buf, 12, chan5_raw);
|
---|
137 | _mav_put_uint16_t(buf, 14, chan6_raw);
|
---|
138 | _mav_put_uint16_t(buf, 16, chan7_raw);
|
---|
139 | _mav_put_uint16_t(buf, 18, chan8_raw);
|
---|
140 | _mav_put_uint16_t(buf, 20, chan9_raw);
|
---|
141 | _mav_put_uint16_t(buf, 22, chan10_raw);
|
---|
142 | _mav_put_uint16_t(buf, 24, chan11_raw);
|
---|
143 | _mav_put_uint16_t(buf, 26, chan12_raw);
|
---|
144 | _mav_put_uint16_t(buf, 28, chan13_raw);
|
---|
145 | _mav_put_uint16_t(buf, 30, chan14_raw);
|
---|
146 | _mav_put_uint16_t(buf, 32, chan15_raw);
|
---|
147 | _mav_put_uint16_t(buf, 34, chan16_raw);
|
---|
148 | _mav_put_uint16_t(buf, 36, chan17_raw);
|
---|
149 | _mav_put_uint16_t(buf, 38, chan18_raw);
|
---|
150 | _mav_put_uint8_t(buf, 40, chancount);
|
---|
151 | _mav_put_uint8_t(buf, 41, rssi);
|
---|
152 |
|
---|
153 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_LEN);
|
---|
154 | #else
|
---|
155 | mavlink_rc_channels_t packet;
|
---|
156 | packet.time_boot_ms = time_boot_ms;
|
---|
157 | packet.chan1_raw = chan1_raw;
|
---|
158 | packet.chan2_raw = chan2_raw;
|
---|
159 | packet.chan3_raw = chan3_raw;
|
---|
160 | packet.chan4_raw = chan4_raw;
|
---|
161 | packet.chan5_raw = chan5_raw;
|
---|
162 | packet.chan6_raw = chan6_raw;
|
---|
163 | packet.chan7_raw = chan7_raw;
|
---|
164 | packet.chan8_raw = chan8_raw;
|
---|
165 | packet.chan9_raw = chan9_raw;
|
---|
166 | packet.chan10_raw = chan10_raw;
|
---|
167 | packet.chan11_raw = chan11_raw;
|
---|
168 | packet.chan12_raw = chan12_raw;
|
---|
169 | packet.chan13_raw = chan13_raw;
|
---|
170 | packet.chan14_raw = chan14_raw;
|
---|
171 | packet.chan15_raw = chan15_raw;
|
---|
172 | packet.chan16_raw = chan16_raw;
|
---|
173 | packet.chan17_raw = chan17_raw;
|
---|
174 | packet.chan18_raw = chan18_raw;
|
---|
175 | packet.chancount = chancount;
|
---|
176 | packet.rssi = rssi;
|
---|
177 |
|
---|
178 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_LEN);
|
---|
179 | #endif
|
---|
180 |
|
---|
181 | msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS;
|
---|
182 | return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC);
|
---|
183 | }
|
---|
184 |
|
---|
185 | /**
|
---|
186 | * @brief Pack a rc_channels message 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 time_boot_ms Timestamp (milliseconds since system boot)
|
---|
192 | * @param chancount Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available.
|
---|
193 | * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
194 | * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
195 | * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
196 | * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
197 | * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
198 | * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
199 | * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
200 | * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
201 | * @param chan9_raw RC channel 9 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
202 | * @param chan10_raw RC channel 10 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
203 | * @param chan11_raw RC channel 11 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
204 | * @param chan12_raw RC channel 12 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
205 | * @param chan13_raw RC channel 13 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
206 | * @param chan14_raw RC channel 14 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
207 | * @param chan15_raw RC channel 15 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
208 | * @param chan16_raw RC channel 16 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
209 | * @param chan17_raw RC channel 17 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
210 | * @param chan18_raw RC channel 18 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
211 | * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
|
---|
212 | * @return length of the message in bytes (excluding serial stream start sign)
|
---|
213 | */
|
---|
214 | static inline uint16_t mavlink_msg_rc_channels_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
|
---|
215 | mavlink_message_t* msg,
|
---|
216 | uint32_t time_boot_ms,uint8_t chancount,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,uint16_t chan9_raw,uint16_t chan10_raw,uint16_t chan11_raw,uint16_t chan12_raw,uint16_t chan13_raw,uint16_t chan14_raw,uint16_t chan15_raw,uint16_t chan16_raw,uint16_t chan17_raw,uint16_t chan18_raw,uint8_t rssi)
|
---|
217 | {
|
---|
218 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
---|
219 | char buf[MAVLINK_MSG_ID_RC_CHANNELS_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_uint16_t(buf, 20, chan9_raw);
|
---|
230 | _mav_put_uint16_t(buf, 22, chan10_raw);
|
---|
231 | _mav_put_uint16_t(buf, 24, chan11_raw);
|
---|
232 | _mav_put_uint16_t(buf, 26, chan12_raw);
|
---|
233 | _mav_put_uint16_t(buf, 28, chan13_raw);
|
---|
234 | _mav_put_uint16_t(buf, 30, chan14_raw);
|
---|
235 | _mav_put_uint16_t(buf, 32, chan15_raw);
|
---|
236 | _mav_put_uint16_t(buf, 34, chan16_raw);
|
---|
237 | _mav_put_uint16_t(buf, 36, chan17_raw);
|
---|
238 | _mav_put_uint16_t(buf, 38, chan18_raw);
|
---|
239 | _mav_put_uint8_t(buf, 40, chancount);
|
---|
240 | _mav_put_uint8_t(buf, 41, rssi);
|
---|
241 |
|
---|
242 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_LEN);
|
---|
243 | #else
|
---|
244 | mavlink_rc_channels_t packet;
|
---|
245 | packet.time_boot_ms = time_boot_ms;
|
---|
246 | packet.chan1_raw = chan1_raw;
|
---|
247 | packet.chan2_raw = chan2_raw;
|
---|
248 | packet.chan3_raw = chan3_raw;
|
---|
249 | packet.chan4_raw = chan4_raw;
|
---|
250 | packet.chan5_raw = chan5_raw;
|
---|
251 | packet.chan6_raw = chan6_raw;
|
---|
252 | packet.chan7_raw = chan7_raw;
|
---|
253 | packet.chan8_raw = chan8_raw;
|
---|
254 | packet.chan9_raw = chan9_raw;
|
---|
255 | packet.chan10_raw = chan10_raw;
|
---|
256 | packet.chan11_raw = chan11_raw;
|
---|
257 | packet.chan12_raw = chan12_raw;
|
---|
258 | packet.chan13_raw = chan13_raw;
|
---|
259 | packet.chan14_raw = chan14_raw;
|
---|
260 | packet.chan15_raw = chan15_raw;
|
---|
261 | packet.chan16_raw = chan16_raw;
|
---|
262 | packet.chan17_raw = chan17_raw;
|
---|
263 | packet.chan18_raw = chan18_raw;
|
---|
264 | packet.chancount = chancount;
|
---|
265 | packet.rssi = rssi;
|
---|
266 |
|
---|
267 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_LEN);
|
---|
268 | #endif
|
---|
269 |
|
---|
270 | msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS;
|
---|
271 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC);
|
---|
272 | }
|
---|
273 |
|
---|
274 | /**
|
---|
275 | * @brief Encode a rc_channels struct
|
---|
276 | *
|
---|
277 | * @param system_id ID of this system
|
---|
278 | * @param component_id ID of this component (e.g. 200 for IMU)
|
---|
279 | * @param msg The MAVLink message to compress the data into
|
---|
280 | * @param rc_channels C-struct to read the message contents from
|
---|
281 | */
|
---|
282 | static inline uint16_t mavlink_msg_rc_channels_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rc_channels_t* rc_channels)
|
---|
283 | {
|
---|
284 | return mavlink_msg_rc_channels_pack(system_id, component_id, msg, rc_channels->time_boot_ms, rc_channels->chancount, rc_channels->chan1_raw, rc_channels->chan2_raw, rc_channels->chan3_raw, rc_channels->chan4_raw, rc_channels->chan5_raw, rc_channels->chan6_raw, rc_channels->chan7_raw, rc_channels->chan8_raw, rc_channels->chan9_raw, rc_channels->chan10_raw, rc_channels->chan11_raw, rc_channels->chan12_raw, rc_channels->chan13_raw, rc_channels->chan14_raw, rc_channels->chan15_raw, rc_channels->chan16_raw, rc_channels->chan17_raw, rc_channels->chan18_raw, rc_channels->rssi);
|
---|
285 | }
|
---|
286 |
|
---|
287 | /**
|
---|
288 | * @brief Encode a rc_channels struct on a channel
|
---|
289 | *
|
---|
290 | * @param system_id ID of this system
|
---|
291 | * @param component_id ID of this component (e.g. 200 for IMU)
|
---|
292 | * @param chan The MAVLink channel this message will be sent over
|
---|
293 | * @param msg The MAVLink message to compress the data into
|
---|
294 | * @param rc_channels C-struct to read the message contents from
|
---|
295 | */
|
---|
296 | static inline uint16_t mavlink_msg_rc_channels_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rc_channels_t* rc_channels)
|
---|
297 | {
|
---|
298 | return mavlink_msg_rc_channels_pack_chan(system_id, component_id, chan, msg, rc_channels->time_boot_ms, rc_channels->chancount, rc_channels->chan1_raw, rc_channels->chan2_raw, rc_channels->chan3_raw, rc_channels->chan4_raw, rc_channels->chan5_raw, rc_channels->chan6_raw, rc_channels->chan7_raw, rc_channels->chan8_raw, rc_channels->chan9_raw, rc_channels->chan10_raw, rc_channels->chan11_raw, rc_channels->chan12_raw, rc_channels->chan13_raw, rc_channels->chan14_raw, rc_channels->chan15_raw, rc_channels->chan16_raw, rc_channels->chan17_raw, rc_channels->chan18_raw, rc_channels->rssi);
|
---|
299 | }
|
---|
300 |
|
---|
301 | /**
|
---|
302 | * @brief Send a rc_channels message
|
---|
303 | * @param chan MAVLink channel to send the message
|
---|
304 | *
|
---|
305 | * @param time_boot_ms Timestamp (milliseconds since system boot)
|
---|
306 | * @param chancount Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available.
|
---|
307 | * @param chan1_raw RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
308 | * @param chan2_raw RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
309 | * @param chan3_raw RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
310 | * @param chan4_raw RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
311 | * @param chan5_raw RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
312 | * @param chan6_raw RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
313 | * @param chan7_raw RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
314 | * @param chan8_raw RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
315 | * @param chan9_raw RC channel 9 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
316 | * @param chan10_raw RC channel 10 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
317 | * @param chan11_raw RC channel 11 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
318 | * @param chan12_raw RC channel 12 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
319 | * @param chan13_raw RC channel 13 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
320 | * @param chan14_raw RC channel 14 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
321 | * @param chan15_raw RC channel 15 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
322 | * @param chan16_raw RC channel 16 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
323 | * @param chan17_raw RC channel 17 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
324 | * @param chan18_raw RC channel 18 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
325 | * @param rssi Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
|
---|
326 | */
|
---|
327 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
|
---|
328 |
|
---|
329 | static inline void mavlink_msg_rc_channels_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t chancount, 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, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint16_t chan13_raw, uint16_t chan14_raw, uint16_t chan15_raw, uint16_t chan16_raw, uint16_t chan17_raw, uint16_t chan18_raw, uint8_t rssi)
|
---|
330 | {
|
---|
331 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
---|
332 | char buf[MAVLINK_MSG_ID_RC_CHANNELS_LEN];
|
---|
333 | _mav_put_uint32_t(buf, 0, time_boot_ms);
|
---|
334 | _mav_put_uint16_t(buf, 4, chan1_raw);
|
---|
335 | _mav_put_uint16_t(buf, 6, chan2_raw);
|
---|
336 | _mav_put_uint16_t(buf, 8, chan3_raw);
|
---|
337 | _mav_put_uint16_t(buf, 10, chan4_raw);
|
---|
338 | _mav_put_uint16_t(buf, 12, chan5_raw);
|
---|
339 | _mav_put_uint16_t(buf, 14, chan6_raw);
|
---|
340 | _mav_put_uint16_t(buf, 16, chan7_raw);
|
---|
341 | _mav_put_uint16_t(buf, 18, chan8_raw);
|
---|
342 | _mav_put_uint16_t(buf, 20, chan9_raw);
|
---|
343 | _mav_put_uint16_t(buf, 22, chan10_raw);
|
---|
344 | _mav_put_uint16_t(buf, 24, chan11_raw);
|
---|
345 | _mav_put_uint16_t(buf, 26, chan12_raw);
|
---|
346 | _mav_put_uint16_t(buf, 28, chan13_raw);
|
---|
347 | _mav_put_uint16_t(buf, 30, chan14_raw);
|
---|
348 | _mav_put_uint16_t(buf, 32, chan15_raw);
|
---|
349 | _mav_put_uint16_t(buf, 34, chan16_raw);
|
---|
350 | _mav_put_uint16_t(buf, 36, chan17_raw);
|
---|
351 | _mav_put_uint16_t(buf, 38, chan18_raw);
|
---|
352 | _mav_put_uint8_t(buf, 40, chancount);
|
---|
353 | _mav_put_uint8_t(buf, 41, rssi);
|
---|
354 |
|
---|
355 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, buf, MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC);
|
---|
356 | #else
|
---|
357 | mavlink_rc_channels_t packet;
|
---|
358 | packet.time_boot_ms = time_boot_ms;
|
---|
359 | packet.chan1_raw = chan1_raw;
|
---|
360 | packet.chan2_raw = chan2_raw;
|
---|
361 | packet.chan3_raw = chan3_raw;
|
---|
362 | packet.chan4_raw = chan4_raw;
|
---|
363 | packet.chan5_raw = chan5_raw;
|
---|
364 | packet.chan6_raw = chan6_raw;
|
---|
365 | packet.chan7_raw = chan7_raw;
|
---|
366 | packet.chan8_raw = chan8_raw;
|
---|
367 | packet.chan9_raw = chan9_raw;
|
---|
368 | packet.chan10_raw = chan10_raw;
|
---|
369 | packet.chan11_raw = chan11_raw;
|
---|
370 | packet.chan12_raw = chan12_raw;
|
---|
371 | packet.chan13_raw = chan13_raw;
|
---|
372 | packet.chan14_raw = chan14_raw;
|
---|
373 | packet.chan15_raw = chan15_raw;
|
---|
374 | packet.chan16_raw = chan16_raw;
|
---|
375 | packet.chan17_raw = chan17_raw;
|
---|
376 | packet.chan18_raw = chan18_raw;
|
---|
377 | packet.chancount = chancount;
|
---|
378 | packet.rssi = rssi;
|
---|
379 |
|
---|
380 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC);
|
---|
381 | #endif
|
---|
382 | }
|
---|
383 |
|
---|
384 | /**
|
---|
385 | * @brief Send a rc_channels message
|
---|
386 | * @param chan MAVLink channel to send the message
|
---|
387 | * @param struct The MAVLink struct to serialize
|
---|
388 | */
|
---|
389 | static inline void mavlink_msg_rc_channels_send_struct(mavlink_channel_t chan, const mavlink_rc_channels_t* rc_channels)
|
---|
390 | {
|
---|
391 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
---|
392 | mavlink_msg_rc_channels_send(chan, rc_channels->time_boot_ms, rc_channels->chancount, rc_channels->chan1_raw, rc_channels->chan2_raw, rc_channels->chan3_raw, rc_channels->chan4_raw, rc_channels->chan5_raw, rc_channels->chan6_raw, rc_channels->chan7_raw, rc_channels->chan8_raw, rc_channels->chan9_raw, rc_channels->chan10_raw, rc_channels->chan11_raw, rc_channels->chan12_raw, rc_channels->chan13_raw, rc_channels->chan14_raw, rc_channels->chan15_raw, rc_channels->chan16_raw, rc_channels->chan17_raw, rc_channels->chan18_raw, rc_channels->rssi);
|
---|
393 | #else
|
---|
394 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, (const char *)rc_channels, MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC);
|
---|
395 | #endif
|
---|
396 | }
|
---|
397 |
|
---|
398 | #if MAVLINK_MSG_ID_RC_CHANNELS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
|
---|
399 | /*
|
---|
400 | This varient of _send() can be used to save stack space by re-using
|
---|
401 | memory from the receive buffer. The caller provides a
|
---|
402 | mavlink_message_t which is the size of a full mavlink message. This
|
---|
403 | is usually the receive buffer for the channel, and allows a reply to an
|
---|
404 | incoming message with minimum stack space usage.
|
---|
405 | */
|
---|
406 | static inline void mavlink_msg_rc_channels_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t chancount, 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, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint16_t chan13_raw, uint16_t chan14_raw, uint16_t chan15_raw, uint16_t chan16_raw, uint16_t chan17_raw, uint16_t chan18_raw, uint8_t rssi)
|
---|
407 | {
|
---|
408 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
---|
409 | char *buf = (char *)msgbuf;
|
---|
410 | _mav_put_uint32_t(buf, 0, time_boot_ms);
|
---|
411 | _mav_put_uint16_t(buf, 4, chan1_raw);
|
---|
412 | _mav_put_uint16_t(buf, 6, chan2_raw);
|
---|
413 | _mav_put_uint16_t(buf, 8, chan3_raw);
|
---|
414 | _mav_put_uint16_t(buf, 10, chan4_raw);
|
---|
415 | _mav_put_uint16_t(buf, 12, chan5_raw);
|
---|
416 | _mav_put_uint16_t(buf, 14, chan6_raw);
|
---|
417 | _mav_put_uint16_t(buf, 16, chan7_raw);
|
---|
418 | _mav_put_uint16_t(buf, 18, chan8_raw);
|
---|
419 | _mav_put_uint16_t(buf, 20, chan9_raw);
|
---|
420 | _mav_put_uint16_t(buf, 22, chan10_raw);
|
---|
421 | _mav_put_uint16_t(buf, 24, chan11_raw);
|
---|
422 | _mav_put_uint16_t(buf, 26, chan12_raw);
|
---|
423 | _mav_put_uint16_t(buf, 28, chan13_raw);
|
---|
424 | _mav_put_uint16_t(buf, 30, chan14_raw);
|
---|
425 | _mav_put_uint16_t(buf, 32, chan15_raw);
|
---|
426 | _mav_put_uint16_t(buf, 34, chan16_raw);
|
---|
427 | _mav_put_uint16_t(buf, 36, chan17_raw);
|
---|
428 | _mav_put_uint16_t(buf, 38, chan18_raw);
|
---|
429 | _mav_put_uint8_t(buf, 40, chancount);
|
---|
430 | _mav_put_uint8_t(buf, 41, rssi);
|
---|
431 |
|
---|
432 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, buf, MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC);
|
---|
433 | #else
|
---|
434 | mavlink_rc_channels_t *packet = (mavlink_rc_channels_t *)msgbuf;
|
---|
435 | packet->time_boot_ms = time_boot_ms;
|
---|
436 | packet->chan1_raw = chan1_raw;
|
---|
437 | packet->chan2_raw = chan2_raw;
|
---|
438 | packet->chan3_raw = chan3_raw;
|
---|
439 | packet->chan4_raw = chan4_raw;
|
---|
440 | packet->chan5_raw = chan5_raw;
|
---|
441 | packet->chan6_raw = chan6_raw;
|
---|
442 | packet->chan7_raw = chan7_raw;
|
---|
443 | packet->chan8_raw = chan8_raw;
|
---|
444 | packet->chan9_raw = chan9_raw;
|
---|
445 | packet->chan10_raw = chan10_raw;
|
---|
446 | packet->chan11_raw = chan11_raw;
|
---|
447 | packet->chan12_raw = chan12_raw;
|
---|
448 | packet->chan13_raw = chan13_raw;
|
---|
449 | packet->chan14_raw = chan14_raw;
|
---|
450 | packet->chan15_raw = chan15_raw;
|
---|
451 | packet->chan16_raw = chan16_raw;
|
---|
452 | packet->chan17_raw = chan17_raw;
|
---|
453 | packet->chan18_raw = chan18_raw;
|
---|
454 | packet->chancount = chancount;
|
---|
455 | packet->rssi = rssi;
|
---|
456 |
|
---|
457 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_LEN, MAVLINK_MSG_ID_RC_CHANNELS_CRC);
|
---|
458 | #endif
|
---|
459 | }
|
---|
460 | #endif
|
---|
461 |
|
---|
462 | #endif
|
---|
463 |
|
---|
464 | // MESSAGE RC_CHANNELS UNPACKING
|
---|
465 |
|
---|
466 |
|
---|
467 | /**
|
---|
468 | * @brief Get field time_boot_ms from rc_channels message
|
---|
469 | *
|
---|
470 | * @return Timestamp (milliseconds since system boot)
|
---|
471 | */
|
---|
472 | static inline uint32_t mavlink_msg_rc_channels_get_time_boot_ms(const mavlink_message_t* msg)
|
---|
473 | {
|
---|
474 | return _MAV_RETURN_uint32_t(msg, 0);
|
---|
475 | }
|
---|
476 |
|
---|
477 | /**
|
---|
478 | * @brief Get field chancount from rc_channels message
|
---|
479 | *
|
---|
480 | * @return Total number of RC channels being received. This can be larger than 18, indicating that more channels are available but not given in this message. This value should be 0 when no RC channels are available.
|
---|
481 | */
|
---|
482 | static inline uint8_t mavlink_msg_rc_channels_get_chancount(const mavlink_message_t* msg)
|
---|
483 | {
|
---|
484 | return _MAV_RETURN_uint8_t(msg, 40);
|
---|
485 | }
|
---|
486 |
|
---|
487 | /**
|
---|
488 | * @brief Get field chan1_raw from rc_channels message
|
---|
489 | *
|
---|
490 | * @return RC channel 1 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
491 | */
|
---|
492 | static inline uint16_t mavlink_msg_rc_channels_get_chan1_raw(const mavlink_message_t* msg)
|
---|
493 | {
|
---|
494 | return _MAV_RETURN_uint16_t(msg, 4);
|
---|
495 | }
|
---|
496 |
|
---|
497 | /**
|
---|
498 | * @brief Get field chan2_raw from rc_channels message
|
---|
499 | *
|
---|
500 | * @return RC channel 2 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
501 | */
|
---|
502 | static inline uint16_t mavlink_msg_rc_channels_get_chan2_raw(const mavlink_message_t* msg)
|
---|
503 | {
|
---|
504 | return _MAV_RETURN_uint16_t(msg, 6);
|
---|
505 | }
|
---|
506 |
|
---|
507 | /**
|
---|
508 | * @brief Get field chan3_raw from rc_channels message
|
---|
509 | *
|
---|
510 | * @return RC channel 3 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
511 | */
|
---|
512 | static inline uint16_t mavlink_msg_rc_channels_get_chan3_raw(const mavlink_message_t* msg)
|
---|
513 | {
|
---|
514 | return _MAV_RETURN_uint16_t(msg, 8);
|
---|
515 | }
|
---|
516 |
|
---|
517 | /**
|
---|
518 | * @brief Get field chan4_raw from rc_channels message
|
---|
519 | *
|
---|
520 | * @return RC channel 4 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
521 | */
|
---|
522 | static inline uint16_t mavlink_msg_rc_channels_get_chan4_raw(const mavlink_message_t* msg)
|
---|
523 | {
|
---|
524 | return _MAV_RETURN_uint16_t(msg, 10);
|
---|
525 | }
|
---|
526 |
|
---|
527 | /**
|
---|
528 | * @brief Get field chan5_raw from rc_channels message
|
---|
529 | *
|
---|
530 | * @return RC channel 5 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
531 | */
|
---|
532 | static inline uint16_t mavlink_msg_rc_channels_get_chan5_raw(const mavlink_message_t* msg)
|
---|
533 | {
|
---|
534 | return _MAV_RETURN_uint16_t(msg, 12);
|
---|
535 | }
|
---|
536 |
|
---|
537 | /**
|
---|
538 | * @brief Get field chan6_raw from rc_channels message
|
---|
539 | *
|
---|
540 | * @return RC channel 6 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
541 | */
|
---|
542 | static inline uint16_t mavlink_msg_rc_channels_get_chan6_raw(const mavlink_message_t* msg)
|
---|
543 | {
|
---|
544 | return _MAV_RETURN_uint16_t(msg, 14);
|
---|
545 | }
|
---|
546 |
|
---|
547 | /**
|
---|
548 | * @brief Get field chan7_raw from rc_channels message
|
---|
549 | *
|
---|
550 | * @return RC channel 7 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
551 | */
|
---|
552 | static inline uint16_t mavlink_msg_rc_channels_get_chan7_raw(const mavlink_message_t* msg)
|
---|
553 | {
|
---|
554 | return _MAV_RETURN_uint16_t(msg, 16);
|
---|
555 | }
|
---|
556 |
|
---|
557 | /**
|
---|
558 | * @brief Get field chan8_raw from rc_channels message
|
---|
559 | *
|
---|
560 | * @return RC channel 8 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
561 | */
|
---|
562 | static inline uint16_t mavlink_msg_rc_channels_get_chan8_raw(const mavlink_message_t* msg)
|
---|
563 | {
|
---|
564 | return _MAV_RETURN_uint16_t(msg, 18);
|
---|
565 | }
|
---|
566 |
|
---|
567 | /**
|
---|
568 | * @brief Get field chan9_raw from rc_channels message
|
---|
569 | *
|
---|
570 | * @return RC channel 9 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
571 | */
|
---|
572 | static inline uint16_t mavlink_msg_rc_channels_get_chan9_raw(const mavlink_message_t* msg)
|
---|
573 | {
|
---|
574 | return _MAV_RETURN_uint16_t(msg, 20);
|
---|
575 | }
|
---|
576 |
|
---|
577 | /**
|
---|
578 | * @brief Get field chan10_raw from rc_channels message
|
---|
579 | *
|
---|
580 | * @return RC channel 10 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
581 | */
|
---|
582 | static inline uint16_t mavlink_msg_rc_channels_get_chan10_raw(const mavlink_message_t* msg)
|
---|
583 | {
|
---|
584 | return _MAV_RETURN_uint16_t(msg, 22);
|
---|
585 | }
|
---|
586 |
|
---|
587 | /**
|
---|
588 | * @brief Get field chan11_raw from rc_channels message
|
---|
589 | *
|
---|
590 | * @return RC channel 11 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
591 | */
|
---|
592 | static inline uint16_t mavlink_msg_rc_channels_get_chan11_raw(const mavlink_message_t* msg)
|
---|
593 | {
|
---|
594 | return _MAV_RETURN_uint16_t(msg, 24);
|
---|
595 | }
|
---|
596 |
|
---|
597 | /**
|
---|
598 | * @brief Get field chan12_raw from rc_channels message
|
---|
599 | *
|
---|
600 | * @return RC channel 12 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
601 | */
|
---|
602 | static inline uint16_t mavlink_msg_rc_channels_get_chan12_raw(const mavlink_message_t* msg)
|
---|
603 | {
|
---|
604 | return _MAV_RETURN_uint16_t(msg, 26);
|
---|
605 | }
|
---|
606 |
|
---|
607 | /**
|
---|
608 | * @brief Get field chan13_raw from rc_channels message
|
---|
609 | *
|
---|
610 | * @return RC channel 13 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
611 | */
|
---|
612 | static inline uint16_t mavlink_msg_rc_channels_get_chan13_raw(const mavlink_message_t* msg)
|
---|
613 | {
|
---|
614 | return _MAV_RETURN_uint16_t(msg, 28);
|
---|
615 | }
|
---|
616 |
|
---|
617 | /**
|
---|
618 | * @brief Get field chan14_raw from rc_channels message
|
---|
619 | *
|
---|
620 | * @return RC channel 14 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
621 | */
|
---|
622 | static inline uint16_t mavlink_msg_rc_channels_get_chan14_raw(const mavlink_message_t* msg)
|
---|
623 | {
|
---|
624 | return _MAV_RETURN_uint16_t(msg, 30);
|
---|
625 | }
|
---|
626 |
|
---|
627 | /**
|
---|
628 | * @brief Get field chan15_raw from rc_channels message
|
---|
629 | *
|
---|
630 | * @return RC channel 15 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
631 | */
|
---|
632 | static inline uint16_t mavlink_msg_rc_channels_get_chan15_raw(const mavlink_message_t* msg)
|
---|
633 | {
|
---|
634 | return _MAV_RETURN_uint16_t(msg, 32);
|
---|
635 | }
|
---|
636 |
|
---|
637 | /**
|
---|
638 | * @brief Get field chan16_raw from rc_channels message
|
---|
639 | *
|
---|
640 | * @return RC channel 16 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
641 | */
|
---|
642 | static inline uint16_t mavlink_msg_rc_channels_get_chan16_raw(const mavlink_message_t* msg)
|
---|
643 | {
|
---|
644 | return _MAV_RETURN_uint16_t(msg, 34);
|
---|
645 | }
|
---|
646 |
|
---|
647 | /**
|
---|
648 | * @brief Get field chan17_raw from rc_channels message
|
---|
649 | *
|
---|
650 | * @return RC channel 17 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
651 | */
|
---|
652 | static inline uint16_t mavlink_msg_rc_channels_get_chan17_raw(const mavlink_message_t* msg)
|
---|
653 | {
|
---|
654 | return _MAV_RETURN_uint16_t(msg, 36);
|
---|
655 | }
|
---|
656 |
|
---|
657 | /**
|
---|
658 | * @brief Get field chan18_raw from rc_channels message
|
---|
659 | *
|
---|
660 | * @return RC channel 18 value, in microseconds. A value of UINT16_MAX implies the channel is unused.
|
---|
661 | */
|
---|
662 | static inline uint16_t mavlink_msg_rc_channels_get_chan18_raw(const mavlink_message_t* msg)
|
---|
663 | {
|
---|
664 | return _MAV_RETURN_uint16_t(msg, 38);
|
---|
665 | }
|
---|
666 |
|
---|
667 | /**
|
---|
668 | * @brief Get field rssi from rc_channels message
|
---|
669 | *
|
---|
670 | * @return Receive signal strength indicator, 0: 0%, 100: 100%, 255: invalid/unknown.
|
---|
671 | */
|
---|
672 | static inline uint8_t mavlink_msg_rc_channels_get_rssi(const mavlink_message_t* msg)
|
---|
673 | {
|
---|
674 | return _MAV_RETURN_uint8_t(msg, 41);
|
---|
675 | }
|
---|
676 |
|
---|
677 | /**
|
---|
678 | * @brief Decode a rc_channels message into a struct
|
---|
679 | *
|
---|
680 | * @param msg The message to decode
|
---|
681 | * @param rc_channels C-struct to decode the message contents into
|
---|
682 | */
|
---|
683 | static inline void mavlink_msg_rc_channels_decode(const mavlink_message_t* msg, mavlink_rc_channels_t* rc_channels)
|
---|
684 | {
|
---|
685 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
|
---|
686 | rc_channels->time_boot_ms = mavlink_msg_rc_channels_get_time_boot_ms(msg);
|
---|
687 | rc_channels->chan1_raw = mavlink_msg_rc_channels_get_chan1_raw(msg);
|
---|
688 | rc_channels->chan2_raw = mavlink_msg_rc_channels_get_chan2_raw(msg);
|
---|
689 | rc_channels->chan3_raw = mavlink_msg_rc_channels_get_chan3_raw(msg);
|
---|
690 | rc_channels->chan4_raw = mavlink_msg_rc_channels_get_chan4_raw(msg);
|
---|
691 | rc_channels->chan5_raw = mavlink_msg_rc_channels_get_chan5_raw(msg);
|
---|
692 | rc_channels->chan6_raw = mavlink_msg_rc_channels_get_chan6_raw(msg);
|
---|
693 | rc_channels->chan7_raw = mavlink_msg_rc_channels_get_chan7_raw(msg);
|
---|
694 | rc_channels->chan8_raw = mavlink_msg_rc_channels_get_chan8_raw(msg);
|
---|
695 | rc_channels->chan9_raw = mavlink_msg_rc_channels_get_chan9_raw(msg);
|
---|
696 | rc_channels->chan10_raw = mavlink_msg_rc_channels_get_chan10_raw(msg);
|
---|
697 | rc_channels->chan11_raw = mavlink_msg_rc_channels_get_chan11_raw(msg);
|
---|
698 | rc_channels->chan12_raw = mavlink_msg_rc_channels_get_chan12_raw(msg);
|
---|
699 | rc_channels->chan13_raw = mavlink_msg_rc_channels_get_chan13_raw(msg);
|
---|
700 | rc_channels->chan14_raw = mavlink_msg_rc_channels_get_chan14_raw(msg);
|
---|
701 | rc_channels->chan15_raw = mavlink_msg_rc_channels_get_chan15_raw(msg);
|
---|
702 | rc_channels->chan16_raw = mavlink_msg_rc_channels_get_chan16_raw(msg);
|
---|
703 | rc_channels->chan17_raw = mavlink_msg_rc_channels_get_chan17_raw(msg);
|
---|
704 | rc_channels->chan18_raw = mavlink_msg_rc_channels_get_chan18_raw(msg);
|
---|
705 | rc_channels->chancount = mavlink_msg_rc_channels_get_chancount(msg);
|
---|
706 | rc_channels->rssi = mavlink_msg_rc_channels_get_rssi(msg);
|
---|
707 | #else
|
---|
708 | uint8_t len = msg->len < MAVLINK_MSG_ID_RC_CHANNELS_LEN? msg->len : MAVLINK_MSG_ID_RC_CHANNELS_LEN;
|
---|
709 | memset(rc_channels, 0, MAVLINK_MSG_ID_RC_CHANNELS_LEN);
|
---|
710 | memcpy(rc_channels, _MAV_PAYLOAD(msg), len);
|
---|
711 | #endif
|
---|
712 | }
|
---|