Merged in f5soh/librepilot/update_credits (pull request #529)
[librepilot.git] / flight / libraries / mavlink / v1.0 / common / testsuite.h
bloba20937159da0b83d6d8681de41b5654996928f94
1 /** @file
2 * @brief MAVLink comm protocol testsuite generated from common.xml
3 * @see http://qgroundcontrol.org/mavlink/
4 */
5 #ifndef COMMON_TESTSUITE_H
6 #define COMMON_TESTSUITE_H
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
12 #ifndef MAVLINK_TEST_ALL
13 #define MAVLINK_TEST_ALL
15 static void mavlink_test_common(uint8_t, uint8_t, mavlink_message_t * last_msg);
17 static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
19 mavlink_test_common(system_id, component_id, last_msg);
21 #endif
24 static void mavlink_test_heartbeat(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
26 mavlink_message_t msg;
27 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
28 uint16_t i;
29 mavlink_heartbeat_t packet_in = {
30 963497464,
31 17,
32 84,
33 151,
34 218,
37 mavlink_heartbeat_t packet1, packet2;
39 memset(&packet1, 0, sizeof(packet1));
40 packet1.custom_mode = packet_in.custom_mode;
41 packet1.type = packet_in.type;
42 packet1.autopilot = packet_in.autopilot;
43 packet1.base_mode = packet_in.base_mode;
44 packet1.system_status = packet_in.system_status;
45 packet1.mavlink_version = packet_in.mavlink_version;
48 memset(&packet2, 0, sizeof(packet2));
49 mavlink_msg_heartbeat_encode(system_id, component_id, &msg, &packet1);
50 mavlink_msg_heartbeat_decode(&msg, &packet2);
51 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
53 memset(&packet2, 0, sizeof(packet2));
54 mavlink_msg_heartbeat_pack(system_id, component_id, &msg, packet1.type, packet1.autopilot, packet1.base_mode, packet1.custom_mode, packet1.system_status);
55 mavlink_msg_heartbeat_decode(&msg, &packet2);
56 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
58 memset(&packet2, 0, sizeof(packet2));
59 mavlink_msg_heartbeat_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.type, packet1.autopilot, packet1.base_mode, packet1.custom_mode, packet1.system_status);
60 mavlink_msg_heartbeat_decode(&msg, &packet2);
61 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
63 memset(&packet2, 0, sizeof(packet2));
64 mavlink_msg_to_send_buffer(buffer, &msg);
65 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
66 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
68 mavlink_msg_heartbeat_decode(last_msg, &packet2);
69 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
71 memset(&packet2, 0, sizeof(packet2));
72 mavlink_msg_heartbeat_send(MAVLINK_COMM_1, packet1.type, packet1.autopilot, packet1.base_mode, packet1.custom_mode, packet1.system_status);
73 mavlink_msg_heartbeat_decode(last_msg, &packet2);
74 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
77 static void mavlink_test_sys_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
79 mavlink_message_t msg;
80 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
81 uint16_t i;
82 mavlink_sys_status_t packet_in = {
83 963497464,
84 963497672,
85 963497880,
86 17859,
87 17963,
88 18067,
89 18171,
90 18275,
91 18379,
92 18483,
93 18587,
94 18691,
95 223,
97 mavlink_sys_status_t packet1, packet2;
99 memset(&packet1, 0, sizeof(packet1));
100 packet1.onboard_control_sensors_present = packet_in.onboard_control_sensors_present;
101 packet1.onboard_control_sensors_enabled = packet_in.onboard_control_sensors_enabled;
102 packet1.onboard_control_sensors_health = packet_in.onboard_control_sensors_health;
103 packet1.load = packet_in.load;
104 packet1.voltage_battery = packet_in.voltage_battery;
105 packet1.current_battery = packet_in.current_battery;
106 packet1.drop_rate_comm = packet_in.drop_rate_comm;
107 packet1.errors_comm = packet_in.errors_comm;
108 packet1.errors_count1 = packet_in.errors_count1;
109 packet1.errors_count2 = packet_in.errors_count2;
110 packet1.errors_count3 = packet_in.errors_count3;
111 packet1.errors_count4 = packet_in.errors_count4;
112 packet1.battery_remaining = packet_in.battery_remaining;
115 memset(&packet2, 0, sizeof(packet2));
116 mavlink_msg_sys_status_encode(system_id, component_id, &msg, &packet1);
117 mavlink_msg_sys_status_decode(&msg, &packet2);
118 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
120 memset(&packet2, 0, sizeof(packet2));
121 mavlink_msg_sys_status_pack(system_id, component_id, &msg, packet1.onboard_control_sensors_present, packet1.onboard_control_sensors_enabled, packet1.onboard_control_sensors_health, packet1.load, packet1.voltage_battery, packet1.current_battery, packet1.battery_remaining, packet1.drop_rate_comm, packet1.errors_comm, packet1.errors_count1, packet1.errors_count2, packet1.errors_count3, packet1.errors_count4);
122 mavlink_msg_sys_status_decode(&msg, &packet2);
123 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
125 memset(&packet2, 0, sizeof(packet2));
126 mavlink_msg_sys_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.onboard_control_sensors_present, packet1.onboard_control_sensors_enabled, packet1.onboard_control_sensors_health, packet1.load, packet1.voltage_battery, packet1.current_battery, packet1.battery_remaining, packet1.drop_rate_comm, packet1.errors_comm, packet1.errors_count1, packet1.errors_count2, packet1.errors_count3, packet1.errors_count4);
127 mavlink_msg_sys_status_decode(&msg, &packet2);
128 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
130 memset(&packet2, 0, sizeof(packet2));
131 mavlink_msg_to_send_buffer(buffer, &msg);
132 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
133 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
135 mavlink_msg_sys_status_decode(last_msg, &packet2);
136 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
138 memset(&packet2, 0, sizeof(packet2));
139 mavlink_msg_sys_status_send(MAVLINK_COMM_1, packet1.onboard_control_sensors_present, packet1.onboard_control_sensors_enabled, packet1.onboard_control_sensors_health, packet1.load, packet1.voltage_battery, packet1.current_battery, packet1.battery_remaining, packet1.drop_rate_comm, packet1.errors_comm, packet1.errors_count1, packet1.errors_count2, packet1.errors_count3, packet1.errors_count4);
140 mavlink_msg_sys_status_decode(last_msg, &packet2);
141 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
144 static void mavlink_test_system_time(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
146 mavlink_message_t msg;
147 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
148 uint16_t i;
149 mavlink_system_time_t packet_in = {
150 93372036854775807ULL,
151 963497880,
153 mavlink_system_time_t packet1, packet2;
155 memset(&packet1, 0, sizeof(packet1));
156 packet1.time_unix_usec = packet_in.time_unix_usec;
157 packet1.time_boot_ms = packet_in.time_boot_ms;
160 memset(&packet2, 0, sizeof(packet2));
161 mavlink_msg_system_time_encode(system_id, component_id, &msg, &packet1);
162 mavlink_msg_system_time_decode(&msg, &packet2);
163 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
165 memset(&packet2, 0, sizeof(packet2));
166 mavlink_msg_system_time_pack(system_id, component_id, &msg, packet1.time_unix_usec, packet1.time_boot_ms);
167 mavlink_msg_system_time_decode(&msg, &packet2);
168 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
170 memset(&packet2, 0, sizeof(packet2));
171 mavlink_msg_system_time_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_unix_usec, packet1.time_boot_ms);
172 mavlink_msg_system_time_decode(&msg, &packet2);
173 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
175 memset(&packet2, 0, sizeof(packet2));
176 mavlink_msg_to_send_buffer(buffer, &msg);
177 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
178 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
180 mavlink_msg_system_time_decode(last_msg, &packet2);
181 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
183 memset(&packet2, 0, sizeof(packet2));
184 mavlink_msg_system_time_send(MAVLINK_COMM_1, packet1.time_unix_usec, packet1.time_boot_ms);
185 mavlink_msg_system_time_decode(last_msg, &packet2);
186 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
189 static void mavlink_test_ping(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
191 mavlink_message_t msg;
192 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
193 uint16_t i;
194 mavlink_ping_t packet_in = {
195 93372036854775807ULL,
196 963497880,
198 108,
200 mavlink_ping_t packet1, packet2;
202 memset(&packet1, 0, sizeof(packet1));
203 packet1.time_usec = packet_in.time_usec;
204 packet1.seq = packet_in.seq;
205 packet1.target_system = packet_in.target_system;
206 packet1.target_component = packet_in.target_component;
209 memset(&packet2, 0, sizeof(packet2));
210 mavlink_msg_ping_encode(system_id, component_id, &msg, &packet1);
211 mavlink_msg_ping_decode(&msg, &packet2);
212 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
214 memset(&packet2, 0, sizeof(packet2));
215 mavlink_msg_ping_pack(system_id, component_id, &msg, packet1.time_usec, packet1.seq, packet1.target_system, packet1.target_component);
216 mavlink_msg_ping_decode(&msg, &packet2);
217 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
219 memset(&packet2, 0, sizeof(packet2));
220 mavlink_msg_ping_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_usec, packet1.seq, packet1.target_system, packet1.target_component);
221 mavlink_msg_ping_decode(&msg, &packet2);
222 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
224 memset(&packet2, 0, sizeof(packet2));
225 mavlink_msg_to_send_buffer(buffer, &msg);
226 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
227 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
229 mavlink_msg_ping_decode(last_msg, &packet2);
230 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
232 memset(&packet2, 0, sizeof(packet2));
233 mavlink_msg_ping_send(MAVLINK_COMM_1, packet1.time_usec, packet1.seq, packet1.target_system, packet1.target_component);
234 mavlink_msg_ping_decode(last_msg, &packet2);
235 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
238 static void mavlink_test_change_operator_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
240 mavlink_message_t msg;
241 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
242 uint16_t i;
243 mavlink_change_operator_control_t packet_in = {
246 139,
247 "DEFGHIJKLMNOPQRSTUVWXYZA",
249 mavlink_change_operator_control_t packet1, packet2;
251 memset(&packet1, 0, sizeof(packet1));
252 packet1.target_system = packet_in.target_system;
253 packet1.control_request = packet_in.control_request;
254 packet1.version = packet_in.version;
256 mav_array_memcpy(packet1.passkey, packet_in.passkey, sizeof(char) * 25);
259 memset(&packet2, 0, sizeof(packet2));
260 mavlink_msg_change_operator_control_encode(system_id, component_id, &msg, &packet1);
261 mavlink_msg_change_operator_control_decode(&msg, &packet2);
262 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
264 memset(&packet2, 0, sizeof(packet2));
265 mavlink_msg_change_operator_control_pack(system_id, component_id, &msg, packet1.target_system, packet1.control_request, packet1.version, packet1.passkey);
266 mavlink_msg_change_operator_control_decode(&msg, &packet2);
267 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
269 memset(&packet2, 0, sizeof(packet2));
270 mavlink_msg_change_operator_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.control_request, packet1.version, packet1.passkey);
271 mavlink_msg_change_operator_control_decode(&msg, &packet2);
272 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
274 memset(&packet2, 0, sizeof(packet2));
275 mavlink_msg_to_send_buffer(buffer, &msg);
276 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
277 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
279 mavlink_msg_change_operator_control_decode(last_msg, &packet2);
280 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
282 memset(&packet2, 0, sizeof(packet2));
283 mavlink_msg_change_operator_control_send(MAVLINK_COMM_1, packet1.target_system, packet1.control_request, packet1.version, packet1.passkey);
284 mavlink_msg_change_operator_control_decode(last_msg, &packet2);
285 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
288 static void mavlink_test_change_operator_control_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
290 mavlink_message_t msg;
291 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
292 uint16_t i;
293 mavlink_change_operator_control_ack_t packet_in = {
296 139,
298 mavlink_change_operator_control_ack_t packet1, packet2;
300 memset(&packet1, 0, sizeof(packet1));
301 packet1.gcs_system_id = packet_in.gcs_system_id;
302 packet1.control_request = packet_in.control_request;
303 packet1.ack = packet_in.ack;
306 memset(&packet2, 0, sizeof(packet2));
307 mavlink_msg_change_operator_control_ack_encode(system_id, component_id, &msg, &packet1);
308 mavlink_msg_change_operator_control_ack_decode(&msg, &packet2);
309 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
311 memset(&packet2, 0, sizeof(packet2));
312 mavlink_msg_change_operator_control_ack_pack(system_id, component_id, &msg, packet1.gcs_system_id, packet1.control_request, packet1.ack);
313 mavlink_msg_change_operator_control_ack_decode(&msg, &packet2);
314 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
316 memset(&packet2, 0, sizeof(packet2));
317 mavlink_msg_change_operator_control_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.gcs_system_id, packet1.control_request, packet1.ack);
318 mavlink_msg_change_operator_control_ack_decode(&msg, &packet2);
319 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
321 memset(&packet2, 0, sizeof(packet2));
322 mavlink_msg_to_send_buffer(buffer, &msg);
323 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
324 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
326 mavlink_msg_change_operator_control_ack_decode(last_msg, &packet2);
327 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
329 memset(&packet2, 0, sizeof(packet2));
330 mavlink_msg_change_operator_control_ack_send(MAVLINK_COMM_1, packet1.gcs_system_id, packet1.control_request, packet1.ack);
331 mavlink_msg_change_operator_control_ack_decode(last_msg, &packet2);
332 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
335 static void mavlink_test_auth_key(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
337 mavlink_message_t msg;
338 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
339 uint16_t i;
340 mavlink_auth_key_t packet_in = {
341 "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDE",
343 mavlink_auth_key_t packet1, packet2;
345 memset(&packet1, 0, sizeof(packet1));
347 mav_array_memcpy(packet1.key, packet_in.key, sizeof(char) * 32);
350 memset(&packet2, 0, sizeof(packet2));
351 mavlink_msg_auth_key_encode(system_id, component_id, &msg, &packet1);
352 mavlink_msg_auth_key_decode(&msg, &packet2);
353 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
355 memset(&packet2, 0, sizeof(packet2));
356 mavlink_msg_auth_key_pack(system_id, component_id, &msg, packet1.key);
357 mavlink_msg_auth_key_decode(&msg, &packet2);
358 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
360 memset(&packet2, 0, sizeof(packet2));
361 mavlink_msg_auth_key_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.key);
362 mavlink_msg_auth_key_decode(&msg, &packet2);
363 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
365 memset(&packet2, 0, sizeof(packet2));
366 mavlink_msg_to_send_buffer(buffer, &msg);
367 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
368 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
370 mavlink_msg_auth_key_decode(last_msg, &packet2);
371 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
373 memset(&packet2, 0, sizeof(packet2));
374 mavlink_msg_auth_key_send(MAVLINK_COMM_1, packet1.key);
375 mavlink_msg_auth_key_decode(last_msg, &packet2);
376 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
379 static void mavlink_test_set_mode(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
381 mavlink_message_t msg;
382 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
383 uint16_t i;
384 mavlink_set_mode_t packet_in = {
385 963497464,
389 mavlink_set_mode_t packet1, packet2;
391 memset(&packet1, 0, sizeof(packet1));
392 packet1.custom_mode = packet_in.custom_mode;
393 packet1.target_system = packet_in.target_system;
394 packet1.base_mode = packet_in.base_mode;
397 memset(&packet2, 0, sizeof(packet2));
398 mavlink_msg_set_mode_encode(system_id, component_id, &msg, &packet1);
399 mavlink_msg_set_mode_decode(&msg, &packet2);
400 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
402 memset(&packet2, 0, sizeof(packet2));
403 mavlink_msg_set_mode_pack(system_id, component_id, &msg, packet1.target_system, packet1.base_mode, packet1.custom_mode);
404 mavlink_msg_set_mode_decode(&msg, &packet2);
405 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
407 memset(&packet2, 0, sizeof(packet2));
408 mavlink_msg_set_mode_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.base_mode, packet1.custom_mode);
409 mavlink_msg_set_mode_decode(&msg, &packet2);
410 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
412 memset(&packet2, 0, sizeof(packet2));
413 mavlink_msg_to_send_buffer(buffer, &msg);
414 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
415 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
417 mavlink_msg_set_mode_decode(last_msg, &packet2);
418 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
420 memset(&packet2, 0, sizeof(packet2));
421 mavlink_msg_set_mode_send(MAVLINK_COMM_1, packet1.target_system, packet1.base_mode, packet1.custom_mode);
422 mavlink_msg_set_mode_decode(last_msg, &packet2);
423 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
426 static void mavlink_test_param_request_read(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
428 mavlink_message_t msg;
429 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
430 uint16_t i;
431 mavlink_param_request_read_t packet_in = {
432 17235,
433 139,
434 206,
435 "EFGHIJKLMNOPQRS",
437 mavlink_param_request_read_t packet1, packet2;
439 memset(&packet1, 0, sizeof(packet1));
440 packet1.param_index = packet_in.param_index;
441 packet1.target_system = packet_in.target_system;
442 packet1.target_component = packet_in.target_component;
444 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char) * 16);
447 memset(&packet2, 0, sizeof(packet2));
448 mavlink_msg_param_request_read_encode(system_id, component_id, &msg, &packet1);
449 mavlink_msg_param_request_read_decode(&msg, &packet2);
450 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
452 memset(&packet2, 0, sizeof(packet2));
453 mavlink_msg_param_request_read_pack(system_id, component_id, &msg, packet1.target_system, packet1.target_component, packet1.param_id, packet1.param_index);
454 mavlink_msg_param_request_read_decode(&msg, &packet2);
455 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
457 memset(&packet2, 0, sizeof(packet2));
458 mavlink_msg_param_request_read_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.target_component, packet1.param_id, packet1.param_index);
459 mavlink_msg_param_request_read_decode(&msg, &packet2);
460 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
462 memset(&packet2, 0, sizeof(packet2));
463 mavlink_msg_to_send_buffer(buffer, &msg);
464 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
465 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
467 mavlink_msg_param_request_read_decode(last_msg, &packet2);
468 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
470 memset(&packet2, 0, sizeof(packet2));
471 mavlink_msg_param_request_read_send(MAVLINK_COMM_1, packet1.target_system, packet1.target_component, packet1.param_id, packet1.param_index);
472 mavlink_msg_param_request_read_decode(last_msg, &packet2);
473 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
476 static void mavlink_test_param_request_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
478 mavlink_message_t msg;
479 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
480 uint16_t i;
481 mavlink_param_request_list_t packet_in = {
485 mavlink_param_request_list_t packet1, packet2;
487 memset(&packet1, 0, sizeof(packet1));
488 packet1.target_system = packet_in.target_system;
489 packet1.target_component = packet_in.target_component;
492 memset(&packet2, 0, sizeof(packet2));
493 mavlink_msg_param_request_list_encode(system_id, component_id, &msg, &packet1);
494 mavlink_msg_param_request_list_decode(&msg, &packet2);
495 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
497 memset(&packet2, 0, sizeof(packet2));
498 mavlink_msg_param_request_list_pack(system_id, component_id, &msg, packet1.target_system, packet1.target_component);
499 mavlink_msg_param_request_list_decode(&msg, &packet2);
500 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
502 memset(&packet2, 0, sizeof(packet2));
503 mavlink_msg_param_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.target_component);
504 mavlink_msg_param_request_list_decode(&msg, &packet2);
505 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
507 memset(&packet2, 0, sizeof(packet2));
508 mavlink_msg_to_send_buffer(buffer, &msg);
509 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
510 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
512 mavlink_msg_param_request_list_decode(last_msg, &packet2);
513 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
515 memset(&packet2, 0, sizeof(packet2));
516 mavlink_msg_param_request_list_send(MAVLINK_COMM_1, packet1.target_system, packet1.target_component);
517 mavlink_msg_param_request_list_decode(last_msg, &packet2);
518 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
521 static void mavlink_test_param_value(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
523 mavlink_message_t msg;
524 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
525 uint16_t i;
526 mavlink_param_value_t packet_in = {
527 17.0,
528 17443,
529 17547,
530 "IJKLMNOPQRSTUVW",
533 mavlink_param_value_t packet1, packet2;
535 memset(&packet1, 0, sizeof(packet1));
536 packet1.param_value = packet_in.param_value;
537 packet1.param_count = packet_in.param_count;
538 packet1.param_index = packet_in.param_index;
539 packet1.param_type = packet_in.param_type;
541 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char) * 16);
544 memset(&packet2, 0, sizeof(packet2));
545 mavlink_msg_param_value_encode(system_id, component_id, &msg, &packet1);
546 mavlink_msg_param_value_decode(&msg, &packet2);
547 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
549 memset(&packet2, 0, sizeof(packet2));
550 mavlink_msg_param_value_pack(system_id, component_id, &msg, packet1.param_id, packet1.param_value, packet1.param_type, packet1.param_count, packet1.param_index);
551 mavlink_msg_param_value_decode(&msg, &packet2);
552 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
554 memset(&packet2, 0, sizeof(packet2));
555 mavlink_msg_param_value_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.param_id, packet1.param_value, packet1.param_type, packet1.param_count, packet1.param_index);
556 mavlink_msg_param_value_decode(&msg, &packet2);
557 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
559 memset(&packet2, 0, sizeof(packet2));
560 mavlink_msg_to_send_buffer(buffer, &msg);
561 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
562 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
564 mavlink_msg_param_value_decode(last_msg, &packet2);
565 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
567 memset(&packet2, 0, sizeof(packet2));
568 mavlink_msg_param_value_send(MAVLINK_COMM_1, packet1.param_id, packet1.param_value, packet1.param_type, packet1.param_count, packet1.param_index);
569 mavlink_msg_param_value_decode(last_msg, &packet2);
570 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
573 static void mavlink_test_param_set(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
575 mavlink_message_t msg;
576 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
577 uint16_t i;
578 mavlink_param_set_t packet_in = {
579 17.0,
582 "GHIJKLMNOPQRSTU",
583 199,
585 mavlink_param_set_t packet1, packet2;
587 memset(&packet1, 0, sizeof(packet1));
588 packet1.param_value = packet_in.param_value;
589 packet1.target_system = packet_in.target_system;
590 packet1.target_component = packet_in.target_component;
591 packet1.param_type = packet_in.param_type;
593 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char) * 16);
596 memset(&packet2, 0, sizeof(packet2));
597 mavlink_msg_param_set_encode(system_id, component_id, &msg, &packet1);
598 mavlink_msg_param_set_decode(&msg, &packet2);
599 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
601 memset(&packet2, 0, sizeof(packet2));
602 mavlink_msg_param_set_pack(system_id, component_id, &msg, packet1.target_system, packet1.target_component, packet1.param_id, packet1.param_value, packet1.param_type);
603 mavlink_msg_param_set_decode(&msg, &packet2);
604 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
606 memset(&packet2, 0, sizeof(packet2));
607 mavlink_msg_param_set_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.target_component, packet1.param_id, packet1.param_value, packet1.param_type);
608 mavlink_msg_param_set_decode(&msg, &packet2);
609 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
611 memset(&packet2, 0, sizeof(packet2));
612 mavlink_msg_to_send_buffer(buffer, &msg);
613 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
614 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
616 mavlink_msg_param_set_decode(last_msg, &packet2);
617 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
619 memset(&packet2, 0, sizeof(packet2));
620 mavlink_msg_param_set_send(MAVLINK_COMM_1, packet1.target_system, packet1.target_component, packet1.param_id, packet1.param_value, packet1.param_type);
621 mavlink_msg_param_set_decode(last_msg, &packet2);
622 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
625 static void mavlink_test_gps_raw_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
627 mavlink_message_t msg;
628 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
629 uint16_t i;
630 mavlink_gps_raw_int_t packet_in = {
631 93372036854775807ULL,
632 963497880,
633 963498088,
634 963498296,
635 18275,
636 18379,
637 18483,
638 18587,
640 156,
642 mavlink_gps_raw_int_t packet1, packet2;
644 memset(&packet1, 0, sizeof(packet1));
645 packet1.time_usec = packet_in.time_usec;
646 packet1.lat = packet_in.lat;
647 packet1.lon = packet_in.lon;
648 packet1.alt = packet_in.alt;
649 packet1.eph = packet_in.eph;
650 packet1.epv = packet_in.epv;
651 packet1.vel = packet_in.vel;
652 packet1.cog = packet_in.cog;
653 packet1.fix_type = packet_in.fix_type;
654 packet1.satellites_visible = packet_in.satellites_visible;
657 memset(&packet2, 0, sizeof(packet2));
658 mavlink_msg_gps_raw_int_encode(system_id, component_id, &msg, &packet1);
659 mavlink_msg_gps_raw_int_decode(&msg, &packet2);
660 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
662 memset(&packet2, 0, sizeof(packet2));
663 mavlink_msg_gps_raw_int_pack(system_id, component_id, &msg, packet1.time_usec, packet1.fix_type, packet1.lat, packet1.lon, packet1.alt, packet1.eph, packet1.epv, packet1.vel, packet1.cog, packet1.satellites_visible);
664 mavlink_msg_gps_raw_int_decode(&msg, &packet2);
665 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
667 memset(&packet2, 0, sizeof(packet2));
668 mavlink_msg_gps_raw_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_usec, packet1.fix_type, packet1.lat, packet1.lon, packet1.alt, packet1.eph, packet1.epv, packet1.vel, packet1.cog, packet1.satellites_visible);
669 mavlink_msg_gps_raw_int_decode(&msg, &packet2);
670 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
672 memset(&packet2, 0, sizeof(packet2));
673 mavlink_msg_to_send_buffer(buffer, &msg);
674 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
675 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
677 mavlink_msg_gps_raw_int_decode(last_msg, &packet2);
678 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
680 memset(&packet2, 0, sizeof(packet2));
681 mavlink_msg_gps_raw_int_send(MAVLINK_COMM_1, packet1.time_usec, packet1.fix_type, packet1.lat, packet1.lon, packet1.alt, packet1.eph, packet1.epv, packet1.vel, packet1.cog, packet1.satellites_visible);
682 mavlink_msg_gps_raw_int_decode(last_msg, &packet2);
683 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
686 static void mavlink_test_gps_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
688 mavlink_message_t msg;
689 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
690 uint16_t i;
691 mavlink_gps_status_t packet_in = {
693 { 72,73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91 },
694 { 132,133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151 },
695 { 192,193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211 },
696 { 252,253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
697 { 56,57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75 },
699 mavlink_gps_status_t packet1, packet2;
701 memset(&packet1, 0, sizeof(packet1));
702 packet1.satellites_visible = packet_in.satellites_visible;
704 mav_array_memcpy(packet1.satellite_prn, packet_in.satellite_prn, sizeof(uint8_t) * 20);
705 mav_array_memcpy(packet1.satellite_used, packet_in.satellite_used, sizeof(uint8_t) * 20);
706 mav_array_memcpy(packet1.satellite_elevation, packet_in.satellite_elevation, sizeof(uint8_t) * 20);
707 mav_array_memcpy(packet1.satellite_azimuth, packet_in.satellite_azimuth, sizeof(uint8_t) * 20);
708 mav_array_memcpy(packet1.satellite_snr, packet_in.satellite_snr, sizeof(uint8_t) * 20);
711 memset(&packet2, 0, sizeof(packet2));
712 mavlink_msg_gps_status_encode(system_id, component_id, &msg, &packet1);
713 mavlink_msg_gps_status_decode(&msg, &packet2);
714 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
716 memset(&packet2, 0, sizeof(packet2));
717 mavlink_msg_gps_status_pack(system_id, component_id, &msg, packet1.satellites_visible, packet1.satellite_prn, packet1.satellite_used, packet1.satellite_elevation, packet1.satellite_azimuth, packet1.satellite_snr);
718 mavlink_msg_gps_status_decode(&msg, &packet2);
719 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
721 memset(&packet2, 0, sizeof(packet2));
722 mavlink_msg_gps_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.satellites_visible, packet1.satellite_prn, packet1.satellite_used, packet1.satellite_elevation, packet1.satellite_azimuth, packet1.satellite_snr);
723 mavlink_msg_gps_status_decode(&msg, &packet2);
724 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
726 memset(&packet2, 0, sizeof(packet2));
727 mavlink_msg_to_send_buffer(buffer, &msg);
728 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
729 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
731 mavlink_msg_gps_status_decode(last_msg, &packet2);
732 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
734 memset(&packet2, 0, sizeof(packet2));
735 mavlink_msg_gps_status_send(MAVLINK_COMM_1, packet1.satellites_visible, packet1.satellite_prn, packet1.satellite_used, packet1.satellite_elevation, packet1.satellite_azimuth, packet1.satellite_snr);
736 mavlink_msg_gps_status_decode(last_msg, &packet2);
737 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
740 static void mavlink_test_scaled_imu(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
742 mavlink_message_t msg;
743 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
744 uint16_t i;
745 mavlink_scaled_imu_t packet_in = {
746 963497464,
747 17443,
748 17547,
749 17651,
750 17755,
751 17859,
752 17963,
753 18067,
754 18171,
755 18275,
757 mavlink_scaled_imu_t packet1, packet2;
759 memset(&packet1, 0, sizeof(packet1));
760 packet1.time_boot_ms = packet_in.time_boot_ms;
761 packet1.xacc = packet_in.xacc;
762 packet1.yacc = packet_in.yacc;
763 packet1.zacc = packet_in.zacc;
764 packet1.xgyro = packet_in.xgyro;
765 packet1.ygyro = packet_in.ygyro;
766 packet1.zgyro = packet_in.zgyro;
767 packet1.xmag = packet_in.xmag;
768 packet1.ymag = packet_in.ymag;
769 packet1.zmag = packet_in.zmag;
772 memset(&packet2, 0, sizeof(packet2));
773 mavlink_msg_scaled_imu_encode(system_id, component_id, &msg, &packet1);
774 mavlink_msg_scaled_imu_decode(&msg, &packet2);
775 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
777 memset(&packet2, 0, sizeof(packet2));
778 mavlink_msg_scaled_imu_pack(system_id, component_id, &msg, packet1.time_boot_ms, packet1.xacc, packet1.yacc, packet1.zacc, packet1.xgyro, packet1.ygyro, packet1.zgyro, packet1.xmag, packet1.ymag, packet1.zmag);
779 mavlink_msg_scaled_imu_decode(&msg, &packet2);
780 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
782 memset(&packet2, 0, sizeof(packet2));
783 mavlink_msg_scaled_imu_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_boot_ms, packet1.xacc, packet1.yacc, packet1.zacc, packet1.xgyro, packet1.ygyro, packet1.zgyro, packet1.xmag, packet1.ymag, packet1.zmag);
784 mavlink_msg_scaled_imu_decode(&msg, &packet2);
785 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
787 memset(&packet2, 0, sizeof(packet2));
788 mavlink_msg_to_send_buffer(buffer, &msg);
789 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
790 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
792 mavlink_msg_scaled_imu_decode(last_msg, &packet2);
793 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
795 memset(&packet2, 0, sizeof(packet2));
796 mavlink_msg_scaled_imu_send(MAVLINK_COMM_1, packet1.time_boot_ms, packet1.xacc, packet1.yacc, packet1.zacc, packet1.xgyro, packet1.ygyro, packet1.zgyro, packet1.xmag, packet1.ymag, packet1.zmag);
797 mavlink_msg_scaled_imu_decode(last_msg, &packet2);
798 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
801 static void mavlink_test_raw_imu(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
803 mavlink_message_t msg;
804 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
805 uint16_t i;
806 mavlink_raw_imu_t packet_in = {
807 93372036854775807ULL,
808 17651,
809 17755,
810 17859,
811 17963,
812 18067,
813 18171,
814 18275,
815 18379,
816 18483,
818 mavlink_raw_imu_t packet1, packet2;
820 memset(&packet1, 0, sizeof(packet1));
821 packet1.time_usec = packet_in.time_usec;
822 packet1.xacc = packet_in.xacc;
823 packet1.yacc = packet_in.yacc;
824 packet1.zacc = packet_in.zacc;
825 packet1.xgyro = packet_in.xgyro;
826 packet1.ygyro = packet_in.ygyro;
827 packet1.zgyro = packet_in.zgyro;
828 packet1.xmag = packet_in.xmag;
829 packet1.ymag = packet_in.ymag;
830 packet1.zmag = packet_in.zmag;
833 memset(&packet2, 0, sizeof(packet2));
834 mavlink_msg_raw_imu_encode(system_id, component_id, &msg, &packet1);
835 mavlink_msg_raw_imu_decode(&msg, &packet2);
836 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
838 memset(&packet2, 0, sizeof(packet2));
839 mavlink_msg_raw_imu_pack(system_id, component_id, &msg, packet1.time_usec, packet1.xacc, packet1.yacc, packet1.zacc, packet1.xgyro, packet1.ygyro, packet1.zgyro, packet1.xmag, packet1.ymag, packet1.zmag);
840 mavlink_msg_raw_imu_decode(&msg, &packet2);
841 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
843 memset(&packet2, 0, sizeof(packet2));
844 mavlink_msg_raw_imu_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_usec, packet1.xacc, packet1.yacc, packet1.zacc, packet1.xgyro, packet1.ygyro, packet1.zgyro, packet1.xmag, packet1.ymag, packet1.zmag);
845 mavlink_msg_raw_imu_decode(&msg, &packet2);
846 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
848 memset(&packet2, 0, sizeof(packet2));
849 mavlink_msg_to_send_buffer(buffer, &msg);
850 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
851 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
853 mavlink_msg_raw_imu_decode(last_msg, &packet2);
854 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
856 memset(&packet2, 0, sizeof(packet2));
857 mavlink_msg_raw_imu_send(MAVLINK_COMM_1, packet1.time_usec, packet1.xacc, packet1.yacc, packet1.zacc, packet1.xgyro, packet1.ygyro, packet1.zgyro, packet1.xmag, packet1.ymag, packet1.zmag);
858 mavlink_msg_raw_imu_decode(last_msg, &packet2);
859 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
862 static void mavlink_test_raw_pressure(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
864 mavlink_message_t msg;
865 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
866 uint16_t i;
867 mavlink_raw_pressure_t packet_in = {
868 93372036854775807ULL,
869 17651,
870 17755,
871 17859,
872 17963,
874 mavlink_raw_pressure_t packet1, packet2;
876 memset(&packet1, 0, sizeof(packet1));
877 packet1.time_usec = packet_in.time_usec;
878 packet1.press_abs = packet_in.press_abs;
879 packet1.press_diff1 = packet_in.press_diff1;
880 packet1.press_diff2 = packet_in.press_diff2;
881 packet1.temperature = packet_in.temperature;
884 memset(&packet2, 0, sizeof(packet2));
885 mavlink_msg_raw_pressure_encode(system_id, component_id, &msg, &packet1);
886 mavlink_msg_raw_pressure_decode(&msg, &packet2);
887 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
889 memset(&packet2, 0, sizeof(packet2));
890 mavlink_msg_raw_pressure_pack(system_id, component_id, &msg, packet1.time_usec, packet1.press_abs, packet1.press_diff1, packet1.press_diff2, packet1.temperature);
891 mavlink_msg_raw_pressure_decode(&msg, &packet2);
892 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
894 memset(&packet2, 0, sizeof(packet2));
895 mavlink_msg_raw_pressure_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_usec, packet1.press_abs, packet1.press_diff1, packet1.press_diff2, packet1.temperature);
896 mavlink_msg_raw_pressure_decode(&msg, &packet2);
897 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
899 memset(&packet2, 0, sizeof(packet2));
900 mavlink_msg_to_send_buffer(buffer, &msg);
901 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
902 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
904 mavlink_msg_raw_pressure_decode(last_msg, &packet2);
905 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
907 memset(&packet2, 0, sizeof(packet2));
908 mavlink_msg_raw_pressure_send(MAVLINK_COMM_1, packet1.time_usec, packet1.press_abs, packet1.press_diff1, packet1.press_diff2, packet1.temperature);
909 mavlink_msg_raw_pressure_decode(last_msg, &packet2);
910 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
913 static void mavlink_test_scaled_pressure(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
915 mavlink_message_t msg;
916 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
917 uint16_t i;
918 mavlink_scaled_pressure_t packet_in = {
919 963497464,
920 45.0,
921 73.0,
922 17859,
924 mavlink_scaled_pressure_t packet1, packet2;
926 memset(&packet1, 0, sizeof(packet1));
927 packet1.time_boot_ms = packet_in.time_boot_ms;
928 packet1.press_abs = packet_in.press_abs;
929 packet1.press_diff = packet_in.press_diff;
930 packet1.temperature = packet_in.temperature;
933 memset(&packet2, 0, sizeof(packet2));
934 mavlink_msg_scaled_pressure_encode(system_id, component_id, &msg, &packet1);
935 mavlink_msg_scaled_pressure_decode(&msg, &packet2);
936 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
938 memset(&packet2, 0, sizeof(packet2));
939 mavlink_msg_scaled_pressure_pack(system_id, component_id, &msg, packet1.time_boot_ms, packet1.press_abs, packet1.press_diff, packet1.temperature);
940 mavlink_msg_scaled_pressure_decode(&msg, &packet2);
941 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
943 memset(&packet2, 0, sizeof(packet2));
944 mavlink_msg_scaled_pressure_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_boot_ms, packet1.press_abs, packet1.press_diff, packet1.temperature);
945 mavlink_msg_scaled_pressure_decode(&msg, &packet2);
946 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
948 memset(&packet2, 0, sizeof(packet2));
949 mavlink_msg_to_send_buffer(buffer, &msg);
950 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
951 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
953 mavlink_msg_scaled_pressure_decode(last_msg, &packet2);
954 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
956 memset(&packet2, 0, sizeof(packet2));
957 mavlink_msg_scaled_pressure_send(MAVLINK_COMM_1, packet1.time_boot_ms, packet1.press_abs, packet1.press_diff, packet1.temperature);
958 mavlink_msg_scaled_pressure_decode(last_msg, &packet2);
959 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
962 static void mavlink_test_attitude(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
964 mavlink_message_t msg;
965 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
966 uint16_t i;
967 mavlink_attitude_t packet_in = {
968 963497464,
969 45.0,
970 73.0,
971 101.0,
972 129.0,
973 157.0,
974 185.0,
976 mavlink_attitude_t packet1, packet2;
978 memset(&packet1, 0, sizeof(packet1));
979 packet1.time_boot_ms = packet_in.time_boot_ms;
980 packet1.roll = packet_in.roll;
981 packet1.pitch = packet_in.pitch;
982 packet1.yaw = packet_in.yaw;
983 packet1.rollspeed = packet_in.rollspeed;
984 packet1.pitchspeed = packet_in.pitchspeed;
985 packet1.yawspeed = packet_in.yawspeed;
988 memset(&packet2, 0, sizeof(packet2));
989 mavlink_msg_attitude_encode(system_id, component_id, &msg, &packet1);
990 mavlink_msg_attitude_decode(&msg, &packet2);
991 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
993 memset(&packet2, 0, sizeof(packet2));
994 mavlink_msg_attitude_pack(system_id, component_id, &msg, packet1.time_boot_ms, packet1.roll, packet1.pitch, packet1.yaw, packet1.rollspeed, packet1.pitchspeed, packet1.yawspeed);
995 mavlink_msg_attitude_decode(&msg, &packet2);
996 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
998 memset(&packet2, 0, sizeof(packet2));
999 mavlink_msg_attitude_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_boot_ms, packet1.roll, packet1.pitch, packet1.yaw, packet1.rollspeed, packet1.pitchspeed, packet1.yawspeed);
1000 mavlink_msg_attitude_decode(&msg, &packet2);
1001 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1003 memset(&packet2, 0, sizeof(packet2));
1004 mavlink_msg_to_send_buffer(buffer, &msg);
1005 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
1006 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1008 mavlink_msg_attitude_decode(last_msg, &packet2);
1009 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1011 memset(&packet2, 0, sizeof(packet2));
1012 mavlink_msg_attitude_send(MAVLINK_COMM_1, packet1.time_boot_ms, packet1.roll, packet1.pitch, packet1.yaw, packet1.rollspeed, packet1.pitchspeed, packet1.yawspeed);
1013 mavlink_msg_attitude_decode(last_msg, &packet2);
1014 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1017 static void mavlink_test_attitude_quaternion(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1019 mavlink_message_t msg;
1020 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1021 uint16_t i;
1022 mavlink_attitude_quaternion_t packet_in = {
1023 963497464,
1024 45.0,
1025 73.0,
1026 101.0,
1027 129.0,
1028 157.0,
1029 185.0,
1030 213.0,
1032 mavlink_attitude_quaternion_t packet1, packet2;
1034 memset(&packet1, 0, sizeof(packet1));
1035 packet1.time_boot_ms = packet_in.time_boot_ms;
1036 packet1.q1 = packet_in.q1;
1037 packet1.q2 = packet_in.q2;
1038 packet1.q3 = packet_in.q3;
1039 packet1.q4 = packet_in.q4;
1040 packet1.rollspeed = packet_in.rollspeed;
1041 packet1.pitchspeed = packet_in.pitchspeed;
1042 packet1.yawspeed = packet_in.yawspeed;
1045 memset(&packet2, 0, sizeof(packet2));
1046 mavlink_msg_attitude_quaternion_encode(system_id, component_id, &msg, &packet1);
1047 mavlink_msg_attitude_quaternion_decode(&msg, &packet2);
1048 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1050 memset(&packet2, 0, sizeof(packet2));
1051 mavlink_msg_attitude_quaternion_pack(system_id, component_id, &msg, packet1.time_boot_ms, packet1.q1, packet1.q2, packet1.q3, packet1.q4, packet1.rollspeed, packet1.pitchspeed, packet1.yawspeed);
1052 mavlink_msg_attitude_quaternion_decode(&msg, &packet2);
1053 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1055 memset(&packet2, 0, sizeof(packet2));
1056 mavlink_msg_attitude_quaternion_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_boot_ms, packet1.q1, packet1.q2, packet1.q3, packet1.q4, packet1.rollspeed, packet1.pitchspeed, packet1.yawspeed);
1057 mavlink_msg_attitude_quaternion_decode(&msg, &packet2);
1058 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1060 memset(&packet2, 0, sizeof(packet2));
1061 mavlink_msg_to_send_buffer(buffer, &msg);
1062 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
1063 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1065 mavlink_msg_attitude_quaternion_decode(last_msg, &packet2);
1066 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1068 memset(&packet2, 0, sizeof(packet2));
1069 mavlink_msg_attitude_quaternion_send(MAVLINK_COMM_1, packet1.time_boot_ms, packet1.q1, packet1.q2, packet1.q3, packet1.q4, packet1.rollspeed, packet1.pitchspeed, packet1.yawspeed);
1070 mavlink_msg_attitude_quaternion_decode(last_msg, &packet2);
1071 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1074 static void mavlink_test_local_position_ned(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1076 mavlink_message_t msg;
1077 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1078 uint16_t i;
1079 mavlink_local_position_ned_t packet_in = {
1080 963497464,
1081 45.0,
1082 73.0,
1083 101.0,
1084 129.0,
1085 157.0,
1086 185.0,
1088 mavlink_local_position_ned_t packet1, packet2;
1090 memset(&packet1, 0, sizeof(packet1));
1091 packet1.time_boot_ms = packet_in.time_boot_ms;
1092 packet1.x = packet_in.x;
1093 packet1.y = packet_in.y;
1094 packet1.z = packet_in.z;
1095 packet1.vx = packet_in.vx;
1096 packet1.vy = packet_in.vy;
1097 packet1.vz = packet_in.vz;
1100 memset(&packet2, 0, sizeof(packet2));
1101 mavlink_msg_local_position_ned_encode(system_id, component_id, &msg, &packet1);
1102 mavlink_msg_local_position_ned_decode(&msg, &packet2);
1103 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1105 memset(&packet2, 0, sizeof(packet2));
1106 mavlink_msg_local_position_ned_pack(system_id, component_id, &msg, packet1.time_boot_ms, packet1.x, packet1.y, packet1.z, packet1.vx, packet1.vy, packet1.vz);
1107 mavlink_msg_local_position_ned_decode(&msg, &packet2);
1108 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1110 memset(&packet2, 0, sizeof(packet2));
1111 mavlink_msg_local_position_ned_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_boot_ms, packet1.x, packet1.y, packet1.z, packet1.vx, packet1.vy, packet1.vz);
1112 mavlink_msg_local_position_ned_decode(&msg, &packet2);
1113 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1115 memset(&packet2, 0, sizeof(packet2));
1116 mavlink_msg_to_send_buffer(buffer, &msg);
1117 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
1118 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1120 mavlink_msg_local_position_ned_decode(last_msg, &packet2);
1121 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1123 memset(&packet2, 0, sizeof(packet2));
1124 mavlink_msg_local_position_ned_send(MAVLINK_COMM_1, packet1.time_boot_ms, packet1.x, packet1.y, packet1.z, packet1.vx, packet1.vy, packet1.vz);
1125 mavlink_msg_local_position_ned_decode(last_msg, &packet2);
1126 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1129 static void mavlink_test_global_position_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1131 mavlink_message_t msg;
1132 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1133 uint16_t i;
1134 mavlink_global_position_int_t packet_in = {
1135 963497464,
1136 963497672,
1137 963497880,
1138 963498088,
1139 963498296,
1140 18275,
1141 18379,
1142 18483,
1143 18587,
1145 mavlink_global_position_int_t packet1, packet2;
1147 memset(&packet1, 0, sizeof(packet1));
1148 packet1.time_boot_ms = packet_in.time_boot_ms;
1149 packet1.lat = packet_in.lat;
1150 packet1.lon = packet_in.lon;
1151 packet1.alt = packet_in.alt;
1152 packet1.relative_alt = packet_in.relative_alt;
1153 packet1.vx = packet_in.vx;
1154 packet1.vy = packet_in.vy;
1155 packet1.vz = packet_in.vz;
1156 packet1.hdg = packet_in.hdg;
1159 memset(&packet2, 0, sizeof(packet2));
1160 mavlink_msg_global_position_int_encode(system_id, component_id, &msg, &packet1);
1161 mavlink_msg_global_position_int_decode(&msg, &packet2);
1162 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1164 memset(&packet2, 0, sizeof(packet2));
1165 mavlink_msg_global_position_int_pack(system_id, component_id, &msg, packet1.time_boot_ms, packet1.lat, packet1.lon, packet1.alt, packet1.relative_alt, packet1.vx, packet1.vy, packet1.vz, packet1.hdg);
1166 mavlink_msg_global_position_int_decode(&msg, &packet2);
1167 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1169 memset(&packet2, 0, sizeof(packet2));
1170 mavlink_msg_global_position_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_boot_ms, packet1.lat, packet1.lon, packet1.alt, packet1.relative_alt, packet1.vx, packet1.vy, packet1.vz, packet1.hdg);
1171 mavlink_msg_global_position_int_decode(&msg, &packet2);
1172 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1174 memset(&packet2, 0, sizeof(packet2));
1175 mavlink_msg_to_send_buffer(buffer, &msg);
1176 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
1177 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1179 mavlink_msg_global_position_int_decode(last_msg, &packet2);
1180 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1182 memset(&packet2, 0, sizeof(packet2));
1183 mavlink_msg_global_position_int_send(MAVLINK_COMM_1, packet1.time_boot_ms, packet1.lat, packet1.lon, packet1.alt, packet1.relative_alt, packet1.vx, packet1.vy, packet1.vz, packet1.hdg);
1184 mavlink_msg_global_position_int_decode(last_msg, &packet2);
1185 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1188 static void mavlink_test_rc_channels_scaled(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1190 mavlink_message_t msg;
1191 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1192 uint16_t i;
1193 mavlink_rc_channels_scaled_t packet_in = {
1194 963497464,
1195 17443,
1196 17547,
1197 17651,
1198 17755,
1199 17859,
1200 17963,
1201 18067,
1202 18171,
1204 132,
1206 mavlink_rc_channels_scaled_t packet1, packet2;
1208 memset(&packet1, 0, sizeof(packet1));
1209 packet1.time_boot_ms = packet_in.time_boot_ms;
1210 packet1.chan1_scaled = packet_in.chan1_scaled;
1211 packet1.chan2_scaled = packet_in.chan2_scaled;
1212 packet1.chan3_scaled = packet_in.chan3_scaled;
1213 packet1.chan4_scaled = packet_in.chan4_scaled;
1214 packet1.chan5_scaled = packet_in.chan5_scaled;
1215 packet1.chan6_scaled = packet_in.chan6_scaled;
1216 packet1.chan7_scaled = packet_in.chan7_scaled;
1217 packet1.chan8_scaled = packet_in.chan8_scaled;
1218 packet1.port = packet_in.port;
1219 packet1.rssi = packet_in.rssi;
1222 memset(&packet2, 0, sizeof(packet2));
1223 mavlink_msg_rc_channels_scaled_encode(system_id, component_id, &msg, &packet1);
1224 mavlink_msg_rc_channels_scaled_decode(&msg, &packet2);
1225 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1227 memset(&packet2, 0, sizeof(packet2));
1228 mavlink_msg_rc_channels_scaled_pack(system_id, component_id, &msg, packet1.time_boot_ms, packet1.port, packet1.chan1_scaled, packet1.chan2_scaled, packet1.chan3_scaled, packet1.chan4_scaled, packet1.chan5_scaled, packet1.chan6_scaled, packet1.chan7_scaled, packet1.chan8_scaled, packet1.rssi);
1229 mavlink_msg_rc_channels_scaled_decode(&msg, &packet2);
1230 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1232 memset(&packet2, 0, sizeof(packet2));
1233 mavlink_msg_rc_channels_scaled_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_boot_ms, packet1.port, packet1.chan1_scaled, packet1.chan2_scaled, packet1.chan3_scaled, packet1.chan4_scaled, packet1.chan5_scaled, packet1.chan6_scaled, packet1.chan7_scaled, packet1.chan8_scaled, packet1.rssi);
1234 mavlink_msg_rc_channels_scaled_decode(&msg, &packet2);
1235 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1237 memset(&packet2, 0, sizeof(packet2));
1238 mavlink_msg_to_send_buffer(buffer, &msg);
1239 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
1240 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1242 mavlink_msg_rc_channels_scaled_decode(last_msg, &packet2);
1243 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1245 memset(&packet2, 0, sizeof(packet2));
1246 mavlink_msg_rc_channels_scaled_send(MAVLINK_COMM_1, packet1.time_boot_ms, packet1.port, packet1.chan1_scaled, packet1.chan2_scaled, packet1.chan3_scaled, packet1.chan4_scaled, packet1.chan5_scaled, packet1.chan6_scaled, packet1.chan7_scaled, packet1.chan8_scaled, packet1.rssi);
1247 mavlink_msg_rc_channels_scaled_decode(last_msg, &packet2);
1248 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1251 static void mavlink_test_rc_channels_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1253 mavlink_message_t msg;
1254 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1255 uint16_t i;
1256 mavlink_rc_channels_raw_t packet_in = {
1257 963497464,
1258 17443,
1259 17547,
1260 17651,
1261 17755,
1262 17859,
1263 17963,
1264 18067,
1265 18171,
1267 132,
1269 mavlink_rc_channels_raw_t packet1, packet2;
1271 memset(&packet1, 0, sizeof(packet1));
1272 packet1.time_boot_ms = packet_in.time_boot_ms;
1273 packet1.chan1_raw = packet_in.chan1_raw;
1274 packet1.chan2_raw = packet_in.chan2_raw;
1275 packet1.chan3_raw = packet_in.chan3_raw;
1276 packet1.chan4_raw = packet_in.chan4_raw;
1277 packet1.chan5_raw = packet_in.chan5_raw;
1278 packet1.chan6_raw = packet_in.chan6_raw;
1279 packet1.chan7_raw = packet_in.chan7_raw;
1280 packet1.chan8_raw = packet_in.chan8_raw;
1281 packet1.port = packet_in.port;
1282 packet1.rssi = packet_in.rssi;
1285 memset(&packet2, 0, sizeof(packet2));
1286 mavlink_msg_rc_channels_raw_encode(system_id, component_id, &msg, &packet1);
1287 mavlink_msg_rc_channels_raw_decode(&msg, &packet2);
1288 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1290 memset(&packet2, 0, sizeof(packet2));
1291 mavlink_msg_rc_channels_raw_pack(system_id, component_id, &msg, packet1.time_boot_ms, packet1.port, packet1.chan1_raw, packet1.chan2_raw, packet1.chan3_raw, packet1.chan4_raw, packet1.chan5_raw, packet1.chan6_raw, packet1.chan7_raw, packet1.chan8_raw, packet1.rssi);
1292 mavlink_msg_rc_channels_raw_decode(&msg, &packet2);
1293 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1295 memset(&packet2, 0, sizeof(packet2));
1296 mavlink_msg_rc_channels_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_boot_ms, packet1.port, packet1.chan1_raw, packet1.chan2_raw, packet1.chan3_raw, packet1.chan4_raw, packet1.chan5_raw, packet1.chan6_raw, packet1.chan7_raw, packet1.chan8_raw, packet1.rssi);
1297 mavlink_msg_rc_channels_raw_decode(&msg, &packet2);
1298 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1300 memset(&packet2, 0, sizeof(packet2));
1301 mavlink_msg_to_send_buffer(buffer, &msg);
1302 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
1303 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1305 mavlink_msg_rc_channels_raw_decode(last_msg, &packet2);
1306 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1308 memset(&packet2, 0, sizeof(packet2));
1309 mavlink_msg_rc_channels_raw_send(MAVLINK_COMM_1, packet1.time_boot_ms, packet1.port, packet1.chan1_raw, packet1.chan2_raw, packet1.chan3_raw, packet1.chan4_raw, packet1.chan5_raw, packet1.chan6_raw, packet1.chan7_raw, packet1.chan8_raw, packet1.rssi);
1310 mavlink_msg_rc_channels_raw_decode(last_msg, &packet2);
1311 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1314 static void mavlink_test_servo_output_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1316 mavlink_message_t msg;
1317 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1318 uint16_t i;
1319 mavlink_servo_output_raw_t packet_in = {
1320 963497464,
1321 17443,
1322 17547,
1323 17651,
1324 17755,
1325 17859,
1326 17963,
1327 18067,
1328 18171,
1331 mavlink_servo_output_raw_t packet1, packet2;
1333 memset(&packet1, 0, sizeof(packet1));
1334 packet1.time_usec = packet_in.time_usec;
1335 packet1.servo1_raw = packet_in.servo1_raw;
1336 packet1.servo2_raw = packet_in.servo2_raw;
1337 packet1.servo3_raw = packet_in.servo3_raw;
1338 packet1.servo4_raw = packet_in.servo4_raw;
1339 packet1.servo5_raw = packet_in.servo5_raw;
1340 packet1.servo6_raw = packet_in.servo6_raw;
1341 packet1.servo7_raw = packet_in.servo7_raw;
1342 packet1.servo8_raw = packet_in.servo8_raw;
1343 packet1.port = packet_in.port;
1346 memset(&packet2, 0, sizeof(packet2));
1347 mavlink_msg_servo_output_raw_encode(system_id, component_id, &msg, &packet1);
1348 mavlink_msg_servo_output_raw_decode(&msg, &packet2);
1349 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1351 memset(&packet2, 0, sizeof(packet2));
1352 mavlink_msg_servo_output_raw_pack(system_id, component_id, &msg, packet1.time_usec, packet1.port, packet1.servo1_raw, packet1.servo2_raw, packet1.servo3_raw, packet1.servo4_raw, packet1.servo5_raw, packet1.servo6_raw, packet1.servo7_raw, packet1.servo8_raw);
1353 mavlink_msg_servo_output_raw_decode(&msg, &packet2);
1354 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1356 memset(&packet2, 0, sizeof(packet2));
1357 mavlink_msg_servo_output_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_usec, packet1.port, packet1.servo1_raw, packet1.servo2_raw, packet1.servo3_raw, packet1.servo4_raw, packet1.servo5_raw, packet1.servo6_raw, packet1.servo7_raw, packet1.servo8_raw);
1358 mavlink_msg_servo_output_raw_decode(&msg, &packet2);
1359 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1361 memset(&packet2, 0, sizeof(packet2));
1362 mavlink_msg_to_send_buffer(buffer, &msg);
1363 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
1364 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1366 mavlink_msg_servo_output_raw_decode(last_msg, &packet2);
1367 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1369 memset(&packet2, 0, sizeof(packet2));
1370 mavlink_msg_servo_output_raw_send(MAVLINK_COMM_1, packet1.time_usec, packet1.port, packet1.servo1_raw, packet1.servo2_raw, packet1.servo3_raw, packet1.servo4_raw, packet1.servo5_raw, packet1.servo6_raw, packet1.servo7_raw, packet1.servo8_raw);
1371 mavlink_msg_servo_output_raw_decode(last_msg, &packet2);
1372 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1375 static void mavlink_test_mission_request_partial_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1377 mavlink_message_t msg;
1378 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1379 uint16_t i;
1380 mavlink_mission_request_partial_list_t packet_in = {
1381 17235,
1382 17339,
1386 mavlink_mission_request_partial_list_t packet1, packet2;
1388 memset(&packet1, 0, sizeof(packet1));
1389 packet1.start_index = packet_in.start_index;
1390 packet1.end_index = packet_in.end_index;
1391 packet1.target_system = packet_in.target_system;
1392 packet1.target_component = packet_in.target_component;
1395 memset(&packet2, 0, sizeof(packet2));
1396 mavlink_msg_mission_request_partial_list_encode(system_id, component_id, &msg, &packet1);
1397 mavlink_msg_mission_request_partial_list_decode(&msg, &packet2);
1398 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1400 memset(&packet2, 0, sizeof(packet2));
1401 mavlink_msg_mission_request_partial_list_pack(system_id, component_id, &msg, packet1.target_system, packet1.target_component, packet1.start_index, packet1.end_index);
1402 mavlink_msg_mission_request_partial_list_decode(&msg, &packet2);
1403 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1405 memset(&packet2, 0, sizeof(packet2));
1406 mavlink_msg_mission_request_partial_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.target_component, packet1.start_index, packet1.end_index);
1407 mavlink_msg_mission_request_partial_list_decode(&msg, &packet2);
1408 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1410 memset(&packet2, 0, sizeof(packet2));
1411 mavlink_msg_to_send_buffer(buffer, &msg);
1412 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
1413 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1415 mavlink_msg_mission_request_partial_list_decode(last_msg, &packet2);
1416 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1418 memset(&packet2, 0, sizeof(packet2));
1419 mavlink_msg_mission_request_partial_list_send(MAVLINK_COMM_1, packet1.target_system, packet1.target_component, packet1.start_index, packet1.end_index);
1420 mavlink_msg_mission_request_partial_list_decode(last_msg, &packet2);
1421 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1424 static void mavlink_test_mission_write_partial_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1426 mavlink_message_t msg;
1427 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1428 uint16_t i;
1429 mavlink_mission_write_partial_list_t packet_in = {
1430 17235,
1431 17339,
1435 mavlink_mission_write_partial_list_t packet1, packet2;
1437 memset(&packet1, 0, sizeof(packet1));
1438 packet1.start_index = packet_in.start_index;
1439 packet1.end_index = packet_in.end_index;
1440 packet1.target_system = packet_in.target_system;
1441 packet1.target_component = packet_in.target_component;
1444 memset(&packet2, 0, sizeof(packet2));
1445 mavlink_msg_mission_write_partial_list_encode(system_id, component_id, &msg, &packet1);
1446 mavlink_msg_mission_write_partial_list_decode(&msg, &packet2);
1447 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1449 memset(&packet2, 0, sizeof(packet2));
1450 mavlink_msg_mission_write_partial_list_pack(system_id, component_id, &msg, packet1.target_system, packet1.target_component, packet1.start_index, packet1.end_index);
1451 mavlink_msg_mission_write_partial_list_decode(&msg, &packet2);
1452 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1454 memset(&packet2, 0, sizeof(packet2));
1455 mavlink_msg_mission_write_partial_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.target_component, packet1.start_index, packet1.end_index);
1456 mavlink_msg_mission_write_partial_list_decode(&msg, &packet2);
1457 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1459 memset(&packet2, 0, sizeof(packet2));
1460 mavlink_msg_to_send_buffer(buffer, &msg);
1461 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
1462 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1464 mavlink_msg_mission_write_partial_list_decode(last_msg, &packet2);
1465 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1467 memset(&packet2, 0, sizeof(packet2));
1468 mavlink_msg_mission_write_partial_list_send(MAVLINK_COMM_1, packet1.target_system, packet1.target_component, packet1.start_index, packet1.end_index);
1469 mavlink_msg_mission_write_partial_list_decode(last_msg, &packet2);
1470 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1473 static void mavlink_test_mission_item(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1475 mavlink_message_t msg;
1476 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1477 uint16_t i;
1478 mavlink_mission_item_t packet_in = {
1479 17.0,
1480 45.0,
1481 73.0,
1482 101.0,
1483 129.0,
1484 157.0,
1485 185.0,
1486 18691,
1487 18795,
1488 101,
1489 168,
1490 235,
1492 113,
1494 mavlink_mission_item_t packet1, packet2;
1496 memset(&packet1, 0, sizeof(packet1));
1497 packet1.param1 = packet_in.param1;
1498 packet1.param2 = packet_in.param2;
1499 packet1.param3 = packet_in.param3;
1500 packet1.param4 = packet_in.param4;
1501 packet1.x = packet_in.x;
1502 packet1.y = packet_in.y;
1503 packet1.z = packet_in.z;
1504 packet1.seq = packet_in.seq;
1505 packet1.command = packet_in.command;
1506 packet1.target_system = packet_in.target_system;
1507 packet1.target_component = packet_in.target_component;
1508 packet1.frame = packet_in.frame;
1509 packet1.current = packet_in.current;
1510 packet1.autocontinue = packet_in.autocontinue;
1513 memset(&packet2, 0, sizeof(packet2));
1514 mavlink_msg_mission_item_encode(system_id, component_id, &msg, &packet1);
1515 mavlink_msg_mission_item_decode(&msg, &packet2);
1516 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1518 memset(&packet2, 0, sizeof(packet2));
1519 mavlink_msg_mission_item_pack(system_id, component_id, &msg, packet1.target_system, packet1.target_component, packet1.seq, packet1.frame, packet1.command, packet1.current, packet1.autocontinue, packet1.param1, packet1.param2, packet1.param3, packet1.param4, packet1.x, packet1.y, packet1.z);
1520 mavlink_msg_mission_item_decode(&msg, &packet2);
1521 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1523 memset(&packet2, 0, sizeof(packet2));
1524 mavlink_msg_mission_item_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.target_component, packet1.seq, packet1.frame, packet1.command, packet1.current, packet1.autocontinue, packet1.param1, packet1.param2, packet1.param3, packet1.param4, packet1.x, packet1.y, packet1.z);
1525 mavlink_msg_mission_item_decode(&msg, &packet2);
1526 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1528 memset(&packet2, 0, sizeof(packet2));
1529 mavlink_msg_to_send_buffer(buffer, &msg);
1530 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
1531 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1533 mavlink_msg_mission_item_decode(last_msg, &packet2);
1534 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1536 memset(&packet2, 0, sizeof(packet2));
1537 mavlink_msg_mission_item_send(MAVLINK_COMM_1, packet1.target_system, packet1.target_component, packet1.seq, packet1.frame, packet1.command, packet1.current, packet1.autocontinue, packet1.param1, packet1.param2, packet1.param3, packet1.param4, packet1.x, packet1.y, packet1.z);
1538 mavlink_msg_mission_item_decode(last_msg, &packet2);
1539 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1542 static void mavlink_test_mission_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1544 mavlink_message_t msg;
1545 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1546 uint16_t i;
1547 mavlink_mission_request_t packet_in = {
1548 17235,
1549 139,
1550 206,
1552 mavlink_mission_request_t packet1, packet2;
1554 memset(&packet1, 0, sizeof(packet1));
1555 packet1.seq = packet_in.seq;
1556 packet1.target_system = packet_in.target_system;
1557 packet1.target_component = packet_in.target_component;
1560 memset(&packet2, 0, sizeof(packet2));
1561 mavlink_msg_mission_request_encode(system_id, component_id, &msg, &packet1);
1562 mavlink_msg_mission_request_decode(&msg, &packet2);
1563 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1565 memset(&packet2, 0, sizeof(packet2));
1566 mavlink_msg_mission_request_pack(system_id, component_id, &msg, packet1.target_system, packet1.target_component, packet1.seq);
1567 mavlink_msg_mission_request_decode(&msg, &packet2);
1568 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1570 memset(&packet2, 0, sizeof(packet2));
1571 mavlink_msg_mission_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.target_component, packet1.seq);
1572 mavlink_msg_mission_request_decode(&msg, &packet2);
1573 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1575 memset(&packet2, 0, sizeof(packet2));
1576 mavlink_msg_to_send_buffer(buffer, &msg);
1577 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
1578 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1580 mavlink_msg_mission_request_decode(last_msg, &packet2);
1581 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1583 memset(&packet2, 0, sizeof(packet2));
1584 mavlink_msg_mission_request_send(MAVLINK_COMM_1, packet1.target_system, packet1.target_component, packet1.seq);
1585 mavlink_msg_mission_request_decode(last_msg, &packet2);
1586 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1589 static void mavlink_test_mission_set_current(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1591 mavlink_message_t msg;
1592 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1593 uint16_t i;
1594 mavlink_mission_set_current_t packet_in = {
1595 17235,
1596 139,
1597 206,
1599 mavlink_mission_set_current_t packet1, packet2;
1601 memset(&packet1, 0, sizeof(packet1));
1602 packet1.seq = packet_in.seq;
1603 packet1.target_system = packet_in.target_system;
1604 packet1.target_component = packet_in.target_component;
1607 memset(&packet2, 0, sizeof(packet2));
1608 mavlink_msg_mission_set_current_encode(system_id, component_id, &msg, &packet1);
1609 mavlink_msg_mission_set_current_decode(&msg, &packet2);
1610 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1612 memset(&packet2, 0, sizeof(packet2));
1613 mavlink_msg_mission_set_current_pack(system_id, component_id, &msg, packet1.target_system, packet1.target_component, packet1.seq);
1614 mavlink_msg_mission_set_current_decode(&msg, &packet2);
1615 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1617 memset(&packet2, 0, sizeof(packet2));
1618 mavlink_msg_mission_set_current_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.target_component, packet1.seq);
1619 mavlink_msg_mission_set_current_decode(&msg, &packet2);
1620 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1622 memset(&packet2, 0, sizeof(packet2));
1623 mavlink_msg_to_send_buffer(buffer, &msg);
1624 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
1625 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1627 mavlink_msg_mission_set_current_decode(last_msg, &packet2);
1628 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1630 memset(&packet2, 0, sizeof(packet2));
1631 mavlink_msg_mission_set_current_send(MAVLINK_COMM_1, packet1.target_system, packet1.target_component, packet1.seq);
1632 mavlink_msg_mission_set_current_decode(last_msg, &packet2);
1633 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1636 static void mavlink_test_mission_current(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1638 mavlink_message_t msg;
1639 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1640 uint16_t i;
1641 mavlink_mission_current_t packet_in = {
1642 17235,
1644 mavlink_mission_current_t packet1, packet2;
1646 memset(&packet1, 0, sizeof(packet1));
1647 packet1.seq = packet_in.seq;
1650 memset(&packet2, 0, sizeof(packet2));
1651 mavlink_msg_mission_current_encode(system_id, component_id, &msg, &packet1);
1652 mavlink_msg_mission_current_decode(&msg, &packet2);
1653 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1655 memset(&packet2, 0, sizeof(packet2));
1656 mavlink_msg_mission_current_pack(system_id, component_id, &msg, packet1.seq);
1657 mavlink_msg_mission_current_decode(&msg, &packet2);
1658 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1660 memset(&packet2, 0, sizeof(packet2));
1661 mavlink_msg_mission_current_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.seq);
1662 mavlink_msg_mission_current_decode(&msg, &packet2);
1663 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1665 memset(&packet2, 0, sizeof(packet2));
1666 mavlink_msg_to_send_buffer(buffer, &msg);
1667 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
1668 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1670 mavlink_msg_mission_current_decode(last_msg, &packet2);
1671 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1673 memset(&packet2, 0, sizeof(packet2));
1674 mavlink_msg_mission_current_send(MAVLINK_COMM_1, packet1.seq);
1675 mavlink_msg_mission_current_decode(last_msg, &packet2);
1676 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1679 static void mavlink_test_mission_request_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1681 mavlink_message_t msg;
1682 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1683 uint16_t i;
1684 mavlink_mission_request_list_t packet_in = {
1688 mavlink_mission_request_list_t packet1, packet2;
1690 memset(&packet1, 0, sizeof(packet1));
1691 packet1.target_system = packet_in.target_system;
1692 packet1.target_component = packet_in.target_component;
1695 memset(&packet2, 0, sizeof(packet2));
1696 mavlink_msg_mission_request_list_encode(system_id, component_id, &msg, &packet1);
1697 mavlink_msg_mission_request_list_decode(&msg, &packet2);
1698 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1700 memset(&packet2, 0, sizeof(packet2));
1701 mavlink_msg_mission_request_list_pack(system_id, component_id, &msg, packet1.target_system, packet1.target_component);
1702 mavlink_msg_mission_request_list_decode(&msg, &packet2);
1703 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1705 memset(&packet2, 0, sizeof(packet2));
1706 mavlink_msg_mission_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.target_component);
1707 mavlink_msg_mission_request_list_decode(&msg, &packet2);
1708 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1710 memset(&packet2, 0, sizeof(packet2));
1711 mavlink_msg_to_send_buffer(buffer, &msg);
1712 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
1713 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1715 mavlink_msg_mission_request_list_decode(last_msg, &packet2);
1716 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1718 memset(&packet2, 0, sizeof(packet2));
1719 mavlink_msg_mission_request_list_send(MAVLINK_COMM_1, packet1.target_system, packet1.target_component);
1720 mavlink_msg_mission_request_list_decode(last_msg, &packet2);
1721 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1724 static void mavlink_test_mission_count(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1726 mavlink_message_t msg;
1727 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1728 uint16_t i;
1729 mavlink_mission_count_t packet_in = {
1730 17235,
1731 139,
1732 206,
1734 mavlink_mission_count_t packet1, packet2;
1736 memset(&packet1, 0, sizeof(packet1));
1737 packet1.count = packet_in.count;
1738 packet1.target_system = packet_in.target_system;
1739 packet1.target_component = packet_in.target_component;
1742 memset(&packet2, 0, sizeof(packet2));
1743 mavlink_msg_mission_count_encode(system_id, component_id, &msg, &packet1);
1744 mavlink_msg_mission_count_decode(&msg, &packet2);
1745 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1747 memset(&packet2, 0, sizeof(packet2));
1748 mavlink_msg_mission_count_pack(system_id, component_id, &msg, packet1.target_system, packet1.target_component, packet1.count);
1749 mavlink_msg_mission_count_decode(&msg, &packet2);
1750 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1752 memset(&packet2, 0, sizeof(packet2));
1753 mavlink_msg_mission_count_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.target_component, packet1.count);
1754 mavlink_msg_mission_count_decode(&msg, &packet2);
1755 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1757 memset(&packet2, 0, sizeof(packet2));
1758 mavlink_msg_to_send_buffer(buffer, &msg);
1759 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
1760 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1762 mavlink_msg_mission_count_decode(last_msg, &packet2);
1763 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1765 memset(&packet2, 0, sizeof(packet2));
1766 mavlink_msg_mission_count_send(MAVLINK_COMM_1, packet1.target_system, packet1.target_component, packet1.count);
1767 mavlink_msg_mission_count_decode(last_msg, &packet2);
1768 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1771 static void mavlink_test_mission_clear_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1773 mavlink_message_t msg;
1774 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1775 uint16_t i;
1776 mavlink_mission_clear_all_t packet_in = {
1780 mavlink_mission_clear_all_t packet1, packet2;
1782 memset(&packet1, 0, sizeof(packet1));
1783 packet1.target_system = packet_in.target_system;
1784 packet1.target_component = packet_in.target_component;
1787 memset(&packet2, 0, sizeof(packet2));
1788 mavlink_msg_mission_clear_all_encode(system_id, component_id, &msg, &packet1);
1789 mavlink_msg_mission_clear_all_decode(&msg, &packet2);
1790 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1792 memset(&packet2, 0, sizeof(packet2));
1793 mavlink_msg_mission_clear_all_pack(system_id, component_id, &msg, packet1.target_system, packet1.target_component);
1794 mavlink_msg_mission_clear_all_decode(&msg, &packet2);
1795 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1797 memset(&packet2, 0, sizeof(packet2));
1798 mavlink_msg_mission_clear_all_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.target_component);
1799 mavlink_msg_mission_clear_all_decode(&msg, &packet2);
1800 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1802 memset(&packet2, 0, sizeof(packet2));
1803 mavlink_msg_to_send_buffer(buffer, &msg);
1804 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
1805 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1807 mavlink_msg_mission_clear_all_decode(last_msg, &packet2);
1808 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1810 memset(&packet2, 0, sizeof(packet2));
1811 mavlink_msg_mission_clear_all_send(MAVLINK_COMM_1, packet1.target_system, packet1.target_component);
1812 mavlink_msg_mission_clear_all_decode(last_msg, &packet2);
1813 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1816 static void mavlink_test_mission_item_reached(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1818 mavlink_message_t msg;
1819 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1820 uint16_t i;
1821 mavlink_mission_item_reached_t packet_in = {
1822 17235,
1824 mavlink_mission_item_reached_t packet1, packet2;
1826 memset(&packet1, 0, sizeof(packet1));
1827 packet1.seq = packet_in.seq;
1830 memset(&packet2, 0, sizeof(packet2));
1831 mavlink_msg_mission_item_reached_encode(system_id, component_id, &msg, &packet1);
1832 mavlink_msg_mission_item_reached_decode(&msg, &packet2);
1833 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1835 memset(&packet2, 0, sizeof(packet2));
1836 mavlink_msg_mission_item_reached_pack(system_id, component_id, &msg, packet1.seq);
1837 mavlink_msg_mission_item_reached_decode(&msg, &packet2);
1838 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1840 memset(&packet2, 0, sizeof(packet2));
1841 mavlink_msg_mission_item_reached_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.seq);
1842 mavlink_msg_mission_item_reached_decode(&msg, &packet2);
1843 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1845 memset(&packet2, 0, sizeof(packet2));
1846 mavlink_msg_to_send_buffer(buffer, &msg);
1847 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
1848 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1850 mavlink_msg_mission_item_reached_decode(last_msg, &packet2);
1851 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1853 memset(&packet2, 0, sizeof(packet2));
1854 mavlink_msg_mission_item_reached_send(MAVLINK_COMM_1, packet1.seq);
1855 mavlink_msg_mission_item_reached_decode(last_msg, &packet2);
1856 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1859 static void mavlink_test_mission_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1861 mavlink_message_t msg;
1862 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1863 uint16_t i;
1864 mavlink_mission_ack_t packet_in = {
1867 139,
1869 mavlink_mission_ack_t packet1, packet2;
1871 memset(&packet1, 0, sizeof(packet1));
1872 packet1.target_system = packet_in.target_system;
1873 packet1.target_component = packet_in.target_component;
1874 packet1.type = packet_in.type;
1877 memset(&packet2, 0, sizeof(packet2));
1878 mavlink_msg_mission_ack_encode(system_id, component_id, &msg, &packet1);
1879 mavlink_msg_mission_ack_decode(&msg, &packet2);
1880 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1882 memset(&packet2, 0, sizeof(packet2));
1883 mavlink_msg_mission_ack_pack(system_id, component_id, &msg, packet1.target_system, packet1.target_component, packet1.type);
1884 mavlink_msg_mission_ack_decode(&msg, &packet2);
1885 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1887 memset(&packet2, 0, sizeof(packet2));
1888 mavlink_msg_mission_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.target_component, packet1.type);
1889 mavlink_msg_mission_ack_decode(&msg, &packet2);
1890 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1892 memset(&packet2, 0, sizeof(packet2));
1893 mavlink_msg_to_send_buffer(buffer, &msg);
1894 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
1895 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1897 mavlink_msg_mission_ack_decode(last_msg, &packet2);
1898 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1900 memset(&packet2, 0, sizeof(packet2));
1901 mavlink_msg_mission_ack_send(MAVLINK_COMM_1, packet1.target_system, packet1.target_component, packet1.type);
1902 mavlink_msg_mission_ack_decode(last_msg, &packet2);
1903 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1906 static void mavlink_test_set_gps_global_origin(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1908 mavlink_message_t msg;
1909 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1910 uint16_t i;
1911 mavlink_set_gps_global_origin_t packet_in = {
1912 963497464,
1913 963497672,
1914 963497880,
1917 mavlink_set_gps_global_origin_t packet1, packet2;
1919 memset(&packet1, 0, sizeof(packet1));
1920 packet1.latitude = packet_in.latitude;
1921 packet1.longitude = packet_in.longitude;
1922 packet1.altitude = packet_in.altitude;
1923 packet1.target_system = packet_in.target_system;
1926 memset(&packet2, 0, sizeof(packet2));
1927 mavlink_msg_set_gps_global_origin_encode(system_id, component_id, &msg, &packet1);
1928 mavlink_msg_set_gps_global_origin_decode(&msg, &packet2);
1929 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1931 memset(&packet2, 0, sizeof(packet2));
1932 mavlink_msg_set_gps_global_origin_pack(system_id, component_id, &msg, packet1.target_system, packet1.latitude, packet1.longitude, packet1.altitude);
1933 mavlink_msg_set_gps_global_origin_decode(&msg, &packet2);
1934 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1936 memset(&packet2, 0, sizeof(packet2));
1937 mavlink_msg_set_gps_global_origin_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.latitude, packet1.longitude, packet1.altitude);
1938 mavlink_msg_set_gps_global_origin_decode(&msg, &packet2);
1939 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1941 memset(&packet2, 0, sizeof(packet2));
1942 mavlink_msg_to_send_buffer(buffer, &msg);
1943 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
1944 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1946 mavlink_msg_set_gps_global_origin_decode(last_msg, &packet2);
1947 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1949 memset(&packet2, 0, sizeof(packet2));
1950 mavlink_msg_set_gps_global_origin_send(MAVLINK_COMM_1, packet1.target_system, packet1.latitude, packet1.longitude, packet1.altitude);
1951 mavlink_msg_set_gps_global_origin_decode(last_msg, &packet2);
1952 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1955 static void mavlink_test_gps_global_origin(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1957 mavlink_message_t msg;
1958 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1959 uint16_t i;
1960 mavlink_gps_global_origin_t packet_in = {
1961 963497464,
1962 963497672,
1963 963497880,
1965 mavlink_gps_global_origin_t packet1, packet2;
1967 memset(&packet1, 0, sizeof(packet1));
1968 packet1.latitude = packet_in.latitude;
1969 packet1.longitude = packet_in.longitude;
1970 packet1.altitude = packet_in.altitude;
1973 memset(&packet2, 0, sizeof(packet2));
1974 mavlink_msg_gps_global_origin_encode(system_id, component_id, &msg, &packet1);
1975 mavlink_msg_gps_global_origin_decode(&msg, &packet2);
1976 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1978 memset(&packet2, 0, sizeof(packet2));
1979 mavlink_msg_gps_global_origin_pack(system_id, component_id, &msg, packet1.latitude, packet1.longitude, packet1.altitude);
1980 mavlink_msg_gps_global_origin_decode(&msg, &packet2);
1981 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1983 memset(&packet2, 0, sizeof(packet2));
1984 mavlink_msg_gps_global_origin_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.latitude, packet1.longitude, packet1.altitude);
1985 mavlink_msg_gps_global_origin_decode(&msg, &packet2);
1986 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1988 memset(&packet2, 0, sizeof(packet2));
1989 mavlink_msg_to_send_buffer(buffer, &msg);
1990 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
1991 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1993 mavlink_msg_gps_global_origin_decode(last_msg, &packet2);
1994 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1996 memset(&packet2, 0, sizeof(packet2));
1997 mavlink_msg_gps_global_origin_send(MAVLINK_COMM_1, packet1.latitude, packet1.longitude, packet1.altitude);
1998 mavlink_msg_gps_global_origin_decode(last_msg, &packet2);
1999 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2002 static void mavlink_test_set_local_position_setpoint(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2004 mavlink_message_t msg;
2005 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2006 uint16_t i;
2007 mavlink_set_local_position_setpoint_t packet_in = {
2008 17.0,
2009 45.0,
2010 73.0,
2011 101.0,
2013 120,
2014 187,
2016 mavlink_set_local_position_setpoint_t packet1, packet2;
2018 memset(&packet1, 0, sizeof(packet1));
2019 packet1.x = packet_in.x;
2020 packet1.y = packet_in.y;
2021 packet1.z = packet_in.z;
2022 packet1.yaw = packet_in.yaw;
2023 packet1.target_system = packet_in.target_system;
2024 packet1.target_component = packet_in.target_component;
2025 packet1.coordinate_frame = packet_in.coordinate_frame;
2028 memset(&packet2, 0, sizeof(packet2));
2029 mavlink_msg_set_local_position_setpoint_encode(system_id, component_id, &msg, &packet1);
2030 mavlink_msg_set_local_position_setpoint_decode(&msg, &packet2);
2031 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2033 memset(&packet2, 0, sizeof(packet2));
2034 mavlink_msg_set_local_position_setpoint_pack(system_id, component_id, &msg, packet1.target_system, packet1.target_component, packet1.coordinate_frame, packet1.x, packet1.y, packet1.z, packet1.yaw);
2035 mavlink_msg_set_local_position_setpoint_decode(&msg, &packet2);
2036 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2038 memset(&packet2, 0, sizeof(packet2));
2039 mavlink_msg_set_local_position_setpoint_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.target_component, packet1.coordinate_frame, packet1.x, packet1.y, packet1.z, packet1.yaw);
2040 mavlink_msg_set_local_position_setpoint_decode(&msg, &packet2);
2041 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2043 memset(&packet2, 0, sizeof(packet2));
2044 mavlink_msg_to_send_buffer(buffer, &msg);
2045 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
2046 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2048 mavlink_msg_set_local_position_setpoint_decode(last_msg, &packet2);
2049 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2051 memset(&packet2, 0, sizeof(packet2));
2052 mavlink_msg_set_local_position_setpoint_send(MAVLINK_COMM_1, packet1.target_system, packet1.target_component, packet1.coordinate_frame, packet1.x, packet1.y, packet1.z, packet1.yaw);
2053 mavlink_msg_set_local_position_setpoint_decode(last_msg, &packet2);
2054 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2057 static void mavlink_test_local_position_setpoint(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2059 mavlink_message_t msg;
2060 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2061 uint16_t i;
2062 mavlink_local_position_setpoint_t packet_in = {
2063 17.0,
2064 45.0,
2065 73.0,
2066 101.0,
2069 mavlink_local_position_setpoint_t packet1, packet2;
2071 memset(&packet1, 0, sizeof(packet1));
2072 packet1.x = packet_in.x;
2073 packet1.y = packet_in.y;
2074 packet1.z = packet_in.z;
2075 packet1.yaw = packet_in.yaw;
2076 packet1.coordinate_frame = packet_in.coordinate_frame;
2079 memset(&packet2, 0, sizeof(packet2));
2080 mavlink_msg_local_position_setpoint_encode(system_id, component_id, &msg, &packet1);
2081 mavlink_msg_local_position_setpoint_decode(&msg, &packet2);
2082 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2084 memset(&packet2, 0, sizeof(packet2));
2085 mavlink_msg_local_position_setpoint_pack(system_id, component_id, &msg, packet1.coordinate_frame, packet1.x, packet1.y, packet1.z, packet1.yaw);
2086 mavlink_msg_local_position_setpoint_decode(&msg, &packet2);
2087 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2089 memset(&packet2, 0, sizeof(packet2));
2090 mavlink_msg_local_position_setpoint_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.coordinate_frame, packet1.x, packet1.y, packet1.z, packet1.yaw);
2091 mavlink_msg_local_position_setpoint_decode(&msg, &packet2);
2092 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2094 memset(&packet2, 0, sizeof(packet2));
2095 mavlink_msg_to_send_buffer(buffer, &msg);
2096 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
2097 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2099 mavlink_msg_local_position_setpoint_decode(last_msg, &packet2);
2100 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2102 memset(&packet2, 0, sizeof(packet2));
2103 mavlink_msg_local_position_setpoint_send(MAVLINK_COMM_1, packet1.coordinate_frame, packet1.x, packet1.y, packet1.z, packet1.yaw);
2104 mavlink_msg_local_position_setpoint_decode(last_msg, &packet2);
2105 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2108 static void mavlink_test_global_position_setpoint_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2110 mavlink_message_t msg;
2111 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2112 uint16_t i;
2113 mavlink_global_position_setpoint_int_t packet_in = {
2114 963497464,
2115 963497672,
2116 963497880,
2117 17859,
2118 175,
2120 mavlink_global_position_setpoint_int_t packet1, packet2;
2122 memset(&packet1, 0, sizeof(packet1));
2123 packet1.latitude = packet_in.latitude;
2124 packet1.longitude = packet_in.longitude;
2125 packet1.altitude = packet_in.altitude;
2126 packet1.yaw = packet_in.yaw;
2127 packet1.coordinate_frame = packet_in.coordinate_frame;
2130 memset(&packet2, 0, sizeof(packet2));
2131 mavlink_msg_global_position_setpoint_int_encode(system_id, component_id, &msg, &packet1);
2132 mavlink_msg_global_position_setpoint_int_decode(&msg, &packet2);
2133 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2135 memset(&packet2, 0, sizeof(packet2));
2136 mavlink_msg_global_position_setpoint_int_pack(system_id, component_id, &msg, packet1.coordinate_frame, packet1.latitude, packet1.longitude, packet1.altitude, packet1.yaw);
2137 mavlink_msg_global_position_setpoint_int_decode(&msg, &packet2);
2138 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2140 memset(&packet2, 0, sizeof(packet2));
2141 mavlink_msg_global_position_setpoint_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.coordinate_frame, packet1.latitude, packet1.longitude, packet1.altitude, packet1.yaw);
2142 mavlink_msg_global_position_setpoint_int_decode(&msg, &packet2);
2143 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2145 memset(&packet2, 0, sizeof(packet2));
2146 mavlink_msg_to_send_buffer(buffer, &msg);
2147 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
2148 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2150 mavlink_msg_global_position_setpoint_int_decode(last_msg, &packet2);
2151 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2153 memset(&packet2, 0, sizeof(packet2));
2154 mavlink_msg_global_position_setpoint_int_send(MAVLINK_COMM_1, packet1.coordinate_frame, packet1.latitude, packet1.longitude, packet1.altitude, packet1.yaw);
2155 mavlink_msg_global_position_setpoint_int_decode(last_msg, &packet2);
2156 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2159 static void mavlink_test_set_global_position_setpoint_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2161 mavlink_message_t msg;
2162 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2163 uint16_t i;
2164 mavlink_set_global_position_setpoint_int_t packet_in = {
2165 963497464,
2166 963497672,
2167 963497880,
2168 17859,
2169 175,
2171 mavlink_set_global_position_setpoint_int_t packet1, packet2;
2173 memset(&packet1, 0, sizeof(packet1));
2174 packet1.latitude = packet_in.latitude;
2175 packet1.longitude = packet_in.longitude;
2176 packet1.altitude = packet_in.altitude;
2177 packet1.yaw = packet_in.yaw;
2178 packet1.coordinate_frame = packet_in.coordinate_frame;
2181 memset(&packet2, 0, sizeof(packet2));
2182 mavlink_msg_set_global_position_setpoint_int_encode(system_id, component_id, &msg, &packet1);
2183 mavlink_msg_set_global_position_setpoint_int_decode(&msg, &packet2);
2184 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2186 memset(&packet2, 0, sizeof(packet2));
2187 mavlink_msg_set_global_position_setpoint_int_pack(system_id, component_id, &msg, packet1.coordinate_frame, packet1.latitude, packet1.longitude, packet1.altitude, packet1.yaw);
2188 mavlink_msg_set_global_position_setpoint_int_decode(&msg, &packet2);
2189 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2191 memset(&packet2, 0, sizeof(packet2));
2192 mavlink_msg_set_global_position_setpoint_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.coordinate_frame, packet1.latitude, packet1.longitude, packet1.altitude, packet1.yaw);
2193 mavlink_msg_set_global_position_setpoint_int_decode(&msg, &packet2);
2194 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2196 memset(&packet2, 0, sizeof(packet2));
2197 mavlink_msg_to_send_buffer(buffer, &msg);
2198 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
2199 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2201 mavlink_msg_set_global_position_setpoint_int_decode(last_msg, &packet2);
2202 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2204 memset(&packet2, 0, sizeof(packet2));
2205 mavlink_msg_set_global_position_setpoint_int_send(MAVLINK_COMM_1, packet1.coordinate_frame, packet1.latitude, packet1.longitude, packet1.altitude, packet1.yaw);
2206 mavlink_msg_set_global_position_setpoint_int_decode(last_msg, &packet2);
2207 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2210 static void mavlink_test_safety_set_allowed_area(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2212 mavlink_message_t msg;
2213 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2214 uint16_t i;
2215 mavlink_safety_set_allowed_area_t packet_in = {
2216 17.0,
2217 45.0,
2218 73.0,
2219 101.0,
2220 129.0,
2221 157.0,
2223 144,
2224 211,
2226 mavlink_safety_set_allowed_area_t packet1, packet2;
2228 memset(&packet1, 0, sizeof(packet1));
2229 packet1.p1x = packet_in.p1x;
2230 packet1.p1y = packet_in.p1y;
2231 packet1.p1z = packet_in.p1z;
2232 packet1.p2x = packet_in.p2x;
2233 packet1.p2y = packet_in.p2y;
2234 packet1.p2z = packet_in.p2z;
2235 packet1.target_system = packet_in.target_system;
2236 packet1.target_component = packet_in.target_component;
2237 packet1.frame = packet_in.frame;
2240 memset(&packet2, 0, sizeof(packet2));
2241 mavlink_msg_safety_set_allowed_area_encode(system_id, component_id, &msg, &packet1);
2242 mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2);
2243 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2245 memset(&packet2, 0, sizeof(packet2));
2246 mavlink_msg_safety_set_allowed_area_pack(system_id, component_id, &msg, packet1.target_system, packet1.target_component, packet1.frame, packet1.p1x, packet1.p1y, packet1.p1z, packet1.p2x, packet1.p2y, packet1.p2z);
2247 mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2);
2248 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2250 memset(&packet2, 0, sizeof(packet2));
2251 mavlink_msg_safety_set_allowed_area_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.target_component, packet1.frame, packet1.p1x, packet1.p1y, packet1.p1z, packet1.p2x, packet1.p2y, packet1.p2z);
2252 mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2);
2253 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2255 memset(&packet2, 0, sizeof(packet2));
2256 mavlink_msg_to_send_buffer(buffer, &msg);
2257 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
2258 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2260 mavlink_msg_safety_set_allowed_area_decode(last_msg, &packet2);
2261 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2263 memset(&packet2, 0, sizeof(packet2));
2264 mavlink_msg_safety_set_allowed_area_send(MAVLINK_COMM_1, packet1.target_system, packet1.target_component, packet1.frame, packet1.p1x, packet1.p1y, packet1.p1z, packet1.p2x, packet1.p2y, packet1.p2z);
2265 mavlink_msg_safety_set_allowed_area_decode(last_msg, &packet2);
2266 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2269 static void mavlink_test_safety_allowed_area(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2271 mavlink_message_t msg;
2272 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2273 uint16_t i;
2274 mavlink_safety_allowed_area_t packet_in = {
2275 17.0,
2276 45.0,
2277 73.0,
2278 101.0,
2279 129.0,
2280 157.0,
2283 mavlink_safety_allowed_area_t packet1, packet2;
2285 memset(&packet1, 0, sizeof(packet1));
2286 packet1.p1x = packet_in.p1x;
2287 packet1.p1y = packet_in.p1y;
2288 packet1.p1z = packet_in.p1z;
2289 packet1.p2x = packet_in.p2x;
2290 packet1.p2y = packet_in.p2y;
2291 packet1.p2z = packet_in.p2z;
2292 packet1.frame = packet_in.frame;
2295 memset(&packet2, 0, sizeof(packet2));
2296 mavlink_msg_safety_allowed_area_encode(system_id, component_id, &msg, &packet1);
2297 mavlink_msg_safety_allowed_area_decode(&msg, &packet2);
2298 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2300 memset(&packet2, 0, sizeof(packet2));
2301 mavlink_msg_safety_allowed_area_pack(system_id, component_id, &msg, packet1.frame, packet1.p1x, packet1.p1y, packet1.p1z, packet1.p2x, packet1.p2y, packet1.p2z);
2302 mavlink_msg_safety_allowed_area_decode(&msg, &packet2);
2303 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2305 memset(&packet2, 0, sizeof(packet2));
2306 mavlink_msg_safety_allowed_area_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.frame, packet1.p1x, packet1.p1y, packet1.p1z, packet1.p2x, packet1.p2y, packet1.p2z);
2307 mavlink_msg_safety_allowed_area_decode(&msg, &packet2);
2308 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2310 memset(&packet2, 0, sizeof(packet2));
2311 mavlink_msg_to_send_buffer(buffer, &msg);
2312 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
2313 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2315 mavlink_msg_safety_allowed_area_decode(last_msg, &packet2);
2316 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2318 memset(&packet2, 0, sizeof(packet2));
2319 mavlink_msg_safety_allowed_area_send(MAVLINK_COMM_1, packet1.frame, packet1.p1x, packet1.p1y, packet1.p1z, packet1.p2x, packet1.p2y, packet1.p2z);
2320 mavlink_msg_safety_allowed_area_decode(last_msg, &packet2);
2321 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2324 static void mavlink_test_set_roll_pitch_yaw_thrust(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2326 mavlink_message_t msg;
2327 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2328 uint16_t i;
2329 mavlink_set_roll_pitch_yaw_thrust_t packet_in = {
2330 17.0,
2331 45.0,
2332 73.0,
2333 101.0,
2335 120,
2337 mavlink_set_roll_pitch_yaw_thrust_t packet1, packet2;
2339 memset(&packet1, 0, sizeof(packet1));
2340 packet1.roll = packet_in.roll;
2341 packet1.pitch = packet_in.pitch;
2342 packet1.yaw = packet_in.yaw;
2343 packet1.thrust = packet_in.thrust;
2344 packet1.target_system = packet_in.target_system;
2345 packet1.target_component = packet_in.target_component;
2348 memset(&packet2, 0, sizeof(packet2));
2349 mavlink_msg_set_roll_pitch_yaw_thrust_encode(system_id, component_id, &msg, &packet1);
2350 mavlink_msg_set_roll_pitch_yaw_thrust_decode(&msg, &packet2);
2351 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2353 memset(&packet2, 0, sizeof(packet2));
2354 mavlink_msg_set_roll_pitch_yaw_thrust_pack(system_id, component_id, &msg, packet1.target_system, packet1.target_component, packet1.roll, packet1.pitch, packet1.yaw, packet1.thrust);
2355 mavlink_msg_set_roll_pitch_yaw_thrust_decode(&msg, &packet2);
2356 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2358 memset(&packet2, 0, sizeof(packet2));
2359 mavlink_msg_set_roll_pitch_yaw_thrust_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.target_component, packet1.roll, packet1.pitch, packet1.yaw, packet1.thrust);
2360 mavlink_msg_set_roll_pitch_yaw_thrust_decode(&msg, &packet2);
2361 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2363 memset(&packet2, 0, sizeof(packet2));
2364 mavlink_msg_to_send_buffer(buffer, &msg);
2365 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
2366 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2368 mavlink_msg_set_roll_pitch_yaw_thrust_decode(last_msg, &packet2);
2369 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2371 memset(&packet2, 0, sizeof(packet2));
2372 mavlink_msg_set_roll_pitch_yaw_thrust_send(MAVLINK_COMM_1, packet1.target_system, packet1.target_component, packet1.roll, packet1.pitch, packet1.yaw, packet1.thrust);
2373 mavlink_msg_set_roll_pitch_yaw_thrust_decode(last_msg, &packet2);
2374 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2377 static void mavlink_test_set_roll_pitch_yaw_speed_thrust(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2379 mavlink_message_t msg;
2380 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2381 uint16_t i;
2382 mavlink_set_roll_pitch_yaw_speed_thrust_t packet_in = {
2383 17.0,
2384 45.0,
2385 73.0,
2386 101.0,
2388 120,
2390 mavlink_set_roll_pitch_yaw_speed_thrust_t packet1, packet2;
2392 memset(&packet1, 0, sizeof(packet1));
2393 packet1.roll_speed = packet_in.roll_speed;
2394 packet1.pitch_speed = packet_in.pitch_speed;
2395 packet1.yaw_speed = packet_in.yaw_speed;
2396 packet1.thrust = packet_in.thrust;
2397 packet1.target_system = packet_in.target_system;
2398 packet1.target_component = packet_in.target_component;
2401 memset(&packet2, 0, sizeof(packet2));
2402 mavlink_msg_set_roll_pitch_yaw_speed_thrust_encode(system_id, component_id, &msg, &packet1);
2403 mavlink_msg_set_roll_pitch_yaw_speed_thrust_decode(&msg, &packet2);
2404 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2406 memset(&packet2, 0, sizeof(packet2));
2407 mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack(system_id, component_id, &msg, packet1.target_system, packet1.target_component, packet1.roll_speed, packet1.pitch_speed, packet1.yaw_speed, packet1.thrust);
2408 mavlink_msg_set_roll_pitch_yaw_speed_thrust_decode(&msg, &packet2);
2409 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2411 memset(&packet2, 0, sizeof(packet2));
2412 mavlink_msg_set_roll_pitch_yaw_speed_thrust_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.target_component, packet1.roll_speed, packet1.pitch_speed, packet1.yaw_speed, packet1.thrust);
2413 mavlink_msg_set_roll_pitch_yaw_speed_thrust_decode(&msg, &packet2);
2414 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2416 memset(&packet2, 0, sizeof(packet2));
2417 mavlink_msg_to_send_buffer(buffer, &msg);
2418 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
2419 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2421 mavlink_msg_set_roll_pitch_yaw_speed_thrust_decode(last_msg, &packet2);
2422 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2424 memset(&packet2, 0, sizeof(packet2));
2425 mavlink_msg_set_roll_pitch_yaw_speed_thrust_send(MAVLINK_COMM_1, packet1.target_system, packet1.target_component, packet1.roll_speed, packet1.pitch_speed, packet1.yaw_speed, packet1.thrust);
2426 mavlink_msg_set_roll_pitch_yaw_speed_thrust_decode(last_msg, &packet2);
2427 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2430 static void mavlink_test_roll_pitch_yaw_thrust_setpoint(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2432 mavlink_message_t msg;
2433 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2434 uint16_t i;
2435 mavlink_roll_pitch_yaw_thrust_setpoint_t packet_in = {
2436 963497464,
2437 45.0,
2438 73.0,
2439 101.0,
2440 129.0,
2442 mavlink_roll_pitch_yaw_thrust_setpoint_t packet1, packet2;
2444 memset(&packet1, 0, sizeof(packet1));
2445 packet1.time_boot_ms = packet_in.time_boot_ms;
2446 packet1.roll = packet_in.roll;
2447 packet1.pitch = packet_in.pitch;
2448 packet1.yaw = packet_in.yaw;
2449 packet1.thrust = packet_in.thrust;
2452 memset(&packet2, 0, sizeof(packet2));
2453 mavlink_msg_roll_pitch_yaw_thrust_setpoint_encode(system_id, component_id, &msg, &packet1);
2454 mavlink_msg_roll_pitch_yaw_thrust_setpoint_decode(&msg, &packet2);
2455 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2457 memset(&packet2, 0, sizeof(packet2));
2458 mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack(system_id, component_id, &msg, packet1.time_boot_ms, packet1.roll, packet1.pitch, packet1.yaw, packet1.thrust);
2459 mavlink_msg_roll_pitch_yaw_thrust_setpoint_decode(&msg, &packet2);
2460 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2462 memset(&packet2, 0, sizeof(packet2));
2463 mavlink_msg_roll_pitch_yaw_thrust_setpoint_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_boot_ms, packet1.roll, packet1.pitch, packet1.yaw, packet1.thrust);
2464 mavlink_msg_roll_pitch_yaw_thrust_setpoint_decode(&msg, &packet2);
2465 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2467 memset(&packet2, 0, sizeof(packet2));
2468 mavlink_msg_to_send_buffer(buffer, &msg);
2469 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
2470 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2472 mavlink_msg_roll_pitch_yaw_thrust_setpoint_decode(last_msg, &packet2);
2473 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2475 memset(&packet2, 0, sizeof(packet2));
2476 mavlink_msg_roll_pitch_yaw_thrust_setpoint_send(MAVLINK_COMM_1, packet1.time_boot_ms, packet1.roll, packet1.pitch, packet1.yaw, packet1.thrust);
2477 mavlink_msg_roll_pitch_yaw_thrust_setpoint_decode(last_msg, &packet2);
2478 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2481 static void mavlink_test_roll_pitch_yaw_speed_thrust_setpoint(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2483 mavlink_message_t msg;
2484 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2485 uint16_t i;
2486 mavlink_roll_pitch_yaw_speed_thrust_setpoint_t packet_in = {
2487 963497464,
2488 45.0,
2489 73.0,
2490 101.0,
2491 129.0,
2493 mavlink_roll_pitch_yaw_speed_thrust_setpoint_t packet1, packet2;
2495 memset(&packet1, 0, sizeof(packet1));
2496 packet1.time_boot_ms = packet_in.time_boot_ms;
2497 packet1.roll_speed = packet_in.roll_speed;
2498 packet1.pitch_speed = packet_in.pitch_speed;
2499 packet1.yaw_speed = packet_in.yaw_speed;
2500 packet1.thrust = packet_in.thrust;
2503 memset(&packet2, 0, sizeof(packet2));
2504 mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_encode(system_id, component_id, &msg, &packet1);
2505 mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_decode(&msg, &packet2);
2506 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2508 memset(&packet2, 0, sizeof(packet2));
2509 mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack(system_id, component_id, &msg, packet1.time_boot_ms, packet1.roll_speed, packet1.pitch_speed, packet1.yaw_speed, packet1.thrust);
2510 mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_decode(&msg, &packet2);
2511 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2513 memset(&packet2, 0, sizeof(packet2));
2514 mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_boot_ms, packet1.roll_speed, packet1.pitch_speed, packet1.yaw_speed, packet1.thrust);
2515 mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_decode(&msg, &packet2);
2516 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2518 memset(&packet2, 0, sizeof(packet2));
2519 mavlink_msg_to_send_buffer(buffer, &msg);
2520 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
2521 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2523 mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_decode(last_msg, &packet2);
2524 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2526 memset(&packet2, 0, sizeof(packet2));
2527 mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_send(MAVLINK_COMM_1, packet1.time_boot_ms, packet1.roll_speed, packet1.pitch_speed, packet1.yaw_speed, packet1.thrust);
2528 mavlink_msg_roll_pitch_yaw_speed_thrust_setpoint_decode(last_msg, &packet2);
2529 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2532 static void mavlink_test_set_quad_motors_setpoint(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2534 mavlink_message_t msg;
2535 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2536 uint16_t i;
2537 mavlink_set_quad_motors_setpoint_t packet_in = {
2538 17235,
2539 17339,
2540 17443,
2541 17547,
2544 mavlink_set_quad_motors_setpoint_t packet1, packet2;
2546 memset(&packet1, 0, sizeof(packet1));
2547 packet1.motor_front_nw = packet_in.motor_front_nw;
2548 packet1.motor_right_ne = packet_in.motor_right_ne;
2549 packet1.motor_back_se = packet_in.motor_back_se;
2550 packet1.motor_left_sw = packet_in.motor_left_sw;
2551 packet1.target_system = packet_in.target_system;
2554 memset(&packet2, 0, sizeof(packet2));
2555 mavlink_msg_set_quad_motors_setpoint_encode(system_id, component_id, &msg, &packet1);
2556 mavlink_msg_set_quad_motors_setpoint_decode(&msg, &packet2);
2557 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2559 memset(&packet2, 0, sizeof(packet2));
2560 mavlink_msg_set_quad_motors_setpoint_pack(system_id, component_id, &msg, packet1.target_system, packet1.motor_front_nw, packet1.motor_right_ne, packet1.motor_back_se, packet1.motor_left_sw);
2561 mavlink_msg_set_quad_motors_setpoint_decode(&msg, &packet2);
2562 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2564 memset(&packet2, 0, sizeof(packet2));
2565 mavlink_msg_set_quad_motors_setpoint_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.motor_front_nw, packet1.motor_right_ne, packet1.motor_back_se, packet1.motor_left_sw);
2566 mavlink_msg_set_quad_motors_setpoint_decode(&msg, &packet2);
2567 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2569 memset(&packet2, 0, sizeof(packet2));
2570 mavlink_msg_to_send_buffer(buffer, &msg);
2571 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
2572 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2574 mavlink_msg_set_quad_motors_setpoint_decode(last_msg, &packet2);
2575 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2577 memset(&packet2, 0, sizeof(packet2));
2578 mavlink_msg_set_quad_motors_setpoint_send(MAVLINK_COMM_1, packet1.target_system, packet1.motor_front_nw, packet1.motor_right_ne, packet1.motor_back_se, packet1.motor_left_sw);
2579 mavlink_msg_set_quad_motors_setpoint_decode(last_msg, &packet2);
2580 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2583 static void mavlink_test_set_quad_swarm_roll_pitch_yaw_thrust(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2585 mavlink_message_t msg;
2586 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2587 uint16_t i;
2588 mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t packet_in = {
2589 { 17235, 17236, 17237, 17238 },
2590 { 17651, 17652, 17653, 17654 },
2591 { 18067, 18068, 18069, 18070 },
2592 { 18483, 18484, 18485, 18486 },
2593 101,
2594 168,
2596 mavlink_set_quad_swarm_roll_pitch_yaw_thrust_t packet1, packet2;
2598 memset(&packet1, 0, sizeof(packet1));
2599 packet1.group = packet_in.group;
2600 packet1.mode = packet_in.mode;
2602 mav_array_memcpy(packet1.roll, packet_in.roll, sizeof(int16_t) * 4);
2603 mav_array_memcpy(packet1.pitch, packet_in.pitch, sizeof(int16_t) * 4);
2604 mav_array_memcpy(packet1.yaw, packet_in.yaw, sizeof(int16_t) * 4);
2605 mav_array_memcpy(packet1.thrust, packet_in.thrust, sizeof(uint16_t) * 4);
2608 memset(&packet2, 0, sizeof(packet2));
2609 mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_encode(system_id, component_id, &msg, &packet1);
2610 mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_decode(&msg, &packet2);
2611 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2613 memset(&packet2, 0, sizeof(packet2));
2614 mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_pack(system_id, component_id, &msg, packet1.group, packet1.mode, packet1.roll, packet1.pitch, packet1.yaw, packet1.thrust);
2615 mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_decode(&msg, &packet2);
2616 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2618 memset(&packet2, 0, sizeof(packet2));
2619 mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.group, packet1.mode, packet1.roll, packet1.pitch, packet1.yaw, packet1.thrust);
2620 mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_decode(&msg, &packet2);
2621 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2623 memset(&packet2, 0, sizeof(packet2));
2624 mavlink_msg_to_send_buffer(buffer, &msg);
2625 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
2626 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2628 mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_decode(last_msg, &packet2);
2629 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2631 memset(&packet2, 0, sizeof(packet2));
2632 mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_send(MAVLINK_COMM_1, packet1.group, packet1.mode, packet1.roll, packet1.pitch, packet1.yaw, packet1.thrust);
2633 mavlink_msg_set_quad_swarm_roll_pitch_yaw_thrust_decode(last_msg, &packet2);
2634 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2637 static void mavlink_test_nav_controller_output(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2639 mavlink_message_t msg;
2640 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2641 uint16_t i;
2642 mavlink_nav_controller_output_t packet_in = {
2643 17.0,
2644 45.0,
2645 73.0,
2646 101.0,
2647 129.0,
2648 18275,
2649 18379,
2650 18483,
2652 mavlink_nav_controller_output_t packet1, packet2;
2654 memset(&packet1, 0, sizeof(packet1));
2655 packet1.nav_roll = packet_in.nav_roll;
2656 packet1.nav_pitch = packet_in.nav_pitch;
2657 packet1.alt_error = packet_in.alt_error;
2658 packet1.aspd_error = packet_in.aspd_error;
2659 packet1.xtrack_error = packet_in.xtrack_error;
2660 packet1.nav_bearing = packet_in.nav_bearing;
2661 packet1.target_bearing = packet_in.target_bearing;
2662 packet1.wp_dist = packet_in.wp_dist;
2665 memset(&packet2, 0, sizeof(packet2));
2666 mavlink_msg_nav_controller_output_encode(system_id, component_id, &msg, &packet1);
2667 mavlink_msg_nav_controller_output_decode(&msg, &packet2);
2668 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2670 memset(&packet2, 0, sizeof(packet2));
2671 mavlink_msg_nav_controller_output_pack(system_id, component_id, &msg, packet1.nav_roll, packet1.nav_pitch, packet1.nav_bearing, packet1.target_bearing, packet1.wp_dist, packet1.alt_error, packet1.aspd_error, packet1.xtrack_error);
2672 mavlink_msg_nav_controller_output_decode(&msg, &packet2);
2673 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2675 memset(&packet2, 0, sizeof(packet2));
2676 mavlink_msg_nav_controller_output_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.nav_roll, packet1.nav_pitch, packet1.nav_bearing, packet1.target_bearing, packet1.wp_dist, packet1.alt_error, packet1.aspd_error, packet1.xtrack_error);
2677 mavlink_msg_nav_controller_output_decode(&msg, &packet2);
2678 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2680 memset(&packet2, 0, sizeof(packet2));
2681 mavlink_msg_to_send_buffer(buffer, &msg);
2682 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
2683 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2685 mavlink_msg_nav_controller_output_decode(last_msg, &packet2);
2686 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2688 memset(&packet2, 0, sizeof(packet2));
2689 mavlink_msg_nav_controller_output_send(MAVLINK_COMM_1, packet1.nav_roll, packet1.nav_pitch, packet1.nav_bearing, packet1.target_bearing, packet1.wp_dist, packet1.alt_error, packet1.aspd_error, packet1.xtrack_error);
2690 mavlink_msg_nav_controller_output_decode(last_msg, &packet2);
2691 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2694 static void mavlink_test_set_quad_swarm_led_roll_pitch_yaw_thrust(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2696 mavlink_message_t msg;
2697 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2698 uint16_t i;
2699 mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t packet_in = {
2700 { 17235, 17236, 17237, 17238 },
2701 { 17651, 17652, 17653, 17654 },
2702 { 18067, 18068, 18069, 18070 },
2703 { 18483, 18484, 18485, 18486 },
2704 101,
2705 168,
2706 { 235, 236, 237, 238 },
2707 { 247, 248, 249, 250 },
2708 { 3, 4, 5, 6 },
2710 mavlink_set_quad_swarm_led_roll_pitch_yaw_thrust_t packet1, packet2;
2712 memset(&packet1, 0, sizeof(packet1));
2713 packet1.group = packet_in.group;
2714 packet1.mode = packet_in.mode;
2716 mav_array_memcpy(packet1.roll, packet_in.roll, sizeof(int16_t) * 4);
2717 mav_array_memcpy(packet1.pitch, packet_in.pitch, sizeof(int16_t) * 4);
2718 mav_array_memcpy(packet1.yaw, packet_in.yaw, sizeof(int16_t) * 4);
2719 mav_array_memcpy(packet1.thrust, packet_in.thrust, sizeof(uint16_t) * 4);
2720 mav_array_memcpy(packet1.led_red, packet_in.led_red, sizeof(uint8_t) * 4);
2721 mav_array_memcpy(packet1.led_blue, packet_in.led_blue, sizeof(uint8_t) * 4);
2722 mav_array_memcpy(packet1.led_green, packet_in.led_green, sizeof(uint8_t) * 4);
2725 memset(&packet2, 0, sizeof(packet2));
2726 mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_encode(system_id, component_id, &msg, &packet1);
2727 mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_decode(&msg, &packet2);
2728 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2730 memset(&packet2, 0, sizeof(packet2));
2731 mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_pack(system_id, component_id, &msg, packet1.group, packet1.mode, packet1.led_red, packet1.led_blue, packet1.led_green, packet1.roll, packet1.pitch, packet1.yaw, packet1.thrust);
2732 mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_decode(&msg, &packet2);
2733 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2735 memset(&packet2, 0, sizeof(packet2));
2736 mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.group, packet1.mode, packet1.led_red, packet1.led_blue, packet1.led_green, packet1.roll, packet1.pitch, packet1.yaw, packet1.thrust);
2737 mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_decode(&msg, &packet2);
2738 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2740 memset(&packet2, 0, sizeof(packet2));
2741 mavlink_msg_to_send_buffer(buffer, &msg);
2742 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
2743 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2745 mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_decode(last_msg, &packet2);
2746 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2748 memset(&packet2, 0, sizeof(packet2));
2749 mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_send(MAVLINK_COMM_1, packet1.group, packet1.mode, packet1.led_red, packet1.led_blue, packet1.led_green, packet1.roll, packet1.pitch, packet1.yaw, packet1.thrust);
2750 mavlink_msg_set_quad_swarm_led_roll_pitch_yaw_thrust_decode(last_msg, &packet2);
2751 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2754 static void mavlink_test_state_correction(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2756 mavlink_message_t msg;
2757 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2758 uint16_t i;
2759 mavlink_state_correction_t packet_in = {
2760 17.0,
2761 45.0,
2762 73.0,
2763 101.0,
2764 129.0,
2765 157.0,
2766 185.0,
2767 213.0,
2768 241.0,
2770 mavlink_state_correction_t packet1, packet2;
2772 memset(&packet1, 0, sizeof(packet1));
2773 packet1.xErr = packet_in.xErr;
2774 packet1.yErr = packet_in.yErr;
2775 packet1.zErr = packet_in.zErr;
2776 packet1.rollErr = packet_in.rollErr;
2777 packet1.pitchErr = packet_in.pitchErr;
2778 packet1.yawErr = packet_in.yawErr;
2779 packet1.vxErr = packet_in.vxErr;
2780 packet1.vyErr = packet_in.vyErr;
2781 packet1.vzErr = packet_in.vzErr;
2784 memset(&packet2, 0, sizeof(packet2));
2785 mavlink_msg_state_correction_encode(system_id, component_id, &msg, &packet1);
2786 mavlink_msg_state_correction_decode(&msg, &packet2);
2787 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2789 memset(&packet2, 0, sizeof(packet2));
2790 mavlink_msg_state_correction_pack(system_id, component_id, &msg, packet1.xErr, packet1.yErr, packet1.zErr, packet1.rollErr, packet1.pitchErr, packet1.yawErr, packet1.vxErr, packet1.vyErr, packet1.vzErr);
2791 mavlink_msg_state_correction_decode(&msg, &packet2);
2792 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2794 memset(&packet2, 0, sizeof(packet2));
2795 mavlink_msg_state_correction_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.xErr, packet1.yErr, packet1.zErr, packet1.rollErr, packet1.pitchErr, packet1.yawErr, packet1.vxErr, packet1.vyErr, packet1.vzErr);
2796 mavlink_msg_state_correction_decode(&msg, &packet2);
2797 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2799 memset(&packet2, 0, sizeof(packet2));
2800 mavlink_msg_to_send_buffer(buffer, &msg);
2801 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
2802 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2804 mavlink_msg_state_correction_decode(last_msg, &packet2);
2805 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2807 memset(&packet2, 0, sizeof(packet2));
2808 mavlink_msg_state_correction_send(MAVLINK_COMM_1, packet1.xErr, packet1.yErr, packet1.zErr, packet1.rollErr, packet1.pitchErr, packet1.yawErr, packet1.vxErr, packet1.vyErr, packet1.vzErr);
2809 mavlink_msg_state_correction_decode(last_msg, &packet2);
2810 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2813 static void mavlink_test_request_data_stream(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2815 mavlink_message_t msg;
2816 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2817 uint16_t i;
2818 mavlink_request_data_stream_t packet_in = {
2819 17235,
2820 139,
2821 206,
2825 mavlink_request_data_stream_t packet1, packet2;
2827 memset(&packet1, 0, sizeof(packet1));
2828 packet1.req_message_rate = packet_in.req_message_rate;
2829 packet1.target_system = packet_in.target_system;
2830 packet1.target_component = packet_in.target_component;
2831 packet1.req_stream_id = packet_in.req_stream_id;
2832 packet1.start_stop = packet_in.start_stop;
2835 memset(&packet2, 0, sizeof(packet2));
2836 mavlink_msg_request_data_stream_encode(system_id, component_id, &msg, &packet1);
2837 mavlink_msg_request_data_stream_decode(&msg, &packet2);
2838 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2840 memset(&packet2, 0, sizeof(packet2));
2841 mavlink_msg_request_data_stream_pack(system_id, component_id, &msg, packet1.target_system, packet1.target_component, packet1.req_stream_id, packet1.req_message_rate, packet1.start_stop);
2842 mavlink_msg_request_data_stream_decode(&msg, &packet2);
2843 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2845 memset(&packet2, 0, sizeof(packet2));
2846 mavlink_msg_request_data_stream_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.target_component, packet1.req_stream_id, packet1.req_message_rate, packet1.start_stop);
2847 mavlink_msg_request_data_stream_decode(&msg, &packet2);
2848 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2850 memset(&packet2, 0, sizeof(packet2));
2851 mavlink_msg_to_send_buffer(buffer, &msg);
2852 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
2853 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2855 mavlink_msg_request_data_stream_decode(last_msg, &packet2);
2856 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2858 memset(&packet2, 0, sizeof(packet2));
2859 mavlink_msg_request_data_stream_send(MAVLINK_COMM_1, packet1.target_system, packet1.target_component, packet1.req_stream_id, packet1.req_message_rate, packet1.start_stop);
2860 mavlink_msg_request_data_stream_decode(last_msg, &packet2);
2861 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2864 static void mavlink_test_data_stream(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2866 mavlink_message_t msg;
2867 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2868 uint16_t i;
2869 mavlink_data_stream_t packet_in = {
2870 17235,
2871 139,
2872 206,
2874 mavlink_data_stream_t packet1, packet2;
2876 memset(&packet1, 0, sizeof(packet1));
2877 packet1.message_rate = packet_in.message_rate;
2878 packet1.stream_id = packet_in.stream_id;
2879 packet1.on_off = packet_in.on_off;
2882 memset(&packet2, 0, sizeof(packet2));
2883 mavlink_msg_data_stream_encode(system_id, component_id, &msg, &packet1);
2884 mavlink_msg_data_stream_decode(&msg, &packet2);
2885 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2887 memset(&packet2, 0, sizeof(packet2));
2888 mavlink_msg_data_stream_pack(system_id, component_id, &msg, packet1.stream_id, packet1.message_rate, packet1.on_off);
2889 mavlink_msg_data_stream_decode(&msg, &packet2);
2890 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2892 memset(&packet2, 0, sizeof(packet2));
2893 mavlink_msg_data_stream_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.stream_id, packet1.message_rate, packet1.on_off);
2894 mavlink_msg_data_stream_decode(&msg, &packet2);
2895 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2897 memset(&packet2, 0, sizeof(packet2));
2898 mavlink_msg_to_send_buffer(buffer, &msg);
2899 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
2900 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2902 mavlink_msg_data_stream_decode(last_msg, &packet2);
2903 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2905 memset(&packet2, 0, sizeof(packet2));
2906 mavlink_msg_data_stream_send(MAVLINK_COMM_1, packet1.stream_id, packet1.message_rate, packet1.on_off);
2907 mavlink_msg_data_stream_decode(last_msg, &packet2);
2908 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2911 static void mavlink_test_manual_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2913 mavlink_message_t msg;
2914 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2915 uint16_t i;
2916 mavlink_manual_control_t packet_in = {
2917 17.0,
2918 45.0,
2919 73.0,
2920 101.0,
2922 120,
2923 187,
2924 254,
2927 mavlink_manual_control_t packet1, packet2;
2929 memset(&packet1, 0, sizeof(packet1));
2930 packet1.roll = packet_in.roll;
2931 packet1.pitch = packet_in.pitch;
2932 packet1.yaw = packet_in.yaw;
2933 packet1.thrust = packet_in.thrust;
2934 packet1.target = packet_in.target;
2935 packet1.roll_manual = packet_in.roll_manual;
2936 packet1.pitch_manual = packet_in.pitch_manual;
2937 packet1.yaw_manual = packet_in.yaw_manual;
2938 packet1.thrust_manual = packet_in.thrust_manual;
2941 memset(&packet2, 0, sizeof(packet2));
2942 mavlink_msg_manual_control_encode(system_id, component_id, &msg, &packet1);
2943 mavlink_msg_manual_control_decode(&msg, &packet2);
2944 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2946 memset(&packet2, 0, sizeof(packet2));
2947 mavlink_msg_manual_control_pack(system_id, component_id, &msg, packet1.target, packet1.roll, packet1.pitch, packet1.yaw, packet1.thrust, packet1.roll_manual, packet1.pitch_manual, packet1.yaw_manual, packet1.thrust_manual);
2948 mavlink_msg_manual_control_decode(&msg, &packet2);
2949 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2951 memset(&packet2, 0, sizeof(packet2));
2952 mavlink_msg_manual_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target, packet1.roll, packet1.pitch, packet1.yaw, packet1.thrust, packet1.roll_manual, packet1.pitch_manual, packet1.yaw_manual, packet1.thrust_manual);
2953 mavlink_msg_manual_control_decode(&msg, &packet2);
2954 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2956 memset(&packet2, 0, sizeof(packet2));
2957 mavlink_msg_to_send_buffer(buffer, &msg);
2958 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
2959 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2961 mavlink_msg_manual_control_decode(last_msg, &packet2);
2962 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2964 memset(&packet2, 0, sizeof(packet2));
2965 mavlink_msg_manual_control_send(MAVLINK_COMM_1, packet1.target, packet1.roll, packet1.pitch, packet1.yaw, packet1.thrust, packet1.roll_manual, packet1.pitch_manual, packet1.yaw_manual, packet1.thrust_manual);
2966 mavlink_msg_manual_control_decode(last_msg, &packet2);
2967 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2970 static void mavlink_test_rc_channels_override(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2972 mavlink_message_t msg;
2973 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2974 uint16_t i;
2975 mavlink_rc_channels_override_t packet_in = {
2976 17235,
2977 17339,
2978 17443,
2979 17547,
2980 17651,
2981 17755,
2982 17859,
2983 17963,
2985 120,
2987 mavlink_rc_channels_override_t packet1, packet2;
2989 memset(&packet1, 0, sizeof(packet1));
2990 packet1.chan1_raw = packet_in.chan1_raw;
2991 packet1.chan2_raw = packet_in.chan2_raw;
2992 packet1.chan3_raw = packet_in.chan3_raw;
2993 packet1.chan4_raw = packet_in.chan4_raw;
2994 packet1.chan5_raw = packet_in.chan5_raw;
2995 packet1.chan6_raw = packet_in.chan6_raw;
2996 packet1.chan7_raw = packet_in.chan7_raw;
2997 packet1.chan8_raw = packet_in.chan8_raw;
2998 packet1.target_system = packet_in.target_system;
2999 packet1.target_component = packet_in.target_component;
3002 memset(&packet2, 0, sizeof(packet2));
3003 mavlink_msg_rc_channels_override_encode(system_id, component_id, &msg, &packet1);
3004 mavlink_msg_rc_channels_override_decode(&msg, &packet2);
3005 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3007 memset(&packet2, 0, sizeof(packet2));
3008 mavlink_msg_rc_channels_override_pack(system_id, component_id, &msg, packet1.target_system, packet1.target_component, packet1.chan1_raw, packet1.chan2_raw, packet1.chan3_raw, packet1.chan4_raw, packet1.chan5_raw, packet1.chan6_raw, packet1.chan7_raw, packet1.chan8_raw);
3009 mavlink_msg_rc_channels_override_decode(&msg, &packet2);
3010 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3012 memset(&packet2, 0, sizeof(packet2));
3013 mavlink_msg_rc_channels_override_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.target_component, packet1.chan1_raw, packet1.chan2_raw, packet1.chan3_raw, packet1.chan4_raw, packet1.chan5_raw, packet1.chan6_raw, packet1.chan7_raw, packet1.chan8_raw);
3014 mavlink_msg_rc_channels_override_decode(&msg, &packet2);
3015 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3017 memset(&packet2, 0, sizeof(packet2));
3018 mavlink_msg_to_send_buffer(buffer, &msg);
3019 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
3020 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3022 mavlink_msg_rc_channels_override_decode(last_msg, &packet2);
3023 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3025 memset(&packet2, 0, sizeof(packet2));
3026 mavlink_msg_rc_channels_override_send(MAVLINK_COMM_1, packet1.target_system, packet1.target_component, packet1.chan1_raw, packet1.chan2_raw, packet1.chan3_raw, packet1.chan4_raw, packet1.chan5_raw, packet1.chan6_raw, packet1.chan7_raw, packet1.chan8_raw);
3027 mavlink_msg_rc_channels_override_decode(last_msg, &packet2);
3028 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3031 static void mavlink_test_vfr_hud(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3033 mavlink_message_t msg;
3034 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3035 uint16_t i;
3036 mavlink_vfr_hud_t packet_in = {
3037 17.0,
3038 45.0,
3039 73.0,
3040 101.0,
3041 18067,
3042 18171,
3044 mavlink_vfr_hud_t packet1, packet2;
3046 memset(&packet1, 0, sizeof(packet1));
3047 packet1.airspeed = packet_in.airspeed;
3048 packet1.groundspeed = packet_in.groundspeed;
3049 packet1.alt = packet_in.alt;
3050 packet1.climb = packet_in.climb;
3051 packet1.heading = packet_in.heading;
3052 packet1.throttle = packet_in.throttle;
3055 memset(&packet2, 0, sizeof(packet2));
3056 mavlink_msg_vfr_hud_encode(system_id, component_id, &msg, &packet1);
3057 mavlink_msg_vfr_hud_decode(&msg, &packet2);
3058 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3060 memset(&packet2, 0, sizeof(packet2));
3061 mavlink_msg_vfr_hud_pack(system_id, component_id, &msg, packet1.airspeed, packet1.groundspeed, packet1.heading, packet1.throttle, packet1.alt, packet1.climb);
3062 mavlink_msg_vfr_hud_decode(&msg, &packet2);
3063 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3065 memset(&packet2, 0, sizeof(packet2));
3066 mavlink_msg_vfr_hud_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.airspeed, packet1.groundspeed, packet1.heading, packet1.throttle, packet1.alt, packet1.climb);
3067 mavlink_msg_vfr_hud_decode(&msg, &packet2);
3068 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3070 memset(&packet2, 0, sizeof(packet2));
3071 mavlink_msg_to_send_buffer(buffer, &msg);
3072 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
3073 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3075 mavlink_msg_vfr_hud_decode(last_msg, &packet2);
3076 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3078 memset(&packet2, 0, sizeof(packet2));
3079 mavlink_msg_vfr_hud_send(MAVLINK_COMM_1, packet1.airspeed, packet1.groundspeed, packet1.heading, packet1.throttle, packet1.alt, packet1.climb);
3080 mavlink_msg_vfr_hud_decode(last_msg, &packet2);
3081 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3084 static void mavlink_test_command_long(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3086 mavlink_message_t msg;
3087 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3088 uint16_t i;
3089 mavlink_command_long_t packet_in = {
3090 17.0,
3091 45.0,
3092 73.0,
3093 101.0,
3094 129.0,
3095 157.0,
3096 185.0,
3097 18691,
3098 223,
3100 101,
3102 mavlink_command_long_t packet1, packet2;
3104 memset(&packet1, 0, sizeof(packet1));
3105 packet1.param1 = packet_in.param1;
3106 packet1.param2 = packet_in.param2;
3107 packet1.param3 = packet_in.param3;
3108 packet1.param4 = packet_in.param4;
3109 packet1.param5 = packet_in.param5;
3110 packet1.param6 = packet_in.param6;
3111 packet1.param7 = packet_in.param7;
3112 packet1.command = packet_in.command;
3113 packet1.target_system = packet_in.target_system;
3114 packet1.target_component = packet_in.target_component;
3115 packet1.confirmation = packet_in.confirmation;
3118 memset(&packet2, 0, sizeof(packet2));
3119 mavlink_msg_command_long_encode(system_id, component_id, &msg, &packet1);
3120 mavlink_msg_command_long_decode(&msg, &packet2);
3121 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3123 memset(&packet2, 0, sizeof(packet2));
3124 mavlink_msg_command_long_pack(system_id, component_id, &msg, packet1.target_system, packet1.target_component, packet1.command, packet1.confirmation, packet1.param1, packet1.param2, packet1.param3, packet1.param4, packet1.param5, packet1.param6, packet1.param7);
3125 mavlink_msg_command_long_decode(&msg, &packet2);
3126 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3128 memset(&packet2, 0, sizeof(packet2));
3129 mavlink_msg_command_long_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.target_system, packet1.target_component, packet1.command, packet1.confirmation, packet1.param1, packet1.param2, packet1.param3, packet1.param4, packet1.param5, packet1.param6, packet1.param7);
3130 mavlink_msg_command_long_decode(&msg, &packet2);
3131 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3133 memset(&packet2, 0, sizeof(packet2));
3134 mavlink_msg_to_send_buffer(buffer, &msg);
3135 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
3136 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3138 mavlink_msg_command_long_decode(last_msg, &packet2);
3139 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3141 memset(&packet2, 0, sizeof(packet2));
3142 mavlink_msg_command_long_send(MAVLINK_COMM_1, packet1.target_system, packet1.target_component, packet1.command, packet1.confirmation, packet1.param1, packet1.param2, packet1.param3, packet1.param4, packet1.param5, packet1.param6, packet1.param7);
3143 mavlink_msg_command_long_decode(last_msg, &packet2);
3144 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3147 static void mavlink_test_command_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3149 mavlink_message_t msg;
3150 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3151 uint16_t i;
3152 mavlink_command_ack_t packet_in = {
3153 17235,
3154 139,
3156 mavlink_command_ack_t packet1, packet2;
3158 memset(&packet1, 0, sizeof(packet1));
3159 packet1.command = packet_in.command;
3160 packet1.result = packet_in.result;
3163 memset(&packet2, 0, sizeof(packet2));
3164 mavlink_msg_command_ack_encode(system_id, component_id, &msg, &packet1);
3165 mavlink_msg_command_ack_decode(&msg, &packet2);
3166 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3168 memset(&packet2, 0, sizeof(packet2));
3169 mavlink_msg_command_ack_pack(system_id, component_id, &msg, packet1.command, packet1.result);
3170 mavlink_msg_command_ack_decode(&msg, &packet2);
3171 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3173 memset(&packet2, 0, sizeof(packet2));
3174 mavlink_msg_command_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.command, packet1.result);
3175 mavlink_msg_command_ack_decode(&msg, &packet2);
3176 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3178 memset(&packet2, 0, sizeof(packet2));
3179 mavlink_msg_to_send_buffer(buffer, &msg);
3180 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
3181 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3183 mavlink_msg_command_ack_decode(last_msg, &packet2);
3184 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3186 memset(&packet2, 0, sizeof(packet2));
3187 mavlink_msg_command_ack_send(MAVLINK_COMM_1, packet1.command, packet1.result);
3188 mavlink_msg_command_ack_decode(last_msg, &packet2);
3189 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3192 static void mavlink_test_local_position_ned_system_global_offset(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3194 mavlink_message_t msg;
3195 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3196 uint16_t i;
3197 mavlink_local_position_ned_system_global_offset_t packet_in = {
3198 963497464,
3199 45.0,
3200 73.0,
3201 101.0,
3202 129.0,
3203 157.0,
3204 185.0,
3206 mavlink_local_position_ned_system_global_offset_t packet1, packet2;
3208 memset(&packet1, 0, sizeof(packet1));
3209 packet1.time_boot_ms = packet_in.time_boot_ms;
3210 packet1.x = packet_in.x;
3211 packet1.y = packet_in.y;
3212 packet1.z = packet_in.z;
3213 packet1.roll = packet_in.roll;
3214 packet1.pitch = packet_in.pitch;
3215 packet1.yaw = packet_in.yaw;
3218 memset(&packet2, 0, sizeof(packet2));
3219 mavlink_msg_local_position_ned_system_global_offset_encode(system_id, component_id, &msg, &packet1);
3220 mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2);
3221 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3223 memset(&packet2, 0, sizeof(packet2));
3224 mavlink_msg_local_position_ned_system_global_offset_pack(system_id, component_id, &msg, packet1.time_boot_ms, packet1.x, packet1.y, packet1.z, packet1.roll, packet1.pitch, packet1.yaw);
3225 mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2);
3226 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3228 memset(&packet2, 0, sizeof(packet2));
3229 mavlink_msg_local_position_ned_system_global_offset_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_boot_ms, packet1.x, packet1.y, packet1.z, packet1.roll, packet1.pitch, packet1.yaw);
3230 mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2);
3231 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3233 memset(&packet2, 0, sizeof(packet2));
3234 mavlink_msg_to_send_buffer(buffer, &msg);
3235 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
3236 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3238 mavlink_msg_local_position_ned_system_global_offset_decode(last_msg, &packet2);
3239 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3241 memset(&packet2, 0, sizeof(packet2));
3242 mavlink_msg_local_position_ned_system_global_offset_send(MAVLINK_COMM_1, packet1.time_boot_ms, packet1.x, packet1.y, packet1.z, packet1.roll, packet1.pitch, packet1.yaw);
3243 mavlink_msg_local_position_ned_system_global_offset_decode(last_msg, &packet2);
3244 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3247 static void mavlink_test_hil_state(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3249 mavlink_message_t msg;
3250 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3251 uint16_t i;
3252 mavlink_hil_state_t packet_in = {
3253 93372036854775807ULL,
3254 73.0,
3255 101.0,
3256 129.0,
3257 157.0,
3258 185.0,
3259 213.0,
3260 963499128,
3261 963499336,
3262 963499544,
3263 19523,
3264 19627,
3265 19731,
3266 19835,
3267 19939,
3268 20043,
3270 mavlink_hil_state_t packet1, packet2;
3272 memset(&packet1, 0, sizeof(packet1));
3273 packet1.time_usec = packet_in.time_usec;
3274 packet1.roll = packet_in.roll;
3275 packet1.pitch = packet_in.pitch;
3276 packet1.yaw = packet_in.yaw;
3277 packet1.rollspeed = packet_in.rollspeed;
3278 packet1.pitchspeed = packet_in.pitchspeed;
3279 packet1.yawspeed = packet_in.yawspeed;
3280 packet1.lat = packet_in.lat;
3281 packet1.lon = packet_in.lon;
3282 packet1.alt = packet_in.alt;
3283 packet1.vx = packet_in.vx;
3284 packet1.vy = packet_in.vy;
3285 packet1.vz = packet_in.vz;
3286 packet1.xacc = packet_in.xacc;
3287 packet1.yacc = packet_in.yacc;
3288 packet1.zacc = packet_in.zacc;
3291 memset(&packet2, 0, sizeof(packet2));
3292 mavlink_msg_hil_state_encode(system_id, component_id, &msg, &packet1);
3293 mavlink_msg_hil_state_decode(&msg, &packet2);
3294 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3296 memset(&packet2, 0, sizeof(packet2));
3297 mavlink_msg_hil_state_pack(system_id, component_id, &msg, packet1.time_usec, packet1.roll, packet1.pitch, packet1.yaw, packet1.rollspeed, packet1.pitchspeed, packet1.yawspeed, packet1.lat, packet1.lon, packet1.alt, packet1.vx, packet1.vy, packet1.vz, packet1.xacc, packet1.yacc, packet1.zacc);
3298 mavlink_msg_hil_state_decode(&msg, &packet2);
3299 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3301 memset(&packet2, 0, sizeof(packet2));
3302 mavlink_msg_hil_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_usec, packet1.roll, packet1.pitch, packet1.yaw, packet1.rollspeed, packet1.pitchspeed, packet1.yawspeed, packet1.lat, packet1.lon, packet1.alt, packet1.vx, packet1.vy, packet1.vz, packet1.xacc, packet1.yacc, packet1.zacc);
3303 mavlink_msg_hil_state_decode(&msg, &packet2);
3304 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3306 memset(&packet2, 0, sizeof(packet2));
3307 mavlink_msg_to_send_buffer(buffer, &msg);
3308 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
3309 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3311 mavlink_msg_hil_state_decode(last_msg, &packet2);
3312 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3314 memset(&packet2, 0, sizeof(packet2));
3315 mavlink_msg_hil_state_send(MAVLINK_COMM_1, packet1.time_usec, packet1.roll, packet1.pitch, packet1.yaw, packet1.rollspeed, packet1.pitchspeed, packet1.yawspeed, packet1.lat, packet1.lon, packet1.alt, packet1.vx, packet1.vy, packet1.vz, packet1.xacc, packet1.yacc, packet1.zacc);
3316 mavlink_msg_hil_state_decode(last_msg, &packet2);
3317 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3320 static void mavlink_test_hil_controls(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3322 mavlink_message_t msg;
3323 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3324 uint16_t i;
3325 mavlink_hil_controls_t packet_in = {
3326 93372036854775807ULL,
3327 73.0,
3328 101.0,
3329 129.0,
3330 157.0,
3331 185.0,
3332 213.0,
3333 241.0,
3334 269.0,
3335 125,
3336 192,
3338 mavlink_hil_controls_t packet1, packet2;
3340 memset(&packet1, 0, sizeof(packet1));
3341 packet1.time_usec = packet_in.time_usec;
3342 packet1.roll_ailerons = packet_in.roll_ailerons;
3343 packet1.pitch_elevator = packet_in.pitch_elevator;
3344 packet1.yaw_rudder = packet_in.yaw_rudder;
3345 packet1.throttle = packet_in.throttle;
3346 packet1.aux1 = packet_in.aux1;
3347 packet1.aux2 = packet_in.aux2;
3348 packet1.aux3 = packet_in.aux3;
3349 packet1.aux4 = packet_in.aux4;
3350 packet1.mode = packet_in.mode;
3351 packet1.nav_mode = packet_in.nav_mode;
3354 memset(&packet2, 0, sizeof(packet2));
3355 mavlink_msg_hil_controls_encode(system_id, component_id, &msg, &packet1);
3356 mavlink_msg_hil_controls_decode(&msg, &packet2);
3357 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3359 memset(&packet2, 0, sizeof(packet2));
3360 mavlink_msg_hil_controls_pack(system_id, component_id, &msg, packet1.time_usec, packet1.roll_ailerons, packet1.pitch_elevator, packet1.yaw_rudder, packet1.throttle, packet1.aux1, packet1.aux2, packet1.aux3, packet1.aux4, packet1.mode, packet1.nav_mode);
3361 mavlink_msg_hil_controls_decode(&msg, &packet2);
3362 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3364 memset(&packet2, 0, sizeof(packet2));
3365 mavlink_msg_hil_controls_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_usec, packet1.roll_ailerons, packet1.pitch_elevator, packet1.yaw_rudder, packet1.throttle, packet1.aux1, packet1.aux2, packet1.aux3, packet1.aux4, packet1.mode, packet1.nav_mode);
3366 mavlink_msg_hil_controls_decode(&msg, &packet2);
3367 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3369 memset(&packet2, 0, sizeof(packet2));
3370 mavlink_msg_to_send_buffer(buffer, &msg);
3371 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
3372 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3374 mavlink_msg_hil_controls_decode(last_msg, &packet2);
3375 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3377 memset(&packet2, 0, sizeof(packet2));
3378 mavlink_msg_hil_controls_send(MAVLINK_COMM_1, packet1.time_usec, packet1.roll_ailerons, packet1.pitch_elevator, packet1.yaw_rudder, packet1.throttle, packet1.aux1, packet1.aux2, packet1.aux3, packet1.aux4, packet1.mode, packet1.nav_mode);
3379 mavlink_msg_hil_controls_decode(last_msg, &packet2);
3380 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3383 static void mavlink_test_hil_rc_inputs_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3385 mavlink_message_t msg;
3386 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3387 uint16_t i;
3388 mavlink_hil_rc_inputs_raw_t packet_in = {
3389 93372036854775807ULL,
3390 17651,
3391 17755,
3392 17859,
3393 17963,
3394 18067,
3395 18171,
3396 18275,
3397 18379,
3398 18483,
3399 18587,
3400 18691,
3401 18795,
3402 101,
3404 mavlink_hil_rc_inputs_raw_t packet1, packet2;
3406 memset(&packet1, 0, sizeof(packet1));
3407 packet1.time_usec = packet_in.time_usec;
3408 packet1.chan1_raw = packet_in.chan1_raw;
3409 packet1.chan2_raw = packet_in.chan2_raw;
3410 packet1.chan3_raw = packet_in.chan3_raw;
3411 packet1.chan4_raw = packet_in.chan4_raw;
3412 packet1.chan5_raw = packet_in.chan5_raw;
3413 packet1.chan6_raw = packet_in.chan6_raw;
3414 packet1.chan7_raw = packet_in.chan7_raw;
3415 packet1.chan8_raw = packet_in.chan8_raw;
3416 packet1.chan9_raw = packet_in.chan9_raw;
3417 packet1.chan10_raw = packet_in.chan10_raw;
3418 packet1.chan11_raw = packet_in.chan11_raw;
3419 packet1.chan12_raw = packet_in.chan12_raw;
3420 packet1.rssi = packet_in.rssi;
3423 memset(&packet2, 0, sizeof(packet2));
3424 mavlink_msg_hil_rc_inputs_raw_encode(system_id, component_id, &msg, &packet1);
3425 mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2);
3426 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3428 memset(&packet2, 0, sizeof(packet2));
3429 mavlink_msg_hil_rc_inputs_raw_pack(system_id, component_id, &msg, packet1.time_usec, packet1.chan1_raw, packet1.chan2_raw, packet1.chan3_raw, packet1.chan4_raw, packet1.chan5_raw, packet1.chan6_raw, packet1.chan7_raw, packet1.chan8_raw, packet1.chan9_raw, packet1.chan10_raw, packet1.chan11_raw, packet1.chan12_raw, packet1.rssi);
3430 mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2);
3431 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3433 memset(&packet2, 0, sizeof(packet2));
3434 mavlink_msg_hil_rc_inputs_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_usec, packet1.chan1_raw, packet1.chan2_raw, packet1.chan3_raw, packet1.chan4_raw, packet1.chan5_raw, packet1.chan6_raw, packet1.chan7_raw, packet1.chan8_raw, packet1.chan9_raw, packet1.chan10_raw, packet1.chan11_raw, packet1.chan12_raw, packet1.rssi);
3435 mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2);
3436 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3438 memset(&packet2, 0, sizeof(packet2));
3439 mavlink_msg_to_send_buffer(buffer, &msg);
3440 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
3441 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3443 mavlink_msg_hil_rc_inputs_raw_decode(last_msg, &packet2);
3444 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3446 memset(&packet2, 0, sizeof(packet2));
3447 mavlink_msg_hil_rc_inputs_raw_send(MAVLINK_COMM_1, packet1.time_usec, packet1.chan1_raw, packet1.chan2_raw, packet1.chan3_raw, packet1.chan4_raw, packet1.chan5_raw, packet1.chan6_raw, packet1.chan7_raw, packet1.chan8_raw, packet1.chan9_raw, packet1.chan10_raw, packet1.chan11_raw, packet1.chan12_raw, packet1.rssi);
3448 mavlink_msg_hil_rc_inputs_raw_decode(last_msg, &packet2);
3449 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3452 static void mavlink_test_optical_flow(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3454 mavlink_message_t msg;
3455 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3456 uint16_t i;
3457 mavlink_optical_flow_t packet_in = {
3458 93372036854775807ULL,
3459 73.0,
3460 101.0,
3461 129.0,
3462 18275,
3463 18379,
3465 144,
3467 mavlink_optical_flow_t packet1, packet2;
3469 memset(&packet1, 0, sizeof(packet1));
3470 packet1.time_usec = packet_in.time_usec;
3471 packet1.flow_comp_m_x = packet_in.flow_comp_m_x;
3472 packet1.flow_comp_m_y = packet_in.flow_comp_m_y;
3473 packet1.ground_distance = packet_in.ground_distance;
3474 packet1.flow_x = packet_in.flow_x;
3475 packet1.flow_y = packet_in.flow_y;
3476 packet1.sensor_id = packet_in.sensor_id;
3477 packet1.quality = packet_in.quality;
3480 memset(&packet2, 0, sizeof(packet2));
3481 mavlink_msg_optical_flow_encode(system_id, component_id, &msg, &packet1);
3482 mavlink_msg_optical_flow_decode(&msg, &packet2);
3483 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3485 memset(&packet2, 0, sizeof(packet2));
3486 mavlink_msg_optical_flow_pack(system_id, component_id, &msg, packet1.time_usec, packet1.sensor_id, packet1.flow_x, packet1.flow_y, packet1.flow_comp_m_x, packet1.flow_comp_m_y, packet1.quality, packet1.ground_distance);
3487 mavlink_msg_optical_flow_decode(&msg, &packet2);
3488 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3490 memset(&packet2, 0, sizeof(packet2));
3491 mavlink_msg_optical_flow_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_usec, packet1.sensor_id, packet1.flow_x, packet1.flow_y, packet1.flow_comp_m_x, packet1.flow_comp_m_y, packet1.quality, packet1.ground_distance);
3492 mavlink_msg_optical_flow_decode(&msg, &packet2);
3493 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3495 memset(&packet2, 0, sizeof(packet2));
3496 mavlink_msg_to_send_buffer(buffer, &msg);
3497 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
3498 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3500 mavlink_msg_optical_flow_decode(last_msg, &packet2);
3501 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3503 memset(&packet2, 0, sizeof(packet2));
3504 mavlink_msg_optical_flow_send(MAVLINK_COMM_1, packet1.time_usec, packet1.sensor_id, packet1.flow_x, packet1.flow_y, packet1.flow_comp_m_x, packet1.flow_comp_m_y, packet1.quality, packet1.ground_distance);
3505 mavlink_msg_optical_flow_decode(last_msg, &packet2);
3506 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3509 static void mavlink_test_global_vision_position_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3511 mavlink_message_t msg;
3512 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3513 uint16_t i;
3514 mavlink_global_vision_position_estimate_t packet_in = {
3515 93372036854775807ULL,
3516 73.0,
3517 101.0,
3518 129.0,
3519 157.0,
3520 185.0,
3521 213.0,
3523 mavlink_global_vision_position_estimate_t packet1, packet2;
3525 memset(&packet1, 0, sizeof(packet1));
3526 packet1.usec = packet_in.usec;
3527 packet1.x = packet_in.x;
3528 packet1.y = packet_in.y;
3529 packet1.z = packet_in.z;
3530 packet1.roll = packet_in.roll;
3531 packet1.pitch = packet_in.pitch;
3532 packet1.yaw = packet_in.yaw;
3535 memset(&packet2, 0, sizeof(packet2));
3536 mavlink_msg_global_vision_position_estimate_encode(system_id, component_id, &msg, &packet1);
3537 mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2);
3538 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3540 memset(&packet2, 0, sizeof(packet2));
3541 mavlink_msg_global_vision_position_estimate_pack(system_id, component_id, &msg, packet1.usec, packet1.x, packet1.y, packet1.z, packet1.roll, packet1.pitch, packet1.yaw);
3542 mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2);
3543 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3545 memset(&packet2, 0, sizeof(packet2));
3546 mavlink_msg_global_vision_position_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.usec, packet1.x, packet1.y, packet1.z, packet1.roll, packet1.pitch, packet1.yaw);
3547 mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2);
3548 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3550 memset(&packet2, 0, sizeof(packet2));
3551 mavlink_msg_to_send_buffer(buffer, &msg);
3552 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
3553 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3555 mavlink_msg_global_vision_position_estimate_decode(last_msg, &packet2);
3556 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3558 memset(&packet2, 0, sizeof(packet2));
3559 mavlink_msg_global_vision_position_estimate_send(MAVLINK_COMM_1, packet1.usec, packet1.x, packet1.y, packet1.z, packet1.roll, packet1.pitch, packet1.yaw);
3560 mavlink_msg_global_vision_position_estimate_decode(last_msg, &packet2);
3561 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3564 static void mavlink_test_vision_position_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3566 mavlink_message_t msg;
3567 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3568 uint16_t i;
3569 mavlink_vision_position_estimate_t packet_in = {
3570 93372036854775807ULL,
3571 73.0,
3572 101.0,
3573 129.0,
3574 157.0,
3575 185.0,
3576 213.0,
3578 mavlink_vision_position_estimate_t packet1, packet2;
3580 memset(&packet1, 0, sizeof(packet1));
3581 packet1.usec = packet_in.usec;
3582 packet1.x = packet_in.x;
3583 packet1.y = packet_in.y;
3584 packet1.z = packet_in.z;
3585 packet1.roll = packet_in.roll;
3586 packet1.pitch = packet_in.pitch;
3587 packet1.yaw = packet_in.yaw;
3590 memset(&packet2, 0, sizeof(packet2));
3591 mavlink_msg_vision_position_estimate_encode(system_id, component_id, &msg, &packet1);
3592 mavlink_msg_vision_position_estimate_decode(&msg, &packet2);
3593 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3595 memset(&packet2, 0, sizeof(packet2));
3596 mavlink_msg_vision_position_estimate_pack(system_id, component_id, &msg, packet1.usec, packet1.x, packet1.y, packet1.z, packet1.roll, packet1.pitch, packet1.yaw);
3597 mavlink_msg_vision_position_estimate_decode(&msg, &packet2);
3598 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3600 memset(&packet2, 0, sizeof(packet2));
3601 mavlink_msg_vision_position_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.usec, packet1.x, packet1.y, packet1.z, packet1.roll, packet1.pitch, packet1.yaw);
3602 mavlink_msg_vision_position_estimate_decode(&msg, &packet2);
3603 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3605 memset(&packet2, 0, sizeof(packet2));
3606 mavlink_msg_to_send_buffer(buffer, &msg);
3607 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
3608 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3610 mavlink_msg_vision_position_estimate_decode(last_msg, &packet2);
3611 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3613 memset(&packet2, 0, sizeof(packet2));
3614 mavlink_msg_vision_position_estimate_send(MAVLINK_COMM_1, packet1.usec, packet1.x, packet1.y, packet1.z, packet1.roll, packet1.pitch, packet1.yaw);
3615 mavlink_msg_vision_position_estimate_decode(last_msg, &packet2);
3616 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3619 static void mavlink_test_vision_speed_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3621 mavlink_message_t msg;
3622 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3623 uint16_t i;
3624 mavlink_vision_speed_estimate_t packet_in = {
3625 93372036854775807ULL,
3626 73.0,
3627 101.0,
3628 129.0,
3630 mavlink_vision_speed_estimate_t packet1, packet2;
3632 memset(&packet1, 0, sizeof(packet1));
3633 packet1.usec = packet_in.usec;
3634 packet1.x = packet_in.x;
3635 packet1.y = packet_in.y;
3636 packet1.z = packet_in.z;
3639 memset(&packet2, 0, sizeof(packet2));
3640 mavlink_msg_vision_speed_estimate_encode(system_id, component_id, &msg, &packet1);
3641 mavlink_msg_vision_speed_estimate_decode(&msg, &packet2);
3642 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3644 memset(&packet2, 0, sizeof(packet2));
3645 mavlink_msg_vision_speed_estimate_pack(system_id, component_id, &msg, packet1.usec, packet1.x, packet1.y, packet1.z);
3646 mavlink_msg_vision_speed_estimate_decode(&msg, &packet2);
3647 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3649 memset(&packet2, 0, sizeof(packet2));
3650 mavlink_msg_vision_speed_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.usec, packet1.x, packet1.y, packet1.z);
3651 mavlink_msg_vision_speed_estimate_decode(&msg, &packet2);
3652 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3654 memset(&packet2, 0, sizeof(packet2));
3655 mavlink_msg_to_send_buffer(buffer, &msg);
3656 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
3657 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3659 mavlink_msg_vision_speed_estimate_decode(last_msg, &packet2);
3660 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3662 memset(&packet2, 0, sizeof(packet2));
3663 mavlink_msg_vision_speed_estimate_send(MAVLINK_COMM_1, packet1.usec, packet1.x, packet1.y, packet1.z);
3664 mavlink_msg_vision_speed_estimate_decode(last_msg, &packet2);
3665 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3668 static void mavlink_test_vicon_position_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3670 mavlink_message_t msg;
3671 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3672 uint16_t i;
3673 mavlink_vicon_position_estimate_t packet_in = {
3674 93372036854775807ULL,
3675 73.0,
3676 101.0,
3677 129.0,
3678 157.0,
3679 185.0,
3680 213.0,
3682 mavlink_vicon_position_estimate_t packet1, packet2;
3684 memset(&packet1, 0, sizeof(packet1));
3685 packet1.usec = packet_in.usec;
3686 packet1.x = packet_in.x;
3687 packet1.y = packet_in.y;
3688 packet1.z = packet_in.z;
3689 packet1.roll = packet_in.roll;
3690 packet1.pitch = packet_in.pitch;
3691 packet1.yaw = packet_in.yaw;
3694 memset(&packet2, 0, sizeof(packet2));
3695 mavlink_msg_vicon_position_estimate_encode(system_id, component_id, &msg, &packet1);
3696 mavlink_msg_vicon_position_estimate_decode(&msg, &packet2);
3697 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3699 memset(&packet2, 0, sizeof(packet2));
3700 mavlink_msg_vicon_position_estimate_pack(system_id, component_id, &msg, packet1.usec, packet1.x, packet1.y, packet1.z, packet1.roll, packet1.pitch, packet1.yaw);
3701 mavlink_msg_vicon_position_estimate_decode(&msg, &packet2);
3702 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3704 memset(&packet2, 0, sizeof(packet2));
3705 mavlink_msg_vicon_position_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.usec, packet1.x, packet1.y, packet1.z, packet1.roll, packet1.pitch, packet1.yaw);
3706 mavlink_msg_vicon_position_estimate_decode(&msg, &packet2);
3707 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3709 memset(&packet2, 0, sizeof(packet2));
3710 mavlink_msg_to_send_buffer(buffer, &msg);
3711 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
3712 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3714 mavlink_msg_vicon_position_estimate_decode(last_msg, &packet2);
3715 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3717 memset(&packet2, 0, sizeof(packet2));
3718 mavlink_msg_vicon_position_estimate_send(MAVLINK_COMM_1, packet1.usec, packet1.x, packet1.y, packet1.z, packet1.roll, packet1.pitch, packet1.yaw);
3719 mavlink_msg_vicon_position_estimate_decode(last_msg, &packet2);
3720 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3723 static void mavlink_test_memory_vect(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3725 mavlink_message_t msg;
3726 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3727 uint16_t i;
3728 mavlink_memory_vect_t packet_in = {
3729 17235,
3730 139,
3731 206,
3732 { 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48 },
3734 mavlink_memory_vect_t packet1, packet2;
3736 memset(&packet1, 0, sizeof(packet1));
3737 packet1.address = packet_in.address;
3738 packet1.ver = packet_in.ver;
3739 packet1.type = packet_in.type;
3741 mav_array_memcpy(packet1.value, packet_in.value, sizeof(int8_t) * 32);
3744 memset(&packet2, 0, sizeof(packet2));
3745 mavlink_msg_memory_vect_encode(system_id, component_id, &msg, &packet1);
3746 mavlink_msg_memory_vect_decode(&msg, &packet2);
3747 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3749 memset(&packet2, 0, sizeof(packet2));
3750 mavlink_msg_memory_vect_pack(system_id, component_id, &msg, packet1.address, packet1.ver, packet1.type, packet1.value);
3751 mavlink_msg_memory_vect_decode(&msg, &packet2);
3752 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3754 memset(&packet2, 0, sizeof(packet2));
3755 mavlink_msg_memory_vect_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.address, packet1.ver, packet1.type, packet1.value);
3756 mavlink_msg_memory_vect_decode(&msg, &packet2);
3757 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3759 memset(&packet2, 0, sizeof(packet2));
3760 mavlink_msg_to_send_buffer(buffer, &msg);
3761 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
3762 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3764 mavlink_msg_memory_vect_decode(last_msg, &packet2);
3765 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3767 memset(&packet2, 0, sizeof(packet2));
3768 mavlink_msg_memory_vect_send(MAVLINK_COMM_1, packet1.address, packet1.ver, packet1.type, packet1.value);
3769 mavlink_msg_memory_vect_decode(last_msg, &packet2);
3770 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3773 static void mavlink_test_debug_vect(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3775 mavlink_message_t msg;
3776 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3777 uint16_t i;
3778 mavlink_debug_vect_t packet_in = {
3779 93372036854775807ULL,
3780 73.0,
3781 101.0,
3782 129.0,
3783 "UVWXYZABC",
3785 mavlink_debug_vect_t packet1, packet2;
3787 memset(&packet1, 0, sizeof(packet1));
3788 packet1.time_usec = packet_in.time_usec;
3789 packet1.x = packet_in.x;
3790 packet1.y = packet_in.y;
3791 packet1.z = packet_in.z;
3793 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char) * 10);
3796 memset(&packet2, 0, sizeof(packet2));
3797 mavlink_msg_debug_vect_encode(system_id, component_id, &msg, &packet1);
3798 mavlink_msg_debug_vect_decode(&msg, &packet2);
3799 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3801 memset(&packet2, 0, sizeof(packet2));
3802 mavlink_msg_debug_vect_pack(system_id, component_id, &msg, packet1.name, packet1.time_usec, packet1.x, packet1.y, packet1.z);
3803 mavlink_msg_debug_vect_decode(&msg, &packet2);
3804 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3806 memset(&packet2, 0, sizeof(packet2));
3807 mavlink_msg_debug_vect_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.name, packet1.time_usec, packet1.x, packet1.y, packet1.z);
3808 mavlink_msg_debug_vect_decode(&msg, &packet2);
3809 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3811 memset(&packet2, 0, sizeof(packet2));
3812 mavlink_msg_to_send_buffer(buffer, &msg);
3813 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
3814 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3816 mavlink_msg_debug_vect_decode(last_msg, &packet2);
3817 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3819 memset(&packet2, 0, sizeof(packet2));
3820 mavlink_msg_debug_vect_send(MAVLINK_COMM_1, packet1.name, packet1.time_usec, packet1.x, packet1.y, packet1.z);
3821 mavlink_msg_debug_vect_decode(last_msg, &packet2);
3822 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3825 static void mavlink_test_named_value_float(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3827 mavlink_message_t msg;
3828 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3829 uint16_t i;
3830 mavlink_named_value_float_t packet_in = {
3831 963497464,
3832 45.0,
3833 "IJKLMNOPQ",
3835 mavlink_named_value_float_t packet1, packet2;
3837 memset(&packet1, 0, sizeof(packet1));
3838 packet1.time_boot_ms = packet_in.time_boot_ms;
3839 packet1.value = packet_in.value;
3841 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char) * 10);
3844 memset(&packet2, 0, sizeof(packet2));
3845 mavlink_msg_named_value_float_encode(system_id, component_id, &msg, &packet1);
3846 mavlink_msg_named_value_float_decode(&msg, &packet2);
3847 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3849 memset(&packet2, 0, sizeof(packet2));
3850 mavlink_msg_named_value_float_pack(system_id, component_id, &msg, packet1.time_boot_ms, packet1.name, packet1.value);
3851 mavlink_msg_named_value_float_decode(&msg, &packet2);
3852 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3854 memset(&packet2, 0, sizeof(packet2));
3855 mavlink_msg_named_value_float_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_boot_ms, packet1.name, packet1.value);
3856 mavlink_msg_named_value_float_decode(&msg, &packet2);
3857 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3859 memset(&packet2, 0, sizeof(packet2));
3860 mavlink_msg_to_send_buffer(buffer, &msg);
3861 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
3862 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3864 mavlink_msg_named_value_float_decode(last_msg, &packet2);
3865 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3867 memset(&packet2, 0, sizeof(packet2));
3868 mavlink_msg_named_value_float_send(MAVLINK_COMM_1, packet1.time_boot_ms, packet1.name, packet1.value);
3869 mavlink_msg_named_value_float_decode(last_msg, &packet2);
3870 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3873 static void mavlink_test_named_value_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3875 mavlink_message_t msg;
3876 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3877 uint16_t i;
3878 mavlink_named_value_int_t packet_in = {
3879 963497464,
3880 963497672,
3881 "IJKLMNOPQ",
3883 mavlink_named_value_int_t packet1, packet2;
3885 memset(&packet1, 0, sizeof(packet1));
3886 packet1.time_boot_ms = packet_in.time_boot_ms;
3887 packet1.value = packet_in.value;
3889 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char) * 10);
3892 memset(&packet2, 0, sizeof(packet2));
3893 mavlink_msg_named_value_int_encode(system_id, component_id, &msg, &packet1);
3894 mavlink_msg_named_value_int_decode(&msg, &packet2);
3895 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3897 memset(&packet2, 0, sizeof(packet2));
3898 mavlink_msg_named_value_int_pack(system_id, component_id, &msg, packet1.time_boot_ms, packet1.name, packet1.value);
3899 mavlink_msg_named_value_int_decode(&msg, &packet2);
3900 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3902 memset(&packet2, 0, sizeof(packet2));
3903 mavlink_msg_named_value_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_boot_ms, packet1.name, packet1.value);
3904 mavlink_msg_named_value_int_decode(&msg, &packet2);
3905 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3907 memset(&packet2, 0, sizeof(packet2));
3908 mavlink_msg_to_send_buffer(buffer, &msg);
3909 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
3910 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3912 mavlink_msg_named_value_int_decode(last_msg, &packet2);
3913 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3915 memset(&packet2, 0, sizeof(packet2));
3916 mavlink_msg_named_value_int_send(MAVLINK_COMM_1, packet1.time_boot_ms, packet1.name, packet1.value);
3917 mavlink_msg_named_value_int_decode(last_msg, &packet2);
3918 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3921 static void mavlink_test_statustext(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3923 mavlink_message_t msg;
3924 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3925 uint16_t i;
3926 mavlink_statustext_t packet_in = {
3928 "BCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX",
3930 mavlink_statustext_t packet1, packet2;
3932 memset(&packet1, 0, sizeof(packet1));
3933 packet1.severity = packet_in.severity;
3935 mav_array_memcpy(packet1.text, packet_in.text, sizeof(char) * 50);
3938 memset(&packet2, 0, sizeof(packet2));
3939 mavlink_msg_statustext_encode(system_id, component_id, &msg, &packet1);
3940 mavlink_msg_statustext_decode(&msg, &packet2);
3941 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3943 memset(&packet2, 0, sizeof(packet2));
3944 mavlink_msg_statustext_pack(system_id, component_id, &msg, packet1.severity, packet1.text);
3945 mavlink_msg_statustext_decode(&msg, &packet2);
3946 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3948 memset(&packet2, 0, sizeof(packet2));
3949 mavlink_msg_statustext_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.severity, packet1.text);
3950 mavlink_msg_statustext_decode(&msg, &packet2);
3951 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3953 memset(&packet2, 0, sizeof(packet2));
3954 mavlink_msg_to_send_buffer(buffer, &msg);
3955 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
3956 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3958 mavlink_msg_statustext_decode(last_msg, &packet2);
3959 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3961 memset(&packet2, 0, sizeof(packet2));
3962 mavlink_msg_statustext_send(MAVLINK_COMM_1, packet1.severity, packet1.text);
3963 mavlink_msg_statustext_decode(last_msg, &packet2);
3964 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3967 static void mavlink_test_debug(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3969 mavlink_message_t msg;
3970 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3971 uint16_t i;
3972 mavlink_debug_t packet_in = {
3973 963497464,
3974 45.0,
3977 mavlink_debug_t packet1, packet2;
3979 memset(&packet1, 0, sizeof(packet1));
3980 packet1.time_boot_ms = packet_in.time_boot_ms;
3981 packet1.value = packet_in.value;
3982 packet1.ind = packet_in.ind;
3985 memset(&packet2, 0, sizeof(packet2));
3986 mavlink_msg_debug_encode(system_id, component_id, &msg, &packet1);
3987 mavlink_msg_debug_decode(&msg, &packet2);
3988 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3990 memset(&packet2, 0, sizeof(packet2));
3991 mavlink_msg_debug_pack(system_id, component_id, &msg, packet1.time_boot_ms, packet1.ind, packet1.value);
3992 mavlink_msg_debug_decode(&msg, &packet2);
3993 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3995 memset(&packet2, 0, sizeof(packet2));
3996 mavlink_msg_debug_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg, packet1.time_boot_ms, packet1.ind, packet1.value);
3997 mavlink_msg_debug_decode(&msg, &packet2);
3998 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4000 memset(&packet2, 0, sizeof(packet2));
4001 mavlink_msg_to_send_buffer(buffer, &msg);
4002 for (i = 0; i < mavlink_msg_get_send_buffer_length(&msg); i++) {
4003 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4005 mavlink_msg_debug_decode(last_msg, &packet2);
4006 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4008 memset(&packet2, 0, sizeof(packet2));
4009 mavlink_msg_debug_send(MAVLINK_COMM_1, packet1.time_boot_ms, packet1.ind, packet1.value);
4010 mavlink_msg_debug_decode(last_msg, &packet2);
4011 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4014 static void mavlink_test_common(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4016 mavlink_test_heartbeat(system_id, component_id, last_msg);
4017 mavlink_test_sys_status(system_id, component_id, last_msg);
4018 mavlink_test_system_time(system_id, component_id, last_msg);
4019 mavlink_test_ping(system_id, component_id, last_msg);
4020 mavlink_test_change_operator_control(system_id, component_id, last_msg);
4021 mavlink_test_change_operator_control_ack(system_id, component_id, last_msg);
4022 mavlink_test_auth_key(system_id, component_id, last_msg);
4023 mavlink_test_set_mode(system_id, component_id, last_msg);
4024 mavlink_test_param_request_read(system_id, component_id, last_msg);
4025 mavlink_test_param_request_list(system_id, component_id, last_msg);
4026 mavlink_test_param_value(system_id, component_id, last_msg);
4027 mavlink_test_param_set(system_id, component_id, last_msg);
4028 mavlink_test_gps_raw_int(system_id, component_id, last_msg);
4029 mavlink_test_gps_status(system_id, component_id, last_msg);
4030 mavlink_test_scaled_imu(system_id, component_id, last_msg);
4031 mavlink_test_raw_imu(system_id, component_id, last_msg);
4032 mavlink_test_raw_pressure(system_id, component_id, last_msg);
4033 mavlink_test_scaled_pressure(system_id, component_id, last_msg);
4034 mavlink_test_attitude(system_id, component_id, last_msg);
4035 mavlink_test_attitude_quaternion(system_id, component_id, last_msg);
4036 mavlink_test_local_position_ned(system_id, component_id, last_msg);
4037 mavlink_test_global_position_int(system_id, component_id, last_msg);
4038 mavlink_test_rc_channels_scaled(system_id, component_id, last_msg);
4039 mavlink_test_rc_channels_raw(system_id, component_id, last_msg);
4040 mavlink_test_servo_output_raw(system_id, component_id, last_msg);
4041 mavlink_test_mission_request_partial_list(system_id, component_id, last_msg);
4042 mavlink_test_mission_write_partial_list(system_id, component_id, last_msg);
4043 mavlink_test_mission_item(system_id, component_id, last_msg);
4044 mavlink_test_mission_request(system_id, component_id, last_msg);
4045 mavlink_test_mission_set_current(system_id, component_id, last_msg);
4046 mavlink_test_mission_current(system_id, component_id, last_msg);
4047 mavlink_test_mission_request_list(system_id, component_id, last_msg);
4048 mavlink_test_mission_count(system_id, component_id, last_msg);
4049 mavlink_test_mission_clear_all(system_id, component_id, last_msg);
4050 mavlink_test_mission_item_reached(system_id, component_id, last_msg);
4051 mavlink_test_mission_ack(system_id, component_id, last_msg);
4052 mavlink_test_set_gps_global_origin(system_id, component_id, last_msg);
4053 mavlink_test_gps_global_origin(system_id, component_id, last_msg);
4054 mavlink_test_set_local_position_setpoint(system_id, component_id, last_msg);
4055 mavlink_test_local_position_setpoint(system_id, component_id, last_msg);
4056 mavlink_test_global_position_setpoint_int(system_id, component_id, last_msg);
4057 mavlink_test_set_global_position_setpoint_int(system_id, component_id, last_msg);
4058 mavlink_test_safety_set_allowed_area(system_id, component_id, last_msg);
4059 mavlink_test_safety_allowed_area(system_id, component_id, last_msg);
4060 mavlink_test_set_roll_pitch_yaw_thrust(system_id, component_id, last_msg);
4061 mavlink_test_set_roll_pitch_yaw_speed_thrust(system_id, component_id, last_msg);
4062 mavlink_test_roll_pitch_yaw_thrust_setpoint(system_id, component_id, last_msg);
4063 mavlink_test_roll_pitch_yaw_speed_thrust_setpoint(system_id, component_id, last_msg);
4064 mavlink_test_set_quad_motors_setpoint(system_id, component_id, last_msg);
4065 mavlink_test_set_quad_swarm_roll_pitch_yaw_thrust(system_id, component_id, last_msg);
4066 mavlink_test_nav_controller_output(system_id, component_id, last_msg);
4067 mavlink_test_set_quad_swarm_led_roll_pitch_yaw_thrust(system_id, component_id, last_msg);
4068 mavlink_test_state_correction(system_id, component_id, last_msg);
4069 mavlink_test_request_data_stream(system_id, component_id, last_msg);
4070 mavlink_test_data_stream(system_id, component_id, last_msg);
4071 mavlink_test_manual_control(system_id, component_id, last_msg);
4072 mavlink_test_rc_channels_override(system_id, component_id, last_msg);
4073 mavlink_test_vfr_hud(system_id, component_id, last_msg);
4074 mavlink_test_command_long(system_id, component_id, last_msg);
4075 mavlink_test_command_ack(system_id, component_id, last_msg);
4076 mavlink_test_local_position_ned_system_global_offset(system_id, component_id, last_msg);
4077 mavlink_test_hil_state(system_id, component_id, last_msg);
4078 mavlink_test_hil_controls(system_id, component_id, last_msg);
4079 mavlink_test_hil_rc_inputs_raw(system_id, component_id, last_msg);
4080 mavlink_test_optical_flow(system_id, component_id, last_msg);
4081 mavlink_test_global_vision_position_estimate(system_id, component_id, last_msg);
4082 mavlink_test_vision_position_estimate(system_id, component_id, last_msg);
4083 mavlink_test_vision_speed_estimate(system_id, component_id, last_msg);
4084 mavlink_test_vicon_position_estimate(system_id, component_id, last_msg);
4085 mavlink_test_memory_vect(system_id, component_id, last_msg);
4086 mavlink_test_debug_vect(system_id, component_id, last_msg);
4087 mavlink_test_named_value_float(system_id, component_id, last_msg);
4088 mavlink_test_named_value_int(system_id, component_id, last_msg);
4089 mavlink_test_statustext(system_id, component_id, last_msg);
4090 mavlink_test_debug(system_id, component_id, last_msg);
4093 #ifdef __cplusplus
4095 #endif // __cplusplus
4096 #endif // COMMON_TESTSUITE_H