Merge remote-tracking branch 'upstream/master' into abo_fw_alt_vel_control
[inav.git] / lib / main / MAVLink / common / mavlink_msg_servo_output_raw.h
blob4b76d20a8ff6c05664be9251a4e3ac6689590e8a
1 #pragma once
2 // MESSAGE SERVO_OUTPUT_RAW PACKING
4 #define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW 36
6 MAVPACKED(
7 typedef struct __mavlink_servo_output_raw_t {
8 uint32_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/
9 uint16_t servo1_raw; /*< [us] Servo output 1 value*/
10 uint16_t servo2_raw; /*< [us] Servo output 2 value*/
11 uint16_t servo3_raw; /*< [us] Servo output 3 value*/
12 uint16_t servo4_raw; /*< [us] Servo output 4 value*/
13 uint16_t servo5_raw; /*< [us] Servo output 5 value*/
14 uint16_t servo6_raw; /*< [us] Servo output 6 value*/
15 uint16_t servo7_raw; /*< [us] Servo output 7 value*/
16 uint16_t servo8_raw; /*< [us] Servo output 8 value*/
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 uint16_t servo9_raw; /*< [us] Servo output 9 value*/
19 uint16_t servo10_raw; /*< [us] Servo output 10 value*/
20 uint16_t servo11_raw; /*< [us] Servo output 11 value*/
21 uint16_t servo12_raw; /*< [us] Servo output 12 value*/
22 uint16_t servo13_raw; /*< [us] Servo output 13 value*/
23 uint16_t servo14_raw; /*< [us] Servo output 14 value*/
24 uint16_t servo15_raw; /*< [us] Servo output 15 value*/
25 uint16_t servo16_raw; /*< [us] Servo output 16 value*/
26 }) mavlink_servo_output_raw_t;
28 #define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN 37
29 #define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN 21
30 #define MAVLINK_MSG_ID_36_LEN 37
31 #define MAVLINK_MSG_ID_36_MIN_LEN 21
33 #define MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC 222
34 #define MAVLINK_MSG_ID_36_CRC 222
38 #if MAVLINK_COMMAND_24BIT
39 #define MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW { \
40 36, \
41 "SERVO_OUTPUT_RAW", \
42 18, \
43 { { "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_servo_output_raw_t, time_usec) }, \
44 { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_servo_output_raw_t, port) }, \
45 { "servo1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_servo_output_raw_t, servo1_raw) }, \
46 { "servo2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_servo_output_raw_t, servo2_raw) }, \
47 { "servo3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_servo_output_raw_t, servo3_raw) }, \
48 { "servo4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_servo_output_raw_t, servo4_raw) }, \
49 { "servo5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_servo_output_raw_t, servo5_raw) }, \
50 { "servo6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_servo_output_raw_t, servo6_raw) }, \
51 { "servo7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_servo_output_raw_t, servo7_raw) }, \
52 { "servo8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_servo_output_raw_t, servo8_raw) }, \
53 { "servo9_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 21, offsetof(mavlink_servo_output_raw_t, servo9_raw) }, \
54 { "servo10_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 23, offsetof(mavlink_servo_output_raw_t, servo10_raw) }, \
55 { "servo11_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 25, offsetof(mavlink_servo_output_raw_t, servo11_raw) }, \
56 { "servo12_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 27, offsetof(mavlink_servo_output_raw_t, servo12_raw) }, \
57 { "servo13_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 29, offsetof(mavlink_servo_output_raw_t, servo13_raw) }, \
58 { "servo14_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 31, offsetof(mavlink_servo_output_raw_t, servo14_raw) }, \
59 { "servo15_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 33, offsetof(mavlink_servo_output_raw_t, servo15_raw) }, \
60 { "servo16_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 35, offsetof(mavlink_servo_output_raw_t, servo16_raw) }, \
61 } \
63 #else
64 #define MAVLINK_MESSAGE_INFO_SERVO_OUTPUT_RAW { \
65 "SERVO_OUTPUT_RAW", \
66 18, \
67 { { "time_usec", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_servo_output_raw_t, time_usec) }, \
68 { "port", NULL, MAVLINK_TYPE_UINT8_T, 0, 20, offsetof(mavlink_servo_output_raw_t, port) }, \
69 { "servo1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_servo_output_raw_t, servo1_raw) }, \
70 { "servo2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_servo_output_raw_t, servo2_raw) }, \
71 { "servo3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_servo_output_raw_t, servo3_raw) }, \
72 { "servo4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_servo_output_raw_t, servo4_raw) }, \
73 { "servo5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_servo_output_raw_t, servo5_raw) }, \
74 { "servo6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_servo_output_raw_t, servo6_raw) }, \
75 { "servo7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 16, offsetof(mavlink_servo_output_raw_t, servo7_raw) }, \
76 { "servo8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_servo_output_raw_t, servo8_raw) }, \
77 { "servo9_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 21, offsetof(mavlink_servo_output_raw_t, servo9_raw) }, \
78 { "servo10_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 23, offsetof(mavlink_servo_output_raw_t, servo10_raw) }, \
79 { "servo11_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 25, offsetof(mavlink_servo_output_raw_t, servo11_raw) }, \
80 { "servo12_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 27, offsetof(mavlink_servo_output_raw_t, servo12_raw) }, \
81 { "servo13_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 29, offsetof(mavlink_servo_output_raw_t, servo13_raw) }, \
82 { "servo14_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 31, offsetof(mavlink_servo_output_raw_t, servo14_raw) }, \
83 { "servo15_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 33, offsetof(mavlink_servo_output_raw_t, servo15_raw) }, \
84 { "servo16_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 35, offsetof(mavlink_servo_output_raw_t, servo16_raw) }, \
85 } \
87 #endif
89 /**
90 * @brief Pack a servo_output_raw message
91 * @param system_id ID of this system
92 * @param component_id ID of this component (e.g. 200 for IMU)
93 * @param msg The MAVLink message to compress the data into
95 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
96 * @param port Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.
97 * @param servo1_raw [us] Servo output 1 value
98 * @param servo2_raw [us] Servo output 2 value
99 * @param servo3_raw [us] Servo output 3 value
100 * @param servo4_raw [us] Servo output 4 value
101 * @param servo5_raw [us] Servo output 5 value
102 * @param servo6_raw [us] Servo output 6 value
103 * @param servo7_raw [us] Servo output 7 value
104 * @param servo8_raw [us] Servo output 8 value
105 * @param servo9_raw [us] Servo output 9 value
106 * @param servo10_raw [us] Servo output 10 value
107 * @param servo11_raw [us] Servo output 11 value
108 * @param servo12_raw [us] Servo output 12 value
109 * @param servo13_raw [us] Servo output 13 value
110 * @param servo14_raw [us] Servo output 14 value
111 * @param servo15_raw [us] Servo output 15 value
112 * @param servo16_raw [us] Servo output 16 value
113 * @return length of the message in bytes (excluding serial stream start sign)
115 static inline uint16_t mavlink_msg_servo_output_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
116 uint32_t time_usec, uint8_t port, uint16_t servo1_raw, uint16_t servo2_raw, uint16_t servo3_raw, uint16_t servo4_raw, uint16_t servo5_raw, uint16_t servo6_raw, uint16_t servo7_raw, uint16_t servo8_raw, uint16_t servo9_raw, uint16_t servo10_raw, uint16_t servo11_raw, uint16_t servo12_raw, uint16_t servo13_raw, uint16_t servo14_raw, uint16_t servo15_raw, uint16_t servo16_raw)
118 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
119 char buf[MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN];
120 _mav_put_uint32_t(buf, 0, time_usec);
121 _mav_put_uint16_t(buf, 4, servo1_raw);
122 _mav_put_uint16_t(buf, 6, servo2_raw);
123 _mav_put_uint16_t(buf, 8, servo3_raw);
124 _mav_put_uint16_t(buf, 10, servo4_raw);
125 _mav_put_uint16_t(buf, 12, servo5_raw);
126 _mav_put_uint16_t(buf, 14, servo6_raw);
127 _mav_put_uint16_t(buf, 16, servo7_raw);
128 _mav_put_uint16_t(buf, 18, servo8_raw);
129 _mav_put_uint8_t(buf, 20, port);
130 _mav_put_uint16_t(buf, 21, servo9_raw);
131 _mav_put_uint16_t(buf, 23, servo10_raw);
132 _mav_put_uint16_t(buf, 25, servo11_raw);
133 _mav_put_uint16_t(buf, 27, servo12_raw);
134 _mav_put_uint16_t(buf, 29, servo13_raw);
135 _mav_put_uint16_t(buf, 31, servo14_raw);
136 _mav_put_uint16_t(buf, 33, servo15_raw);
137 _mav_put_uint16_t(buf, 35, servo16_raw);
139 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN);
140 #else
141 mavlink_servo_output_raw_t packet;
142 packet.time_usec = time_usec;
143 packet.servo1_raw = servo1_raw;
144 packet.servo2_raw = servo2_raw;
145 packet.servo3_raw = servo3_raw;
146 packet.servo4_raw = servo4_raw;
147 packet.servo5_raw = servo5_raw;
148 packet.servo6_raw = servo6_raw;
149 packet.servo7_raw = servo7_raw;
150 packet.servo8_raw = servo8_raw;
151 packet.port = port;
152 packet.servo9_raw = servo9_raw;
153 packet.servo10_raw = servo10_raw;
154 packet.servo11_raw = servo11_raw;
155 packet.servo12_raw = servo12_raw;
156 packet.servo13_raw = servo13_raw;
157 packet.servo14_raw = servo14_raw;
158 packet.servo15_raw = servo15_raw;
159 packet.servo16_raw = servo16_raw;
161 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN);
162 #endif
164 msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW;
165 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC);
169 * @brief Pack a servo_output_raw message on a channel
170 * @param system_id ID of this system
171 * @param component_id ID of this component (e.g. 200 for IMU)
172 * @param chan The MAVLink channel this message will be sent over
173 * @param msg The MAVLink message to compress the data into
174 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
175 * @param port Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.
176 * @param servo1_raw [us] Servo output 1 value
177 * @param servo2_raw [us] Servo output 2 value
178 * @param servo3_raw [us] Servo output 3 value
179 * @param servo4_raw [us] Servo output 4 value
180 * @param servo5_raw [us] Servo output 5 value
181 * @param servo6_raw [us] Servo output 6 value
182 * @param servo7_raw [us] Servo output 7 value
183 * @param servo8_raw [us] Servo output 8 value
184 * @param servo9_raw [us] Servo output 9 value
185 * @param servo10_raw [us] Servo output 10 value
186 * @param servo11_raw [us] Servo output 11 value
187 * @param servo12_raw [us] Servo output 12 value
188 * @param servo13_raw [us] Servo output 13 value
189 * @param servo14_raw [us] Servo output 14 value
190 * @param servo15_raw [us] Servo output 15 value
191 * @param servo16_raw [us] Servo output 16 value
192 * @return length of the message in bytes (excluding serial stream start sign)
194 static inline uint16_t mavlink_msg_servo_output_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
195 mavlink_message_t* msg,
196 uint32_t time_usec,uint8_t port,uint16_t servo1_raw,uint16_t servo2_raw,uint16_t servo3_raw,uint16_t servo4_raw,uint16_t servo5_raw,uint16_t servo6_raw,uint16_t servo7_raw,uint16_t servo8_raw,uint16_t servo9_raw,uint16_t servo10_raw,uint16_t servo11_raw,uint16_t servo12_raw,uint16_t servo13_raw,uint16_t servo14_raw,uint16_t servo15_raw,uint16_t servo16_raw)
198 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
199 char buf[MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN];
200 _mav_put_uint32_t(buf, 0, time_usec);
201 _mav_put_uint16_t(buf, 4, servo1_raw);
202 _mav_put_uint16_t(buf, 6, servo2_raw);
203 _mav_put_uint16_t(buf, 8, servo3_raw);
204 _mav_put_uint16_t(buf, 10, servo4_raw);
205 _mav_put_uint16_t(buf, 12, servo5_raw);
206 _mav_put_uint16_t(buf, 14, servo6_raw);
207 _mav_put_uint16_t(buf, 16, servo7_raw);
208 _mav_put_uint16_t(buf, 18, servo8_raw);
209 _mav_put_uint8_t(buf, 20, port);
210 _mav_put_uint16_t(buf, 21, servo9_raw);
211 _mav_put_uint16_t(buf, 23, servo10_raw);
212 _mav_put_uint16_t(buf, 25, servo11_raw);
213 _mav_put_uint16_t(buf, 27, servo12_raw);
214 _mav_put_uint16_t(buf, 29, servo13_raw);
215 _mav_put_uint16_t(buf, 31, servo14_raw);
216 _mav_put_uint16_t(buf, 33, servo15_raw);
217 _mav_put_uint16_t(buf, 35, servo16_raw);
219 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN);
220 #else
221 mavlink_servo_output_raw_t packet;
222 packet.time_usec = time_usec;
223 packet.servo1_raw = servo1_raw;
224 packet.servo2_raw = servo2_raw;
225 packet.servo3_raw = servo3_raw;
226 packet.servo4_raw = servo4_raw;
227 packet.servo5_raw = servo5_raw;
228 packet.servo6_raw = servo6_raw;
229 packet.servo7_raw = servo7_raw;
230 packet.servo8_raw = servo8_raw;
231 packet.port = port;
232 packet.servo9_raw = servo9_raw;
233 packet.servo10_raw = servo10_raw;
234 packet.servo11_raw = servo11_raw;
235 packet.servo12_raw = servo12_raw;
236 packet.servo13_raw = servo13_raw;
237 packet.servo14_raw = servo14_raw;
238 packet.servo15_raw = servo15_raw;
239 packet.servo16_raw = servo16_raw;
241 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN);
242 #endif
244 msg->msgid = MAVLINK_MSG_ID_SERVO_OUTPUT_RAW;
245 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC);
249 * @brief Encode a servo_output_raw struct
251 * @param system_id ID of this system
252 * @param component_id ID of this component (e.g. 200 for IMU)
253 * @param msg The MAVLink message to compress the data into
254 * @param servo_output_raw C-struct to read the message contents from
256 static inline uint16_t mavlink_msg_servo_output_raw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_servo_output_raw_t* servo_output_raw)
258 return mavlink_msg_servo_output_raw_pack(system_id, component_id, msg, servo_output_raw->time_usec, servo_output_raw->port, servo_output_raw->servo1_raw, servo_output_raw->servo2_raw, servo_output_raw->servo3_raw, servo_output_raw->servo4_raw, servo_output_raw->servo5_raw, servo_output_raw->servo6_raw, servo_output_raw->servo7_raw, servo_output_raw->servo8_raw, servo_output_raw->servo9_raw, servo_output_raw->servo10_raw, servo_output_raw->servo11_raw, servo_output_raw->servo12_raw, servo_output_raw->servo13_raw, servo_output_raw->servo14_raw, servo_output_raw->servo15_raw, servo_output_raw->servo16_raw);
262 * @brief Encode a servo_output_raw struct on a channel
264 * @param system_id ID of this system
265 * @param component_id ID of this component (e.g. 200 for IMU)
266 * @param chan The MAVLink channel this message will be sent over
267 * @param msg The MAVLink message to compress the data into
268 * @param servo_output_raw C-struct to read the message contents from
270 static inline uint16_t mavlink_msg_servo_output_raw_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_servo_output_raw_t* servo_output_raw)
272 return mavlink_msg_servo_output_raw_pack_chan(system_id, component_id, chan, msg, servo_output_raw->time_usec, servo_output_raw->port, servo_output_raw->servo1_raw, servo_output_raw->servo2_raw, servo_output_raw->servo3_raw, servo_output_raw->servo4_raw, servo_output_raw->servo5_raw, servo_output_raw->servo6_raw, servo_output_raw->servo7_raw, servo_output_raw->servo8_raw, servo_output_raw->servo9_raw, servo_output_raw->servo10_raw, servo_output_raw->servo11_raw, servo_output_raw->servo12_raw, servo_output_raw->servo13_raw, servo_output_raw->servo14_raw, servo_output_raw->servo15_raw, servo_output_raw->servo16_raw);
276 * @brief Send a servo_output_raw message
277 * @param chan MAVLink channel to send the message
279 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
280 * @param port Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.
281 * @param servo1_raw [us] Servo output 1 value
282 * @param servo2_raw [us] Servo output 2 value
283 * @param servo3_raw [us] Servo output 3 value
284 * @param servo4_raw [us] Servo output 4 value
285 * @param servo5_raw [us] Servo output 5 value
286 * @param servo6_raw [us] Servo output 6 value
287 * @param servo7_raw [us] Servo output 7 value
288 * @param servo8_raw [us] Servo output 8 value
289 * @param servo9_raw [us] Servo output 9 value
290 * @param servo10_raw [us] Servo output 10 value
291 * @param servo11_raw [us] Servo output 11 value
292 * @param servo12_raw [us] Servo output 12 value
293 * @param servo13_raw [us] Servo output 13 value
294 * @param servo14_raw [us] Servo output 14 value
295 * @param servo15_raw [us] Servo output 15 value
296 * @param servo16_raw [us] Servo output 16 value
298 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
300 static inline void mavlink_msg_servo_output_raw_send(mavlink_channel_t chan, uint32_t time_usec, uint8_t port, uint16_t servo1_raw, uint16_t servo2_raw, uint16_t servo3_raw, uint16_t servo4_raw, uint16_t servo5_raw, uint16_t servo6_raw, uint16_t servo7_raw, uint16_t servo8_raw, uint16_t servo9_raw, uint16_t servo10_raw, uint16_t servo11_raw, uint16_t servo12_raw, uint16_t servo13_raw, uint16_t servo14_raw, uint16_t servo15_raw, uint16_t servo16_raw)
302 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
303 char buf[MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN];
304 _mav_put_uint32_t(buf, 0, time_usec);
305 _mav_put_uint16_t(buf, 4, servo1_raw);
306 _mav_put_uint16_t(buf, 6, servo2_raw);
307 _mav_put_uint16_t(buf, 8, servo3_raw);
308 _mav_put_uint16_t(buf, 10, servo4_raw);
309 _mav_put_uint16_t(buf, 12, servo5_raw);
310 _mav_put_uint16_t(buf, 14, servo6_raw);
311 _mav_put_uint16_t(buf, 16, servo7_raw);
312 _mav_put_uint16_t(buf, 18, servo8_raw);
313 _mav_put_uint8_t(buf, 20, port);
314 _mav_put_uint16_t(buf, 21, servo9_raw);
315 _mav_put_uint16_t(buf, 23, servo10_raw);
316 _mav_put_uint16_t(buf, 25, servo11_raw);
317 _mav_put_uint16_t(buf, 27, servo12_raw);
318 _mav_put_uint16_t(buf, 29, servo13_raw);
319 _mav_put_uint16_t(buf, 31, servo14_raw);
320 _mav_put_uint16_t(buf, 33, servo15_raw);
321 _mav_put_uint16_t(buf, 35, servo16_raw);
323 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC);
324 #else
325 mavlink_servo_output_raw_t packet;
326 packet.time_usec = time_usec;
327 packet.servo1_raw = servo1_raw;
328 packet.servo2_raw = servo2_raw;
329 packet.servo3_raw = servo3_raw;
330 packet.servo4_raw = servo4_raw;
331 packet.servo5_raw = servo5_raw;
332 packet.servo6_raw = servo6_raw;
333 packet.servo7_raw = servo7_raw;
334 packet.servo8_raw = servo8_raw;
335 packet.port = port;
336 packet.servo9_raw = servo9_raw;
337 packet.servo10_raw = servo10_raw;
338 packet.servo11_raw = servo11_raw;
339 packet.servo12_raw = servo12_raw;
340 packet.servo13_raw = servo13_raw;
341 packet.servo14_raw = servo14_raw;
342 packet.servo15_raw = servo15_raw;
343 packet.servo16_raw = servo16_raw;
345 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, (const char *)&packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC);
346 #endif
350 * @brief Send a servo_output_raw message
351 * @param chan MAVLink channel to send the message
352 * @param struct The MAVLink struct to serialize
354 static inline void mavlink_msg_servo_output_raw_send_struct(mavlink_channel_t chan, const mavlink_servo_output_raw_t* servo_output_raw)
356 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
357 mavlink_msg_servo_output_raw_send(chan, servo_output_raw->time_usec, servo_output_raw->port, servo_output_raw->servo1_raw, servo_output_raw->servo2_raw, servo_output_raw->servo3_raw, servo_output_raw->servo4_raw, servo_output_raw->servo5_raw, servo_output_raw->servo6_raw, servo_output_raw->servo7_raw, servo_output_raw->servo8_raw, servo_output_raw->servo9_raw, servo_output_raw->servo10_raw, servo_output_raw->servo11_raw, servo_output_raw->servo12_raw, servo_output_raw->servo13_raw, servo_output_raw->servo14_raw, servo_output_raw->servo15_raw, servo_output_raw->servo16_raw);
358 #else
359 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, (const char *)servo_output_raw, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC);
360 #endif
363 #if MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
365 This varient of _send() can be used to save stack space by re-using
366 memory from the receive buffer. The caller provides a
367 mavlink_message_t which is the size of a full mavlink message. This
368 is usually the receive buffer for the channel, and allows a reply to an
369 incoming message with minimum stack space usage.
371 static inline void mavlink_msg_servo_output_raw_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_usec, uint8_t port, uint16_t servo1_raw, uint16_t servo2_raw, uint16_t servo3_raw, uint16_t servo4_raw, uint16_t servo5_raw, uint16_t servo6_raw, uint16_t servo7_raw, uint16_t servo8_raw, uint16_t servo9_raw, uint16_t servo10_raw, uint16_t servo11_raw, uint16_t servo12_raw, uint16_t servo13_raw, uint16_t servo14_raw, uint16_t servo15_raw, uint16_t servo16_raw)
373 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
374 char *buf = (char *)msgbuf;
375 _mav_put_uint32_t(buf, 0, time_usec);
376 _mav_put_uint16_t(buf, 4, servo1_raw);
377 _mav_put_uint16_t(buf, 6, servo2_raw);
378 _mav_put_uint16_t(buf, 8, servo3_raw);
379 _mav_put_uint16_t(buf, 10, servo4_raw);
380 _mav_put_uint16_t(buf, 12, servo5_raw);
381 _mav_put_uint16_t(buf, 14, servo6_raw);
382 _mav_put_uint16_t(buf, 16, servo7_raw);
383 _mav_put_uint16_t(buf, 18, servo8_raw);
384 _mav_put_uint8_t(buf, 20, port);
385 _mav_put_uint16_t(buf, 21, servo9_raw);
386 _mav_put_uint16_t(buf, 23, servo10_raw);
387 _mav_put_uint16_t(buf, 25, servo11_raw);
388 _mav_put_uint16_t(buf, 27, servo12_raw);
389 _mav_put_uint16_t(buf, 29, servo13_raw);
390 _mav_put_uint16_t(buf, 31, servo14_raw);
391 _mav_put_uint16_t(buf, 33, servo15_raw);
392 _mav_put_uint16_t(buf, 35, servo16_raw);
394 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, buf, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC);
395 #else
396 mavlink_servo_output_raw_t *packet = (mavlink_servo_output_raw_t *)msgbuf;
397 packet->time_usec = time_usec;
398 packet->servo1_raw = servo1_raw;
399 packet->servo2_raw = servo2_raw;
400 packet->servo3_raw = servo3_raw;
401 packet->servo4_raw = servo4_raw;
402 packet->servo5_raw = servo5_raw;
403 packet->servo6_raw = servo6_raw;
404 packet->servo7_raw = servo7_raw;
405 packet->servo8_raw = servo8_raw;
406 packet->port = port;
407 packet->servo9_raw = servo9_raw;
408 packet->servo10_raw = servo10_raw;
409 packet->servo11_raw = servo11_raw;
410 packet->servo12_raw = servo12_raw;
411 packet->servo13_raw = servo13_raw;
412 packet->servo14_raw = servo14_raw;
413 packet->servo15_raw = servo15_raw;
414 packet->servo16_raw = servo16_raw;
416 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, (const char *)packet, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_CRC);
417 #endif
419 #endif
421 #endif
423 // MESSAGE SERVO_OUTPUT_RAW UNPACKING
427 * @brief Get field time_usec from servo_output_raw message
429 * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
431 static inline uint32_t mavlink_msg_servo_output_raw_get_time_usec(const mavlink_message_t* msg)
433 return _MAV_RETURN_uint32_t(msg, 0);
437 * @brief Get field port from servo_output_raw message
439 * @return Servo output port (set of 8 outputs = 1 port). Flight stacks running on Pixhawk should use: 0 = MAIN, 1 = AUX.
441 static inline uint8_t mavlink_msg_servo_output_raw_get_port(const mavlink_message_t* msg)
443 return _MAV_RETURN_uint8_t(msg, 20);
447 * @brief Get field servo1_raw from servo_output_raw message
449 * @return [us] Servo output 1 value
451 static inline uint16_t mavlink_msg_servo_output_raw_get_servo1_raw(const mavlink_message_t* msg)
453 return _MAV_RETURN_uint16_t(msg, 4);
457 * @brief Get field servo2_raw from servo_output_raw message
459 * @return [us] Servo output 2 value
461 static inline uint16_t mavlink_msg_servo_output_raw_get_servo2_raw(const mavlink_message_t* msg)
463 return _MAV_RETURN_uint16_t(msg, 6);
467 * @brief Get field servo3_raw from servo_output_raw message
469 * @return [us] Servo output 3 value
471 static inline uint16_t mavlink_msg_servo_output_raw_get_servo3_raw(const mavlink_message_t* msg)
473 return _MAV_RETURN_uint16_t(msg, 8);
477 * @brief Get field servo4_raw from servo_output_raw message
479 * @return [us] Servo output 4 value
481 static inline uint16_t mavlink_msg_servo_output_raw_get_servo4_raw(const mavlink_message_t* msg)
483 return _MAV_RETURN_uint16_t(msg, 10);
487 * @brief Get field servo5_raw from servo_output_raw message
489 * @return [us] Servo output 5 value
491 static inline uint16_t mavlink_msg_servo_output_raw_get_servo5_raw(const mavlink_message_t* msg)
493 return _MAV_RETURN_uint16_t(msg, 12);
497 * @brief Get field servo6_raw from servo_output_raw message
499 * @return [us] Servo output 6 value
501 static inline uint16_t mavlink_msg_servo_output_raw_get_servo6_raw(const mavlink_message_t* msg)
503 return _MAV_RETURN_uint16_t(msg, 14);
507 * @brief Get field servo7_raw from servo_output_raw message
509 * @return [us] Servo output 7 value
511 static inline uint16_t mavlink_msg_servo_output_raw_get_servo7_raw(const mavlink_message_t* msg)
513 return _MAV_RETURN_uint16_t(msg, 16);
517 * @brief Get field servo8_raw from servo_output_raw message
519 * @return [us] Servo output 8 value
521 static inline uint16_t mavlink_msg_servo_output_raw_get_servo8_raw(const mavlink_message_t* msg)
523 return _MAV_RETURN_uint16_t(msg, 18);
527 * @brief Get field servo9_raw from servo_output_raw message
529 * @return [us] Servo output 9 value
531 static inline uint16_t mavlink_msg_servo_output_raw_get_servo9_raw(const mavlink_message_t* msg)
533 return _MAV_RETURN_uint16_t(msg, 21);
537 * @brief Get field servo10_raw from servo_output_raw message
539 * @return [us] Servo output 10 value
541 static inline uint16_t mavlink_msg_servo_output_raw_get_servo10_raw(const mavlink_message_t* msg)
543 return _MAV_RETURN_uint16_t(msg, 23);
547 * @brief Get field servo11_raw from servo_output_raw message
549 * @return [us] Servo output 11 value
551 static inline uint16_t mavlink_msg_servo_output_raw_get_servo11_raw(const mavlink_message_t* msg)
553 return _MAV_RETURN_uint16_t(msg, 25);
557 * @brief Get field servo12_raw from servo_output_raw message
559 * @return [us] Servo output 12 value
561 static inline uint16_t mavlink_msg_servo_output_raw_get_servo12_raw(const mavlink_message_t* msg)
563 return _MAV_RETURN_uint16_t(msg, 27);
567 * @brief Get field servo13_raw from servo_output_raw message
569 * @return [us] Servo output 13 value
571 static inline uint16_t mavlink_msg_servo_output_raw_get_servo13_raw(const mavlink_message_t* msg)
573 return _MAV_RETURN_uint16_t(msg, 29);
577 * @brief Get field servo14_raw from servo_output_raw message
579 * @return [us] Servo output 14 value
581 static inline uint16_t mavlink_msg_servo_output_raw_get_servo14_raw(const mavlink_message_t* msg)
583 return _MAV_RETURN_uint16_t(msg, 31);
587 * @brief Get field servo15_raw from servo_output_raw message
589 * @return [us] Servo output 15 value
591 static inline uint16_t mavlink_msg_servo_output_raw_get_servo15_raw(const mavlink_message_t* msg)
593 return _MAV_RETURN_uint16_t(msg, 33);
597 * @brief Get field servo16_raw from servo_output_raw message
599 * @return [us] Servo output 16 value
601 static inline uint16_t mavlink_msg_servo_output_raw_get_servo16_raw(const mavlink_message_t* msg)
603 return _MAV_RETURN_uint16_t(msg, 35);
607 * @brief Decode a servo_output_raw message into a struct
609 * @param msg The message to decode
610 * @param servo_output_raw C-struct to decode the message contents into
612 static inline void mavlink_msg_servo_output_raw_decode(const mavlink_message_t* msg, mavlink_servo_output_raw_t* servo_output_raw)
614 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
615 servo_output_raw->time_usec = mavlink_msg_servo_output_raw_get_time_usec(msg);
616 servo_output_raw->servo1_raw = mavlink_msg_servo_output_raw_get_servo1_raw(msg);
617 servo_output_raw->servo2_raw = mavlink_msg_servo_output_raw_get_servo2_raw(msg);
618 servo_output_raw->servo3_raw = mavlink_msg_servo_output_raw_get_servo3_raw(msg);
619 servo_output_raw->servo4_raw = mavlink_msg_servo_output_raw_get_servo4_raw(msg);
620 servo_output_raw->servo5_raw = mavlink_msg_servo_output_raw_get_servo5_raw(msg);
621 servo_output_raw->servo6_raw = mavlink_msg_servo_output_raw_get_servo6_raw(msg);
622 servo_output_raw->servo7_raw = mavlink_msg_servo_output_raw_get_servo7_raw(msg);
623 servo_output_raw->servo8_raw = mavlink_msg_servo_output_raw_get_servo8_raw(msg);
624 servo_output_raw->port = mavlink_msg_servo_output_raw_get_port(msg);
625 servo_output_raw->servo9_raw = mavlink_msg_servo_output_raw_get_servo9_raw(msg);
626 servo_output_raw->servo10_raw = mavlink_msg_servo_output_raw_get_servo10_raw(msg);
627 servo_output_raw->servo11_raw = mavlink_msg_servo_output_raw_get_servo11_raw(msg);
628 servo_output_raw->servo12_raw = mavlink_msg_servo_output_raw_get_servo12_raw(msg);
629 servo_output_raw->servo13_raw = mavlink_msg_servo_output_raw_get_servo13_raw(msg);
630 servo_output_raw->servo14_raw = mavlink_msg_servo_output_raw_get_servo14_raw(msg);
631 servo_output_raw->servo15_raw = mavlink_msg_servo_output_raw_get_servo15_raw(msg);
632 servo_output_raw->servo16_raw = mavlink_msg_servo_output_raw_get_servo16_raw(msg);
633 #else
634 uint8_t len = msg->len < MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN? msg->len : MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN;
635 memset(servo_output_raw, 0, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_LEN);
636 memcpy(servo_output_raw, _MAV_PAYLOAD(msg), len);
637 #endif