Move telemetry displayport init and cms device registering
[betaflight.git] / lib / main / MAVLink / common / testsuite.h
blob8effea6cd1f1393138357e62928a24ee9d1d1768
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)
20 mavlink_test_common(system_id, component_id, last_msg);
22 #endif
27 static void mavlink_test_heartbeat(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
29 mavlink_message_t msg;
30 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
31 uint16_t i;
32 mavlink_heartbeat_t packet_in = {
33 963497464,17,84,151,218,3
35 mavlink_heartbeat_t packet1, packet2;
36 memset(&packet1, 0, sizeof(packet1));
37 packet1.custom_mode = packet_in.custom_mode;
38 packet1.type = packet_in.type;
39 packet1.autopilot = packet_in.autopilot;
40 packet1.base_mode = packet_in.base_mode;
41 packet1.system_status = packet_in.system_status;
42 packet1.mavlink_version = packet_in.mavlink_version;
46 memset(&packet2, 0, sizeof(packet2));
47 mavlink_msg_heartbeat_encode(system_id, component_id, &msg, &packet1);
48 mavlink_msg_heartbeat_decode(&msg, &packet2);
49 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
51 memset(&packet2, 0, sizeof(packet2));
52 mavlink_msg_heartbeat_pack(system_id, component_id, &msg , packet1.type , packet1.autopilot , packet1.base_mode , packet1.custom_mode , packet1.system_status );
53 mavlink_msg_heartbeat_decode(&msg, &packet2);
54 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
56 memset(&packet2, 0, sizeof(packet2));
57 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 );
58 mavlink_msg_heartbeat_decode(&msg, &packet2);
59 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
61 memset(&packet2, 0, sizeof(packet2));
62 mavlink_msg_to_send_buffer(buffer, &msg);
63 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
64 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
66 mavlink_msg_heartbeat_decode(last_msg, &packet2);
67 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
69 memset(&packet2, 0, sizeof(packet2));
70 mavlink_msg_heartbeat_send(MAVLINK_COMM_1 , packet1.type , packet1.autopilot , packet1.base_mode , packet1.custom_mode , packet1.system_status );
71 mavlink_msg_heartbeat_decode(last_msg, &packet2);
72 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
75 static void mavlink_test_sys_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
77 mavlink_message_t msg;
78 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
79 uint16_t i;
80 mavlink_sys_status_t packet_in = {
81 963497464,963497672,963497880,17859,17963,18067,18171,18275,18379,18483,18587,18691,223
83 mavlink_sys_status_t packet1, packet2;
84 memset(&packet1, 0, sizeof(packet1));
85 packet1.onboard_control_sensors_present = packet_in.onboard_control_sensors_present;
86 packet1.onboard_control_sensors_enabled = packet_in.onboard_control_sensors_enabled;
87 packet1.onboard_control_sensors_health = packet_in.onboard_control_sensors_health;
88 packet1.load = packet_in.load;
89 packet1.voltage_battery = packet_in.voltage_battery;
90 packet1.current_battery = packet_in.current_battery;
91 packet1.drop_rate_comm = packet_in.drop_rate_comm;
92 packet1.errors_comm = packet_in.errors_comm;
93 packet1.errors_count1 = packet_in.errors_count1;
94 packet1.errors_count2 = packet_in.errors_count2;
95 packet1.errors_count3 = packet_in.errors_count3;
96 packet1.errors_count4 = packet_in.errors_count4;
97 packet1.battery_remaining = packet_in.battery_remaining;
101 memset(&packet2, 0, sizeof(packet2));
102 mavlink_msg_sys_status_encode(system_id, component_id, &msg, &packet1);
103 mavlink_msg_sys_status_decode(&msg, &packet2);
104 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
106 memset(&packet2, 0, sizeof(packet2));
107 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 );
108 mavlink_msg_sys_status_decode(&msg, &packet2);
109 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
111 memset(&packet2, 0, sizeof(packet2));
112 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 );
113 mavlink_msg_sys_status_decode(&msg, &packet2);
114 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
116 memset(&packet2, 0, sizeof(packet2));
117 mavlink_msg_to_send_buffer(buffer, &msg);
118 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
119 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
121 mavlink_msg_sys_status_decode(last_msg, &packet2);
122 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
124 memset(&packet2, 0, sizeof(packet2));
125 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 );
126 mavlink_msg_sys_status_decode(last_msg, &packet2);
127 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
130 static void mavlink_test_system_time(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
132 mavlink_message_t msg;
133 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
134 uint16_t i;
135 mavlink_system_time_t packet_in = {
136 93372036854775807ULL,963497880
138 mavlink_system_time_t packet1, packet2;
139 memset(&packet1, 0, sizeof(packet1));
140 packet1.time_unix_usec = packet_in.time_unix_usec;
141 packet1.time_boot_ms = packet_in.time_boot_ms;
145 memset(&packet2, 0, sizeof(packet2));
146 mavlink_msg_system_time_encode(system_id, component_id, &msg, &packet1);
147 mavlink_msg_system_time_decode(&msg, &packet2);
148 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
150 memset(&packet2, 0, sizeof(packet2));
151 mavlink_msg_system_time_pack(system_id, component_id, &msg , packet1.time_unix_usec , packet1.time_boot_ms );
152 mavlink_msg_system_time_decode(&msg, &packet2);
153 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
155 memset(&packet2, 0, sizeof(packet2));
156 mavlink_msg_system_time_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_unix_usec , packet1.time_boot_ms );
157 mavlink_msg_system_time_decode(&msg, &packet2);
158 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
160 memset(&packet2, 0, sizeof(packet2));
161 mavlink_msg_to_send_buffer(buffer, &msg);
162 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
163 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
165 mavlink_msg_system_time_decode(last_msg, &packet2);
166 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
168 memset(&packet2, 0, sizeof(packet2));
169 mavlink_msg_system_time_send(MAVLINK_COMM_1 , packet1.time_unix_usec , packet1.time_boot_ms );
170 mavlink_msg_system_time_decode(last_msg, &packet2);
171 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
174 static void mavlink_test_ping(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
176 mavlink_message_t msg;
177 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
178 uint16_t i;
179 mavlink_ping_t packet_in = {
180 93372036854775807ULL,963497880,41,108
182 mavlink_ping_t packet1, packet2;
183 memset(&packet1, 0, sizeof(packet1));
184 packet1.time_usec = packet_in.time_usec;
185 packet1.seq = packet_in.seq;
186 packet1.target_system = packet_in.target_system;
187 packet1.target_component = packet_in.target_component;
191 memset(&packet2, 0, sizeof(packet2));
192 mavlink_msg_ping_encode(system_id, component_id, &msg, &packet1);
193 mavlink_msg_ping_decode(&msg, &packet2);
194 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
196 memset(&packet2, 0, sizeof(packet2));
197 mavlink_msg_ping_pack(system_id, component_id, &msg , packet1.time_usec , packet1.seq , packet1.target_system , packet1.target_component );
198 mavlink_msg_ping_decode(&msg, &packet2);
199 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
201 memset(&packet2, 0, sizeof(packet2));
202 mavlink_msg_ping_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.seq , packet1.target_system , packet1.target_component );
203 mavlink_msg_ping_decode(&msg, &packet2);
204 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
206 memset(&packet2, 0, sizeof(packet2));
207 mavlink_msg_to_send_buffer(buffer, &msg);
208 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
209 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
211 mavlink_msg_ping_decode(last_msg, &packet2);
212 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
214 memset(&packet2, 0, sizeof(packet2));
215 mavlink_msg_ping_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.seq , packet1.target_system , packet1.target_component );
216 mavlink_msg_ping_decode(last_msg, &packet2);
217 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
220 static void mavlink_test_change_operator_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
222 mavlink_message_t msg;
223 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
224 uint16_t i;
225 mavlink_change_operator_control_t packet_in = {
226 5,72,139,"DEFGHIJKLMNOPQRSTUVWXYZA"
228 mavlink_change_operator_control_t packet1, packet2;
229 memset(&packet1, 0, sizeof(packet1));
230 packet1.target_system = packet_in.target_system;
231 packet1.control_request = packet_in.control_request;
232 packet1.version = packet_in.version;
234 mav_array_memcpy(packet1.passkey, packet_in.passkey, sizeof(char)*25);
237 memset(&packet2, 0, sizeof(packet2));
238 mavlink_msg_change_operator_control_encode(system_id, component_id, &msg, &packet1);
239 mavlink_msg_change_operator_control_decode(&msg, &packet2);
240 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
242 memset(&packet2, 0, sizeof(packet2));
243 mavlink_msg_change_operator_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.control_request , packet1.version , packet1.passkey );
244 mavlink_msg_change_operator_control_decode(&msg, &packet2);
245 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
247 memset(&packet2, 0, sizeof(packet2));
248 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 );
249 mavlink_msg_change_operator_control_decode(&msg, &packet2);
250 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
252 memset(&packet2, 0, sizeof(packet2));
253 mavlink_msg_to_send_buffer(buffer, &msg);
254 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
255 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
257 mavlink_msg_change_operator_control_decode(last_msg, &packet2);
258 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
260 memset(&packet2, 0, sizeof(packet2));
261 mavlink_msg_change_operator_control_send(MAVLINK_COMM_1 , packet1.target_system , packet1.control_request , packet1.version , packet1.passkey );
262 mavlink_msg_change_operator_control_decode(last_msg, &packet2);
263 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
266 static void mavlink_test_change_operator_control_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
268 mavlink_message_t msg;
269 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
270 uint16_t i;
271 mavlink_change_operator_control_ack_t packet_in = {
272 5,72,139
274 mavlink_change_operator_control_ack_t packet1, packet2;
275 memset(&packet1, 0, sizeof(packet1));
276 packet1.gcs_system_id = packet_in.gcs_system_id;
277 packet1.control_request = packet_in.control_request;
278 packet1.ack = packet_in.ack;
282 memset(&packet2, 0, sizeof(packet2));
283 mavlink_msg_change_operator_control_ack_encode(system_id, component_id, &msg, &packet1);
284 mavlink_msg_change_operator_control_ack_decode(&msg, &packet2);
285 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
287 memset(&packet2, 0, sizeof(packet2));
288 mavlink_msg_change_operator_control_ack_pack(system_id, component_id, &msg , packet1.gcs_system_id , packet1.control_request , packet1.ack );
289 mavlink_msg_change_operator_control_ack_decode(&msg, &packet2);
290 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
292 memset(&packet2, 0, sizeof(packet2));
293 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 );
294 mavlink_msg_change_operator_control_ack_decode(&msg, &packet2);
295 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
297 memset(&packet2, 0, sizeof(packet2));
298 mavlink_msg_to_send_buffer(buffer, &msg);
299 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
300 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
302 mavlink_msg_change_operator_control_ack_decode(last_msg, &packet2);
303 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
305 memset(&packet2, 0, sizeof(packet2));
306 mavlink_msg_change_operator_control_ack_send(MAVLINK_COMM_1 , packet1.gcs_system_id , packet1.control_request , packet1.ack );
307 mavlink_msg_change_operator_control_ack_decode(last_msg, &packet2);
308 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
311 static void mavlink_test_auth_key(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
313 mavlink_message_t msg;
314 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
315 uint16_t i;
316 mavlink_auth_key_t packet_in = {
317 "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDE"
319 mavlink_auth_key_t packet1, packet2;
320 memset(&packet1, 0, sizeof(packet1));
322 mav_array_memcpy(packet1.key, packet_in.key, sizeof(char)*32);
325 memset(&packet2, 0, sizeof(packet2));
326 mavlink_msg_auth_key_encode(system_id, component_id, &msg, &packet1);
327 mavlink_msg_auth_key_decode(&msg, &packet2);
328 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
330 memset(&packet2, 0, sizeof(packet2));
331 mavlink_msg_auth_key_pack(system_id, component_id, &msg , packet1.key );
332 mavlink_msg_auth_key_decode(&msg, &packet2);
333 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
335 memset(&packet2, 0, sizeof(packet2));
336 mavlink_msg_auth_key_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.key );
337 mavlink_msg_auth_key_decode(&msg, &packet2);
338 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
340 memset(&packet2, 0, sizeof(packet2));
341 mavlink_msg_to_send_buffer(buffer, &msg);
342 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
343 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
345 mavlink_msg_auth_key_decode(last_msg, &packet2);
346 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
348 memset(&packet2, 0, sizeof(packet2));
349 mavlink_msg_auth_key_send(MAVLINK_COMM_1 , packet1.key );
350 mavlink_msg_auth_key_decode(last_msg, &packet2);
351 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
354 static void mavlink_test_set_mode(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
356 mavlink_message_t msg;
357 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
358 uint16_t i;
359 mavlink_set_mode_t packet_in = {
360 963497464,17,84
362 mavlink_set_mode_t packet1, packet2;
363 memset(&packet1, 0, sizeof(packet1));
364 packet1.custom_mode = packet_in.custom_mode;
365 packet1.target_system = packet_in.target_system;
366 packet1.base_mode = packet_in.base_mode;
370 memset(&packet2, 0, sizeof(packet2));
371 mavlink_msg_set_mode_encode(system_id, component_id, &msg, &packet1);
372 mavlink_msg_set_mode_decode(&msg, &packet2);
373 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
375 memset(&packet2, 0, sizeof(packet2));
376 mavlink_msg_set_mode_pack(system_id, component_id, &msg , packet1.target_system , packet1.base_mode , packet1.custom_mode );
377 mavlink_msg_set_mode_decode(&msg, &packet2);
378 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
380 memset(&packet2, 0, sizeof(packet2));
381 mavlink_msg_set_mode_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.base_mode , packet1.custom_mode );
382 mavlink_msg_set_mode_decode(&msg, &packet2);
383 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
385 memset(&packet2, 0, sizeof(packet2));
386 mavlink_msg_to_send_buffer(buffer, &msg);
387 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
388 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
390 mavlink_msg_set_mode_decode(last_msg, &packet2);
391 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
393 memset(&packet2, 0, sizeof(packet2));
394 mavlink_msg_set_mode_send(MAVLINK_COMM_1 , packet1.target_system , packet1.base_mode , packet1.custom_mode );
395 mavlink_msg_set_mode_decode(last_msg, &packet2);
396 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
399 static void mavlink_test_param_request_read(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
401 mavlink_message_t msg;
402 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
403 uint16_t i;
404 mavlink_param_request_read_t packet_in = {
405 17235,139,206,"EFGHIJKLMNOPQRS"
407 mavlink_param_request_read_t packet1, packet2;
408 memset(&packet1, 0, sizeof(packet1));
409 packet1.param_index = packet_in.param_index;
410 packet1.target_system = packet_in.target_system;
411 packet1.target_component = packet_in.target_component;
413 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
416 memset(&packet2, 0, sizeof(packet2));
417 mavlink_msg_param_request_read_encode(system_id, component_id, &msg, &packet1);
418 mavlink_msg_param_request_read_decode(&msg, &packet2);
419 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
421 memset(&packet2, 0, sizeof(packet2));
422 mavlink_msg_param_request_read_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index );
423 mavlink_msg_param_request_read_decode(&msg, &packet2);
424 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
426 memset(&packet2, 0, sizeof(packet2));
427 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 );
428 mavlink_msg_param_request_read_decode(&msg, &packet2);
429 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
431 memset(&packet2, 0, sizeof(packet2));
432 mavlink_msg_to_send_buffer(buffer, &msg);
433 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
434 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
436 mavlink_msg_param_request_read_decode(last_msg, &packet2);
437 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
439 memset(&packet2, 0, sizeof(packet2));
440 mavlink_msg_param_request_read_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index );
441 mavlink_msg_param_request_read_decode(last_msg, &packet2);
442 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
445 static void mavlink_test_param_request_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
447 mavlink_message_t msg;
448 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
449 uint16_t i;
450 mavlink_param_request_list_t packet_in = {
451 5,72
453 mavlink_param_request_list_t packet1, packet2;
454 memset(&packet1, 0, sizeof(packet1));
455 packet1.target_system = packet_in.target_system;
456 packet1.target_component = packet_in.target_component;
460 memset(&packet2, 0, sizeof(packet2));
461 mavlink_msg_param_request_list_encode(system_id, component_id, &msg, &packet1);
462 mavlink_msg_param_request_list_decode(&msg, &packet2);
463 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
465 memset(&packet2, 0, sizeof(packet2));
466 mavlink_msg_param_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
467 mavlink_msg_param_request_list_decode(&msg, &packet2);
468 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
470 memset(&packet2, 0, sizeof(packet2));
471 mavlink_msg_param_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
472 mavlink_msg_param_request_list_decode(&msg, &packet2);
473 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
475 memset(&packet2, 0, sizeof(packet2));
476 mavlink_msg_to_send_buffer(buffer, &msg);
477 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
478 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
480 mavlink_msg_param_request_list_decode(last_msg, &packet2);
481 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
483 memset(&packet2, 0, sizeof(packet2));
484 mavlink_msg_param_request_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
485 mavlink_msg_param_request_list_decode(last_msg, &packet2);
486 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
489 static void mavlink_test_param_value(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
491 mavlink_message_t msg;
492 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
493 uint16_t i;
494 mavlink_param_value_t packet_in = {
495 17.0,17443,17547,"IJKLMNOPQRSTUVW",77
497 mavlink_param_value_t packet1, packet2;
498 memset(&packet1, 0, sizeof(packet1));
499 packet1.param_value = packet_in.param_value;
500 packet1.param_count = packet_in.param_count;
501 packet1.param_index = packet_in.param_index;
502 packet1.param_type = packet_in.param_type;
504 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
507 memset(&packet2, 0, sizeof(packet2));
508 mavlink_msg_param_value_encode(system_id, component_id, &msg, &packet1);
509 mavlink_msg_param_value_decode(&msg, &packet2);
510 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
512 memset(&packet2, 0, sizeof(packet2));
513 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 );
514 mavlink_msg_param_value_decode(&msg, &packet2);
515 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
517 memset(&packet2, 0, sizeof(packet2));
518 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 );
519 mavlink_msg_param_value_decode(&msg, &packet2);
520 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
522 memset(&packet2, 0, sizeof(packet2));
523 mavlink_msg_to_send_buffer(buffer, &msg);
524 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
525 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
527 mavlink_msg_param_value_decode(last_msg, &packet2);
528 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
530 memset(&packet2, 0, sizeof(packet2));
531 mavlink_msg_param_value_send(MAVLINK_COMM_1 , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_count , packet1.param_index );
532 mavlink_msg_param_value_decode(last_msg, &packet2);
533 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
536 static void mavlink_test_param_set(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
538 mavlink_message_t msg;
539 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
540 uint16_t i;
541 mavlink_param_set_t packet_in = {
542 17.0,17,84,"GHIJKLMNOPQRSTU",199
544 mavlink_param_set_t packet1, packet2;
545 memset(&packet1, 0, sizeof(packet1));
546 packet1.param_value = packet_in.param_value;
547 packet1.target_system = packet_in.target_system;
548 packet1.target_component = packet_in.target_component;
549 packet1.param_type = packet_in.param_type;
551 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
554 memset(&packet2, 0, sizeof(packet2));
555 mavlink_msg_param_set_encode(system_id, component_id, &msg, &packet1);
556 mavlink_msg_param_set_decode(&msg, &packet2);
557 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
559 memset(&packet2, 0, sizeof(packet2));
560 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 );
561 mavlink_msg_param_set_decode(&msg, &packet2);
562 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
564 memset(&packet2, 0, sizeof(packet2));
565 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 );
566 mavlink_msg_param_set_decode(&msg, &packet2);
567 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
569 memset(&packet2, 0, sizeof(packet2));
570 mavlink_msg_to_send_buffer(buffer, &msg);
571 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
572 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
574 mavlink_msg_param_set_decode(last_msg, &packet2);
575 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
577 memset(&packet2, 0, sizeof(packet2));
578 mavlink_msg_param_set_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type );
579 mavlink_msg_param_set_decode(last_msg, &packet2);
580 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
583 static void mavlink_test_gps_raw_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
585 mavlink_message_t msg;
586 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
587 uint16_t i;
588 mavlink_gps_raw_int_t packet_in = {
589 93372036854775807ULL,963497880,963498088,963498296,18275,18379,18483,18587,89,156
591 mavlink_gps_raw_int_t packet1, packet2;
592 memset(&packet1, 0, sizeof(packet1));
593 packet1.time_usec = packet_in.time_usec;
594 packet1.lat = packet_in.lat;
595 packet1.lon = packet_in.lon;
596 packet1.alt = packet_in.alt;
597 packet1.eph = packet_in.eph;
598 packet1.epv = packet_in.epv;
599 packet1.vel = packet_in.vel;
600 packet1.cog = packet_in.cog;
601 packet1.fix_type = packet_in.fix_type;
602 packet1.satellites_visible = packet_in.satellites_visible;
606 memset(&packet2, 0, sizeof(packet2));
607 mavlink_msg_gps_raw_int_encode(system_id, component_id, &msg, &packet1);
608 mavlink_msg_gps_raw_int_decode(&msg, &packet2);
609 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
611 memset(&packet2, 0, sizeof(packet2));
612 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 );
613 mavlink_msg_gps_raw_int_decode(&msg, &packet2);
614 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
616 memset(&packet2, 0, sizeof(packet2));
617 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 );
618 mavlink_msg_gps_raw_int_decode(&msg, &packet2);
619 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
621 memset(&packet2, 0, sizeof(packet2));
622 mavlink_msg_to_send_buffer(buffer, &msg);
623 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
624 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
626 mavlink_msg_gps_raw_int_decode(last_msg, &packet2);
627 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
629 memset(&packet2, 0, sizeof(packet2));
630 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 );
631 mavlink_msg_gps_raw_int_decode(last_msg, &packet2);
632 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
635 static void mavlink_test_gps_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
637 mavlink_message_t msg;
638 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
639 uint16_t i;
640 mavlink_gps_status_t packet_in = {
641 5,{ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91 },{ 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151 },{ 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211 },{ 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },{ 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75 }
643 mavlink_gps_status_t packet1, packet2;
644 memset(&packet1, 0, sizeof(packet1));
645 packet1.satellites_visible = packet_in.satellites_visible;
647 mav_array_memcpy(packet1.satellite_prn, packet_in.satellite_prn, sizeof(uint8_t)*20);
648 mav_array_memcpy(packet1.satellite_used, packet_in.satellite_used, sizeof(uint8_t)*20);
649 mav_array_memcpy(packet1.satellite_elevation, packet_in.satellite_elevation, sizeof(uint8_t)*20);
650 mav_array_memcpy(packet1.satellite_azimuth, packet_in.satellite_azimuth, sizeof(uint8_t)*20);
651 mav_array_memcpy(packet1.satellite_snr, packet_in.satellite_snr, sizeof(uint8_t)*20);
654 memset(&packet2, 0, sizeof(packet2));
655 mavlink_msg_gps_status_encode(system_id, component_id, &msg, &packet1);
656 mavlink_msg_gps_status_decode(&msg, &packet2);
657 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
659 memset(&packet2, 0, sizeof(packet2));
660 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 );
661 mavlink_msg_gps_status_decode(&msg, &packet2);
662 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
664 memset(&packet2, 0, sizeof(packet2));
665 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 );
666 mavlink_msg_gps_status_decode(&msg, &packet2);
667 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
669 memset(&packet2, 0, sizeof(packet2));
670 mavlink_msg_to_send_buffer(buffer, &msg);
671 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
672 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
674 mavlink_msg_gps_status_decode(last_msg, &packet2);
675 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
677 memset(&packet2, 0, sizeof(packet2));
678 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 );
679 mavlink_msg_gps_status_decode(last_msg, &packet2);
680 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
683 static void mavlink_test_scaled_imu(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
685 mavlink_message_t msg;
686 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
687 uint16_t i;
688 mavlink_scaled_imu_t packet_in = {
689 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275
691 mavlink_scaled_imu_t packet1, packet2;
692 memset(&packet1, 0, sizeof(packet1));
693 packet1.time_boot_ms = packet_in.time_boot_ms;
694 packet1.xacc = packet_in.xacc;
695 packet1.yacc = packet_in.yacc;
696 packet1.zacc = packet_in.zacc;
697 packet1.xgyro = packet_in.xgyro;
698 packet1.ygyro = packet_in.ygyro;
699 packet1.zgyro = packet_in.zgyro;
700 packet1.xmag = packet_in.xmag;
701 packet1.ymag = packet_in.ymag;
702 packet1.zmag = packet_in.zmag;
706 memset(&packet2, 0, sizeof(packet2));
707 mavlink_msg_scaled_imu_encode(system_id, component_id, &msg, &packet1);
708 mavlink_msg_scaled_imu_decode(&msg, &packet2);
709 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
711 memset(&packet2, 0, sizeof(packet2));
712 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 );
713 mavlink_msg_scaled_imu_decode(&msg, &packet2);
714 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
716 memset(&packet2, 0, sizeof(packet2));
717 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 );
718 mavlink_msg_scaled_imu_decode(&msg, &packet2);
719 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
721 memset(&packet2, 0, sizeof(packet2));
722 mavlink_msg_to_send_buffer(buffer, &msg);
723 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
724 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
726 mavlink_msg_scaled_imu_decode(last_msg, &packet2);
727 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
729 memset(&packet2, 0, sizeof(packet2));
730 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 );
731 mavlink_msg_scaled_imu_decode(last_msg, &packet2);
732 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
735 static void mavlink_test_raw_imu(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
737 mavlink_message_t msg;
738 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
739 uint16_t i;
740 mavlink_raw_imu_t packet_in = {
741 93372036854775807ULL,17651,17755,17859,17963,18067,18171,18275,18379,18483
743 mavlink_raw_imu_t packet1, packet2;
744 memset(&packet1, 0, sizeof(packet1));
745 packet1.time_usec = packet_in.time_usec;
746 packet1.xacc = packet_in.xacc;
747 packet1.yacc = packet_in.yacc;
748 packet1.zacc = packet_in.zacc;
749 packet1.xgyro = packet_in.xgyro;
750 packet1.ygyro = packet_in.ygyro;
751 packet1.zgyro = packet_in.zgyro;
752 packet1.xmag = packet_in.xmag;
753 packet1.ymag = packet_in.ymag;
754 packet1.zmag = packet_in.zmag;
758 memset(&packet2, 0, sizeof(packet2));
759 mavlink_msg_raw_imu_encode(system_id, component_id, &msg, &packet1);
760 mavlink_msg_raw_imu_decode(&msg, &packet2);
761 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
763 memset(&packet2, 0, sizeof(packet2));
764 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 );
765 mavlink_msg_raw_imu_decode(&msg, &packet2);
766 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
768 memset(&packet2, 0, sizeof(packet2));
769 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 );
770 mavlink_msg_raw_imu_decode(&msg, &packet2);
771 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
773 memset(&packet2, 0, sizeof(packet2));
774 mavlink_msg_to_send_buffer(buffer, &msg);
775 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
776 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
778 mavlink_msg_raw_imu_decode(last_msg, &packet2);
779 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
781 memset(&packet2, 0, sizeof(packet2));
782 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 );
783 mavlink_msg_raw_imu_decode(last_msg, &packet2);
784 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
787 static void mavlink_test_raw_pressure(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
789 mavlink_message_t msg;
790 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
791 uint16_t i;
792 mavlink_raw_pressure_t packet_in = {
793 93372036854775807ULL,17651,17755,17859,17963
795 mavlink_raw_pressure_t packet1, packet2;
796 memset(&packet1, 0, sizeof(packet1));
797 packet1.time_usec = packet_in.time_usec;
798 packet1.press_abs = packet_in.press_abs;
799 packet1.press_diff1 = packet_in.press_diff1;
800 packet1.press_diff2 = packet_in.press_diff2;
801 packet1.temperature = packet_in.temperature;
805 memset(&packet2, 0, sizeof(packet2));
806 mavlink_msg_raw_pressure_encode(system_id, component_id, &msg, &packet1);
807 mavlink_msg_raw_pressure_decode(&msg, &packet2);
808 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
810 memset(&packet2, 0, sizeof(packet2));
811 mavlink_msg_raw_pressure_pack(system_id, component_id, &msg , packet1.time_usec , packet1.press_abs , packet1.press_diff1 , packet1.press_diff2 , packet1.temperature );
812 mavlink_msg_raw_pressure_decode(&msg, &packet2);
813 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
815 memset(&packet2, 0, sizeof(packet2));
816 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 );
817 mavlink_msg_raw_pressure_decode(&msg, &packet2);
818 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
820 memset(&packet2, 0, sizeof(packet2));
821 mavlink_msg_to_send_buffer(buffer, &msg);
822 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
823 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
825 mavlink_msg_raw_pressure_decode(last_msg, &packet2);
826 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
828 memset(&packet2, 0, sizeof(packet2));
829 mavlink_msg_raw_pressure_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.press_abs , packet1.press_diff1 , packet1.press_diff2 , packet1.temperature );
830 mavlink_msg_raw_pressure_decode(last_msg, &packet2);
831 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
834 static void mavlink_test_scaled_pressure(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
836 mavlink_message_t msg;
837 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
838 uint16_t i;
839 mavlink_scaled_pressure_t packet_in = {
840 963497464,45.0,73.0,17859
842 mavlink_scaled_pressure_t packet1, packet2;
843 memset(&packet1, 0, sizeof(packet1));
844 packet1.time_boot_ms = packet_in.time_boot_ms;
845 packet1.press_abs = packet_in.press_abs;
846 packet1.press_diff = packet_in.press_diff;
847 packet1.temperature = packet_in.temperature;
851 memset(&packet2, 0, sizeof(packet2));
852 mavlink_msg_scaled_pressure_encode(system_id, component_id, &msg, &packet1);
853 mavlink_msg_scaled_pressure_decode(&msg, &packet2);
854 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
856 memset(&packet2, 0, sizeof(packet2));
857 mavlink_msg_scaled_pressure_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature );
858 mavlink_msg_scaled_pressure_decode(&msg, &packet2);
859 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
861 memset(&packet2, 0, sizeof(packet2));
862 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 );
863 mavlink_msg_scaled_pressure_decode(&msg, &packet2);
864 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
866 memset(&packet2, 0, sizeof(packet2));
867 mavlink_msg_to_send_buffer(buffer, &msg);
868 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
869 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
871 mavlink_msg_scaled_pressure_decode(last_msg, &packet2);
872 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
874 memset(&packet2, 0, sizeof(packet2));
875 mavlink_msg_scaled_pressure_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature );
876 mavlink_msg_scaled_pressure_decode(last_msg, &packet2);
877 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
880 static void mavlink_test_attitude(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
882 mavlink_message_t msg;
883 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
884 uint16_t i;
885 mavlink_attitude_t packet_in = {
886 963497464,45.0,73.0,101.0,129.0,157.0,185.0
888 mavlink_attitude_t packet1, packet2;
889 memset(&packet1, 0, sizeof(packet1));
890 packet1.time_boot_ms = packet_in.time_boot_ms;
891 packet1.roll = packet_in.roll;
892 packet1.pitch = packet_in.pitch;
893 packet1.yaw = packet_in.yaw;
894 packet1.rollspeed = packet_in.rollspeed;
895 packet1.pitchspeed = packet_in.pitchspeed;
896 packet1.yawspeed = packet_in.yawspeed;
900 memset(&packet2, 0, sizeof(packet2));
901 mavlink_msg_attitude_encode(system_id, component_id, &msg, &packet1);
902 mavlink_msg_attitude_decode(&msg, &packet2);
903 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
905 memset(&packet2, 0, sizeof(packet2));
906 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 );
907 mavlink_msg_attitude_decode(&msg, &packet2);
908 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
910 memset(&packet2, 0, sizeof(packet2));
911 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 );
912 mavlink_msg_attitude_decode(&msg, &packet2);
913 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
915 memset(&packet2, 0, sizeof(packet2));
916 mavlink_msg_to_send_buffer(buffer, &msg);
917 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
918 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
920 mavlink_msg_attitude_decode(last_msg, &packet2);
921 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
923 memset(&packet2, 0, sizeof(packet2));
924 mavlink_msg_attitude_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed );
925 mavlink_msg_attitude_decode(last_msg, &packet2);
926 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
929 static void mavlink_test_attitude_quaternion(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
931 mavlink_message_t msg;
932 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
933 uint16_t i;
934 mavlink_attitude_quaternion_t packet_in = {
935 963497464,45.0,73.0,101.0,129.0,157.0,185.0,213.0
937 mavlink_attitude_quaternion_t packet1, packet2;
938 memset(&packet1, 0, sizeof(packet1));
939 packet1.time_boot_ms = packet_in.time_boot_ms;
940 packet1.q1 = packet_in.q1;
941 packet1.q2 = packet_in.q2;
942 packet1.q3 = packet_in.q3;
943 packet1.q4 = packet_in.q4;
944 packet1.rollspeed = packet_in.rollspeed;
945 packet1.pitchspeed = packet_in.pitchspeed;
946 packet1.yawspeed = packet_in.yawspeed;
950 memset(&packet2, 0, sizeof(packet2));
951 mavlink_msg_attitude_quaternion_encode(system_id, component_id, &msg, &packet1);
952 mavlink_msg_attitude_quaternion_decode(&msg, &packet2);
953 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
955 memset(&packet2, 0, sizeof(packet2));
956 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 );
957 mavlink_msg_attitude_quaternion_decode(&msg, &packet2);
958 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
960 memset(&packet2, 0, sizeof(packet2));
961 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 );
962 mavlink_msg_attitude_quaternion_decode(&msg, &packet2);
963 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
965 memset(&packet2, 0, sizeof(packet2));
966 mavlink_msg_to_send_buffer(buffer, &msg);
967 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
968 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
970 mavlink_msg_attitude_quaternion_decode(last_msg, &packet2);
971 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
973 memset(&packet2, 0, sizeof(packet2));
974 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 );
975 mavlink_msg_attitude_quaternion_decode(last_msg, &packet2);
976 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
979 static void mavlink_test_local_position_ned(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
981 mavlink_message_t msg;
982 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
983 uint16_t i;
984 mavlink_local_position_ned_t packet_in = {
985 963497464,45.0,73.0,101.0,129.0,157.0,185.0
987 mavlink_local_position_ned_t packet1, packet2;
988 memset(&packet1, 0, sizeof(packet1));
989 packet1.time_boot_ms = packet_in.time_boot_ms;
990 packet1.x = packet_in.x;
991 packet1.y = packet_in.y;
992 packet1.z = packet_in.z;
993 packet1.vx = packet_in.vx;
994 packet1.vy = packet_in.vy;
995 packet1.vz = packet_in.vz;
999 memset(&packet2, 0, sizeof(packet2));
1000 mavlink_msg_local_position_ned_encode(system_id, component_id, &msg, &packet1);
1001 mavlink_msg_local_position_ned_decode(&msg, &packet2);
1002 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1004 memset(&packet2, 0, sizeof(packet2));
1005 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 );
1006 mavlink_msg_local_position_ned_decode(&msg, &packet2);
1007 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1009 memset(&packet2, 0, sizeof(packet2));
1010 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 );
1011 mavlink_msg_local_position_ned_decode(&msg, &packet2);
1012 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1014 memset(&packet2, 0, sizeof(packet2));
1015 mavlink_msg_to_send_buffer(buffer, &msg);
1016 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1017 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1019 mavlink_msg_local_position_ned_decode(last_msg, &packet2);
1020 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1022 memset(&packet2, 0, sizeof(packet2));
1023 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 );
1024 mavlink_msg_local_position_ned_decode(last_msg, &packet2);
1025 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1028 static void mavlink_test_global_position_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1030 mavlink_message_t msg;
1031 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1032 uint16_t i;
1033 mavlink_global_position_int_t packet_in = {
1034 963497464,963497672,963497880,963498088,963498296,18275,18379,18483,18587
1036 mavlink_global_position_int_t packet1, packet2;
1037 memset(&packet1, 0, sizeof(packet1));
1038 packet1.time_boot_ms = packet_in.time_boot_ms;
1039 packet1.lat = packet_in.lat;
1040 packet1.lon = packet_in.lon;
1041 packet1.alt = packet_in.alt;
1042 packet1.relative_alt = packet_in.relative_alt;
1043 packet1.vx = packet_in.vx;
1044 packet1.vy = packet_in.vy;
1045 packet1.vz = packet_in.vz;
1046 packet1.hdg = packet_in.hdg;
1050 memset(&packet2, 0, sizeof(packet2));
1051 mavlink_msg_global_position_int_encode(system_id, component_id, &msg, &packet1);
1052 mavlink_msg_global_position_int_decode(&msg, &packet2);
1053 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1055 memset(&packet2, 0, sizeof(packet2));
1056 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 );
1057 mavlink_msg_global_position_int_decode(&msg, &packet2);
1058 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1060 memset(&packet2, 0, sizeof(packet2));
1061 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 );
1062 mavlink_msg_global_position_int_decode(&msg, &packet2);
1063 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1065 memset(&packet2, 0, sizeof(packet2));
1066 mavlink_msg_to_send_buffer(buffer, &msg);
1067 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1068 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1070 mavlink_msg_global_position_int_decode(last_msg, &packet2);
1071 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1073 memset(&packet2, 0, sizeof(packet2));
1074 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 );
1075 mavlink_msg_global_position_int_decode(last_msg, &packet2);
1076 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1079 static void mavlink_test_rc_channels_scaled(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1081 mavlink_message_t msg;
1082 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1083 uint16_t i;
1084 mavlink_rc_channels_scaled_t packet_in = {
1085 963497464,17443,17547,17651,17755,17859,17963,18067,18171,65,132
1087 mavlink_rc_channels_scaled_t packet1, packet2;
1088 memset(&packet1, 0, sizeof(packet1));
1089 packet1.time_boot_ms = packet_in.time_boot_ms;
1090 packet1.chan1_scaled = packet_in.chan1_scaled;
1091 packet1.chan2_scaled = packet_in.chan2_scaled;
1092 packet1.chan3_scaled = packet_in.chan3_scaled;
1093 packet1.chan4_scaled = packet_in.chan4_scaled;
1094 packet1.chan5_scaled = packet_in.chan5_scaled;
1095 packet1.chan6_scaled = packet_in.chan6_scaled;
1096 packet1.chan7_scaled = packet_in.chan7_scaled;
1097 packet1.chan8_scaled = packet_in.chan8_scaled;
1098 packet1.port = packet_in.port;
1099 packet1.rssi = packet_in.rssi;
1103 memset(&packet2, 0, sizeof(packet2));
1104 mavlink_msg_rc_channels_scaled_encode(system_id, component_id, &msg, &packet1);
1105 mavlink_msg_rc_channels_scaled_decode(&msg, &packet2);
1106 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1108 memset(&packet2, 0, sizeof(packet2));
1109 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 );
1110 mavlink_msg_rc_channels_scaled_decode(&msg, &packet2);
1111 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1113 memset(&packet2, 0, sizeof(packet2));
1114 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 );
1115 mavlink_msg_rc_channels_scaled_decode(&msg, &packet2);
1116 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1118 memset(&packet2, 0, sizeof(packet2));
1119 mavlink_msg_to_send_buffer(buffer, &msg);
1120 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1121 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1123 mavlink_msg_rc_channels_scaled_decode(last_msg, &packet2);
1124 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1126 memset(&packet2, 0, sizeof(packet2));
1127 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 );
1128 mavlink_msg_rc_channels_scaled_decode(last_msg, &packet2);
1129 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1132 static void mavlink_test_rc_channels_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1134 mavlink_message_t msg;
1135 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1136 uint16_t i;
1137 mavlink_rc_channels_raw_t packet_in = {
1138 963497464,17443,17547,17651,17755,17859,17963,18067,18171,65,132
1140 mavlink_rc_channels_raw_t packet1, packet2;
1141 memset(&packet1, 0, sizeof(packet1));
1142 packet1.time_boot_ms = packet_in.time_boot_ms;
1143 packet1.chan1_raw = packet_in.chan1_raw;
1144 packet1.chan2_raw = packet_in.chan2_raw;
1145 packet1.chan3_raw = packet_in.chan3_raw;
1146 packet1.chan4_raw = packet_in.chan4_raw;
1147 packet1.chan5_raw = packet_in.chan5_raw;
1148 packet1.chan6_raw = packet_in.chan6_raw;
1149 packet1.chan7_raw = packet_in.chan7_raw;
1150 packet1.chan8_raw = packet_in.chan8_raw;
1151 packet1.port = packet_in.port;
1152 packet1.rssi = packet_in.rssi;
1156 memset(&packet2, 0, sizeof(packet2));
1157 mavlink_msg_rc_channels_raw_encode(system_id, component_id, &msg, &packet1);
1158 mavlink_msg_rc_channels_raw_decode(&msg, &packet2);
1159 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1161 memset(&packet2, 0, sizeof(packet2));
1162 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 );
1163 mavlink_msg_rc_channels_raw_decode(&msg, &packet2);
1164 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1166 memset(&packet2, 0, sizeof(packet2));
1167 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 );
1168 mavlink_msg_rc_channels_raw_decode(&msg, &packet2);
1169 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1171 memset(&packet2, 0, sizeof(packet2));
1172 mavlink_msg_to_send_buffer(buffer, &msg);
1173 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1174 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1176 mavlink_msg_rc_channels_raw_decode(last_msg, &packet2);
1177 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1179 memset(&packet2, 0, sizeof(packet2));
1180 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 );
1181 mavlink_msg_rc_channels_raw_decode(last_msg, &packet2);
1182 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1185 static void mavlink_test_servo_output_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1187 mavlink_message_t msg;
1188 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1189 uint16_t i;
1190 mavlink_servo_output_raw_t packet_in = {
1191 963497464,17443,17547,17651,17755,17859,17963,18067,18171,65
1193 mavlink_servo_output_raw_t packet1, packet2;
1194 memset(&packet1, 0, sizeof(packet1));
1195 packet1.time_usec = packet_in.time_usec;
1196 packet1.servo1_raw = packet_in.servo1_raw;
1197 packet1.servo2_raw = packet_in.servo2_raw;
1198 packet1.servo3_raw = packet_in.servo3_raw;
1199 packet1.servo4_raw = packet_in.servo4_raw;
1200 packet1.servo5_raw = packet_in.servo5_raw;
1201 packet1.servo6_raw = packet_in.servo6_raw;
1202 packet1.servo7_raw = packet_in.servo7_raw;
1203 packet1.servo8_raw = packet_in.servo8_raw;
1204 packet1.port = packet_in.port;
1208 memset(&packet2, 0, sizeof(packet2));
1209 mavlink_msg_servo_output_raw_encode(system_id, component_id, &msg, &packet1);
1210 mavlink_msg_servo_output_raw_decode(&msg, &packet2);
1211 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1213 memset(&packet2, 0, sizeof(packet2));
1214 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 );
1215 mavlink_msg_servo_output_raw_decode(&msg, &packet2);
1216 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1218 memset(&packet2, 0, sizeof(packet2));
1219 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 );
1220 mavlink_msg_servo_output_raw_decode(&msg, &packet2);
1221 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1223 memset(&packet2, 0, sizeof(packet2));
1224 mavlink_msg_to_send_buffer(buffer, &msg);
1225 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1226 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1228 mavlink_msg_servo_output_raw_decode(last_msg, &packet2);
1229 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1231 memset(&packet2, 0, sizeof(packet2));
1232 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 );
1233 mavlink_msg_servo_output_raw_decode(last_msg, &packet2);
1234 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1237 static void mavlink_test_mission_request_partial_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1239 mavlink_message_t msg;
1240 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1241 uint16_t i;
1242 mavlink_mission_request_partial_list_t packet_in = {
1243 17235,17339,17,84
1245 mavlink_mission_request_partial_list_t packet1, packet2;
1246 memset(&packet1, 0, sizeof(packet1));
1247 packet1.start_index = packet_in.start_index;
1248 packet1.end_index = packet_in.end_index;
1249 packet1.target_system = packet_in.target_system;
1250 packet1.target_component = packet_in.target_component;
1254 memset(&packet2, 0, sizeof(packet2));
1255 mavlink_msg_mission_request_partial_list_encode(system_id, component_id, &msg, &packet1);
1256 mavlink_msg_mission_request_partial_list_decode(&msg, &packet2);
1257 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1259 memset(&packet2, 0, sizeof(packet2));
1260 mavlink_msg_mission_request_partial_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index );
1261 mavlink_msg_mission_request_partial_list_decode(&msg, &packet2);
1262 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1264 memset(&packet2, 0, sizeof(packet2));
1265 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 );
1266 mavlink_msg_mission_request_partial_list_decode(&msg, &packet2);
1267 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1269 memset(&packet2, 0, sizeof(packet2));
1270 mavlink_msg_to_send_buffer(buffer, &msg);
1271 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1272 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1274 mavlink_msg_mission_request_partial_list_decode(last_msg, &packet2);
1275 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1277 memset(&packet2, 0, sizeof(packet2));
1278 mavlink_msg_mission_request_partial_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index );
1279 mavlink_msg_mission_request_partial_list_decode(last_msg, &packet2);
1280 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1283 static void mavlink_test_mission_write_partial_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1285 mavlink_message_t msg;
1286 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1287 uint16_t i;
1288 mavlink_mission_write_partial_list_t packet_in = {
1289 17235,17339,17,84
1291 mavlink_mission_write_partial_list_t packet1, packet2;
1292 memset(&packet1, 0, sizeof(packet1));
1293 packet1.start_index = packet_in.start_index;
1294 packet1.end_index = packet_in.end_index;
1295 packet1.target_system = packet_in.target_system;
1296 packet1.target_component = packet_in.target_component;
1300 memset(&packet2, 0, sizeof(packet2));
1301 mavlink_msg_mission_write_partial_list_encode(system_id, component_id, &msg, &packet1);
1302 mavlink_msg_mission_write_partial_list_decode(&msg, &packet2);
1303 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1305 memset(&packet2, 0, sizeof(packet2));
1306 mavlink_msg_mission_write_partial_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index );
1307 mavlink_msg_mission_write_partial_list_decode(&msg, &packet2);
1308 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1310 memset(&packet2, 0, sizeof(packet2));
1311 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 );
1312 mavlink_msg_mission_write_partial_list_decode(&msg, &packet2);
1313 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1315 memset(&packet2, 0, sizeof(packet2));
1316 mavlink_msg_to_send_buffer(buffer, &msg);
1317 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1318 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1320 mavlink_msg_mission_write_partial_list_decode(last_msg, &packet2);
1321 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1323 memset(&packet2, 0, sizeof(packet2));
1324 mavlink_msg_mission_write_partial_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index );
1325 mavlink_msg_mission_write_partial_list_decode(last_msg, &packet2);
1326 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1329 static void mavlink_test_mission_item(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1331 mavlink_message_t msg;
1332 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1333 uint16_t i;
1334 mavlink_mission_item_t packet_in = {
1335 17.0,45.0,73.0,101.0,129.0,157.0,185.0,18691,18795,101,168,235,46,113
1337 mavlink_mission_item_t packet1, packet2;
1338 memset(&packet1, 0, sizeof(packet1));
1339 packet1.param1 = packet_in.param1;
1340 packet1.param2 = packet_in.param2;
1341 packet1.param3 = packet_in.param3;
1342 packet1.param4 = packet_in.param4;
1343 packet1.x = packet_in.x;
1344 packet1.y = packet_in.y;
1345 packet1.z = packet_in.z;
1346 packet1.seq = packet_in.seq;
1347 packet1.command = packet_in.command;
1348 packet1.target_system = packet_in.target_system;
1349 packet1.target_component = packet_in.target_component;
1350 packet1.frame = packet_in.frame;
1351 packet1.current = packet_in.current;
1352 packet1.autocontinue = packet_in.autocontinue;
1356 memset(&packet2, 0, sizeof(packet2));
1357 mavlink_msg_mission_item_encode(system_id, component_id, &msg, &packet1);
1358 mavlink_msg_mission_item_decode(&msg, &packet2);
1359 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1361 memset(&packet2, 0, sizeof(packet2));
1362 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 );
1363 mavlink_msg_mission_item_decode(&msg, &packet2);
1364 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1366 memset(&packet2, 0, sizeof(packet2));
1367 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 );
1368 mavlink_msg_mission_item_decode(&msg, &packet2);
1369 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1371 memset(&packet2, 0, sizeof(packet2));
1372 mavlink_msg_to_send_buffer(buffer, &msg);
1373 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1374 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1376 mavlink_msg_mission_item_decode(last_msg, &packet2);
1377 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1379 memset(&packet2, 0, sizeof(packet2));
1380 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 );
1381 mavlink_msg_mission_item_decode(last_msg, &packet2);
1382 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1385 static void mavlink_test_mission_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1387 mavlink_message_t msg;
1388 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1389 uint16_t i;
1390 mavlink_mission_request_t packet_in = {
1391 17235,139,206
1393 mavlink_mission_request_t packet1, packet2;
1394 memset(&packet1, 0, sizeof(packet1));
1395 packet1.seq = packet_in.seq;
1396 packet1.target_system = packet_in.target_system;
1397 packet1.target_component = packet_in.target_component;
1401 memset(&packet2, 0, sizeof(packet2));
1402 mavlink_msg_mission_request_encode(system_id, component_id, &msg, &packet1);
1403 mavlink_msg_mission_request_decode(&msg, &packet2);
1404 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1406 memset(&packet2, 0, sizeof(packet2));
1407 mavlink_msg_mission_request_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq );
1408 mavlink_msg_mission_request_decode(&msg, &packet2);
1409 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1411 memset(&packet2, 0, sizeof(packet2));
1412 mavlink_msg_mission_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq );
1413 mavlink_msg_mission_request_decode(&msg, &packet2);
1414 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1416 memset(&packet2, 0, sizeof(packet2));
1417 mavlink_msg_to_send_buffer(buffer, &msg);
1418 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1419 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1421 mavlink_msg_mission_request_decode(last_msg, &packet2);
1422 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1424 memset(&packet2, 0, sizeof(packet2));
1425 mavlink_msg_mission_request_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seq );
1426 mavlink_msg_mission_request_decode(last_msg, &packet2);
1427 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1430 static void mavlink_test_mission_set_current(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1432 mavlink_message_t msg;
1433 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1434 uint16_t i;
1435 mavlink_mission_set_current_t packet_in = {
1436 17235,139,206
1438 mavlink_mission_set_current_t packet1, packet2;
1439 memset(&packet1, 0, sizeof(packet1));
1440 packet1.seq = packet_in.seq;
1441 packet1.target_system = packet_in.target_system;
1442 packet1.target_component = packet_in.target_component;
1446 memset(&packet2, 0, sizeof(packet2));
1447 mavlink_msg_mission_set_current_encode(system_id, component_id, &msg, &packet1);
1448 mavlink_msg_mission_set_current_decode(&msg, &packet2);
1449 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1451 memset(&packet2, 0, sizeof(packet2));
1452 mavlink_msg_mission_set_current_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq );
1453 mavlink_msg_mission_set_current_decode(&msg, &packet2);
1454 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1456 memset(&packet2, 0, sizeof(packet2));
1457 mavlink_msg_mission_set_current_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq );
1458 mavlink_msg_mission_set_current_decode(&msg, &packet2);
1459 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1461 memset(&packet2, 0, sizeof(packet2));
1462 mavlink_msg_to_send_buffer(buffer, &msg);
1463 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1464 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1466 mavlink_msg_mission_set_current_decode(last_msg, &packet2);
1467 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1469 memset(&packet2, 0, sizeof(packet2));
1470 mavlink_msg_mission_set_current_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seq );
1471 mavlink_msg_mission_set_current_decode(last_msg, &packet2);
1472 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1475 static void mavlink_test_mission_current(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1477 mavlink_message_t msg;
1478 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1479 uint16_t i;
1480 mavlink_mission_current_t packet_in = {
1481 17235
1483 mavlink_mission_current_t packet1, packet2;
1484 memset(&packet1, 0, sizeof(packet1));
1485 packet1.seq = packet_in.seq;
1489 memset(&packet2, 0, sizeof(packet2));
1490 mavlink_msg_mission_current_encode(system_id, component_id, &msg, &packet1);
1491 mavlink_msg_mission_current_decode(&msg, &packet2);
1492 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1494 memset(&packet2, 0, sizeof(packet2));
1495 mavlink_msg_mission_current_pack(system_id, component_id, &msg , packet1.seq );
1496 mavlink_msg_mission_current_decode(&msg, &packet2);
1497 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1499 memset(&packet2, 0, sizeof(packet2));
1500 mavlink_msg_mission_current_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seq );
1501 mavlink_msg_mission_current_decode(&msg, &packet2);
1502 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1504 memset(&packet2, 0, sizeof(packet2));
1505 mavlink_msg_to_send_buffer(buffer, &msg);
1506 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1507 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1509 mavlink_msg_mission_current_decode(last_msg, &packet2);
1510 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1512 memset(&packet2, 0, sizeof(packet2));
1513 mavlink_msg_mission_current_send(MAVLINK_COMM_1 , packet1.seq );
1514 mavlink_msg_mission_current_decode(last_msg, &packet2);
1515 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1518 static void mavlink_test_mission_request_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1520 mavlink_message_t msg;
1521 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1522 uint16_t i;
1523 mavlink_mission_request_list_t packet_in = {
1524 5,72
1526 mavlink_mission_request_list_t packet1, packet2;
1527 memset(&packet1, 0, sizeof(packet1));
1528 packet1.target_system = packet_in.target_system;
1529 packet1.target_component = packet_in.target_component;
1533 memset(&packet2, 0, sizeof(packet2));
1534 mavlink_msg_mission_request_list_encode(system_id, component_id, &msg, &packet1);
1535 mavlink_msg_mission_request_list_decode(&msg, &packet2);
1536 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1538 memset(&packet2, 0, sizeof(packet2));
1539 mavlink_msg_mission_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
1540 mavlink_msg_mission_request_list_decode(&msg, &packet2);
1541 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1543 memset(&packet2, 0, sizeof(packet2));
1544 mavlink_msg_mission_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
1545 mavlink_msg_mission_request_list_decode(&msg, &packet2);
1546 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1548 memset(&packet2, 0, sizeof(packet2));
1549 mavlink_msg_to_send_buffer(buffer, &msg);
1550 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1551 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1553 mavlink_msg_mission_request_list_decode(last_msg, &packet2);
1554 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1556 memset(&packet2, 0, sizeof(packet2));
1557 mavlink_msg_mission_request_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
1558 mavlink_msg_mission_request_list_decode(last_msg, &packet2);
1559 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1562 static void mavlink_test_mission_count(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1564 mavlink_message_t msg;
1565 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1566 uint16_t i;
1567 mavlink_mission_count_t packet_in = {
1568 17235,139,206
1570 mavlink_mission_count_t packet1, packet2;
1571 memset(&packet1, 0, sizeof(packet1));
1572 packet1.count = packet_in.count;
1573 packet1.target_system = packet_in.target_system;
1574 packet1.target_component = packet_in.target_component;
1578 memset(&packet2, 0, sizeof(packet2));
1579 mavlink_msg_mission_count_encode(system_id, component_id, &msg, &packet1);
1580 mavlink_msg_mission_count_decode(&msg, &packet2);
1581 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1583 memset(&packet2, 0, sizeof(packet2));
1584 mavlink_msg_mission_count_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.count );
1585 mavlink_msg_mission_count_decode(&msg, &packet2);
1586 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1588 memset(&packet2, 0, sizeof(packet2));
1589 mavlink_msg_mission_count_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.count );
1590 mavlink_msg_mission_count_decode(&msg, &packet2);
1591 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1593 memset(&packet2, 0, sizeof(packet2));
1594 mavlink_msg_to_send_buffer(buffer, &msg);
1595 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1596 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1598 mavlink_msg_mission_count_decode(last_msg, &packet2);
1599 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1601 memset(&packet2, 0, sizeof(packet2));
1602 mavlink_msg_mission_count_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.count );
1603 mavlink_msg_mission_count_decode(last_msg, &packet2);
1604 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1607 static void mavlink_test_mission_clear_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1609 mavlink_message_t msg;
1610 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1611 uint16_t i;
1612 mavlink_mission_clear_all_t packet_in = {
1613 5,72
1615 mavlink_mission_clear_all_t packet1, packet2;
1616 memset(&packet1, 0, sizeof(packet1));
1617 packet1.target_system = packet_in.target_system;
1618 packet1.target_component = packet_in.target_component;
1622 memset(&packet2, 0, sizeof(packet2));
1623 mavlink_msg_mission_clear_all_encode(system_id, component_id, &msg, &packet1);
1624 mavlink_msg_mission_clear_all_decode(&msg, &packet2);
1625 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1627 memset(&packet2, 0, sizeof(packet2));
1628 mavlink_msg_mission_clear_all_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
1629 mavlink_msg_mission_clear_all_decode(&msg, &packet2);
1630 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1632 memset(&packet2, 0, sizeof(packet2));
1633 mavlink_msg_mission_clear_all_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
1634 mavlink_msg_mission_clear_all_decode(&msg, &packet2);
1635 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1637 memset(&packet2, 0, sizeof(packet2));
1638 mavlink_msg_to_send_buffer(buffer, &msg);
1639 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1640 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1642 mavlink_msg_mission_clear_all_decode(last_msg, &packet2);
1643 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1645 memset(&packet2, 0, sizeof(packet2));
1646 mavlink_msg_mission_clear_all_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
1647 mavlink_msg_mission_clear_all_decode(last_msg, &packet2);
1648 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1651 static void mavlink_test_mission_item_reached(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1653 mavlink_message_t msg;
1654 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1655 uint16_t i;
1656 mavlink_mission_item_reached_t packet_in = {
1657 17235
1659 mavlink_mission_item_reached_t packet1, packet2;
1660 memset(&packet1, 0, sizeof(packet1));
1661 packet1.seq = packet_in.seq;
1665 memset(&packet2, 0, sizeof(packet2));
1666 mavlink_msg_mission_item_reached_encode(system_id, component_id, &msg, &packet1);
1667 mavlink_msg_mission_item_reached_decode(&msg, &packet2);
1668 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1670 memset(&packet2, 0, sizeof(packet2));
1671 mavlink_msg_mission_item_reached_pack(system_id, component_id, &msg , packet1.seq );
1672 mavlink_msg_mission_item_reached_decode(&msg, &packet2);
1673 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1675 memset(&packet2, 0, sizeof(packet2));
1676 mavlink_msg_mission_item_reached_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seq );
1677 mavlink_msg_mission_item_reached_decode(&msg, &packet2);
1678 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1680 memset(&packet2, 0, sizeof(packet2));
1681 mavlink_msg_to_send_buffer(buffer, &msg);
1682 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1683 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1685 mavlink_msg_mission_item_reached_decode(last_msg, &packet2);
1686 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1688 memset(&packet2, 0, sizeof(packet2));
1689 mavlink_msg_mission_item_reached_send(MAVLINK_COMM_1 , packet1.seq );
1690 mavlink_msg_mission_item_reached_decode(last_msg, &packet2);
1691 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1694 static void mavlink_test_mission_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1696 mavlink_message_t msg;
1697 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1698 uint16_t i;
1699 mavlink_mission_ack_t packet_in = {
1700 5,72,139
1702 mavlink_mission_ack_t packet1, packet2;
1703 memset(&packet1, 0, sizeof(packet1));
1704 packet1.target_system = packet_in.target_system;
1705 packet1.target_component = packet_in.target_component;
1706 packet1.type = packet_in.type;
1710 memset(&packet2, 0, sizeof(packet2));
1711 mavlink_msg_mission_ack_encode(system_id, component_id, &msg, &packet1);
1712 mavlink_msg_mission_ack_decode(&msg, &packet2);
1713 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1715 memset(&packet2, 0, sizeof(packet2));
1716 mavlink_msg_mission_ack_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.type );
1717 mavlink_msg_mission_ack_decode(&msg, &packet2);
1718 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1720 memset(&packet2, 0, sizeof(packet2));
1721 mavlink_msg_mission_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.type );
1722 mavlink_msg_mission_ack_decode(&msg, &packet2);
1723 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1725 memset(&packet2, 0, sizeof(packet2));
1726 mavlink_msg_to_send_buffer(buffer, &msg);
1727 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1728 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1730 mavlink_msg_mission_ack_decode(last_msg, &packet2);
1731 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1733 memset(&packet2, 0, sizeof(packet2));
1734 mavlink_msg_mission_ack_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.type );
1735 mavlink_msg_mission_ack_decode(last_msg, &packet2);
1736 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1739 static void mavlink_test_set_gps_global_origin(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1741 mavlink_message_t msg;
1742 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1743 uint16_t i;
1744 mavlink_set_gps_global_origin_t packet_in = {
1745 963497464,963497672,963497880,41
1747 mavlink_set_gps_global_origin_t packet1, packet2;
1748 memset(&packet1, 0, sizeof(packet1));
1749 packet1.latitude = packet_in.latitude;
1750 packet1.longitude = packet_in.longitude;
1751 packet1.altitude = packet_in.altitude;
1752 packet1.target_system = packet_in.target_system;
1756 memset(&packet2, 0, sizeof(packet2));
1757 mavlink_msg_set_gps_global_origin_encode(system_id, component_id, &msg, &packet1);
1758 mavlink_msg_set_gps_global_origin_decode(&msg, &packet2);
1759 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1761 memset(&packet2, 0, sizeof(packet2));
1762 mavlink_msg_set_gps_global_origin_pack(system_id, component_id, &msg , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude );
1763 mavlink_msg_set_gps_global_origin_decode(&msg, &packet2);
1764 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1766 memset(&packet2, 0, sizeof(packet2));
1767 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 );
1768 mavlink_msg_set_gps_global_origin_decode(&msg, &packet2);
1769 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1771 memset(&packet2, 0, sizeof(packet2));
1772 mavlink_msg_to_send_buffer(buffer, &msg);
1773 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1774 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1776 mavlink_msg_set_gps_global_origin_decode(last_msg, &packet2);
1777 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1779 memset(&packet2, 0, sizeof(packet2));
1780 mavlink_msg_set_gps_global_origin_send(MAVLINK_COMM_1 , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude );
1781 mavlink_msg_set_gps_global_origin_decode(last_msg, &packet2);
1782 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1785 static void mavlink_test_gps_global_origin(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1787 mavlink_message_t msg;
1788 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1789 uint16_t i;
1790 mavlink_gps_global_origin_t packet_in = {
1791 963497464,963497672,963497880
1793 mavlink_gps_global_origin_t packet1, packet2;
1794 memset(&packet1, 0, sizeof(packet1));
1795 packet1.latitude = packet_in.latitude;
1796 packet1.longitude = packet_in.longitude;
1797 packet1.altitude = packet_in.altitude;
1801 memset(&packet2, 0, sizeof(packet2));
1802 mavlink_msg_gps_global_origin_encode(system_id, component_id, &msg, &packet1);
1803 mavlink_msg_gps_global_origin_decode(&msg, &packet2);
1804 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1806 memset(&packet2, 0, sizeof(packet2));
1807 mavlink_msg_gps_global_origin_pack(system_id, component_id, &msg , packet1.latitude , packet1.longitude , packet1.altitude );
1808 mavlink_msg_gps_global_origin_decode(&msg, &packet2);
1809 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1811 memset(&packet2, 0, sizeof(packet2));
1812 mavlink_msg_gps_global_origin_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.latitude , packet1.longitude , packet1.altitude );
1813 mavlink_msg_gps_global_origin_decode(&msg, &packet2);
1814 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1816 memset(&packet2, 0, sizeof(packet2));
1817 mavlink_msg_to_send_buffer(buffer, &msg);
1818 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1819 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1821 mavlink_msg_gps_global_origin_decode(last_msg, &packet2);
1822 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1824 memset(&packet2, 0, sizeof(packet2));
1825 mavlink_msg_gps_global_origin_send(MAVLINK_COMM_1 , packet1.latitude , packet1.longitude , packet1.altitude );
1826 mavlink_msg_gps_global_origin_decode(last_msg, &packet2);
1827 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1830 static void mavlink_test_param_map_rc(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1832 mavlink_message_t msg;
1833 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1834 uint16_t i;
1835 mavlink_param_map_rc_t packet_in = {
1836 17.0,45.0,73.0,101.0,18067,187,254,"UVWXYZABCDEFGHI",113
1838 mavlink_param_map_rc_t packet1, packet2;
1839 memset(&packet1, 0, sizeof(packet1));
1840 packet1.param_value0 = packet_in.param_value0;
1841 packet1.scale = packet_in.scale;
1842 packet1.param_value_min = packet_in.param_value_min;
1843 packet1.param_value_max = packet_in.param_value_max;
1844 packet1.param_index = packet_in.param_index;
1845 packet1.target_system = packet_in.target_system;
1846 packet1.target_component = packet_in.target_component;
1847 packet1.parameter_rc_channel_index = packet_in.parameter_rc_channel_index;
1849 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
1852 memset(&packet2, 0, sizeof(packet2));
1853 mavlink_msg_param_map_rc_encode(system_id, component_id, &msg, &packet1);
1854 mavlink_msg_param_map_rc_decode(&msg, &packet2);
1855 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1857 memset(&packet2, 0, sizeof(packet2));
1858 mavlink_msg_param_map_rc_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.parameter_rc_channel_index , packet1.param_value0 , packet1.scale , packet1.param_value_min , packet1.param_value_max );
1859 mavlink_msg_param_map_rc_decode(&msg, &packet2);
1860 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1862 memset(&packet2, 0, sizeof(packet2));
1863 mavlink_msg_param_map_rc_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.parameter_rc_channel_index , packet1.param_value0 , packet1.scale , packet1.param_value_min , packet1.param_value_max );
1864 mavlink_msg_param_map_rc_decode(&msg, &packet2);
1865 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1867 memset(&packet2, 0, sizeof(packet2));
1868 mavlink_msg_to_send_buffer(buffer, &msg);
1869 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1870 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1872 mavlink_msg_param_map_rc_decode(last_msg, &packet2);
1873 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1875 memset(&packet2, 0, sizeof(packet2));
1876 mavlink_msg_param_map_rc_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.parameter_rc_channel_index , packet1.param_value0 , packet1.scale , packet1.param_value_min , packet1.param_value_max );
1877 mavlink_msg_param_map_rc_decode(last_msg, &packet2);
1878 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1881 static void mavlink_test_safety_set_allowed_area(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1883 mavlink_message_t msg;
1884 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1885 uint16_t i;
1886 mavlink_safety_set_allowed_area_t packet_in = {
1887 17.0,45.0,73.0,101.0,129.0,157.0,77,144,211
1889 mavlink_safety_set_allowed_area_t packet1, packet2;
1890 memset(&packet1, 0, sizeof(packet1));
1891 packet1.p1x = packet_in.p1x;
1892 packet1.p1y = packet_in.p1y;
1893 packet1.p1z = packet_in.p1z;
1894 packet1.p2x = packet_in.p2x;
1895 packet1.p2y = packet_in.p2y;
1896 packet1.p2z = packet_in.p2z;
1897 packet1.target_system = packet_in.target_system;
1898 packet1.target_component = packet_in.target_component;
1899 packet1.frame = packet_in.frame;
1903 memset(&packet2, 0, sizeof(packet2));
1904 mavlink_msg_safety_set_allowed_area_encode(system_id, component_id, &msg, &packet1);
1905 mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2);
1906 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1908 memset(&packet2, 0, sizeof(packet2));
1909 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 );
1910 mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2);
1911 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1913 memset(&packet2, 0, sizeof(packet2));
1914 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 );
1915 mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2);
1916 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1918 memset(&packet2, 0, sizeof(packet2));
1919 mavlink_msg_to_send_buffer(buffer, &msg);
1920 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1921 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1923 mavlink_msg_safety_set_allowed_area_decode(last_msg, &packet2);
1924 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1926 memset(&packet2, 0, sizeof(packet2));
1927 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 );
1928 mavlink_msg_safety_set_allowed_area_decode(last_msg, &packet2);
1929 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1932 static void mavlink_test_safety_allowed_area(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1934 mavlink_message_t msg;
1935 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1936 uint16_t i;
1937 mavlink_safety_allowed_area_t packet_in = {
1938 17.0,45.0,73.0,101.0,129.0,157.0,77
1940 mavlink_safety_allowed_area_t packet1, packet2;
1941 memset(&packet1, 0, sizeof(packet1));
1942 packet1.p1x = packet_in.p1x;
1943 packet1.p1y = packet_in.p1y;
1944 packet1.p1z = packet_in.p1z;
1945 packet1.p2x = packet_in.p2x;
1946 packet1.p2y = packet_in.p2y;
1947 packet1.p2z = packet_in.p2z;
1948 packet1.frame = packet_in.frame;
1952 memset(&packet2, 0, sizeof(packet2));
1953 mavlink_msg_safety_allowed_area_encode(system_id, component_id, &msg, &packet1);
1954 mavlink_msg_safety_allowed_area_decode(&msg, &packet2);
1955 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1957 memset(&packet2, 0, sizeof(packet2));
1958 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 );
1959 mavlink_msg_safety_allowed_area_decode(&msg, &packet2);
1960 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1962 memset(&packet2, 0, sizeof(packet2));
1963 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 );
1964 mavlink_msg_safety_allowed_area_decode(&msg, &packet2);
1965 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1967 memset(&packet2, 0, sizeof(packet2));
1968 mavlink_msg_to_send_buffer(buffer, &msg);
1969 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1970 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1972 mavlink_msg_safety_allowed_area_decode(last_msg, &packet2);
1973 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1975 memset(&packet2, 0, sizeof(packet2));
1976 mavlink_msg_safety_allowed_area_send(MAVLINK_COMM_1 , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z );
1977 mavlink_msg_safety_allowed_area_decode(last_msg, &packet2);
1978 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1981 static void mavlink_test_attitude_quaternion_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1983 mavlink_message_t msg;
1984 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1985 uint16_t i;
1986 mavlink_attitude_quaternion_cov_t packet_in = {
1987 963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,{ 241.0, 242.0, 243.0, 244.0, 245.0, 246.0, 247.0, 248.0, 249.0 }
1989 mavlink_attitude_quaternion_cov_t packet1, packet2;
1990 memset(&packet1, 0, sizeof(packet1));
1991 packet1.time_boot_ms = packet_in.time_boot_ms;
1992 packet1.rollspeed = packet_in.rollspeed;
1993 packet1.pitchspeed = packet_in.pitchspeed;
1994 packet1.yawspeed = packet_in.yawspeed;
1996 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
1997 mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*9);
2000 memset(&packet2, 0, sizeof(packet2));
2001 mavlink_msg_attitude_quaternion_cov_encode(system_id, component_id, &msg, &packet1);
2002 mavlink_msg_attitude_quaternion_cov_decode(&msg, &packet2);
2003 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2005 memset(&packet2, 0, sizeof(packet2));
2006 mavlink_msg_attitude_quaternion_cov_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.q , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.covariance );
2007 mavlink_msg_attitude_quaternion_cov_decode(&msg, &packet2);
2008 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2010 memset(&packet2, 0, sizeof(packet2));
2011 mavlink_msg_attitude_quaternion_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.q , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.covariance );
2012 mavlink_msg_attitude_quaternion_cov_decode(&msg, &packet2);
2013 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2015 memset(&packet2, 0, sizeof(packet2));
2016 mavlink_msg_to_send_buffer(buffer, &msg);
2017 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2018 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2020 mavlink_msg_attitude_quaternion_cov_decode(last_msg, &packet2);
2021 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2023 memset(&packet2, 0, sizeof(packet2));
2024 mavlink_msg_attitude_quaternion_cov_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.q , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.covariance );
2025 mavlink_msg_attitude_quaternion_cov_decode(last_msg, &packet2);
2026 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2029 static void mavlink_test_nav_controller_output(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2031 mavlink_message_t msg;
2032 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2033 uint16_t i;
2034 mavlink_nav_controller_output_t packet_in = {
2035 17.0,45.0,73.0,101.0,129.0,18275,18379,18483
2037 mavlink_nav_controller_output_t packet1, packet2;
2038 memset(&packet1, 0, sizeof(packet1));
2039 packet1.nav_roll = packet_in.nav_roll;
2040 packet1.nav_pitch = packet_in.nav_pitch;
2041 packet1.alt_error = packet_in.alt_error;
2042 packet1.aspd_error = packet_in.aspd_error;
2043 packet1.xtrack_error = packet_in.xtrack_error;
2044 packet1.nav_bearing = packet_in.nav_bearing;
2045 packet1.target_bearing = packet_in.target_bearing;
2046 packet1.wp_dist = packet_in.wp_dist;
2050 memset(&packet2, 0, sizeof(packet2));
2051 mavlink_msg_nav_controller_output_encode(system_id, component_id, &msg, &packet1);
2052 mavlink_msg_nav_controller_output_decode(&msg, &packet2);
2053 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2055 memset(&packet2, 0, sizeof(packet2));
2056 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 );
2057 mavlink_msg_nav_controller_output_decode(&msg, &packet2);
2058 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2060 memset(&packet2, 0, sizeof(packet2));
2061 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 );
2062 mavlink_msg_nav_controller_output_decode(&msg, &packet2);
2063 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2065 memset(&packet2, 0, sizeof(packet2));
2066 mavlink_msg_to_send_buffer(buffer, &msg);
2067 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2068 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2070 mavlink_msg_nav_controller_output_decode(last_msg, &packet2);
2071 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2073 memset(&packet2, 0, sizeof(packet2));
2074 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 );
2075 mavlink_msg_nav_controller_output_decode(last_msg, &packet2);
2076 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2079 static void mavlink_test_global_position_int_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2081 mavlink_message_t msg;
2082 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2083 uint16_t i;
2084 mavlink_global_position_int_cov_t packet_in = {
2085 93372036854775807ULL,963497880,963498088,963498296,963498504,963498712,213.0,241.0,269.0,{ 297.0, 298.0, 299.0, 300.0, 301.0, 302.0, 303.0, 304.0, 305.0, 306.0, 307.0, 308.0, 309.0, 310.0, 311.0, 312.0, 313.0, 314.0, 315.0, 316.0, 317.0, 318.0, 319.0, 320.0, 321.0, 322.0, 323.0, 324.0, 325.0, 326.0, 327.0, 328.0, 329.0, 330.0, 331.0, 332.0 },45
2087 mavlink_global_position_int_cov_t packet1, packet2;
2088 memset(&packet1, 0, sizeof(packet1));
2089 packet1.time_utc = packet_in.time_utc;
2090 packet1.time_boot_ms = packet_in.time_boot_ms;
2091 packet1.lat = packet_in.lat;
2092 packet1.lon = packet_in.lon;
2093 packet1.alt = packet_in.alt;
2094 packet1.relative_alt = packet_in.relative_alt;
2095 packet1.vx = packet_in.vx;
2096 packet1.vy = packet_in.vy;
2097 packet1.vz = packet_in.vz;
2098 packet1.estimator_type = packet_in.estimator_type;
2100 mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*36);
2103 memset(&packet2, 0, sizeof(packet2));
2104 mavlink_msg_global_position_int_cov_encode(system_id, component_id, &msg, &packet1);
2105 mavlink_msg_global_position_int_cov_decode(&msg, &packet2);
2106 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2108 memset(&packet2, 0, sizeof(packet2));
2109 mavlink_msg_global_position_int_cov_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.time_utc , packet1.estimator_type , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.covariance );
2110 mavlink_msg_global_position_int_cov_decode(&msg, &packet2);
2111 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2113 memset(&packet2, 0, sizeof(packet2));
2114 mavlink_msg_global_position_int_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.time_utc , packet1.estimator_type , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.covariance );
2115 mavlink_msg_global_position_int_cov_decode(&msg, &packet2);
2116 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2118 memset(&packet2, 0, sizeof(packet2));
2119 mavlink_msg_to_send_buffer(buffer, &msg);
2120 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2121 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2123 mavlink_msg_global_position_int_cov_decode(last_msg, &packet2);
2124 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2126 memset(&packet2, 0, sizeof(packet2));
2127 mavlink_msg_global_position_int_cov_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.time_utc , packet1.estimator_type , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.covariance );
2128 mavlink_msg_global_position_int_cov_decode(last_msg, &packet2);
2129 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2132 static void mavlink_test_local_position_ned_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2134 mavlink_message_t msg;
2135 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2136 uint16_t i;
2137 mavlink_local_position_ned_cov_t packet_in = {
2138 93372036854775807ULL,963497880,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,{ 353.0, 354.0, 355.0, 356.0, 357.0, 358.0, 359.0, 360.0, 361.0, 362.0, 363.0, 364.0, 365.0, 366.0, 367.0, 368.0, 369.0, 370.0, 371.0, 372.0, 373.0, 374.0, 375.0, 376.0, 377.0, 378.0, 379.0, 380.0, 381.0, 382.0, 383.0, 384.0, 385.0, 386.0, 387.0, 388.0, 389.0, 390.0, 391.0, 392.0, 393.0, 394.0, 395.0, 396.0, 397.0 },177
2140 mavlink_local_position_ned_cov_t packet1, packet2;
2141 memset(&packet1, 0, sizeof(packet1));
2142 packet1.time_utc = packet_in.time_utc;
2143 packet1.time_boot_ms = packet_in.time_boot_ms;
2144 packet1.x = packet_in.x;
2145 packet1.y = packet_in.y;
2146 packet1.z = packet_in.z;
2147 packet1.vx = packet_in.vx;
2148 packet1.vy = packet_in.vy;
2149 packet1.vz = packet_in.vz;
2150 packet1.ax = packet_in.ax;
2151 packet1.ay = packet_in.ay;
2152 packet1.az = packet_in.az;
2153 packet1.estimator_type = packet_in.estimator_type;
2155 mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*45);
2158 memset(&packet2, 0, sizeof(packet2));
2159 mavlink_msg_local_position_ned_cov_encode(system_id, component_id, &msg, &packet1);
2160 mavlink_msg_local_position_ned_cov_decode(&msg, &packet2);
2161 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2163 memset(&packet2, 0, sizeof(packet2));
2164 mavlink_msg_local_position_ned_cov_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.time_utc , packet1.estimator_type , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.ax , packet1.ay , packet1.az , packet1.covariance );
2165 mavlink_msg_local_position_ned_cov_decode(&msg, &packet2);
2166 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2168 memset(&packet2, 0, sizeof(packet2));
2169 mavlink_msg_local_position_ned_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.time_utc , packet1.estimator_type , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.ax , packet1.ay , packet1.az , packet1.covariance );
2170 mavlink_msg_local_position_ned_cov_decode(&msg, &packet2);
2171 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2173 memset(&packet2, 0, sizeof(packet2));
2174 mavlink_msg_to_send_buffer(buffer, &msg);
2175 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2176 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2178 mavlink_msg_local_position_ned_cov_decode(last_msg, &packet2);
2179 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2181 memset(&packet2, 0, sizeof(packet2));
2182 mavlink_msg_local_position_ned_cov_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.time_utc , packet1.estimator_type , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.ax , packet1.ay , packet1.az , packet1.covariance );
2183 mavlink_msg_local_position_ned_cov_decode(last_msg, &packet2);
2184 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2187 static void mavlink_test_rc_channels(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2189 mavlink_message_t msg;
2190 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2191 uint16_t i;
2192 mavlink_rc_channels_t packet_in = {
2193 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275,18379,18483,18587,18691,18795,18899,19003,19107,19211,125,192
2195 mavlink_rc_channels_t packet1, packet2;
2196 memset(&packet1, 0, sizeof(packet1));
2197 packet1.time_boot_ms = packet_in.time_boot_ms;
2198 packet1.chan1_raw = packet_in.chan1_raw;
2199 packet1.chan2_raw = packet_in.chan2_raw;
2200 packet1.chan3_raw = packet_in.chan3_raw;
2201 packet1.chan4_raw = packet_in.chan4_raw;
2202 packet1.chan5_raw = packet_in.chan5_raw;
2203 packet1.chan6_raw = packet_in.chan6_raw;
2204 packet1.chan7_raw = packet_in.chan7_raw;
2205 packet1.chan8_raw = packet_in.chan8_raw;
2206 packet1.chan9_raw = packet_in.chan9_raw;
2207 packet1.chan10_raw = packet_in.chan10_raw;
2208 packet1.chan11_raw = packet_in.chan11_raw;
2209 packet1.chan12_raw = packet_in.chan12_raw;
2210 packet1.chan13_raw = packet_in.chan13_raw;
2211 packet1.chan14_raw = packet_in.chan14_raw;
2212 packet1.chan15_raw = packet_in.chan15_raw;
2213 packet1.chan16_raw = packet_in.chan16_raw;
2214 packet1.chan17_raw = packet_in.chan17_raw;
2215 packet1.chan18_raw = packet_in.chan18_raw;
2216 packet1.chancount = packet_in.chancount;
2217 packet1.rssi = packet_in.rssi;
2221 memset(&packet2, 0, sizeof(packet2));
2222 mavlink_msg_rc_channels_encode(system_id, component_id, &msg, &packet1);
2223 mavlink_msg_rc_channels_decode(&msg, &packet2);
2224 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2226 memset(&packet2, 0, sizeof(packet2));
2227 mavlink_msg_rc_channels_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.chancount , 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.chan13_raw , packet1.chan14_raw , packet1.chan15_raw , packet1.chan16_raw , packet1.chan17_raw , packet1.chan18_raw , packet1.rssi );
2228 mavlink_msg_rc_channels_decode(&msg, &packet2);
2229 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2231 memset(&packet2, 0, sizeof(packet2));
2232 mavlink_msg_rc_channels_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.chancount , 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.chan13_raw , packet1.chan14_raw , packet1.chan15_raw , packet1.chan16_raw , packet1.chan17_raw , packet1.chan18_raw , packet1.rssi );
2233 mavlink_msg_rc_channels_decode(&msg, &packet2);
2234 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2236 memset(&packet2, 0, sizeof(packet2));
2237 mavlink_msg_to_send_buffer(buffer, &msg);
2238 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2239 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2241 mavlink_msg_rc_channels_decode(last_msg, &packet2);
2242 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2244 memset(&packet2, 0, sizeof(packet2));
2245 mavlink_msg_rc_channels_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.chancount , 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.chan13_raw , packet1.chan14_raw , packet1.chan15_raw , packet1.chan16_raw , packet1.chan17_raw , packet1.chan18_raw , packet1.rssi );
2246 mavlink_msg_rc_channels_decode(last_msg, &packet2);
2247 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2250 static void mavlink_test_request_data_stream(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2252 mavlink_message_t msg;
2253 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2254 uint16_t i;
2255 mavlink_request_data_stream_t packet_in = {
2256 17235,139,206,17,84
2258 mavlink_request_data_stream_t packet1, packet2;
2259 memset(&packet1, 0, sizeof(packet1));
2260 packet1.req_message_rate = packet_in.req_message_rate;
2261 packet1.target_system = packet_in.target_system;
2262 packet1.target_component = packet_in.target_component;
2263 packet1.req_stream_id = packet_in.req_stream_id;
2264 packet1.start_stop = packet_in.start_stop;
2268 memset(&packet2, 0, sizeof(packet2));
2269 mavlink_msg_request_data_stream_encode(system_id, component_id, &msg, &packet1);
2270 mavlink_msg_request_data_stream_decode(&msg, &packet2);
2271 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2273 memset(&packet2, 0, sizeof(packet2));
2274 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 );
2275 mavlink_msg_request_data_stream_decode(&msg, &packet2);
2276 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2278 memset(&packet2, 0, sizeof(packet2));
2279 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 );
2280 mavlink_msg_request_data_stream_decode(&msg, &packet2);
2281 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2283 memset(&packet2, 0, sizeof(packet2));
2284 mavlink_msg_to_send_buffer(buffer, &msg);
2285 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2286 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2288 mavlink_msg_request_data_stream_decode(last_msg, &packet2);
2289 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2291 memset(&packet2, 0, sizeof(packet2));
2292 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 );
2293 mavlink_msg_request_data_stream_decode(last_msg, &packet2);
2294 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2297 static void mavlink_test_data_stream(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2299 mavlink_message_t msg;
2300 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2301 uint16_t i;
2302 mavlink_data_stream_t packet_in = {
2303 17235,139,206
2305 mavlink_data_stream_t packet1, packet2;
2306 memset(&packet1, 0, sizeof(packet1));
2307 packet1.message_rate = packet_in.message_rate;
2308 packet1.stream_id = packet_in.stream_id;
2309 packet1.on_off = packet_in.on_off;
2313 memset(&packet2, 0, sizeof(packet2));
2314 mavlink_msg_data_stream_encode(system_id, component_id, &msg, &packet1);
2315 mavlink_msg_data_stream_decode(&msg, &packet2);
2316 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2318 memset(&packet2, 0, sizeof(packet2));
2319 mavlink_msg_data_stream_pack(system_id, component_id, &msg , packet1.stream_id , packet1.message_rate , packet1.on_off );
2320 mavlink_msg_data_stream_decode(&msg, &packet2);
2321 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2323 memset(&packet2, 0, sizeof(packet2));
2324 mavlink_msg_data_stream_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.stream_id , packet1.message_rate , packet1.on_off );
2325 mavlink_msg_data_stream_decode(&msg, &packet2);
2326 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2328 memset(&packet2, 0, sizeof(packet2));
2329 mavlink_msg_to_send_buffer(buffer, &msg);
2330 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2331 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2333 mavlink_msg_data_stream_decode(last_msg, &packet2);
2334 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2336 memset(&packet2, 0, sizeof(packet2));
2337 mavlink_msg_data_stream_send(MAVLINK_COMM_1 , packet1.stream_id , packet1.message_rate , packet1.on_off );
2338 mavlink_msg_data_stream_decode(last_msg, &packet2);
2339 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2342 static void mavlink_test_manual_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2344 mavlink_message_t msg;
2345 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2346 uint16_t i;
2347 mavlink_manual_control_t packet_in = {
2348 17235,17339,17443,17547,17651,163
2350 mavlink_manual_control_t packet1, packet2;
2351 memset(&packet1, 0, sizeof(packet1));
2352 packet1.x = packet_in.x;
2353 packet1.y = packet_in.y;
2354 packet1.z = packet_in.z;
2355 packet1.r = packet_in.r;
2356 packet1.buttons = packet_in.buttons;
2357 packet1.target = packet_in.target;
2361 memset(&packet2, 0, sizeof(packet2));
2362 mavlink_msg_manual_control_encode(system_id, component_id, &msg, &packet1);
2363 mavlink_msg_manual_control_decode(&msg, &packet2);
2364 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2366 memset(&packet2, 0, sizeof(packet2));
2367 mavlink_msg_manual_control_pack(system_id, component_id, &msg , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons );
2368 mavlink_msg_manual_control_decode(&msg, &packet2);
2369 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2371 memset(&packet2, 0, sizeof(packet2));
2372 mavlink_msg_manual_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons );
2373 mavlink_msg_manual_control_decode(&msg, &packet2);
2374 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2376 memset(&packet2, 0, sizeof(packet2));
2377 mavlink_msg_to_send_buffer(buffer, &msg);
2378 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2379 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2381 mavlink_msg_manual_control_decode(last_msg, &packet2);
2382 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2384 memset(&packet2, 0, sizeof(packet2));
2385 mavlink_msg_manual_control_send(MAVLINK_COMM_1 , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons );
2386 mavlink_msg_manual_control_decode(last_msg, &packet2);
2387 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2390 static void mavlink_test_rc_channels_override(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2392 mavlink_message_t msg;
2393 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2394 uint16_t i;
2395 mavlink_rc_channels_override_t packet_in = {
2396 17235,17339,17443,17547,17651,17755,17859,17963,53,120
2398 mavlink_rc_channels_override_t packet1, packet2;
2399 memset(&packet1, 0, sizeof(packet1));
2400 packet1.chan1_raw = packet_in.chan1_raw;
2401 packet1.chan2_raw = packet_in.chan2_raw;
2402 packet1.chan3_raw = packet_in.chan3_raw;
2403 packet1.chan4_raw = packet_in.chan4_raw;
2404 packet1.chan5_raw = packet_in.chan5_raw;
2405 packet1.chan6_raw = packet_in.chan6_raw;
2406 packet1.chan7_raw = packet_in.chan7_raw;
2407 packet1.chan8_raw = packet_in.chan8_raw;
2408 packet1.target_system = packet_in.target_system;
2409 packet1.target_component = packet_in.target_component;
2413 memset(&packet2, 0, sizeof(packet2));
2414 mavlink_msg_rc_channels_override_encode(system_id, component_id, &msg, &packet1);
2415 mavlink_msg_rc_channels_override_decode(&msg, &packet2);
2416 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2418 memset(&packet2, 0, sizeof(packet2));
2419 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 );
2420 mavlink_msg_rc_channels_override_decode(&msg, &packet2);
2421 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2423 memset(&packet2, 0, sizeof(packet2));
2424 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 );
2425 mavlink_msg_rc_channels_override_decode(&msg, &packet2);
2426 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2428 memset(&packet2, 0, sizeof(packet2));
2429 mavlink_msg_to_send_buffer(buffer, &msg);
2430 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2431 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2433 mavlink_msg_rc_channels_override_decode(last_msg, &packet2);
2434 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2436 memset(&packet2, 0, sizeof(packet2));
2437 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 );
2438 mavlink_msg_rc_channels_override_decode(last_msg, &packet2);
2439 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2442 static void mavlink_test_mission_item_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2444 mavlink_message_t msg;
2445 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2446 uint16_t i;
2447 mavlink_mission_item_int_t packet_in = {
2448 17.0,45.0,73.0,101.0,963498296,963498504,185.0,18691,18795,101,168,235,46,113
2450 mavlink_mission_item_int_t packet1, packet2;
2451 memset(&packet1, 0, sizeof(packet1));
2452 packet1.param1 = packet_in.param1;
2453 packet1.param2 = packet_in.param2;
2454 packet1.param3 = packet_in.param3;
2455 packet1.param4 = packet_in.param4;
2456 packet1.x = packet_in.x;
2457 packet1.y = packet_in.y;
2458 packet1.z = packet_in.z;
2459 packet1.seq = packet_in.seq;
2460 packet1.command = packet_in.command;
2461 packet1.target_system = packet_in.target_system;
2462 packet1.target_component = packet_in.target_component;
2463 packet1.frame = packet_in.frame;
2464 packet1.current = packet_in.current;
2465 packet1.autocontinue = packet_in.autocontinue;
2469 memset(&packet2, 0, sizeof(packet2));
2470 mavlink_msg_mission_item_int_encode(system_id, component_id, &msg, &packet1);
2471 mavlink_msg_mission_item_int_decode(&msg, &packet2);
2472 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2474 memset(&packet2, 0, sizeof(packet2));
2475 mavlink_msg_mission_item_int_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 );
2476 mavlink_msg_mission_item_int_decode(&msg, &packet2);
2477 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2479 memset(&packet2, 0, sizeof(packet2));
2480 mavlink_msg_mission_item_int_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 );
2481 mavlink_msg_mission_item_int_decode(&msg, &packet2);
2482 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2484 memset(&packet2, 0, sizeof(packet2));
2485 mavlink_msg_to_send_buffer(buffer, &msg);
2486 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2487 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2489 mavlink_msg_mission_item_int_decode(last_msg, &packet2);
2490 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2492 memset(&packet2, 0, sizeof(packet2));
2493 mavlink_msg_mission_item_int_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 );
2494 mavlink_msg_mission_item_int_decode(last_msg, &packet2);
2495 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2498 static void mavlink_test_vfr_hud(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2500 mavlink_message_t msg;
2501 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2502 uint16_t i;
2503 mavlink_vfr_hud_t packet_in = {
2504 17.0,45.0,73.0,101.0,18067,18171
2506 mavlink_vfr_hud_t packet1, packet2;
2507 memset(&packet1, 0, sizeof(packet1));
2508 packet1.airspeed = packet_in.airspeed;
2509 packet1.groundspeed = packet_in.groundspeed;
2510 packet1.alt = packet_in.alt;
2511 packet1.climb = packet_in.climb;
2512 packet1.heading = packet_in.heading;
2513 packet1.throttle = packet_in.throttle;
2517 memset(&packet2, 0, sizeof(packet2));
2518 mavlink_msg_vfr_hud_encode(system_id, component_id, &msg, &packet1);
2519 mavlink_msg_vfr_hud_decode(&msg, &packet2);
2520 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2522 memset(&packet2, 0, sizeof(packet2));
2523 mavlink_msg_vfr_hud_pack(system_id, component_id, &msg , packet1.airspeed , packet1.groundspeed , packet1.heading , packet1.throttle , packet1.alt , packet1.climb );
2524 mavlink_msg_vfr_hud_decode(&msg, &packet2);
2525 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2527 memset(&packet2, 0, sizeof(packet2));
2528 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 );
2529 mavlink_msg_vfr_hud_decode(&msg, &packet2);
2530 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2532 memset(&packet2, 0, sizeof(packet2));
2533 mavlink_msg_to_send_buffer(buffer, &msg);
2534 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2535 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2537 mavlink_msg_vfr_hud_decode(last_msg, &packet2);
2538 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2540 memset(&packet2, 0, sizeof(packet2));
2541 mavlink_msg_vfr_hud_send(MAVLINK_COMM_1 , packet1.airspeed , packet1.groundspeed , packet1.heading , packet1.throttle , packet1.alt , packet1.climb );
2542 mavlink_msg_vfr_hud_decode(last_msg, &packet2);
2543 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2546 static void mavlink_test_command_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2548 mavlink_message_t msg;
2549 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2550 uint16_t i;
2551 mavlink_command_int_t packet_in = {
2552 17.0,45.0,73.0,101.0,963498296,963498504,185.0,18691,223,34,101,168,235
2554 mavlink_command_int_t packet1, packet2;
2555 memset(&packet1, 0, sizeof(packet1));
2556 packet1.param1 = packet_in.param1;
2557 packet1.param2 = packet_in.param2;
2558 packet1.param3 = packet_in.param3;
2559 packet1.param4 = packet_in.param4;
2560 packet1.x = packet_in.x;
2561 packet1.y = packet_in.y;
2562 packet1.z = packet_in.z;
2563 packet1.command = packet_in.command;
2564 packet1.target_system = packet_in.target_system;
2565 packet1.target_component = packet_in.target_component;
2566 packet1.frame = packet_in.frame;
2567 packet1.current = packet_in.current;
2568 packet1.autocontinue = packet_in.autocontinue;
2572 memset(&packet2, 0, sizeof(packet2));
2573 mavlink_msg_command_int_encode(system_id, component_id, &msg, &packet1);
2574 mavlink_msg_command_int_decode(&msg, &packet2);
2575 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2577 memset(&packet2, 0, sizeof(packet2));
2578 mavlink_msg_command_int_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z );
2579 mavlink_msg_command_int_decode(&msg, &packet2);
2580 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2582 memset(&packet2, 0, sizeof(packet2));
2583 mavlink_msg_command_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z );
2584 mavlink_msg_command_int_decode(&msg, &packet2);
2585 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2587 memset(&packet2, 0, sizeof(packet2));
2588 mavlink_msg_to_send_buffer(buffer, &msg);
2589 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2590 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2592 mavlink_msg_command_int_decode(last_msg, &packet2);
2593 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2595 memset(&packet2, 0, sizeof(packet2));
2596 mavlink_msg_command_int_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z );
2597 mavlink_msg_command_int_decode(last_msg, &packet2);
2598 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2601 static void mavlink_test_command_long(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2603 mavlink_message_t msg;
2604 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2605 uint16_t i;
2606 mavlink_command_long_t packet_in = {
2607 17.0,45.0,73.0,101.0,129.0,157.0,185.0,18691,223,34,101
2609 mavlink_command_long_t packet1, packet2;
2610 memset(&packet1, 0, sizeof(packet1));
2611 packet1.param1 = packet_in.param1;
2612 packet1.param2 = packet_in.param2;
2613 packet1.param3 = packet_in.param3;
2614 packet1.param4 = packet_in.param4;
2615 packet1.param5 = packet_in.param5;
2616 packet1.param6 = packet_in.param6;
2617 packet1.param7 = packet_in.param7;
2618 packet1.command = packet_in.command;
2619 packet1.target_system = packet_in.target_system;
2620 packet1.target_component = packet_in.target_component;
2621 packet1.confirmation = packet_in.confirmation;
2625 memset(&packet2, 0, sizeof(packet2));
2626 mavlink_msg_command_long_encode(system_id, component_id, &msg, &packet1);
2627 mavlink_msg_command_long_decode(&msg, &packet2);
2628 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2630 memset(&packet2, 0, sizeof(packet2));
2631 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 );
2632 mavlink_msg_command_long_decode(&msg, &packet2);
2633 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2635 memset(&packet2, 0, sizeof(packet2));
2636 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 );
2637 mavlink_msg_command_long_decode(&msg, &packet2);
2638 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2640 memset(&packet2, 0, sizeof(packet2));
2641 mavlink_msg_to_send_buffer(buffer, &msg);
2642 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2643 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2645 mavlink_msg_command_long_decode(last_msg, &packet2);
2646 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2648 memset(&packet2, 0, sizeof(packet2));
2649 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 );
2650 mavlink_msg_command_long_decode(last_msg, &packet2);
2651 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2654 static void mavlink_test_command_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2656 mavlink_message_t msg;
2657 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2658 uint16_t i;
2659 mavlink_command_ack_t packet_in = {
2660 17235,139
2662 mavlink_command_ack_t packet1, packet2;
2663 memset(&packet1, 0, sizeof(packet1));
2664 packet1.command = packet_in.command;
2665 packet1.result = packet_in.result;
2669 memset(&packet2, 0, sizeof(packet2));
2670 mavlink_msg_command_ack_encode(system_id, component_id, &msg, &packet1);
2671 mavlink_msg_command_ack_decode(&msg, &packet2);
2672 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2674 memset(&packet2, 0, sizeof(packet2));
2675 mavlink_msg_command_ack_pack(system_id, component_id, &msg , packet1.command , packet1.result );
2676 mavlink_msg_command_ack_decode(&msg, &packet2);
2677 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2679 memset(&packet2, 0, sizeof(packet2));
2680 mavlink_msg_command_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.command , packet1.result );
2681 mavlink_msg_command_ack_decode(&msg, &packet2);
2682 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2684 memset(&packet2, 0, sizeof(packet2));
2685 mavlink_msg_to_send_buffer(buffer, &msg);
2686 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2687 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2689 mavlink_msg_command_ack_decode(last_msg, &packet2);
2690 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2692 memset(&packet2, 0, sizeof(packet2));
2693 mavlink_msg_command_ack_send(MAVLINK_COMM_1 , packet1.command , packet1.result );
2694 mavlink_msg_command_ack_decode(last_msg, &packet2);
2695 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2698 static void mavlink_test_manual_setpoint(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2700 mavlink_message_t msg;
2701 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2702 uint16_t i;
2703 mavlink_manual_setpoint_t packet_in = {
2704 963497464,45.0,73.0,101.0,129.0,65,132
2706 mavlink_manual_setpoint_t packet1, packet2;
2707 memset(&packet1, 0, sizeof(packet1));
2708 packet1.time_boot_ms = packet_in.time_boot_ms;
2709 packet1.roll = packet_in.roll;
2710 packet1.pitch = packet_in.pitch;
2711 packet1.yaw = packet_in.yaw;
2712 packet1.thrust = packet_in.thrust;
2713 packet1.mode_switch = packet_in.mode_switch;
2714 packet1.manual_override_switch = packet_in.manual_override_switch;
2718 memset(&packet2, 0, sizeof(packet2));
2719 mavlink_msg_manual_setpoint_encode(system_id, component_id, &msg, &packet1);
2720 mavlink_msg_manual_setpoint_decode(&msg, &packet2);
2721 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2723 memset(&packet2, 0, sizeof(packet2));
2724 mavlink_msg_manual_setpoint_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.mode_switch , packet1.manual_override_switch );
2725 mavlink_msg_manual_setpoint_decode(&msg, &packet2);
2726 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2728 memset(&packet2, 0, sizeof(packet2));
2729 mavlink_msg_manual_setpoint_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.mode_switch , packet1.manual_override_switch );
2730 mavlink_msg_manual_setpoint_decode(&msg, &packet2);
2731 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2733 memset(&packet2, 0, sizeof(packet2));
2734 mavlink_msg_to_send_buffer(buffer, &msg);
2735 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2736 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2738 mavlink_msg_manual_setpoint_decode(last_msg, &packet2);
2739 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2741 memset(&packet2, 0, sizeof(packet2));
2742 mavlink_msg_manual_setpoint_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.mode_switch , packet1.manual_override_switch );
2743 mavlink_msg_manual_setpoint_decode(last_msg, &packet2);
2744 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2747 static void mavlink_test_set_attitude_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2749 mavlink_message_t msg;
2750 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2751 uint16_t i;
2752 mavlink_set_attitude_target_t packet_in = {
2753 963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,241.0,113,180,247
2755 mavlink_set_attitude_target_t packet1, packet2;
2756 memset(&packet1, 0, sizeof(packet1));
2757 packet1.time_boot_ms = packet_in.time_boot_ms;
2758 packet1.body_roll_rate = packet_in.body_roll_rate;
2759 packet1.body_pitch_rate = packet_in.body_pitch_rate;
2760 packet1.body_yaw_rate = packet_in.body_yaw_rate;
2761 packet1.thrust = packet_in.thrust;
2762 packet1.target_system = packet_in.target_system;
2763 packet1.target_component = packet_in.target_component;
2764 packet1.type_mask = packet_in.type_mask;
2766 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
2769 memset(&packet2, 0, sizeof(packet2));
2770 mavlink_msg_set_attitude_target_encode(system_id, component_id, &msg, &packet1);
2771 mavlink_msg_set_attitude_target_decode(&msg, &packet2);
2772 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2774 memset(&packet2, 0, sizeof(packet2));
2775 mavlink_msg_set_attitude_target_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust );
2776 mavlink_msg_set_attitude_target_decode(&msg, &packet2);
2777 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2779 memset(&packet2, 0, sizeof(packet2));
2780 mavlink_msg_set_attitude_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust );
2781 mavlink_msg_set_attitude_target_decode(&msg, &packet2);
2782 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2784 memset(&packet2, 0, sizeof(packet2));
2785 mavlink_msg_to_send_buffer(buffer, &msg);
2786 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2787 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2789 mavlink_msg_set_attitude_target_decode(last_msg, &packet2);
2790 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2792 memset(&packet2, 0, sizeof(packet2));
2793 mavlink_msg_set_attitude_target_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust );
2794 mavlink_msg_set_attitude_target_decode(last_msg, &packet2);
2795 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2798 static void mavlink_test_attitude_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2800 mavlink_message_t msg;
2801 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2802 uint16_t i;
2803 mavlink_attitude_target_t packet_in = {
2804 963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,241.0,113
2806 mavlink_attitude_target_t packet1, packet2;
2807 memset(&packet1, 0, sizeof(packet1));
2808 packet1.time_boot_ms = packet_in.time_boot_ms;
2809 packet1.body_roll_rate = packet_in.body_roll_rate;
2810 packet1.body_pitch_rate = packet_in.body_pitch_rate;
2811 packet1.body_yaw_rate = packet_in.body_yaw_rate;
2812 packet1.thrust = packet_in.thrust;
2813 packet1.type_mask = packet_in.type_mask;
2815 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
2818 memset(&packet2, 0, sizeof(packet2));
2819 mavlink_msg_attitude_target_encode(system_id, component_id, &msg, &packet1);
2820 mavlink_msg_attitude_target_decode(&msg, &packet2);
2821 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2823 memset(&packet2, 0, sizeof(packet2));
2824 mavlink_msg_attitude_target_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust );
2825 mavlink_msg_attitude_target_decode(&msg, &packet2);
2826 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2828 memset(&packet2, 0, sizeof(packet2));
2829 mavlink_msg_attitude_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust );
2830 mavlink_msg_attitude_target_decode(&msg, &packet2);
2831 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2833 memset(&packet2, 0, sizeof(packet2));
2834 mavlink_msg_to_send_buffer(buffer, &msg);
2835 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2836 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2838 mavlink_msg_attitude_target_decode(last_msg, &packet2);
2839 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2841 memset(&packet2, 0, sizeof(packet2));
2842 mavlink_msg_attitude_target_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust );
2843 mavlink_msg_attitude_target_decode(last_msg, &packet2);
2844 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2847 static void mavlink_test_set_position_target_local_ned(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2849 mavlink_message_t msg;
2850 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2851 uint16_t i;
2852 mavlink_set_position_target_local_ned_t packet_in = {
2853 963497464,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27,94,161
2855 mavlink_set_position_target_local_ned_t packet1, packet2;
2856 memset(&packet1, 0, sizeof(packet1));
2857 packet1.time_boot_ms = packet_in.time_boot_ms;
2858 packet1.x = packet_in.x;
2859 packet1.y = packet_in.y;
2860 packet1.z = packet_in.z;
2861 packet1.vx = packet_in.vx;
2862 packet1.vy = packet_in.vy;
2863 packet1.vz = packet_in.vz;
2864 packet1.afx = packet_in.afx;
2865 packet1.afy = packet_in.afy;
2866 packet1.afz = packet_in.afz;
2867 packet1.yaw = packet_in.yaw;
2868 packet1.yaw_rate = packet_in.yaw_rate;
2869 packet1.type_mask = packet_in.type_mask;
2870 packet1.target_system = packet_in.target_system;
2871 packet1.target_component = packet_in.target_component;
2872 packet1.coordinate_frame = packet_in.coordinate_frame;
2876 memset(&packet2, 0, sizeof(packet2));
2877 mavlink_msg_set_position_target_local_ned_encode(system_id, component_id, &msg, &packet1);
2878 mavlink_msg_set_position_target_local_ned_decode(&msg, &packet2);
2879 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2881 memset(&packet2, 0, sizeof(packet2));
2882 mavlink_msg_set_position_target_local_ned_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
2883 mavlink_msg_set_position_target_local_ned_decode(&msg, &packet2);
2884 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2886 memset(&packet2, 0, sizeof(packet2));
2887 mavlink_msg_set_position_target_local_ned_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
2888 mavlink_msg_set_position_target_local_ned_decode(&msg, &packet2);
2889 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2891 memset(&packet2, 0, sizeof(packet2));
2892 mavlink_msg_to_send_buffer(buffer, &msg);
2893 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2894 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2896 mavlink_msg_set_position_target_local_ned_decode(last_msg, &packet2);
2897 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2899 memset(&packet2, 0, sizeof(packet2));
2900 mavlink_msg_set_position_target_local_ned_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
2901 mavlink_msg_set_position_target_local_ned_decode(last_msg, &packet2);
2902 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2905 static void mavlink_test_position_target_local_ned(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2907 mavlink_message_t msg;
2908 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2909 uint16_t i;
2910 mavlink_position_target_local_ned_t packet_in = {
2911 963497464,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27
2913 mavlink_position_target_local_ned_t packet1, packet2;
2914 memset(&packet1, 0, sizeof(packet1));
2915 packet1.time_boot_ms = packet_in.time_boot_ms;
2916 packet1.x = packet_in.x;
2917 packet1.y = packet_in.y;
2918 packet1.z = packet_in.z;
2919 packet1.vx = packet_in.vx;
2920 packet1.vy = packet_in.vy;
2921 packet1.vz = packet_in.vz;
2922 packet1.afx = packet_in.afx;
2923 packet1.afy = packet_in.afy;
2924 packet1.afz = packet_in.afz;
2925 packet1.yaw = packet_in.yaw;
2926 packet1.yaw_rate = packet_in.yaw_rate;
2927 packet1.type_mask = packet_in.type_mask;
2928 packet1.coordinate_frame = packet_in.coordinate_frame;
2932 memset(&packet2, 0, sizeof(packet2));
2933 mavlink_msg_position_target_local_ned_encode(system_id, component_id, &msg, &packet1);
2934 mavlink_msg_position_target_local_ned_decode(&msg, &packet2);
2935 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2937 memset(&packet2, 0, sizeof(packet2));
2938 mavlink_msg_position_target_local_ned_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
2939 mavlink_msg_position_target_local_ned_decode(&msg, &packet2);
2940 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2942 memset(&packet2, 0, sizeof(packet2));
2943 mavlink_msg_position_target_local_ned_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
2944 mavlink_msg_position_target_local_ned_decode(&msg, &packet2);
2945 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2947 memset(&packet2, 0, sizeof(packet2));
2948 mavlink_msg_to_send_buffer(buffer, &msg);
2949 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2950 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2952 mavlink_msg_position_target_local_ned_decode(last_msg, &packet2);
2953 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2955 memset(&packet2, 0, sizeof(packet2));
2956 mavlink_msg_position_target_local_ned_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
2957 mavlink_msg_position_target_local_ned_decode(last_msg, &packet2);
2958 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2961 static void mavlink_test_set_position_target_global_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2963 mavlink_message_t msg;
2964 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2965 uint16_t i;
2966 mavlink_set_position_target_global_int_t packet_in = {
2967 963497464,963497672,963497880,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27,94,161
2969 mavlink_set_position_target_global_int_t packet1, packet2;
2970 memset(&packet1, 0, sizeof(packet1));
2971 packet1.time_boot_ms = packet_in.time_boot_ms;
2972 packet1.lat_int = packet_in.lat_int;
2973 packet1.lon_int = packet_in.lon_int;
2974 packet1.alt = packet_in.alt;
2975 packet1.vx = packet_in.vx;
2976 packet1.vy = packet_in.vy;
2977 packet1.vz = packet_in.vz;
2978 packet1.afx = packet_in.afx;
2979 packet1.afy = packet_in.afy;
2980 packet1.afz = packet_in.afz;
2981 packet1.yaw = packet_in.yaw;
2982 packet1.yaw_rate = packet_in.yaw_rate;
2983 packet1.type_mask = packet_in.type_mask;
2984 packet1.target_system = packet_in.target_system;
2985 packet1.target_component = packet_in.target_component;
2986 packet1.coordinate_frame = packet_in.coordinate_frame;
2990 memset(&packet2, 0, sizeof(packet2));
2991 mavlink_msg_set_position_target_global_int_encode(system_id, component_id, &msg, &packet1);
2992 mavlink_msg_set_position_target_global_int_decode(&msg, &packet2);
2993 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2995 memset(&packet2, 0, sizeof(packet2));
2996 mavlink_msg_set_position_target_global_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
2997 mavlink_msg_set_position_target_global_int_decode(&msg, &packet2);
2998 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3000 memset(&packet2, 0, sizeof(packet2));
3001 mavlink_msg_set_position_target_global_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
3002 mavlink_msg_set_position_target_global_int_decode(&msg, &packet2);
3003 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3005 memset(&packet2, 0, sizeof(packet2));
3006 mavlink_msg_to_send_buffer(buffer, &msg);
3007 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3008 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3010 mavlink_msg_set_position_target_global_int_decode(last_msg, &packet2);
3011 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3013 memset(&packet2, 0, sizeof(packet2));
3014 mavlink_msg_set_position_target_global_int_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
3015 mavlink_msg_set_position_target_global_int_decode(last_msg, &packet2);
3016 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3019 static void mavlink_test_position_target_global_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3021 mavlink_message_t msg;
3022 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3023 uint16_t i;
3024 mavlink_position_target_global_int_t packet_in = {
3025 963497464,963497672,963497880,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27
3027 mavlink_position_target_global_int_t packet1, packet2;
3028 memset(&packet1, 0, sizeof(packet1));
3029 packet1.time_boot_ms = packet_in.time_boot_ms;
3030 packet1.lat_int = packet_in.lat_int;
3031 packet1.lon_int = packet_in.lon_int;
3032 packet1.alt = packet_in.alt;
3033 packet1.vx = packet_in.vx;
3034 packet1.vy = packet_in.vy;
3035 packet1.vz = packet_in.vz;
3036 packet1.afx = packet_in.afx;
3037 packet1.afy = packet_in.afy;
3038 packet1.afz = packet_in.afz;
3039 packet1.yaw = packet_in.yaw;
3040 packet1.yaw_rate = packet_in.yaw_rate;
3041 packet1.type_mask = packet_in.type_mask;
3042 packet1.coordinate_frame = packet_in.coordinate_frame;
3046 memset(&packet2, 0, sizeof(packet2));
3047 mavlink_msg_position_target_global_int_encode(system_id, component_id, &msg, &packet1);
3048 mavlink_msg_position_target_global_int_decode(&msg, &packet2);
3049 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3051 memset(&packet2, 0, sizeof(packet2));
3052 mavlink_msg_position_target_global_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
3053 mavlink_msg_position_target_global_int_decode(&msg, &packet2);
3054 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3056 memset(&packet2, 0, sizeof(packet2));
3057 mavlink_msg_position_target_global_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
3058 mavlink_msg_position_target_global_int_decode(&msg, &packet2);
3059 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3061 memset(&packet2, 0, sizeof(packet2));
3062 mavlink_msg_to_send_buffer(buffer, &msg);
3063 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3064 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3066 mavlink_msg_position_target_global_int_decode(last_msg, &packet2);
3067 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3069 memset(&packet2, 0, sizeof(packet2));
3070 mavlink_msg_position_target_global_int_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
3071 mavlink_msg_position_target_global_int_decode(last_msg, &packet2);
3072 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3075 static void mavlink_test_local_position_ned_system_global_offset(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3077 mavlink_message_t msg;
3078 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3079 uint16_t i;
3080 mavlink_local_position_ned_system_global_offset_t packet_in = {
3081 963497464,45.0,73.0,101.0,129.0,157.0,185.0
3083 mavlink_local_position_ned_system_global_offset_t packet1, packet2;
3084 memset(&packet1, 0, sizeof(packet1));
3085 packet1.time_boot_ms = packet_in.time_boot_ms;
3086 packet1.x = packet_in.x;
3087 packet1.y = packet_in.y;
3088 packet1.z = packet_in.z;
3089 packet1.roll = packet_in.roll;
3090 packet1.pitch = packet_in.pitch;
3091 packet1.yaw = packet_in.yaw;
3095 memset(&packet2, 0, sizeof(packet2));
3096 mavlink_msg_local_position_ned_system_global_offset_encode(system_id, component_id, &msg, &packet1);
3097 mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2);
3098 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3100 memset(&packet2, 0, sizeof(packet2));
3101 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 );
3102 mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2);
3103 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3105 memset(&packet2, 0, sizeof(packet2));
3106 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 );
3107 mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2);
3108 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3110 memset(&packet2, 0, sizeof(packet2));
3111 mavlink_msg_to_send_buffer(buffer, &msg);
3112 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3113 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3115 mavlink_msg_local_position_ned_system_global_offset_decode(last_msg, &packet2);
3116 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3118 memset(&packet2, 0, sizeof(packet2));
3119 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 );
3120 mavlink_msg_local_position_ned_system_global_offset_decode(last_msg, &packet2);
3121 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3124 static void mavlink_test_hil_state(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3126 mavlink_message_t msg;
3127 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3128 uint16_t i;
3129 mavlink_hil_state_t packet_in = {
3130 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,963499128,963499336,963499544,19523,19627,19731,19835,19939,20043
3132 mavlink_hil_state_t packet1, packet2;
3133 memset(&packet1, 0, sizeof(packet1));
3134 packet1.time_usec = packet_in.time_usec;
3135 packet1.roll = packet_in.roll;
3136 packet1.pitch = packet_in.pitch;
3137 packet1.yaw = packet_in.yaw;
3138 packet1.rollspeed = packet_in.rollspeed;
3139 packet1.pitchspeed = packet_in.pitchspeed;
3140 packet1.yawspeed = packet_in.yawspeed;
3141 packet1.lat = packet_in.lat;
3142 packet1.lon = packet_in.lon;
3143 packet1.alt = packet_in.alt;
3144 packet1.vx = packet_in.vx;
3145 packet1.vy = packet_in.vy;
3146 packet1.vz = packet_in.vz;
3147 packet1.xacc = packet_in.xacc;
3148 packet1.yacc = packet_in.yacc;
3149 packet1.zacc = packet_in.zacc;
3153 memset(&packet2, 0, sizeof(packet2));
3154 mavlink_msg_hil_state_encode(system_id, component_id, &msg, &packet1);
3155 mavlink_msg_hil_state_decode(&msg, &packet2);
3156 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3158 memset(&packet2, 0, sizeof(packet2));
3159 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 );
3160 mavlink_msg_hil_state_decode(&msg, &packet2);
3161 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3163 memset(&packet2, 0, sizeof(packet2));
3164 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 );
3165 mavlink_msg_hil_state_decode(&msg, &packet2);
3166 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3168 memset(&packet2, 0, sizeof(packet2));
3169 mavlink_msg_to_send_buffer(buffer, &msg);
3170 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3171 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3173 mavlink_msg_hil_state_decode(last_msg, &packet2);
3174 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3176 memset(&packet2, 0, sizeof(packet2));
3177 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 );
3178 mavlink_msg_hil_state_decode(last_msg, &packet2);
3179 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3182 static void mavlink_test_hil_controls(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3184 mavlink_message_t msg;
3185 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3186 uint16_t i;
3187 mavlink_hil_controls_t packet_in = {
3188 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,125,192
3190 mavlink_hil_controls_t packet1, packet2;
3191 memset(&packet1, 0, sizeof(packet1));
3192 packet1.time_usec = packet_in.time_usec;
3193 packet1.roll_ailerons = packet_in.roll_ailerons;
3194 packet1.pitch_elevator = packet_in.pitch_elevator;
3195 packet1.yaw_rudder = packet_in.yaw_rudder;
3196 packet1.throttle = packet_in.throttle;
3197 packet1.aux1 = packet_in.aux1;
3198 packet1.aux2 = packet_in.aux2;
3199 packet1.aux3 = packet_in.aux3;
3200 packet1.aux4 = packet_in.aux4;
3201 packet1.mode = packet_in.mode;
3202 packet1.nav_mode = packet_in.nav_mode;
3206 memset(&packet2, 0, sizeof(packet2));
3207 mavlink_msg_hil_controls_encode(system_id, component_id, &msg, &packet1);
3208 mavlink_msg_hil_controls_decode(&msg, &packet2);
3209 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3211 memset(&packet2, 0, sizeof(packet2));
3212 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 );
3213 mavlink_msg_hil_controls_decode(&msg, &packet2);
3214 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3216 memset(&packet2, 0, sizeof(packet2));
3217 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 );
3218 mavlink_msg_hil_controls_decode(&msg, &packet2);
3219 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3221 memset(&packet2, 0, sizeof(packet2));
3222 mavlink_msg_to_send_buffer(buffer, &msg);
3223 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3224 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3226 mavlink_msg_hil_controls_decode(last_msg, &packet2);
3227 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3229 memset(&packet2, 0, sizeof(packet2));
3230 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 );
3231 mavlink_msg_hil_controls_decode(last_msg, &packet2);
3232 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3235 static void mavlink_test_hil_rc_inputs_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3237 mavlink_message_t msg;
3238 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3239 uint16_t i;
3240 mavlink_hil_rc_inputs_raw_t packet_in = {
3241 93372036854775807ULL,17651,17755,17859,17963,18067,18171,18275,18379,18483,18587,18691,18795,101
3243 mavlink_hil_rc_inputs_raw_t packet1, packet2;
3244 memset(&packet1, 0, sizeof(packet1));
3245 packet1.time_usec = packet_in.time_usec;
3246 packet1.chan1_raw = packet_in.chan1_raw;
3247 packet1.chan2_raw = packet_in.chan2_raw;
3248 packet1.chan3_raw = packet_in.chan3_raw;
3249 packet1.chan4_raw = packet_in.chan4_raw;
3250 packet1.chan5_raw = packet_in.chan5_raw;
3251 packet1.chan6_raw = packet_in.chan6_raw;
3252 packet1.chan7_raw = packet_in.chan7_raw;
3253 packet1.chan8_raw = packet_in.chan8_raw;
3254 packet1.chan9_raw = packet_in.chan9_raw;
3255 packet1.chan10_raw = packet_in.chan10_raw;
3256 packet1.chan11_raw = packet_in.chan11_raw;
3257 packet1.chan12_raw = packet_in.chan12_raw;
3258 packet1.rssi = packet_in.rssi;
3262 memset(&packet2, 0, sizeof(packet2));
3263 mavlink_msg_hil_rc_inputs_raw_encode(system_id, component_id, &msg, &packet1);
3264 mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2);
3265 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3267 memset(&packet2, 0, sizeof(packet2));
3268 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 );
3269 mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2);
3270 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3272 memset(&packet2, 0, sizeof(packet2));
3273 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 );
3274 mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2);
3275 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3277 memset(&packet2, 0, sizeof(packet2));
3278 mavlink_msg_to_send_buffer(buffer, &msg);
3279 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3280 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3282 mavlink_msg_hil_rc_inputs_raw_decode(last_msg, &packet2);
3283 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3285 memset(&packet2, 0, sizeof(packet2));
3286 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 );
3287 mavlink_msg_hil_rc_inputs_raw_decode(last_msg, &packet2);
3288 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3291 static void mavlink_test_optical_flow(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3293 mavlink_message_t msg;
3294 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3295 uint16_t i;
3296 mavlink_optical_flow_t packet_in = {
3297 93372036854775807ULL,73.0,101.0,129.0,18275,18379,77,144
3299 mavlink_optical_flow_t packet1, packet2;
3300 memset(&packet1, 0, sizeof(packet1));
3301 packet1.time_usec = packet_in.time_usec;
3302 packet1.flow_comp_m_x = packet_in.flow_comp_m_x;
3303 packet1.flow_comp_m_y = packet_in.flow_comp_m_y;
3304 packet1.ground_distance = packet_in.ground_distance;
3305 packet1.flow_x = packet_in.flow_x;
3306 packet1.flow_y = packet_in.flow_y;
3307 packet1.sensor_id = packet_in.sensor_id;
3308 packet1.quality = packet_in.quality;
3312 memset(&packet2, 0, sizeof(packet2));
3313 mavlink_msg_optical_flow_encode(system_id, component_id, &msg, &packet1);
3314 mavlink_msg_optical_flow_decode(&msg, &packet2);
3315 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3317 memset(&packet2, 0, sizeof(packet2));
3318 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 );
3319 mavlink_msg_optical_flow_decode(&msg, &packet2);
3320 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3322 memset(&packet2, 0, sizeof(packet2));
3323 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 );
3324 mavlink_msg_optical_flow_decode(&msg, &packet2);
3325 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3327 memset(&packet2, 0, sizeof(packet2));
3328 mavlink_msg_to_send_buffer(buffer, &msg);
3329 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3330 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3332 mavlink_msg_optical_flow_decode(last_msg, &packet2);
3333 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3335 memset(&packet2, 0, sizeof(packet2));
3336 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 );
3337 mavlink_msg_optical_flow_decode(last_msg, &packet2);
3338 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3341 static void mavlink_test_global_vision_position_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3343 mavlink_message_t msg;
3344 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3345 uint16_t i;
3346 mavlink_global_vision_position_estimate_t packet_in = {
3347 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0
3349 mavlink_global_vision_position_estimate_t packet1, packet2;
3350 memset(&packet1, 0, sizeof(packet1));
3351 packet1.usec = packet_in.usec;
3352 packet1.x = packet_in.x;
3353 packet1.y = packet_in.y;
3354 packet1.z = packet_in.z;
3355 packet1.roll = packet_in.roll;
3356 packet1.pitch = packet_in.pitch;
3357 packet1.yaw = packet_in.yaw;
3361 memset(&packet2, 0, sizeof(packet2));
3362 mavlink_msg_global_vision_position_estimate_encode(system_id, component_id, &msg, &packet1);
3363 mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2);
3364 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3366 memset(&packet2, 0, sizeof(packet2));
3367 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 );
3368 mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2);
3369 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3371 memset(&packet2, 0, sizeof(packet2));
3372 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 );
3373 mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2);
3374 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3376 memset(&packet2, 0, sizeof(packet2));
3377 mavlink_msg_to_send_buffer(buffer, &msg);
3378 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3379 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3381 mavlink_msg_global_vision_position_estimate_decode(last_msg, &packet2);
3382 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3384 memset(&packet2, 0, sizeof(packet2));
3385 mavlink_msg_global_vision_position_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
3386 mavlink_msg_global_vision_position_estimate_decode(last_msg, &packet2);
3387 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3390 static void mavlink_test_vision_position_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3392 mavlink_message_t msg;
3393 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3394 uint16_t i;
3395 mavlink_vision_position_estimate_t packet_in = {
3396 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0
3398 mavlink_vision_position_estimate_t packet1, packet2;
3399 memset(&packet1, 0, sizeof(packet1));
3400 packet1.usec = packet_in.usec;
3401 packet1.x = packet_in.x;
3402 packet1.y = packet_in.y;
3403 packet1.z = packet_in.z;
3404 packet1.roll = packet_in.roll;
3405 packet1.pitch = packet_in.pitch;
3406 packet1.yaw = packet_in.yaw;
3410 memset(&packet2, 0, sizeof(packet2));
3411 mavlink_msg_vision_position_estimate_encode(system_id, component_id, &msg, &packet1);
3412 mavlink_msg_vision_position_estimate_decode(&msg, &packet2);
3413 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3415 memset(&packet2, 0, sizeof(packet2));
3416 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 );
3417 mavlink_msg_vision_position_estimate_decode(&msg, &packet2);
3418 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3420 memset(&packet2, 0, sizeof(packet2));
3421 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 );
3422 mavlink_msg_vision_position_estimate_decode(&msg, &packet2);
3423 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3425 memset(&packet2, 0, sizeof(packet2));
3426 mavlink_msg_to_send_buffer(buffer, &msg);
3427 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3428 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3430 mavlink_msg_vision_position_estimate_decode(last_msg, &packet2);
3431 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3433 memset(&packet2, 0, sizeof(packet2));
3434 mavlink_msg_vision_position_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
3435 mavlink_msg_vision_position_estimate_decode(last_msg, &packet2);
3436 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3439 static void mavlink_test_vision_speed_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3441 mavlink_message_t msg;
3442 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3443 uint16_t i;
3444 mavlink_vision_speed_estimate_t packet_in = {
3445 93372036854775807ULL,73.0,101.0,129.0
3447 mavlink_vision_speed_estimate_t packet1, packet2;
3448 memset(&packet1, 0, sizeof(packet1));
3449 packet1.usec = packet_in.usec;
3450 packet1.x = packet_in.x;
3451 packet1.y = packet_in.y;
3452 packet1.z = packet_in.z;
3456 memset(&packet2, 0, sizeof(packet2));
3457 mavlink_msg_vision_speed_estimate_encode(system_id, component_id, &msg, &packet1);
3458 mavlink_msg_vision_speed_estimate_decode(&msg, &packet2);
3459 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3461 memset(&packet2, 0, sizeof(packet2));
3462 mavlink_msg_vision_speed_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z );
3463 mavlink_msg_vision_speed_estimate_decode(&msg, &packet2);
3464 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3466 memset(&packet2, 0, sizeof(packet2));
3467 mavlink_msg_vision_speed_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z );
3468 mavlink_msg_vision_speed_estimate_decode(&msg, &packet2);
3469 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3471 memset(&packet2, 0, sizeof(packet2));
3472 mavlink_msg_to_send_buffer(buffer, &msg);
3473 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3474 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3476 mavlink_msg_vision_speed_estimate_decode(last_msg, &packet2);
3477 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3479 memset(&packet2, 0, sizeof(packet2));
3480 mavlink_msg_vision_speed_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z );
3481 mavlink_msg_vision_speed_estimate_decode(last_msg, &packet2);
3482 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3485 static void mavlink_test_vicon_position_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3487 mavlink_message_t msg;
3488 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3489 uint16_t i;
3490 mavlink_vicon_position_estimate_t packet_in = {
3491 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0
3493 mavlink_vicon_position_estimate_t packet1, packet2;
3494 memset(&packet1, 0, sizeof(packet1));
3495 packet1.usec = packet_in.usec;
3496 packet1.x = packet_in.x;
3497 packet1.y = packet_in.y;
3498 packet1.z = packet_in.z;
3499 packet1.roll = packet_in.roll;
3500 packet1.pitch = packet_in.pitch;
3501 packet1.yaw = packet_in.yaw;
3505 memset(&packet2, 0, sizeof(packet2));
3506 mavlink_msg_vicon_position_estimate_encode(system_id, component_id, &msg, &packet1);
3507 mavlink_msg_vicon_position_estimate_decode(&msg, &packet2);
3508 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3510 memset(&packet2, 0, sizeof(packet2));
3511 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 );
3512 mavlink_msg_vicon_position_estimate_decode(&msg, &packet2);
3513 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3515 memset(&packet2, 0, sizeof(packet2));
3516 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 );
3517 mavlink_msg_vicon_position_estimate_decode(&msg, &packet2);
3518 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3520 memset(&packet2, 0, sizeof(packet2));
3521 mavlink_msg_to_send_buffer(buffer, &msg);
3522 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3523 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3525 mavlink_msg_vicon_position_estimate_decode(last_msg, &packet2);
3526 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3528 memset(&packet2, 0, sizeof(packet2));
3529 mavlink_msg_vicon_position_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
3530 mavlink_msg_vicon_position_estimate_decode(last_msg, &packet2);
3531 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3534 static void mavlink_test_highres_imu(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3536 mavlink_message_t msg;
3537 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3538 uint16_t i;
3539 mavlink_highres_imu_t packet_in = {
3540 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,409.0,20355
3542 mavlink_highres_imu_t packet1, packet2;
3543 memset(&packet1, 0, sizeof(packet1));
3544 packet1.time_usec = packet_in.time_usec;
3545 packet1.xacc = packet_in.xacc;
3546 packet1.yacc = packet_in.yacc;
3547 packet1.zacc = packet_in.zacc;
3548 packet1.xgyro = packet_in.xgyro;
3549 packet1.ygyro = packet_in.ygyro;
3550 packet1.zgyro = packet_in.zgyro;
3551 packet1.xmag = packet_in.xmag;
3552 packet1.ymag = packet_in.ymag;
3553 packet1.zmag = packet_in.zmag;
3554 packet1.abs_pressure = packet_in.abs_pressure;
3555 packet1.diff_pressure = packet_in.diff_pressure;
3556 packet1.pressure_alt = packet_in.pressure_alt;
3557 packet1.temperature = packet_in.temperature;
3558 packet1.fields_updated = packet_in.fields_updated;
3562 memset(&packet2, 0, sizeof(packet2));
3563 mavlink_msg_highres_imu_encode(system_id, component_id, &msg, &packet1);
3564 mavlink_msg_highres_imu_decode(&msg, &packet2);
3565 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3567 memset(&packet2, 0, sizeof(packet2));
3568 mavlink_msg_highres_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 , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated );
3569 mavlink_msg_highres_imu_decode(&msg, &packet2);
3570 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3572 memset(&packet2, 0, sizeof(packet2));
3573 mavlink_msg_highres_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 , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated );
3574 mavlink_msg_highres_imu_decode(&msg, &packet2);
3575 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3577 memset(&packet2, 0, sizeof(packet2));
3578 mavlink_msg_to_send_buffer(buffer, &msg);
3579 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3580 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3582 mavlink_msg_highres_imu_decode(last_msg, &packet2);
3583 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3585 memset(&packet2, 0, sizeof(packet2));
3586 mavlink_msg_highres_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 , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated );
3587 mavlink_msg_highres_imu_decode(last_msg, &packet2);
3588 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3591 static void mavlink_test_optical_flow_rad(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3593 mavlink_message_t msg;
3594 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3595 uint16_t i;
3596 mavlink_optical_flow_rad_t packet_in = {
3597 93372036854775807ULL,963497880,101.0,129.0,157.0,185.0,213.0,963499128,269.0,19315,3,70
3599 mavlink_optical_flow_rad_t packet1, packet2;
3600 memset(&packet1, 0, sizeof(packet1));
3601 packet1.time_usec = packet_in.time_usec;
3602 packet1.integration_time_us = packet_in.integration_time_us;
3603 packet1.integrated_x = packet_in.integrated_x;
3604 packet1.integrated_y = packet_in.integrated_y;
3605 packet1.integrated_xgyro = packet_in.integrated_xgyro;
3606 packet1.integrated_ygyro = packet_in.integrated_ygyro;
3607 packet1.integrated_zgyro = packet_in.integrated_zgyro;
3608 packet1.time_delta_distance_us = packet_in.time_delta_distance_us;
3609 packet1.distance = packet_in.distance;
3610 packet1.temperature = packet_in.temperature;
3611 packet1.sensor_id = packet_in.sensor_id;
3612 packet1.quality = packet_in.quality;
3616 memset(&packet2, 0, sizeof(packet2));
3617 mavlink_msg_optical_flow_rad_encode(system_id, component_id, &msg, &packet1);
3618 mavlink_msg_optical_flow_rad_decode(&msg, &packet2);
3619 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3621 memset(&packet2, 0, sizeof(packet2));
3622 mavlink_msg_optical_flow_rad_pack(system_id, component_id, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
3623 mavlink_msg_optical_flow_rad_decode(&msg, &packet2);
3624 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3626 memset(&packet2, 0, sizeof(packet2));
3627 mavlink_msg_optical_flow_rad_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
3628 mavlink_msg_optical_flow_rad_decode(&msg, &packet2);
3629 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3631 memset(&packet2, 0, sizeof(packet2));
3632 mavlink_msg_to_send_buffer(buffer, &msg);
3633 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3634 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3636 mavlink_msg_optical_flow_rad_decode(last_msg, &packet2);
3637 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3639 memset(&packet2, 0, sizeof(packet2));
3640 mavlink_msg_optical_flow_rad_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
3641 mavlink_msg_optical_flow_rad_decode(last_msg, &packet2);
3642 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3645 static void mavlink_test_hil_sensor(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3647 mavlink_message_t msg;
3648 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3649 uint16_t i;
3650 mavlink_hil_sensor_t packet_in = {
3651 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,409.0,963500584
3653 mavlink_hil_sensor_t packet1, packet2;
3654 memset(&packet1, 0, sizeof(packet1));
3655 packet1.time_usec = packet_in.time_usec;
3656 packet1.xacc = packet_in.xacc;
3657 packet1.yacc = packet_in.yacc;
3658 packet1.zacc = packet_in.zacc;
3659 packet1.xgyro = packet_in.xgyro;
3660 packet1.ygyro = packet_in.ygyro;
3661 packet1.zgyro = packet_in.zgyro;
3662 packet1.xmag = packet_in.xmag;
3663 packet1.ymag = packet_in.ymag;
3664 packet1.zmag = packet_in.zmag;
3665 packet1.abs_pressure = packet_in.abs_pressure;
3666 packet1.diff_pressure = packet_in.diff_pressure;
3667 packet1.pressure_alt = packet_in.pressure_alt;
3668 packet1.temperature = packet_in.temperature;
3669 packet1.fields_updated = packet_in.fields_updated;
3673 memset(&packet2, 0, sizeof(packet2));
3674 mavlink_msg_hil_sensor_encode(system_id, component_id, &msg, &packet1);
3675 mavlink_msg_hil_sensor_decode(&msg, &packet2);
3676 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3678 memset(&packet2, 0, sizeof(packet2));
3679 mavlink_msg_hil_sensor_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 , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated );
3680 mavlink_msg_hil_sensor_decode(&msg, &packet2);
3681 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3683 memset(&packet2, 0, sizeof(packet2));
3684 mavlink_msg_hil_sensor_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 , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated );
3685 mavlink_msg_hil_sensor_decode(&msg, &packet2);
3686 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3688 memset(&packet2, 0, sizeof(packet2));
3689 mavlink_msg_to_send_buffer(buffer, &msg);
3690 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3691 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3693 mavlink_msg_hil_sensor_decode(last_msg, &packet2);
3694 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3696 memset(&packet2, 0, sizeof(packet2));
3697 mavlink_msg_hil_sensor_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 , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated );
3698 mavlink_msg_hil_sensor_decode(last_msg, &packet2);
3699 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3702 static void mavlink_test_sim_state(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3704 mavlink_message_t msg;
3705 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3706 uint16_t i;
3707 mavlink_sim_state_t packet_in = {
3708 17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,409.0,437.0,465.0,493.0,521.0,549.0,577.0
3710 mavlink_sim_state_t packet1, packet2;
3711 memset(&packet1, 0, sizeof(packet1));
3712 packet1.q1 = packet_in.q1;
3713 packet1.q2 = packet_in.q2;
3714 packet1.q3 = packet_in.q3;
3715 packet1.q4 = packet_in.q4;
3716 packet1.roll = packet_in.roll;
3717 packet1.pitch = packet_in.pitch;
3718 packet1.yaw = packet_in.yaw;
3719 packet1.xacc = packet_in.xacc;
3720 packet1.yacc = packet_in.yacc;
3721 packet1.zacc = packet_in.zacc;
3722 packet1.xgyro = packet_in.xgyro;
3723 packet1.ygyro = packet_in.ygyro;
3724 packet1.zgyro = packet_in.zgyro;
3725 packet1.lat = packet_in.lat;
3726 packet1.lon = packet_in.lon;
3727 packet1.alt = packet_in.alt;
3728 packet1.std_dev_horz = packet_in.std_dev_horz;
3729 packet1.std_dev_vert = packet_in.std_dev_vert;
3730 packet1.vn = packet_in.vn;
3731 packet1.ve = packet_in.ve;
3732 packet1.vd = packet_in.vd;
3736 memset(&packet2, 0, sizeof(packet2));
3737 mavlink_msg_sim_state_encode(system_id, component_id, &msg, &packet1);
3738 mavlink_msg_sim_state_decode(&msg, &packet2);
3739 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3741 memset(&packet2, 0, sizeof(packet2));
3742 mavlink_msg_sim_state_pack(system_id, component_id, &msg , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lon , packet1.alt , packet1.std_dev_horz , packet1.std_dev_vert , packet1.vn , packet1.ve , packet1.vd );
3743 mavlink_msg_sim_state_decode(&msg, &packet2);
3744 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3746 memset(&packet2, 0, sizeof(packet2));
3747 mavlink_msg_sim_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lon , packet1.alt , packet1.std_dev_horz , packet1.std_dev_vert , packet1.vn , packet1.ve , packet1.vd );
3748 mavlink_msg_sim_state_decode(&msg, &packet2);
3749 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3751 memset(&packet2, 0, sizeof(packet2));
3752 mavlink_msg_to_send_buffer(buffer, &msg);
3753 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3754 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3756 mavlink_msg_sim_state_decode(last_msg, &packet2);
3757 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3759 memset(&packet2, 0, sizeof(packet2));
3760 mavlink_msg_sim_state_send(MAVLINK_COMM_1 , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lon , packet1.alt , packet1.std_dev_horz , packet1.std_dev_vert , packet1.vn , packet1.ve , packet1.vd );
3761 mavlink_msg_sim_state_decode(last_msg, &packet2);
3762 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3765 static void mavlink_test_radio_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3767 mavlink_message_t msg;
3768 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3769 uint16_t i;
3770 mavlink_radio_status_t packet_in = {
3771 17235,17339,17,84,151,218,29
3773 mavlink_radio_status_t packet1, packet2;
3774 memset(&packet1, 0, sizeof(packet1));
3775 packet1.rxerrors = packet_in.rxerrors;
3776 packet1.fixed = packet_in.fixed;
3777 packet1.rssi = packet_in.rssi;
3778 packet1.remrssi = packet_in.remrssi;
3779 packet1.txbuf = packet_in.txbuf;
3780 packet1.noise = packet_in.noise;
3781 packet1.remnoise = packet_in.remnoise;
3785 memset(&packet2, 0, sizeof(packet2));
3786 mavlink_msg_radio_status_encode(system_id, component_id, &msg, &packet1);
3787 mavlink_msg_radio_status_decode(&msg, &packet2);
3788 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3790 memset(&packet2, 0, sizeof(packet2));
3791 mavlink_msg_radio_status_pack(system_id, component_id, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
3792 mavlink_msg_radio_status_decode(&msg, &packet2);
3793 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3795 memset(&packet2, 0, sizeof(packet2));
3796 mavlink_msg_radio_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
3797 mavlink_msg_radio_status_decode(&msg, &packet2);
3798 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3800 memset(&packet2, 0, sizeof(packet2));
3801 mavlink_msg_to_send_buffer(buffer, &msg);
3802 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3803 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3805 mavlink_msg_radio_status_decode(last_msg, &packet2);
3806 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3808 memset(&packet2, 0, sizeof(packet2));
3809 mavlink_msg_radio_status_send(MAVLINK_COMM_1 , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
3810 mavlink_msg_radio_status_decode(last_msg, &packet2);
3811 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3814 static void mavlink_test_file_transfer_protocol(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3816 mavlink_message_t msg;
3817 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3818 uint16_t i;
3819 mavlink_file_transfer_protocol_t packet_in = {
3820 5,72,139,{ 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 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, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200 }
3822 mavlink_file_transfer_protocol_t packet1, packet2;
3823 memset(&packet1, 0, sizeof(packet1));
3824 packet1.target_network = packet_in.target_network;
3825 packet1.target_system = packet_in.target_system;
3826 packet1.target_component = packet_in.target_component;
3828 mav_array_memcpy(packet1.payload, packet_in.payload, sizeof(uint8_t)*251);
3831 memset(&packet2, 0, sizeof(packet2));
3832 mavlink_msg_file_transfer_protocol_encode(system_id, component_id, &msg, &packet1);
3833 mavlink_msg_file_transfer_protocol_decode(&msg, &packet2);
3834 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3836 memset(&packet2, 0, sizeof(packet2));
3837 mavlink_msg_file_transfer_protocol_pack(system_id, component_id, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.payload );
3838 mavlink_msg_file_transfer_protocol_decode(&msg, &packet2);
3839 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3841 memset(&packet2, 0, sizeof(packet2));
3842 mavlink_msg_file_transfer_protocol_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.payload );
3843 mavlink_msg_file_transfer_protocol_decode(&msg, &packet2);
3844 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3846 memset(&packet2, 0, sizeof(packet2));
3847 mavlink_msg_to_send_buffer(buffer, &msg);
3848 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3849 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3851 mavlink_msg_file_transfer_protocol_decode(last_msg, &packet2);
3852 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3854 memset(&packet2, 0, sizeof(packet2));
3855 mavlink_msg_file_transfer_protocol_send(MAVLINK_COMM_1 , packet1.target_network , packet1.target_system , packet1.target_component , packet1.payload );
3856 mavlink_msg_file_transfer_protocol_decode(last_msg, &packet2);
3857 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3860 static void mavlink_test_timesync(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3862 mavlink_message_t msg;
3863 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3864 uint16_t i;
3865 mavlink_timesync_t packet_in = {
3866 93372036854775807LL,93372036854776311LL
3868 mavlink_timesync_t packet1, packet2;
3869 memset(&packet1, 0, sizeof(packet1));
3870 packet1.tc1 = packet_in.tc1;
3871 packet1.ts1 = packet_in.ts1;
3875 memset(&packet2, 0, sizeof(packet2));
3876 mavlink_msg_timesync_encode(system_id, component_id, &msg, &packet1);
3877 mavlink_msg_timesync_decode(&msg, &packet2);
3878 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3880 memset(&packet2, 0, sizeof(packet2));
3881 mavlink_msg_timesync_pack(system_id, component_id, &msg , packet1.tc1 , packet1.ts1 );
3882 mavlink_msg_timesync_decode(&msg, &packet2);
3883 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3885 memset(&packet2, 0, sizeof(packet2));
3886 mavlink_msg_timesync_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.tc1 , packet1.ts1 );
3887 mavlink_msg_timesync_decode(&msg, &packet2);
3888 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3890 memset(&packet2, 0, sizeof(packet2));
3891 mavlink_msg_to_send_buffer(buffer, &msg);
3892 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3893 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3895 mavlink_msg_timesync_decode(last_msg, &packet2);
3896 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3898 memset(&packet2, 0, sizeof(packet2));
3899 mavlink_msg_timesync_send(MAVLINK_COMM_1 , packet1.tc1 , packet1.ts1 );
3900 mavlink_msg_timesync_decode(last_msg, &packet2);
3901 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3904 static void mavlink_test_camera_trigger(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3906 mavlink_message_t msg;
3907 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3908 uint16_t i;
3909 mavlink_camera_trigger_t packet_in = {
3910 93372036854775807ULL,963497880
3912 mavlink_camera_trigger_t packet1, packet2;
3913 memset(&packet1, 0, sizeof(packet1));
3914 packet1.time_usec = packet_in.time_usec;
3915 packet1.seq = packet_in.seq;
3919 memset(&packet2, 0, sizeof(packet2));
3920 mavlink_msg_camera_trigger_encode(system_id, component_id, &msg, &packet1);
3921 mavlink_msg_camera_trigger_decode(&msg, &packet2);
3922 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3924 memset(&packet2, 0, sizeof(packet2));
3925 mavlink_msg_camera_trigger_pack(system_id, component_id, &msg , packet1.time_usec , packet1.seq );
3926 mavlink_msg_camera_trigger_decode(&msg, &packet2);
3927 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3929 memset(&packet2, 0, sizeof(packet2));
3930 mavlink_msg_camera_trigger_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.seq );
3931 mavlink_msg_camera_trigger_decode(&msg, &packet2);
3932 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3934 memset(&packet2, 0, sizeof(packet2));
3935 mavlink_msg_to_send_buffer(buffer, &msg);
3936 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3937 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3939 mavlink_msg_camera_trigger_decode(last_msg, &packet2);
3940 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3942 memset(&packet2, 0, sizeof(packet2));
3943 mavlink_msg_camera_trigger_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.seq );
3944 mavlink_msg_camera_trigger_decode(last_msg, &packet2);
3945 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3948 static void mavlink_test_hil_gps(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3950 mavlink_message_t msg;
3951 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3952 uint16_t i;
3953 mavlink_hil_gps_t packet_in = {
3954 93372036854775807ULL,963497880,963498088,963498296,18275,18379,18483,18587,18691,18795,18899,235,46
3956 mavlink_hil_gps_t packet1, packet2;
3957 memset(&packet1, 0, sizeof(packet1));
3958 packet1.time_usec = packet_in.time_usec;
3959 packet1.lat = packet_in.lat;
3960 packet1.lon = packet_in.lon;
3961 packet1.alt = packet_in.alt;
3962 packet1.eph = packet_in.eph;
3963 packet1.epv = packet_in.epv;
3964 packet1.vel = packet_in.vel;
3965 packet1.vn = packet_in.vn;
3966 packet1.ve = packet_in.ve;
3967 packet1.vd = packet_in.vd;
3968 packet1.cog = packet_in.cog;
3969 packet1.fix_type = packet_in.fix_type;
3970 packet1.satellites_visible = packet_in.satellites_visible;
3974 memset(&packet2, 0, sizeof(packet2));
3975 mavlink_msg_hil_gps_encode(system_id, component_id, &msg, &packet1);
3976 mavlink_msg_hil_gps_decode(&msg, &packet2);
3977 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3979 memset(&packet2, 0, sizeof(packet2));
3980 mavlink_msg_hil_gps_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.vn , packet1.ve , packet1.vd , packet1.cog , packet1.satellites_visible );
3981 mavlink_msg_hil_gps_decode(&msg, &packet2);
3982 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3984 memset(&packet2, 0, sizeof(packet2));
3985 mavlink_msg_hil_gps_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.vn , packet1.ve , packet1.vd , packet1.cog , packet1.satellites_visible );
3986 mavlink_msg_hil_gps_decode(&msg, &packet2);
3987 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3989 memset(&packet2, 0, sizeof(packet2));
3990 mavlink_msg_to_send_buffer(buffer, &msg);
3991 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3992 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3994 mavlink_msg_hil_gps_decode(last_msg, &packet2);
3995 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3997 memset(&packet2, 0, sizeof(packet2));
3998 mavlink_msg_hil_gps_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.vn , packet1.ve , packet1.vd , packet1.cog , packet1.satellites_visible );
3999 mavlink_msg_hil_gps_decode(last_msg, &packet2);
4000 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4003 static void mavlink_test_hil_optical_flow(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4005 mavlink_message_t msg;
4006 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4007 uint16_t i;
4008 mavlink_hil_optical_flow_t packet_in = {
4009 93372036854775807ULL,963497880,101.0,129.0,157.0,185.0,213.0,963499128,269.0,19315,3,70
4011 mavlink_hil_optical_flow_t packet1, packet2;
4012 memset(&packet1, 0, sizeof(packet1));
4013 packet1.time_usec = packet_in.time_usec;
4014 packet1.integration_time_us = packet_in.integration_time_us;
4015 packet1.integrated_x = packet_in.integrated_x;
4016 packet1.integrated_y = packet_in.integrated_y;
4017 packet1.integrated_xgyro = packet_in.integrated_xgyro;
4018 packet1.integrated_ygyro = packet_in.integrated_ygyro;
4019 packet1.integrated_zgyro = packet_in.integrated_zgyro;
4020 packet1.time_delta_distance_us = packet_in.time_delta_distance_us;
4021 packet1.distance = packet_in.distance;
4022 packet1.temperature = packet_in.temperature;
4023 packet1.sensor_id = packet_in.sensor_id;
4024 packet1.quality = packet_in.quality;
4028 memset(&packet2, 0, sizeof(packet2));
4029 mavlink_msg_hil_optical_flow_encode(system_id, component_id, &msg, &packet1);
4030 mavlink_msg_hil_optical_flow_decode(&msg, &packet2);
4031 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4033 memset(&packet2, 0, sizeof(packet2));
4034 mavlink_msg_hil_optical_flow_pack(system_id, component_id, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
4035 mavlink_msg_hil_optical_flow_decode(&msg, &packet2);
4036 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4038 memset(&packet2, 0, sizeof(packet2));
4039 mavlink_msg_hil_optical_flow_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
4040 mavlink_msg_hil_optical_flow_decode(&msg, &packet2);
4041 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4043 memset(&packet2, 0, sizeof(packet2));
4044 mavlink_msg_to_send_buffer(buffer, &msg);
4045 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4046 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4048 mavlink_msg_hil_optical_flow_decode(last_msg, &packet2);
4049 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4051 memset(&packet2, 0, sizeof(packet2));
4052 mavlink_msg_hil_optical_flow_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
4053 mavlink_msg_hil_optical_flow_decode(last_msg, &packet2);
4054 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4057 static void mavlink_test_hil_state_quaternion(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4059 mavlink_message_t msg;
4060 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4061 uint16_t i;
4062 mavlink_hil_state_quaternion_t packet_in = {
4063 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0 },185.0,213.0,241.0,963499336,963499544,963499752,19731,19835,19939,20043,20147,20251,20355,20459
4065 mavlink_hil_state_quaternion_t packet1, packet2;
4066 memset(&packet1, 0, sizeof(packet1));
4067 packet1.time_usec = packet_in.time_usec;
4068 packet1.rollspeed = packet_in.rollspeed;
4069 packet1.pitchspeed = packet_in.pitchspeed;
4070 packet1.yawspeed = packet_in.yawspeed;
4071 packet1.lat = packet_in.lat;
4072 packet1.lon = packet_in.lon;
4073 packet1.alt = packet_in.alt;
4074 packet1.vx = packet_in.vx;
4075 packet1.vy = packet_in.vy;
4076 packet1.vz = packet_in.vz;
4077 packet1.ind_airspeed = packet_in.ind_airspeed;
4078 packet1.true_airspeed = packet_in.true_airspeed;
4079 packet1.xacc = packet_in.xacc;
4080 packet1.yacc = packet_in.yacc;
4081 packet1.zacc = packet_in.zacc;
4083 mav_array_memcpy(packet1.attitude_quaternion, packet_in.attitude_quaternion, sizeof(float)*4);
4086 memset(&packet2, 0, sizeof(packet2));
4087 mavlink_msg_hil_state_quaternion_encode(system_id, component_id, &msg, &packet1);
4088 mavlink_msg_hil_state_quaternion_decode(&msg, &packet2);
4089 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4091 memset(&packet2, 0, sizeof(packet2));
4092 mavlink_msg_hil_state_quaternion_pack(system_id, component_id, &msg , packet1.time_usec , packet1.attitude_quaternion , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.ind_airspeed , packet1.true_airspeed , packet1.xacc , packet1.yacc , packet1.zacc );
4093 mavlink_msg_hil_state_quaternion_decode(&msg, &packet2);
4094 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4096 memset(&packet2, 0, sizeof(packet2));
4097 mavlink_msg_hil_state_quaternion_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.attitude_quaternion , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.ind_airspeed , packet1.true_airspeed , packet1.xacc , packet1.yacc , packet1.zacc );
4098 mavlink_msg_hil_state_quaternion_decode(&msg, &packet2);
4099 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4101 memset(&packet2, 0, sizeof(packet2));
4102 mavlink_msg_to_send_buffer(buffer, &msg);
4103 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4104 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4106 mavlink_msg_hil_state_quaternion_decode(last_msg, &packet2);
4107 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4109 memset(&packet2, 0, sizeof(packet2));
4110 mavlink_msg_hil_state_quaternion_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.attitude_quaternion , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.ind_airspeed , packet1.true_airspeed , packet1.xacc , packet1.yacc , packet1.zacc );
4111 mavlink_msg_hil_state_quaternion_decode(last_msg, &packet2);
4112 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4115 static void mavlink_test_scaled_imu2(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4117 mavlink_message_t msg;
4118 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4119 uint16_t i;
4120 mavlink_scaled_imu2_t packet_in = {
4121 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275
4123 mavlink_scaled_imu2_t packet1, packet2;
4124 memset(&packet1, 0, sizeof(packet1));
4125 packet1.time_boot_ms = packet_in.time_boot_ms;
4126 packet1.xacc = packet_in.xacc;
4127 packet1.yacc = packet_in.yacc;
4128 packet1.zacc = packet_in.zacc;
4129 packet1.xgyro = packet_in.xgyro;
4130 packet1.ygyro = packet_in.ygyro;
4131 packet1.zgyro = packet_in.zgyro;
4132 packet1.xmag = packet_in.xmag;
4133 packet1.ymag = packet_in.ymag;
4134 packet1.zmag = packet_in.zmag;
4138 memset(&packet2, 0, sizeof(packet2));
4139 mavlink_msg_scaled_imu2_encode(system_id, component_id, &msg, &packet1);
4140 mavlink_msg_scaled_imu2_decode(&msg, &packet2);
4141 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4143 memset(&packet2, 0, sizeof(packet2));
4144 mavlink_msg_scaled_imu2_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 );
4145 mavlink_msg_scaled_imu2_decode(&msg, &packet2);
4146 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4148 memset(&packet2, 0, sizeof(packet2));
4149 mavlink_msg_scaled_imu2_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 );
4150 mavlink_msg_scaled_imu2_decode(&msg, &packet2);
4151 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4153 memset(&packet2, 0, sizeof(packet2));
4154 mavlink_msg_to_send_buffer(buffer, &msg);
4155 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4156 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4158 mavlink_msg_scaled_imu2_decode(last_msg, &packet2);
4159 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4161 memset(&packet2, 0, sizeof(packet2));
4162 mavlink_msg_scaled_imu2_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 );
4163 mavlink_msg_scaled_imu2_decode(last_msg, &packet2);
4164 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4167 static void mavlink_test_log_request_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4169 mavlink_message_t msg;
4170 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4171 uint16_t i;
4172 mavlink_log_request_list_t packet_in = {
4173 17235,17339,17,84
4175 mavlink_log_request_list_t packet1, packet2;
4176 memset(&packet1, 0, sizeof(packet1));
4177 packet1.start = packet_in.start;
4178 packet1.end = packet_in.end;
4179 packet1.target_system = packet_in.target_system;
4180 packet1.target_component = packet_in.target_component;
4184 memset(&packet2, 0, sizeof(packet2));
4185 mavlink_msg_log_request_list_encode(system_id, component_id, &msg, &packet1);
4186 mavlink_msg_log_request_list_decode(&msg, &packet2);
4187 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4189 memset(&packet2, 0, sizeof(packet2));
4190 mavlink_msg_log_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.start , packet1.end );
4191 mavlink_msg_log_request_list_decode(&msg, &packet2);
4192 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4194 memset(&packet2, 0, sizeof(packet2));
4195 mavlink_msg_log_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.start , packet1.end );
4196 mavlink_msg_log_request_list_decode(&msg, &packet2);
4197 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4199 memset(&packet2, 0, sizeof(packet2));
4200 mavlink_msg_to_send_buffer(buffer, &msg);
4201 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4202 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4204 mavlink_msg_log_request_list_decode(last_msg, &packet2);
4205 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4207 memset(&packet2, 0, sizeof(packet2));
4208 mavlink_msg_log_request_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.start , packet1.end );
4209 mavlink_msg_log_request_list_decode(last_msg, &packet2);
4210 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4213 static void mavlink_test_log_entry(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4215 mavlink_message_t msg;
4216 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4217 uint16_t i;
4218 mavlink_log_entry_t packet_in = {
4219 963497464,963497672,17651,17755,17859
4221 mavlink_log_entry_t packet1, packet2;
4222 memset(&packet1, 0, sizeof(packet1));
4223 packet1.time_utc = packet_in.time_utc;
4224 packet1.size = packet_in.size;
4225 packet1.id = packet_in.id;
4226 packet1.num_logs = packet_in.num_logs;
4227 packet1.last_log_num = packet_in.last_log_num;
4231 memset(&packet2, 0, sizeof(packet2));
4232 mavlink_msg_log_entry_encode(system_id, component_id, &msg, &packet1);
4233 mavlink_msg_log_entry_decode(&msg, &packet2);
4234 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4236 memset(&packet2, 0, sizeof(packet2));
4237 mavlink_msg_log_entry_pack(system_id, component_id, &msg , packet1.id , packet1.num_logs , packet1.last_log_num , packet1.time_utc , packet1.size );
4238 mavlink_msg_log_entry_decode(&msg, &packet2);
4239 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4241 memset(&packet2, 0, sizeof(packet2));
4242 mavlink_msg_log_entry_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.num_logs , packet1.last_log_num , packet1.time_utc , packet1.size );
4243 mavlink_msg_log_entry_decode(&msg, &packet2);
4244 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4246 memset(&packet2, 0, sizeof(packet2));
4247 mavlink_msg_to_send_buffer(buffer, &msg);
4248 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4249 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4251 mavlink_msg_log_entry_decode(last_msg, &packet2);
4252 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4254 memset(&packet2, 0, sizeof(packet2));
4255 mavlink_msg_log_entry_send(MAVLINK_COMM_1 , packet1.id , packet1.num_logs , packet1.last_log_num , packet1.time_utc , packet1.size );
4256 mavlink_msg_log_entry_decode(last_msg, &packet2);
4257 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4260 static void mavlink_test_log_request_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4262 mavlink_message_t msg;
4263 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4264 uint16_t i;
4265 mavlink_log_request_data_t packet_in = {
4266 963497464,963497672,17651,163,230
4268 mavlink_log_request_data_t packet1, packet2;
4269 memset(&packet1, 0, sizeof(packet1));
4270 packet1.ofs = packet_in.ofs;
4271 packet1.count = packet_in.count;
4272 packet1.id = packet_in.id;
4273 packet1.target_system = packet_in.target_system;
4274 packet1.target_component = packet_in.target_component;
4278 memset(&packet2, 0, sizeof(packet2));
4279 mavlink_msg_log_request_data_encode(system_id, component_id, &msg, &packet1);
4280 mavlink_msg_log_request_data_decode(&msg, &packet2);
4281 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4283 memset(&packet2, 0, sizeof(packet2));
4284 mavlink_msg_log_request_data_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id , packet1.ofs , packet1.count );
4285 mavlink_msg_log_request_data_decode(&msg, &packet2);
4286 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4288 memset(&packet2, 0, sizeof(packet2));
4289 mavlink_msg_log_request_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.id , packet1.ofs , packet1.count );
4290 mavlink_msg_log_request_data_decode(&msg, &packet2);
4291 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4293 memset(&packet2, 0, sizeof(packet2));
4294 mavlink_msg_to_send_buffer(buffer, &msg);
4295 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4296 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4298 mavlink_msg_log_request_data_decode(last_msg, &packet2);
4299 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4301 memset(&packet2, 0, sizeof(packet2));
4302 mavlink_msg_log_request_data_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.id , packet1.ofs , packet1.count );
4303 mavlink_msg_log_request_data_decode(last_msg, &packet2);
4304 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4307 static void mavlink_test_log_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4309 mavlink_message_t msg;
4310 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4311 uint16_t i;
4312 mavlink_log_data_t packet_in = {
4313 963497464,17443,151,{ 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 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, 49, 50, 51 }
4315 mavlink_log_data_t packet1, packet2;
4316 memset(&packet1, 0, sizeof(packet1));
4317 packet1.ofs = packet_in.ofs;
4318 packet1.id = packet_in.id;
4319 packet1.count = packet_in.count;
4321 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*90);
4324 memset(&packet2, 0, sizeof(packet2));
4325 mavlink_msg_log_data_encode(system_id, component_id, &msg, &packet1);
4326 mavlink_msg_log_data_decode(&msg, &packet2);
4327 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4329 memset(&packet2, 0, sizeof(packet2));
4330 mavlink_msg_log_data_pack(system_id, component_id, &msg , packet1.id , packet1.ofs , packet1.count , packet1.data );
4331 mavlink_msg_log_data_decode(&msg, &packet2);
4332 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4334 memset(&packet2, 0, sizeof(packet2));
4335 mavlink_msg_log_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.ofs , packet1.count , packet1.data );
4336 mavlink_msg_log_data_decode(&msg, &packet2);
4337 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4339 memset(&packet2, 0, sizeof(packet2));
4340 mavlink_msg_to_send_buffer(buffer, &msg);
4341 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4342 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4344 mavlink_msg_log_data_decode(last_msg, &packet2);
4345 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4347 memset(&packet2, 0, sizeof(packet2));
4348 mavlink_msg_log_data_send(MAVLINK_COMM_1 , packet1.id , packet1.ofs , packet1.count , packet1.data );
4349 mavlink_msg_log_data_decode(last_msg, &packet2);
4350 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4353 static void mavlink_test_log_erase(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4355 mavlink_message_t msg;
4356 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4357 uint16_t i;
4358 mavlink_log_erase_t packet_in = {
4359 5,72
4361 mavlink_log_erase_t packet1, packet2;
4362 memset(&packet1, 0, sizeof(packet1));
4363 packet1.target_system = packet_in.target_system;
4364 packet1.target_component = packet_in.target_component;
4368 memset(&packet2, 0, sizeof(packet2));
4369 mavlink_msg_log_erase_encode(system_id, component_id, &msg, &packet1);
4370 mavlink_msg_log_erase_decode(&msg, &packet2);
4371 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4373 memset(&packet2, 0, sizeof(packet2));
4374 mavlink_msg_log_erase_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
4375 mavlink_msg_log_erase_decode(&msg, &packet2);
4376 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4378 memset(&packet2, 0, sizeof(packet2));
4379 mavlink_msg_log_erase_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
4380 mavlink_msg_log_erase_decode(&msg, &packet2);
4381 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4383 memset(&packet2, 0, sizeof(packet2));
4384 mavlink_msg_to_send_buffer(buffer, &msg);
4385 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4386 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4388 mavlink_msg_log_erase_decode(last_msg, &packet2);
4389 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4391 memset(&packet2, 0, sizeof(packet2));
4392 mavlink_msg_log_erase_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
4393 mavlink_msg_log_erase_decode(last_msg, &packet2);
4394 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4397 static void mavlink_test_log_request_end(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4399 mavlink_message_t msg;
4400 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4401 uint16_t i;
4402 mavlink_log_request_end_t packet_in = {
4403 5,72
4405 mavlink_log_request_end_t packet1, packet2;
4406 memset(&packet1, 0, sizeof(packet1));
4407 packet1.target_system = packet_in.target_system;
4408 packet1.target_component = packet_in.target_component;
4412 memset(&packet2, 0, sizeof(packet2));
4413 mavlink_msg_log_request_end_encode(system_id, component_id, &msg, &packet1);
4414 mavlink_msg_log_request_end_decode(&msg, &packet2);
4415 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4417 memset(&packet2, 0, sizeof(packet2));
4418 mavlink_msg_log_request_end_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
4419 mavlink_msg_log_request_end_decode(&msg, &packet2);
4420 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4422 memset(&packet2, 0, sizeof(packet2));
4423 mavlink_msg_log_request_end_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
4424 mavlink_msg_log_request_end_decode(&msg, &packet2);
4425 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4427 memset(&packet2, 0, sizeof(packet2));
4428 mavlink_msg_to_send_buffer(buffer, &msg);
4429 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4430 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4432 mavlink_msg_log_request_end_decode(last_msg, &packet2);
4433 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4435 memset(&packet2, 0, sizeof(packet2));
4436 mavlink_msg_log_request_end_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
4437 mavlink_msg_log_request_end_decode(last_msg, &packet2);
4438 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4441 static void mavlink_test_gps_inject_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4443 mavlink_message_t msg;
4444 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4445 uint16_t i;
4446 mavlink_gps_inject_data_t packet_in = {
4447 5,72,139,{ 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 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, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59 }
4449 mavlink_gps_inject_data_t packet1, packet2;
4450 memset(&packet1, 0, sizeof(packet1));
4451 packet1.target_system = packet_in.target_system;
4452 packet1.target_component = packet_in.target_component;
4453 packet1.len = packet_in.len;
4455 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*110);
4458 memset(&packet2, 0, sizeof(packet2));
4459 mavlink_msg_gps_inject_data_encode(system_id, component_id, &msg, &packet1);
4460 mavlink_msg_gps_inject_data_decode(&msg, &packet2);
4461 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4463 memset(&packet2, 0, sizeof(packet2));
4464 mavlink_msg_gps_inject_data_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.len , packet1.data );
4465 mavlink_msg_gps_inject_data_decode(&msg, &packet2);
4466 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4468 memset(&packet2, 0, sizeof(packet2));
4469 mavlink_msg_gps_inject_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.len , packet1.data );
4470 mavlink_msg_gps_inject_data_decode(&msg, &packet2);
4471 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4473 memset(&packet2, 0, sizeof(packet2));
4474 mavlink_msg_to_send_buffer(buffer, &msg);
4475 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4476 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4478 mavlink_msg_gps_inject_data_decode(last_msg, &packet2);
4479 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4481 memset(&packet2, 0, sizeof(packet2));
4482 mavlink_msg_gps_inject_data_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.len , packet1.data );
4483 mavlink_msg_gps_inject_data_decode(last_msg, &packet2);
4484 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4487 static void mavlink_test_gps2_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4489 mavlink_message_t msg;
4490 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4491 uint16_t i;
4492 mavlink_gps2_raw_t packet_in = {
4493 93372036854775807ULL,963497880,963498088,963498296,963498504,18483,18587,18691,18795,101,168,235
4495 mavlink_gps2_raw_t packet1, packet2;
4496 memset(&packet1, 0, sizeof(packet1));
4497 packet1.time_usec = packet_in.time_usec;
4498 packet1.lat = packet_in.lat;
4499 packet1.lon = packet_in.lon;
4500 packet1.alt = packet_in.alt;
4501 packet1.dgps_age = packet_in.dgps_age;
4502 packet1.eph = packet_in.eph;
4503 packet1.epv = packet_in.epv;
4504 packet1.vel = packet_in.vel;
4505 packet1.cog = packet_in.cog;
4506 packet1.fix_type = packet_in.fix_type;
4507 packet1.satellites_visible = packet_in.satellites_visible;
4508 packet1.dgps_numch = packet_in.dgps_numch;
4512 memset(&packet2, 0, sizeof(packet2));
4513 mavlink_msg_gps2_raw_encode(system_id, component_id, &msg, &packet1);
4514 mavlink_msg_gps2_raw_decode(&msg, &packet2);
4515 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4517 memset(&packet2, 0, sizeof(packet2));
4518 mavlink_msg_gps2_raw_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 , packet1.dgps_numch , packet1.dgps_age );
4519 mavlink_msg_gps2_raw_decode(&msg, &packet2);
4520 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4522 memset(&packet2, 0, sizeof(packet2));
4523 mavlink_msg_gps2_raw_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 , packet1.dgps_numch , packet1.dgps_age );
4524 mavlink_msg_gps2_raw_decode(&msg, &packet2);
4525 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4527 memset(&packet2, 0, sizeof(packet2));
4528 mavlink_msg_to_send_buffer(buffer, &msg);
4529 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4530 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4532 mavlink_msg_gps2_raw_decode(last_msg, &packet2);
4533 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4535 memset(&packet2, 0, sizeof(packet2));
4536 mavlink_msg_gps2_raw_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 , packet1.dgps_numch , packet1.dgps_age );
4537 mavlink_msg_gps2_raw_decode(last_msg, &packet2);
4538 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4541 static void mavlink_test_power_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4543 mavlink_message_t msg;
4544 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4545 uint16_t i;
4546 mavlink_power_status_t packet_in = {
4547 17235,17339,17443
4549 mavlink_power_status_t packet1, packet2;
4550 memset(&packet1, 0, sizeof(packet1));
4551 packet1.Vcc = packet_in.Vcc;
4552 packet1.Vservo = packet_in.Vservo;
4553 packet1.flags = packet_in.flags;
4557 memset(&packet2, 0, sizeof(packet2));
4558 mavlink_msg_power_status_encode(system_id, component_id, &msg, &packet1);
4559 mavlink_msg_power_status_decode(&msg, &packet2);
4560 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4562 memset(&packet2, 0, sizeof(packet2));
4563 mavlink_msg_power_status_pack(system_id, component_id, &msg , packet1.Vcc , packet1.Vservo , packet1.flags );
4564 mavlink_msg_power_status_decode(&msg, &packet2);
4565 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4567 memset(&packet2, 0, sizeof(packet2));
4568 mavlink_msg_power_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.Vcc , packet1.Vservo , packet1.flags );
4569 mavlink_msg_power_status_decode(&msg, &packet2);
4570 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4572 memset(&packet2, 0, sizeof(packet2));
4573 mavlink_msg_to_send_buffer(buffer, &msg);
4574 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4575 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4577 mavlink_msg_power_status_decode(last_msg, &packet2);
4578 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4580 memset(&packet2, 0, sizeof(packet2));
4581 mavlink_msg_power_status_send(MAVLINK_COMM_1 , packet1.Vcc , packet1.Vservo , packet1.flags );
4582 mavlink_msg_power_status_decode(last_msg, &packet2);
4583 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4586 static void mavlink_test_serial_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4588 mavlink_message_t msg;
4589 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4590 uint16_t i;
4591 mavlink_serial_control_t packet_in = {
4592 963497464,17443,151,218,29,{ 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165 }
4594 mavlink_serial_control_t packet1, packet2;
4595 memset(&packet1, 0, sizeof(packet1));
4596 packet1.baudrate = packet_in.baudrate;
4597 packet1.timeout = packet_in.timeout;
4598 packet1.device = packet_in.device;
4599 packet1.flags = packet_in.flags;
4600 packet1.count = packet_in.count;
4602 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*70);
4605 memset(&packet2, 0, sizeof(packet2));
4606 mavlink_msg_serial_control_encode(system_id, component_id, &msg, &packet1);
4607 mavlink_msg_serial_control_decode(&msg, &packet2);
4608 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4610 memset(&packet2, 0, sizeof(packet2));
4611 mavlink_msg_serial_control_pack(system_id, component_id, &msg , packet1.device , packet1.flags , packet1.timeout , packet1.baudrate , packet1.count , packet1.data );
4612 mavlink_msg_serial_control_decode(&msg, &packet2);
4613 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4615 memset(&packet2, 0, sizeof(packet2));
4616 mavlink_msg_serial_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.device , packet1.flags , packet1.timeout , packet1.baudrate , packet1.count , packet1.data );
4617 mavlink_msg_serial_control_decode(&msg, &packet2);
4618 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4620 memset(&packet2, 0, sizeof(packet2));
4621 mavlink_msg_to_send_buffer(buffer, &msg);
4622 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4623 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4625 mavlink_msg_serial_control_decode(last_msg, &packet2);
4626 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4628 memset(&packet2, 0, sizeof(packet2));
4629 mavlink_msg_serial_control_send(MAVLINK_COMM_1 , packet1.device , packet1.flags , packet1.timeout , packet1.baudrate , packet1.count , packet1.data );
4630 mavlink_msg_serial_control_decode(last_msg, &packet2);
4631 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4634 static void mavlink_test_gps_rtk(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4636 mavlink_message_t msg;
4637 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4638 uint16_t i;
4639 mavlink_gps_rtk_t packet_in = {
4640 963497464,963497672,963497880,963498088,963498296,963498504,963498712,18691,223,34,101,168,235
4642 mavlink_gps_rtk_t packet1, packet2;
4643 memset(&packet1, 0, sizeof(packet1));
4644 packet1.time_last_baseline_ms = packet_in.time_last_baseline_ms;
4645 packet1.tow = packet_in.tow;
4646 packet1.baseline_a_mm = packet_in.baseline_a_mm;
4647 packet1.baseline_b_mm = packet_in.baseline_b_mm;
4648 packet1.baseline_c_mm = packet_in.baseline_c_mm;
4649 packet1.accuracy = packet_in.accuracy;
4650 packet1.iar_num_hypotheses = packet_in.iar_num_hypotheses;
4651 packet1.wn = packet_in.wn;
4652 packet1.rtk_receiver_id = packet_in.rtk_receiver_id;
4653 packet1.rtk_health = packet_in.rtk_health;
4654 packet1.rtk_rate = packet_in.rtk_rate;
4655 packet1.nsats = packet_in.nsats;
4656 packet1.baseline_coords_type = packet_in.baseline_coords_type;
4660 memset(&packet2, 0, sizeof(packet2));
4661 mavlink_msg_gps_rtk_encode(system_id, component_id, &msg, &packet1);
4662 mavlink_msg_gps_rtk_decode(&msg, &packet2);
4663 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4665 memset(&packet2, 0, sizeof(packet2));
4666 mavlink_msg_gps_rtk_pack(system_id, component_id, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
4667 mavlink_msg_gps_rtk_decode(&msg, &packet2);
4668 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4670 memset(&packet2, 0, sizeof(packet2));
4671 mavlink_msg_gps_rtk_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
4672 mavlink_msg_gps_rtk_decode(&msg, &packet2);
4673 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4675 memset(&packet2, 0, sizeof(packet2));
4676 mavlink_msg_to_send_buffer(buffer, &msg);
4677 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4678 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4680 mavlink_msg_gps_rtk_decode(last_msg, &packet2);
4681 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4683 memset(&packet2, 0, sizeof(packet2));
4684 mavlink_msg_gps_rtk_send(MAVLINK_COMM_1 , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
4685 mavlink_msg_gps_rtk_decode(last_msg, &packet2);
4686 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4689 static void mavlink_test_gps2_rtk(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4691 mavlink_message_t msg;
4692 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4693 uint16_t i;
4694 mavlink_gps2_rtk_t packet_in = {
4695 963497464,963497672,963497880,963498088,963498296,963498504,963498712,18691,223,34,101,168,235
4697 mavlink_gps2_rtk_t packet1, packet2;
4698 memset(&packet1, 0, sizeof(packet1));
4699 packet1.time_last_baseline_ms = packet_in.time_last_baseline_ms;
4700 packet1.tow = packet_in.tow;
4701 packet1.baseline_a_mm = packet_in.baseline_a_mm;
4702 packet1.baseline_b_mm = packet_in.baseline_b_mm;
4703 packet1.baseline_c_mm = packet_in.baseline_c_mm;
4704 packet1.accuracy = packet_in.accuracy;
4705 packet1.iar_num_hypotheses = packet_in.iar_num_hypotheses;
4706 packet1.wn = packet_in.wn;
4707 packet1.rtk_receiver_id = packet_in.rtk_receiver_id;
4708 packet1.rtk_health = packet_in.rtk_health;
4709 packet1.rtk_rate = packet_in.rtk_rate;
4710 packet1.nsats = packet_in.nsats;
4711 packet1.baseline_coords_type = packet_in.baseline_coords_type;
4715 memset(&packet2, 0, sizeof(packet2));
4716 mavlink_msg_gps2_rtk_encode(system_id, component_id, &msg, &packet1);
4717 mavlink_msg_gps2_rtk_decode(&msg, &packet2);
4718 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4720 memset(&packet2, 0, sizeof(packet2));
4721 mavlink_msg_gps2_rtk_pack(system_id, component_id, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
4722 mavlink_msg_gps2_rtk_decode(&msg, &packet2);
4723 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4725 memset(&packet2, 0, sizeof(packet2));
4726 mavlink_msg_gps2_rtk_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
4727 mavlink_msg_gps2_rtk_decode(&msg, &packet2);
4728 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4730 memset(&packet2, 0, sizeof(packet2));
4731 mavlink_msg_to_send_buffer(buffer, &msg);
4732 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4733 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4735 mavlink_msg_gps2_rtk_decode(last_msg, &packet2);
4736 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4738 memset(&packet2, 0, sizeof(packet2));
4739 mavlink_msg_gps2_rtk_send(MAVLINK_COMM_1 , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
4740 mavlink_msg_gps2_rtk_decode(last_msg, &packet2);
4741 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4744 static void mavlink_test_scaled_imu3(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4746 mavlink_message_t msg;
4747 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4748 uint16_t i;
4749 mavlink_scaled_imu3_t packet_in = {
4750 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275
4752 mavlink_scaled_imu3_t packet1, packet2;
4753 memset(&packet1, 0, sizeof(packet1));
4754 packet1.time_boot_ms = packet_in.time_boot_ms;
4755 packet1.xacc = packet_in.xacc;
4756 packet1.yacc = packet_in.yacc;
4757 packet1.zacc = packet_in.zacc;
4758 packet1.xgyro = packet_in.xgyro;
4759 packet1.ygyro = packet_in.ygyro;
4760 packet1.zgyro = packet_in.zgyro;
4761 packet1.xmag = packet_in.xmag;
4762 packet1.ymag = packet_in.ymag;
4763 packet1.zmag = packet_in.zmag;
4767 memset(&packet2, 0, sizeof(packet2));
4768 mavlink_msg_scaled_imu3_encode(system_id, component_id, &msg, &packet1);
4769 mavlink_msg_scaled_imu3_decode(&msg, &packet2);
4770 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4772 memset(&packet2, 0, sizeof(packet2));
4773 mavlink_msg_scaled_imu3_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 );
4774 mavlink_msg_scaled_imu3_decode(&msg, &packet2);
4775 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4777 memset(&packet2, 0, sizeof(packet2));
4778 mavlink_msg_scaled_imu3_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 );
4779 mavlink_msg_scaled_imu3_decode(&msg, &packet2);
4780 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4782 memset(&packet2, 0, sizeof(packet2));
4783 mavlink_msg_to_send_buffer(buffer, &msg);
4784 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4785 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4787 mavlink_msg_scaled_imu3_decode(last_msg, &packet2);
4788 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4790 memset(&packet2, 0, sizeof(packet2));
4791 mavlink_msg_scaled_imu3_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 );
4792 mavlink_msg_scaled_imu3_decode(last_msg, &packet2);
4793 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4796 static void mavlink_test_data_transmission_handshake(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4798 mavlink_message_t msg;
4799 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4800 uint16_t i;
4801 mavlink_data_transmission_handshake_t packet_in = {
4802 963497464,17443,17547,17651,163,230,41
4804 mavlink_data_transmission_handshake_t packet1, packet2;
4805 memset(&packet1, 0, sizeof(packet1));
4806 packet1.size = packet_in.size;
4807 packet1.width = packet_in.width;
4808 packet1.height = packet_in.height;
4809 packet1.packets = packet_in.packets;
4810 packet1.type = packet_in.type;
4811 packet1.payload = packet_in.payload;
4812 packet1.jpg_quality = packet_in.jpg_quality;
4816 memset(&packet2, 0, sizeof(packet2));
4817 mavlink_msg_data_transmission_handshake_encode(system_id, component_id, &msg, &packet1);
4818 mavlink_msg_data_transmission_handshake_decode(&msg, &packet2);
4819 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4821 memset(&packet2, 0, sizeof(packet2));
4822 mavlink_msg_data_transmission_handshake_pack(system_id, component_id, &msg , packet1.type , packet1.size , packet1.width , packet1.height , packet1.packets , packet1.payload , packet1.jpg_quality );
4823 mavlink_msg_data_transmission_handshake_decode(&msg, &packet2);
4824 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4826 memset(&packet2, 0, sizeof(packet2));
4827 mavlink_msg_data_transmission_handshake_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.size , packet1.width , packet1.height , packet1.packets , packet1.payload , packet1.jpg_quality );
4828 mavlink_msg_data_transmission_handshake_decode(&msg, &packet2);
4829 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4831 memset(&packet2, 0, sizeof(packet2));
4832 mavlink_msg_to_send_buffer(buffer, &msg);
4833 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4834 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4836 mavlink_msg_data_transmission_handshake_decode(last_msg, &packet2);
4837 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4839 memset(&packet2, 0, sizeof(packet2));
4840 mavlink_msg_data_transmission_handshake_send(MAVLINK_COMM_1 , packet1.type , packet1.size , packet1.width , packet1.height , packet1.packets , packet1.payload , packet1.jpg_quality );
4841 mavlink_msg_data_transmission_handshake_decode(last_msg, &packet2);
4842 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4845 static void mavlink_test_encapsulated_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4847 mavlink_message_t msg;
4848 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4849 uint16_t i;
4850 mavlink_encapsulated_data_t packet_in = {
4851 17235,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 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, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135 }
4853 mavlink_encapsulated_data_t packet1, packet2;
4854 memset(&packet1, 0, sizeof(packet1));
4855 packet1.seqnr = packet_in.seqnr;
4857 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*253);
4860 memset(&packet2, 0, sizeof(packet2));
4861 mavlink_msg_encapsulated_data_encode(system_id, component_id, &msg, &packet1);
4862 mavlink_msg_encapsulated_data_decode(&msg, &packet2);
4863 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4865 memset(&packet2, 0, sizeof(packet2));
4866 mavlink_msg_encapsulated_data_pack(system_id, component_id, &msg , packet1.seqnr , packet1.data );
4867 mavlink_msg_encapsulated_data_decode(&msg, &packet2);
4868 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4870 memset(&packet2, 0, sizeof(packet2));
4871 mavlink_msg_encapsulated_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seqnr , packet1.data );
4872 mavlink_msg_encapsulated_data_decode(&msg, &packet2);
4873 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4875 memset(&packet2, 0, sizeof(packet2));
4876 mavlink_msg_to_send_buffer(buffer, &msg);
4877 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4878 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4880 mavlink_msg_encapsulated_data_decode(last_msg, &packet2);
4881 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4883 memset(&packet2, 0, sizeof(packet2));
4884 mavlink_msg_encapsulated_data_send(MAVLINK_COMM_1 , packet1.seqnr , packet1.data );
4885 mavlink_msg_encapsulated_data_decode(last_msg, &packet2);
4886 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4889 static void mavlink_test_distance_sensor(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4891 mavlink_message_t msg;
4892 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4893 uint16_t i;
4894 mavlink_distance_sensor_t packet_in = {
4895 963497464,17443,17547,17651,163,230,41,108
4897 mavlink_distance_sensor_t packet1, packet2;
4898 memset(&packet1, 0, sizeof(packet1));
4899 packet1.time_boot_ms = packet_in.time_boot_ms;
4900 packet1.min_distance = packet_in.min_distance;
4901 packet1.max_distance = packet_in.max_distance;
4902 packet1.current_distance = packet_in.current_distance;
4903 packet1.type = packet_in.type;
4904 packet1.id = packet_in.id;
4905 packet1.orientation = packet_in.orientation;
4906 packet1.covariance = packet_in.covariance;
4910 memset(&packet2, 0, sizeof(packet2));
4911 mavlink_msg_distance_sensor_encode(system_id, component_id, &msg, &packet1);
4912 mavlink_msg_distance_sensor_decode(&msg, &packet2);
4913 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4915 memset(&packet2, 0, sizeof(packet2));
4916 mavlink_msg_distance_sensor_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance );
4917 mavlink_msg_distance_sensor_decode(&msg, &packet2);
4918 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4920 memset(&packet2, 0, sizeof(packet2));
4921 mavlink_msg_distance_sensor_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance );
4922 mavlink_msg_distance_sensor_decode(&msg, &packet2);
4923 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4925 memset(&packet2, 0, sizeof(packet2));
4926 mavlink_msg_to_send_buffer(buffer, &msg);
4927 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4928 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4930 mavlink_msg_distance_sensor_decode(last_msg, &packet2);
4931 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4933 memset(&packet2, 0, sizeof(packet2));
4934 mavlink_msg_distance_sensor_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance );
4935 mavlink_msg_distance_sensor_decode(last_msg, &packet2);
4936 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4939 static void mavlink_test_terrain_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4941 mavlink_message_t msg;
4942 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4943 uint16_t i;
4944 mavlink_terrain_request_t packet_in = {
4945 93372036854775807ULL,963497880,963498088,18067
4947 mavlink_terrain_request_t packet1, packet2;
4948 memset(&packet1, 0, sizeof(packet1));
4949 packet1.mask = packet_in.mask;
4950 packet1.lat = packet_in.lat;
4951 packet1.lon = packet_in.lon;
4952 packet1.grid_spacing = packet_in.grid_spacing;
4956 memset(&packet2, 0, sizeof(packet2));
4957 mavlink_msg_terrain_request_encode(system_id, component_id, &msg, &packet1);
4958 mavlink_msg_terrain_request_decode(&msg, &packet2);
4959 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4961 memset(&packet2, 0, sizeof(packet2));
4962 mavlink_msg_terrain_request_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.mask );
4963 mavlink_msg_terrain_request_decode(&msg, &packet2);
4964 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4966 memset(&packet2, 0, sizeof(packet2));
4967 mavlink_msg_terrain_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.mask );
4968 mavlink_msg_terrain_request_decode(&msg, &packet2);
4969 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4971 memset(&packet2, 0, sizeof(packet2));
4972 mavlink_msg_to_send_buffer(buffer, &msg);
4973 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4974 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4976 mavlink_msg_terrain_request_decode(last_msg, &packet2);
4977 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4979 memset(&packet2, 0, sizeof(packet2));
4980 mavlink_msg_terrain_request_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.mask );
4981 mavlink_msg_terrain_request_decode(last_msg, &packet2);
4982 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4985 static void mavlink_test_terrain_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4987 mavlink_message_t msg;
4988 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4989 uint16_t i;
4990 mavlink_terrain_data_t packet_in = {
4991 963497464,963497672,17651,{ 17755, 17756, 17757, 17758, 17759, 17760, 17761, 17762, 17763, 17764, 17765, 17766, 17767, 17768, 17769, 17770 },3
4993 mavlink_terrain_data_t packet1, packet2;
4994 memset(&packet1, 0, sizeof(packet1));
4995 packet1.lat = packet_in.lat;
4996 packet1.lon = packet_in.lon;
4997 packet1.grid_spacing = packet_in.grid_spacing;
4998 packet1.gridbit = packet_in.gridbit;
5000 mav_array_memcpy(packet1.data, packet_in.data, sizeof(int16_t)*16);
5003 memset(&packet2, 0, sizeof(packet2));
5004 mavlink_msg_terrain_data_encode(system_id, component_id, &msg, &packet1);
5005 mavlink_msg_terrain_data_decode(&msg, &packet2);
5006 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5008 memset(&packet2, 0, sizeof(packet2));
5009 mavlink_msg_terrain_data_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.gridbit , packet1.data );
5010 mavlink_msg_terrain_data_decode(&msg, &packet2);
5011 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5013 memset(&packet2, 0, sizeof(packet2));
5014 mavlink_msg_terrain_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.gridbit , packet1.data );
5015 mavlink_msg_terrain_data_decode(&msg, &packet2);
5016 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5018 memset(&packet2, 0, sizeof(packet2));
5019 mavlink_msg_to_send_buffer(buffer, &msg);
5020 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5021 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5023 mavlink_msg_terrain_data_decode(last_msg, &packet2);
5024 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5026 memset(&packet2, 0, sizeof(packet2));
5027 mavlink_msg_terrain_data_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.gridbit , packet1.data );
5028 mavlink_msg_terrain_data_decode(last_msg, &packet2);
5029 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5032 static void mavlink_test_terrain_check(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5034 mavlink_message_t msg;
5035 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5036 uint16_t i;
5037 mavlink_terrain_check_t packet_in = {
5038 963497464,963497672
5040 mavlink_terrain_check_t packet1, packet2;
5041 memset(&packet1, 0, sizeof(packet1));
5042 packet1.lat = packet_in.lat;
5043 packet1.lon = packet_in.lon;
5047 memset(&packet2, 0, sizeof(packet2));
5048 mavlink_msg_terrain_check_encode(system_id, component_id, &msg, &packet1);
5049 mavlink_msg_terrain_check_decode(&msg, &packet2);
5050 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5052 memset(&packet2, 0, sizeof(packet2));
5053 mavlink_msg_terrain_check_pack(system_id, component_id, &msg , packet1.lat , packet1.lon );
5054 mavlink_msg_terrain_check_decode(&msg, &packet2);
5055 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5057 memset(&packet2, 0, sizeof(packet2));
5058 mavlink_msg_terrain_check_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon );
5059 mavlink_msg_terrain_check_decode(&msg, &packet2);
5060 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5062 memset(&packet2, 0, sizeof(packet2));
5063 mavlink_msg_to_send_buffer(buffer, &msg);
5064 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5065 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5067 mavlink_msg_terrain_check_decode(last_msg, &packet2);
5068 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5070 memset(&packet2, 0, sizeof(packet2));
5071 mavlink_msg_terrain_check_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon );
5072 mavlink_msg_terrain_check_decode(last_msg, &packet2);
5073 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5076 static void mavlink_test_terrain_report(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5078 mavlink_message_t msg;
5079 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5080 uint16_t i;
5081 mavlink_terrain_report_t packet_in = {
5082 963497464,963497672,73.0,101.0,18067,18171,18275
5084 mavlink_terrain_report_t packet1, packet2;
5085 memset(&packet1, 0, sizeof(packet1));
5086 packet1.lat = packet_in.lat;
5087 packet1.lon = packet_in.lon;
5088 packet1.terrain_height = packet_in.terrain_height;
5089 packet1.current_height = packet_in.current_height;
5090 packet1.spacing = packet_in.spacing;
5091 packet1.pending = packet_in.pending;
5092 packet1.loaded = packet_in.loaded;
5096 memset(&packet2, 0, sizeof(packet2));
5097 mavlink_msg_terrain_report_encode(system_id, component_id, &msg, &packet1);
5098 mavlink_msg_terrain_report_decode(&msg, &packet2);
5099 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5101 memset(&packet2, 0, sizeof(packet2));
5102 mavlink_msg_terrain_report_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.spacing , packet1.terrain_height , packet1.current_height , packet1.pending , packet1.loaded );
5103 mavlink_msg_terrain_report_decode(&msg, &packet2);
5104 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5106 memset(&packet2, 0, sizeof(packet2));
5107 mavlink_msg_terrain_report_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon , packet1.spacing , packet1.terrain_height , packet1.current_height , packet1.pending , packet1.loaded );
5108 mavlink_msg_terrain_report_decode(&msg, &packet2);
5109 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5111 memset(&packet2, 0, sizeof(packet2));
5112 mavlink_msg_to_send_buffer(buffer, &msg);
5113 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5114 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5116 mavlink_msg_terrain_report_decode(last_msg, &packet2);
5117 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5119 memset(&packet2, 0, sizeof(packet2));
5120 mavlink_msg_terrain_report_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon , packet1.spacing , packet1.terrain_height , packet1.current_height , packet1.pending , packet1.loaded );
5121 mavlink_msg_terrain_report_decode(last_msg, &packet2);
5122 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5125 static void mavlink_test_scaled_pressure2(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5127 mavlink_message_t msg;
5128 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5129 uint16_t i;
5130 mavlink_scaled_pressure2_t packet_in = {
5131 963497464,45.0,73.0,17859
5133 mavlink_scaled_pressure2_t packet1, packet2;
5134 memset(&packet1, 0, sizeof(packet1));
5135 packet1.time_boot_ms = packet_in.time_boot_ms;
5136 packet1.press_abs = packet_in.press_abs;
5137 packet1.press_diff = packet_in.press_diff;
5138 packet1.temperature = packet_in.temperature;
5142 memset(&packet2, 0, sizeof(packet2));
5143 mavlink_msg_scaled_pressure2_encode(system_id, component_id, &msg, &packet1);
5144 mavlink_msg_scaled_pressure2_decode(&msg, &packet2);
5145 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5147 memset(&packet2, 0, sizeof(packet2));
5148 mavlink_msg_scaled_pressure2_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature );
5149 mavlink_msg_scaled_pressure2_decode(&msg, &packet2);
5150 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5152 memset(&packet2, 0, sizeof(packet2));
5153 mavlink_msg_scaled_pressure2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature );
5154 mavlink_msg_scaled_pressure2_decode(&msg, &packet2);
5155 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5157 memset(&packet2, 0, sizeof(packet2));
5158 mavlink_msg_to_send_buffer(buffer, &msg);
5159 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5160 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5162 mavlink_msg_scaled_pressure2_decode(last_msg, &packet2);
5163 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5165 memset(&packet2, 0, sizeof(packet2));
5166 mavlink_msg_scaled_pressure2_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature );
5167 mavlink_msg_scaled_pressure2_decode(last_msg, &packet2);
5168 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5171 static void mavlink_test_att_pos_mocap(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5173 mavlink_message_t msg;
5174 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5175 uint16_t i;
5176 mavlink_att_pos_mocap_t packet_in = {
5177 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0 },185.0,213.0,241.0
5179 mavlink_att_pos_mocap_t packet1, packet2;
5180 memset(&packet1, 0, sizeof(packet1));
5181 packet1.time_usec = packet_in.time_usec;
5182 packet1.x = packet_in.x;
5183 packet1.y = packet_in.y;
5184 packet1.z = packet_in.z;
5186 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
5189 memset(&packet2, 0, sizeof(packet2));
5190 mavlink_msg_att_pos_mocap_encode(system_id, component_id, &msg, &packet1);
5191 mavlink_msg_att_pos_mocap_decode(&msg, &packet2);
5192 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5194 memset(&packet2, 0, sizeof(packet2));
5195 mavlink_msg_att_pos_mocap_pack(system_id, component_id, &msg , packet1.time_usec , packet1.q , packet1.x , packet1.y , packet1.z );
5196 mavlink_msg_att_pos_mocap_decode(&msg, &packet2);
5197 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5199 memset(&packet2, 0, sizeof(packet2));
5200 mavlink_msg_att_pos_mocap_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.q , packet1.x , packet1.y , packet1.z );
5201 mavlink_msg_att_pos_mocap_decode(&msg, &packet2);
5202 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5204 memset(&packet2, 0, sizeof(packet2));
5205 mavlink_msg_to_send_buffer(buffer, &msg);
5206 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5207 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5209 mavlink_msg_att_pos_mocap_decode(last_msg, &packet2);
5210 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5212 memset(&packet2, 0, sizeof(packet2));
5213 mavlink_msg_att_pos_mocap_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.q , packet1.x , packet1.y , packet1.z );
5214 mavlink_msg_att_pos_mocap_decode(last_msg, &packet2);
5215 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5218 static void mavlink_test_set_actuator_control_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5220 mavlink_message_t msg;
5221 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5222 uint16_t i;
5223 mavlink_set_actuator_control_target_t packet_in = {
5224 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0, 77.0, 78.0, 79.0, 80.0 },125,192,3
5226 mavlink_set_actuator_control_target_t packet1, packet2;
5227 memset(&packet1, 0, sizeof(packet1));
5228 packet1.time_usec = packet_in.time_usec;
5229 packet1.group_mlx = packet_in.group_mlx;
5230 packet1.target_system = packet_in.target_system;
5231 packet1.target_component = packet_in.target_component;
5233 mav_array_memcpy(packet1.controls, packet_in.controls, sizeof(float)*8);
5236 memset(&packet2, 0, sizeof(packet2));
5237 mavlink_msg_set_actuator_control_target_encode(system_id, component_id, &msg, &packet1);
5238 mavlink_msg_set_actuator_control_target_decode(&msg, &packet2);
5239 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5241 memset(&packet2, 0, sizeof(packet2));
5242 mavlink_msg_set_actuator_control_target_pack(system_id, component_id, &msg , packet1.time_usec , packet1.group_mlx , packet1.target_system , packet1.target_component , packet1.controls );
5243 mavlink_msg_set_actuator_control_target_decode(&msg, &packet2);
5244 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5246 memset(&packet2, 0, sizeof(packet2));
5247 mavlink_msg_set_actuator_control_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.group_mlx , packet1.target_system , packet1.target_component , packet1.controls );
5248 mavlink_msg_set_actuator_control_target_decode(&msg, &packet2);
5249 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5251 memset(&packet2, 0, sizeof(packet2));
5252 mavlink_msg_to_send_buffer(buffer, &msg);
5253 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5254 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5256 mavlink_msg_set_actuator_control_target_decode(last_msg, &packet2);
5257 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5259 memset(&packet2, 0, sizeof(packet2));
5260 mavlink_msg_set_actuator_control_target_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.group_mlx , packet1.target_system , packet1.target_component , packet1.controls );
5261 mavlink_msg_set_actuator_control_target_decode(last_msg, &packet2);
5262 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5265 static void mavlink_test_actuator_control_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5267 mavlink_message_t msg;
5268 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5269 uint16_t i;
5270 mavlink_actuator_control_target_t packet_in = {
5271 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0, 77.0, 78.0, 79.0, 80.0 },125
5273 mavlink_actuator_control_target_t packet1, packet2;
5274 memset(&packet1, 0, sizeof(packet1));
5275 packet1.time_usec = packet_in.time_usec;
5276 packet1.group_mlx = packet_in.group_mlx;
5278 mav_array_memcpy(packet1.controls, packet_in.controls, sizeof(float)*8);
5281 memset(&packet2, 0, sizeof(packet2));
5282 mavlink_msg_actuator_control_target_encode(system_id, component_id, &msg, &packet1);
5283 mavlink_msg_actuator_control_target_decode(&msg, &packet2);
5284 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5286 memset(&packet2, 0, sizeof(packet2));
5287 mavlink_msg_actuator_control_target_pack(system_id, component_id, &msg , packet1.time_usec , packet1.group_mlx , packet1.controls );
5288 mavlink_msg_actuator_control_target_decode(&msg, &packet2);
5289 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5291 memset(&packet2, 0, sizeof(packet2));
5292 mavlink_msg_actuator_control_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.group_mlx , packet1.controls );
5293 mavlink_msg_actuator_control_target_decode(&msg, &packet2);
5294 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5296 memset(&packet2, 0, sizeof(packet2));
5297 mavlink_msg_to_send_buffer(buffer, &msg);
5298 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5299 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5301 mavlink_msg_actuator_control_target_decode(last_msg, &packet2);
5302 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5304 memset(&packet2, 0, sizeof(packet2));
5305 mavlink_msg_actuator_control_target_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.group_mlx , packet1.controls );
5306 mavlink_msg_actuator_control_target_decode(last_msg, &packet2);
5307 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5310 static void mavlink_test_battery_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5312 mavlink_message_t msg;
5313 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5314 uint16_t i;
5315 mavlink_battery_status_t packet_in = {
5316 963497464,963497672,17651,{ 17755, 17756, 17757, 17758, 17759, 17760, 17761, 17762, 17763, 17764 },18795,101,168,235,46
5318 mavlink_battery_status_t packet1, packet2;
5319 memset(&packet1, 0, sizeof(packet1));
5320 packet1.current_consumed = packet_in.current_consumed;
5321 packet1.energy_consumed = packet_in.energy_consumed;
5322 packet1.temperature = packet_in.temperature;
5323 packet1.current_battery = packet_in.current_battery;
5324 packet1.id = packet_in.id;
5325 packet1.battery_function = packet_in.battery_function;
5326 packet1.type = packet_in.type;
5327 packet1.battery_remaining = packet_in.battery_remaining;
5329 mav_array_memcpy(packet1.voltages, packet_in.voltages, sizeof(uint16_t)*10);
5332 memset(&packet2, 0, sizeof(packet2));
5333 mavlink_msg_battery_status_encode(system_id, component_id, &msg, &packet1);
5334 mavlink_msg_battery_status_decode(&msg, &packet2);
5335 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5337 memset(&packet2, 0, sizeof(packet2));
5338 mavlink_msg_battery_status_pack(system_id, component_id, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.temperature , packet1.voltages , packet1.current_battery , packet1.current_consumed , packet1.energy_consumed , packet1.battery_remaining );
5339 mavlink_msg_battery_status_decode(&msg, &packet2);
5340 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5342 memset(&packet2, 0, sizeof(packet2));
5343 mavlink_msg_battery_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.temperature , packet1.voltages , packet1.current_battery , packet1.current_consumed , packet1.energy_consumed , packet1.battery_remaining );
5344 mavlink_msg_battery_status_decode(&msg, &packet2);
5345 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5347 memset(&packet2, 0, sizeof(packet2));
5348 mavlink_msg_to_send_buffer(buffer, &msg);
5349 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5350 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5352 mavlink_msg_battery_status_decode(last_msg, &packet2);
5353 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5355 memset(&packet2, 0, sizeof(packet2));
5356 mavlink_msg_battery_status_send(MAVLINK_COMM_1 , packet1.id , packet1.battery_function , packet1.type , packet1.temperature , packet1.voltages , packet1.current_battery , packet1.current_consumed , packet1.energy_consumed , packet1.battery_remaining );
5357 mavlink_msg_battery_status_decode(last_msg, &packet2);
5358 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5361 static void mavlink_test_autopilot_version(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5363 mavlink_message_t msg;
5364 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5365 uint16_t i;
5366 mavlink_autopilot_version_t packet_in = {
5367 93372036854775807ULL,93372036854776311ULL,963498296,963498504,963498712,963498920,18899,19003,{ 113, 114, 115, 116, 117, 118, 119, 120 },{ 137, 138, 139, 140, 141, 142, 143, 144 },{ 161, 162, 163, 164, 165, 166, 167, 168 }
5369 mavlink_autopilot_version_t packet1, packet2;
5370 memset(&packet1, 0, sizeof(packet1));
5371 packet1.capabilities = packet_in.capabilities;
5372 packet1.uid = packet_in.uid;
5373 packet1.flight_sw_version = packet_in.flight_sw_version;
5374 packet1.middleware_sw_version = packet_in.middleware_sw_version;
5375 packet1.os_sw_version = packet_in.os_sw_version;
5376 packet1.board_version = packet_in.board_version;
5377 packet1.vendor_id = packet_in.vendor_id;
5378 packet1.product_id = packet_in.product_id;
5380 mav_array_memcpy(packet1.flight_custom_version, packet_in.flight_custom_version, sizeof(uint8_t)*8);
5381 mav_array_memcpy(packet1.middleware_custom_version, packet_in.middleware_custom_version, sizeof(uint8_t)*8);
5382 mav_array_memcpy(packet1.os_custom_version, packet_in.os_custom_version, sizeof(uint8_t)*8);
5385 memset(&packet2, 0, sizeof(packet2));
5386 mavlink_msg_autopilot_version_encode(system_id, component_id, &msg, &packet1);
5387 mavlink_msg_autopilot_version_decode(&msg, &packet2);
5388 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5390 memset(&packet2, 0, sizeof(packet2));
5391 mavlink_msg_autopilot_version_pack(system_id, component_id, &msg , packet1.capabilities , packet1.flight_sw_version , packet1.middleware_sw_version , packet1.os_sw_version , packet1.board_version , packet1.flight_custom_version , packet1.middleware_custom_version , packet1.os_custom_version , packet1.vendor_id , packet1.product_id , packet1.uid );
5392 mavlink_msg_autopilot_version_decode(&msg, &packet2);
5393 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5395 memset(&packet2, 0, sizeof(packet2));
5396 mavlink_msg_autopilot_version_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.capabilities , packet1.flight_sw_version , packet1.middleware_sw_version , packet1.os_sw_version , packet1.board_version , packet1.flight_custom_version , packet1.middleware_custom_version , packet1.os_custom_version , packet1.vendor_id , packet1.product_id , packet1.uid );
5397 mavlink_msg_autopilot_version_decode(&msg, &packet2);
5398 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5400 memset(&packet2, 0, sizeof(packet2));
5401 mavlink_msg_to_send_buffer(buffer, &msg);
5402 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5403 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5405 mavlink_msg_autopilot_version_decode(last_msg, &packet2);
5406 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5408 memset(&packet2, 0, sizeof(packet2));
5409 mavlink_msg_autopilot_version_send(MAVLINK_COMM_1 , packet1.capabilities , packet1.flight_sw_version , packet1.middleware_sw_version , packet1.os_sw_version , packet1.board_version , packet1.flight_custom_version , packet1.middleware_custom_version , packet1.os_custom_version , packet1.vendor_id , packet1.product_id , packet1.uid );
5410 mavlink_msg_autopilot_version_decode(last_msg, &packet2);
5411 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5414 static void mavlink_test_v2_extension(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5416 mavlink_message_t msg;
5417 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5418 uint16_t i;
5419 mavlink_v2_extension_t packet_in = {
5420 17235,139,206,17,{ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 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, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76 }
5422 mavlink_v2_extension_t packet1, packet2;
5423 memset(&packet1, 0, sizeof(packet1));
5424 packet1.message_type = packet_in.message_type;
5425 packet1.target_network = packet_in.target_network;
5426 packet1.target_system = packet_in.target_system;
5427 packet1.target_component = packet_in.target_component;
5429 mav_array_memcpy(packet1.payload, packet_in.payload, sizeof(uint8_t)*249);
5432 memset(&packet2, 0, sizeof(packet2));
5433 mavlink_msg_v2_extension_encode(system_id, component_id, &msg, &packet1);
5434 mavlink_msg_v2_extension_decode(&msg, &packet2);
5435 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5437 memset(&packet2, 0, sizeof(packet2));
5438 mavlink_msg_v2_extension_pack(system_id, component_id, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.message_type , packet1.payload );
5439 mavlink_msg_v2_extension_decode(&msg, &packet2);
5440 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5442 memset(&packet2, 0, sizeof(packet2));
5443 mavlink_msg_v2_extension_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.message_type , packet1.payload );
5444 mavlink_msg_v2_extension_decode(&msg, &packet2);
5445 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5447 memset(&packet2, 0, sizeof(packet2));
5448 mavlink_msg_to_send_buffer(buffer, &msg);
5449 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5450 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5452 mavlink_msg_v2_extension_decode(last_msg, &packet2);
5453 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5455 memset(&packet2, 0, sizeof(packet2));
5456 mavlink_msg_v2_extension_send(MAVLINK_COMM_1 , packet1.target_network , packet1.target_system , packet1.target_component , packet1.message_type , packet1.payload );
5457 mavlink_msg_v2_extension_decode(last_msg, &packet2);
5458 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5461 static void mavlink_test_memory_vect(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5463 mavlink_message_t msg;
5464 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5465 uint16_t i;
5466 mavlink_memory_vect_t packet_in = {
5467 17235,139,206,{ 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 }
5469 mavlink_memory_vect_t packet1, packet2;
5470 memset(&packet1, 0, sizeof(packet1));
5471 packet1.address = packet_in.address;
5472 packet1.ver = packet_in.ver;
5473 packet1.type = packet_in.type;
5475 mav_array_memcpy(packet1.value, packet_in.value, sizeof(int8_t)*32);
5478 memset(&packet2, 0, sizeof(packet2));
5479 mavlink_msg_memory_vect_encode(system_id, component_id, &msg, &packet1);
5480 mavlink_msg_memory_vect_decode(&msg, &packet2);
5481 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5483 memset(&packet2, 0, sizeof(packet2));
5484 mavlink_msg_memory_vect_pack(system_id, component_id, &msg , packet1.address , packet1.ver , packet1.type , packet1.value );
5485 mavlink_msg_memory_vect_decode(&msg, &packet2);
5486 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5488 memset(&packet2, 0, sizeof(packet2));
5489 mavlink_msg_memory_vect_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.address , packet1.ver , packet1.type , packet1.value );
5490 mavlink_msg_memory_vect_decode(&msg, &packet2);
5491 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5493 memset(&packet2, 0, sizeof(packet2));
5494 mavlink_msg_to_send_buffer(buffer, &msg);
5495 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5496 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5498 mavlink_msg_memory_vect_decode(last_msg, &packet2);
5499 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5501 memset(&packet2, 0, sizeof(packet2));
5502 mavlink_msg_memory_vect_send(MAVLINK_COMM_1 , packet1.address , packet1.ver , packet1.type , packet1.value );
5503 mavlink_msg_memory_vect_decode(last_msg, &packet2);
5504 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5507 static void mavlink_test_debug_vect(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5509 mavlink_message_t msg;
5510 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5511 uint16_t i;
5512 mavlink_debug_vect_t packet_in = {
5513 93372036854775807ULL,73.0,101.0,129.0,"UVWXYZABC"
5515 mavlink_debug_vect_t packet1, packet2;
5516 memset(&packet1, 0, sizeof(packet1));
5517 packet1.time_usec = packet_in.time_usec;
5518 packet1.x = packet_in.x;
5519 packet1.y = packet_in.y;
5520 packet1.z = packet_in.z;
5522 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*10);
5525 memset(&packet2, 0, sizeof(packet2));
5526 mavlink_msg_debug_vect_encode(system_id, component_id, &msg, &packet1);
5527 mavlink_msg_debug_vect_decode(&msg, &packet2);
5528 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5530 memset(&packet2, 0, sizeof(packet2));
5531 mavlink_msg_debug_vect_pack(system_id, component_id, &msg , packet1.name , packet1.time_usec , packet1.x , packet1.y , packet1.z );
5532 mavlink_msg_debug_vect_decode(&msg, &packet2);
5533 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5535 memset(&packet2, 0, sizeof(packet2));
5536 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 );
5537 mavlink_msg_debug_vect_decode(&msg, &packet2);
5538 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5540 memset(&packet2, 0, sizeof(packet2));
5541 mavlink_msg_to_send_buffer(buffer, &msg);
5542 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5543 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5545 mavlink_msg_debug_vect_decode(last_msg, &packet2);
5546 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5548 memset(&packet2, 0, sizeof(packet2));
5549 mavlink_msg_debug_vect_send(MAVLINK_COMM_1 , packet1.name , packet1.time_usec , packet1.x , packet1.y , packet1.z );
5550 mavlink_msg_debug_vect_decode(last_msg, &packet2);
5551 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5554 static void mavlink_test_named_value_float(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5556 mavlink_message_t msg;
5557 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5558 uint16_t i;
5559 mavlink_named_value_float_t packet_in = {
5560 963497464,45.0,"IJKLMNOPQ"
5562 mavlink_named_value_float_t packet1, packet2;
5563 memset(&packet1, 0, sizeof(packet1));
5564 packet1.time_boot_ms = packet_in.time_boot_ms;
5565 packet1.value = packet_in.value;
5567 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*10);
5570 memset(&packet2, 0, sizeof(packet2));
5571 mavlink_msg_named_value_float_encode(system_id, component_id, &msg, &packet1);
5572 mavlink_msg_named_value_float_decode(&msg, &packet2);
5573 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5575 memset(&packet2, 0, sizeof(packet2));
5576 mavlink_msg_named_value_float_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.name , packet1.value );
5577 mavlink_msg_named_value_float_decode(&msg, &packet2);
5578 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5580 memset(&packet2, 0, sizeof(packet2));
5581 mavlink_msg_named_value_float_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.name , packet1.value );
5582 mavlink_msg_named_value_float_decode(&msg, &packet2);
5583 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5585 memset(&packet2, 0, sizeof(packet2));
5586 mavlink_msg_to_send_buffer(buffer, &msg);
5587 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5588 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5590 mavlink_msg_named_value_float_decode(last_msg, &packet2);
5591 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5593 memset(&packet2, 0, sizeof(packet2));
5594 mavlink_msg_named_value_float_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.name , packet1.value );
5595 mavlink_msg_named_value_float_decode(last_msg, &packet2);
5596 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5599 static void mavlink_test_named_value_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5601 mavlink_message_t msg;
5602 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5603 uint16_t i;
5604 mavlink_named_value_int_t packet_in = {
5605 963497464,963497672,"IJKLMNOPQ"
5607 mavlink_named_value_int_t packet1, packet2;
5608 memset(&packet1, 0, sizeof(packet1));
5609 packet1.time_boot_ms = packet_in.time_boot_ms;
5610 packet1.value = packet_in.value;
5612 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*10);
5615 memset(&packet2, 0, sizeof(packet2));
5616 mavlink_msg_named_value_int_encode(system_id, component_id, &msg, &packet1);
5617 mavlink_msg_named_value_int_decode(&msg, &packet2);
5618 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5620 memset(&packet2, 0, sizeof(packet2));
5621 mavlink_msg_named_value_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.name , packet1.value );
5622 mavlink_msg_named_value_int_decode(&msg, &packet2);
5623 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5625 memset(&packet2, 0, sizeof(packet2));
5626 mavlink_msg_named_value_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.name , packet1.value );
5627 mavlink_msg_named_value_int_decode(&msg, &packet2);
5628 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5630 memset(&packet2, 0, sizeof(packet2));
5631 mavlink_msg_to_send_buffer(buffer, &msg);
5632 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5633 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5635 mavlink_msg_named_value_int_decode(last_msg, &packet2);
5636 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5638 memset(&packet2, 0, sizeof(packet2));
5639 mavlink_msg_named_value_int_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.name , packet1.value );
5640 mavlink_msg_named_value_int_decode(last_msg, &packet2);
5641 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5644 static void mavlink_test_statustext(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5646 mavlink_message_t msg;
5647 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5648 uint16_t i;
5649 mavlink_statustext_t packet_in = {
5650 5,"BCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX"
5652 mavlink_statustext_t packet1, packet2;
5653 memset(&packet1, 0, sizeof(packet1));
5654 packet1.severity = packet_in.severity;
5656 mav_array_memcpy(packet1.text, packet_in.text, sizeof(char)*50);
5659 memset(&packet2, 0, sizeof(packet2));
5660 mavlink_msg_statustext_encode(system_id, component_id, &msg, &packet1);
5661 mavlink_msg_statustext_decode(&msg, &packet2);
5662 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5664 memset(&packet2, 0, sizeof(packet2));
5665 mavlink_msg_statustext_pack(system_id, component_id, &msg , packet1.severity , packet1.text );
5666 mavlink_msg_statustext_decode(&msg, &packet2);
5667 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5669 memset(&packet2, 0, sizeof(packet2));
5670 mavlink_msg_statustext_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.severity , packet1.text );
5671 mavlink_msg_statustext_decode(&msg, &packet2);
5672 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5674 memset(&packet2, 0, sizeof(packet2));
5675 mavlink_msg_to_send_buffer(buffer, &msg);
5676 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5677 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5679 mavlink_msg_statustext_decode(last_msg, &packet2);
5680 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5682 memset(&packet2, 0, sizeof(packet2));
5683 mavlink_msg_statustext_send(MAVLINK_COMM_1 , packet1.severity , packet1.text );
5684 mavlink_msg_statustext_decode(last_msg, &packet2);
5685 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5688 static void mavlink_test_debug(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5690 mavlink_message_t msg;
5691 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5692 uint16_t i;
5693 mavlink_debug_t packet_in = {
5694 963497464,45.0,29
5696 mavlink_debug_t packet1, packet2;
5697 memset(&packet1, 0, sizeof(packet1));
5698 packet1.time_boot_ms = packet_in.time_boot_ms;
5699 packet1.value = packet_in.value;
5700 packet1.ind = packet_in.ind;
5704 memset(&packet2, 0, sizeof(packet2));
5705 mavlink_msg_debug_encode(system_id, component_id, &msg, &packet1);
5706 mavlink_msg_debug_decode(&msg, &packet2);
5707 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5709 memset(&packet2, 0, sizeof(packet2));
5710 mavlink_msg_debug_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.ind , packet1.value );
5711 mavlink_msg_debug_decode(&msg, &packet2);
5712 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5714 memset(&packet2, 0, sizeof(packet2));
5715 mavlink_msg_debug_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.ind , packet1.value );
5716 mavlink_msg_debug_decode(&msg, &packet2);
5717 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5719 memset(&packet2, 0, sizeof(packet2));
5720 mavlink_msg_to_send_buffer(buffer, &msg);
5721 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5722 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5724 mavlink_msg_debug_decode(last_msg, &packet2);
5725 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5727 memset(&packet2, 0, sizeof(packet2));
5728 mavlink_msg_debug_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.ind , packet1.value );
5729 mavlink_msg_debug_decode(last_msg, &packet2);
5730 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5733 static void mavlink_test_common(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5735 mavlink_test_heartbeat(system_id, component_id, last_msg);
5736 mavlink_test_sys_status(system_id, component_id, last_msg);
5737 mavlink_test_system_time(system_id, component_id, last_msg);
5738 mavlink_test_ping(system_id, component_id, last_msg);
5739 mavlink_test_change_operator_control(system_id, component_id, last_msg);
5740 mavlink_test_change_operator_control_ack(system_id, component_id, last_msg);
5741 mavlink_test_auth_key(system_id, component_id, last_msg);
5742 mavlink_test_set_mode(system_id, component_id, last_msg);
5743 mavlink_test_param_request_read(system_id, component_id, last_msg);
5744 mavlink_test_param_request_list(system_id, component_id, last_msg);
5745 mavlink_test_param_value(system_id, component_id, last_msg);
5746 mavlink_test_param_set(system_id, component_id, last_msg);
5747 mavlink_test_gps_raw_int(system_id, component_id, last_msg);
5748 mavlink_test_gps_status(system_id, component_id, last_msg);
5749 mavlink_test_scaled_imu(system_id, component_id, last_msg);
5750 mavlink_test_raw_imu(system_id, component_id, last_msg);
5751 mavlink_test_raw_pressure(system_id, component_id, last_msg);
5752 mavlink_test_scaled_pressure(system_id, component_id, last_msg);
5753 mavlink_test_attitude(system_id, component_id, last_msg);
5754 mavlink_test_attitude_quaternion(system_id, component_id, last_msg);
5755 mavlink_test_local_position_ned(system_id, component_id, last_msg);
5756 mavlink_test_global_position_int(system_id, component_id, last_msg);
5757 mavlink_test_rc_channels_scaled(system_id, component_id, last_msg);
5758 mavlink_test_rc_channels_raw(system_id, component_id, last_msg);
5759 mavlink_test_servo_output_raw(system_id, component_id, last_msg);
5760 mavlink_test_mission_request_partial_list(system_id, component_id, last_msg);
5761 mavlink_test_mission_write_partial_list(system_id, component_id, last_msg);
5762 mavlink_test_mission_item(system_id, component_id, last_msg);
5763 mavlink_test_mission_request(system_id, component_id, last_msg);
5764 mavlink_test_mission_set_current(system_id, component_id, last_msg);
5765 mavlink_test_mission_current(system_id, component_id, last_msg);
5766 mavlink_test_mission_request_list(system_id, component_id, last_msg);
5767 mavlink_test_mission_count(system_id, component_id, last_msg);
5768 mavlink_test_mission_clear_all(system_id, component_id, last_msg);
5769 mavlink_test_mission_item_reached(system_id, component_id, last_msg);
5770 mavlink_test_mission_ack(system_id, component_id, last_msg);
5771 mavlink_test_set_gps_global_origin(system_id, component_id, last_msg);
5772 mavlink_test_gps_global_origin(system_id, component_id, last_msg);
5773 mavlink_test_param_map_rc(system_id, component_id, last_msg);
5774 mavlink_test_safety_set_allowed_area(system_id, component_id, last_msg);
5775 mavlink_test_safety_allowed_area(system_id, component_id, last_msg);
5776 mavlink_test_attitude_quaternion_cov(system_id, component_id, last_msg);
5777 mavlink_test_nav_controller_output(system_id, component_id, last_msg);
5778 mavlink_test_global_position_int_cov(system_id, component_id, last_msg);
5779 mavlink_test_local_position_ned_cov(system_id, component_id, last_msg);
5780 mavlink_test_rc_channels(system_id, component_id, last_msg);
5781 mavlink_test_request_data_stream(system_id, component_id, last_msg);
5782 mavlink_test_data_stream(system_id, component_id, last_msg);
5783 mavlink_test_manual_control(system_id, component_id, last_msg);
5784 mavlink_test_rc_channels_override(system_id, component_id, last_msg);
5785 mavlink_test_mission_item_int(system_id, component_id, last_msg);
5786 mavlink_test_vfr_hud(system_id, component_id, last_msg);
5787 mavlink_test_command_int(system_id, component_id, last_msg);
5788 mavlink_test_command_long(system_id, component_id, last_msg);
5789 mavlink_test_command_ack(system_id, component_id, last_msg);
5790 mavlink_test_manual_setpoint(system_id, component_id, last_msg);
5791 mavlink_test_set_attitude_target(system_id, component_id, last_msg);
5792 mavlink_test_attitude_target(system_id, component_id, last_msg);
5793 mavlink_test_set_position_target_local_ned(system_id, component_id, last_msg);
5794 mavlink_test_position_target_local_ned(system_id, component_id, last_msg);
5795 mavlink_test_set_position_target_global_int(system_id, component_id, last_msg);
5796 mavlink_test_position_target_global_int(system_id, component_id, last_msg);
5797 mavlink_test_local_position_ned_system_global_offset(system_id, component_id, last_msg);
5798 mavlink_test_hil_state(system_id, component_id, last_msg);
5799 mavlink_test_hil_controls(system_id, component_id, last_msg);
5800 mavlink_test_hil_rc_inputs_raw(system_id, component_id, last_msg);
5801 mavlink_test_optical_flow(system_id, component_id, last_msg);
5802 mavlink_test_global_vision_position_estimate(system_id, component_id, last_msg);
5803 mavlink_test_vision_position_estimate(system_id, component_id, last_msg);
5804 mavlink_test_vision_speed_estimate(system_id, component_id, last_msg);
5805 mavlink_test_vicon_position_estimate(system_id, component_id, last_msg);
5806 mavlink_test_highres_imu(system_id, component_id, last_msg);
5807 mavlink_test_optical_flow_rad(system_id, component_id, last_msg);
5808 mavlink_test_hil_sensor(system_id, component_id, last_msg);
5809 mavlink_test_sim_state(system_id, component_id, last_msg);
5810 mavlink_test_radio_status(system_id, component_id, last_msg);
5811 mavlink_test_file_transfer_protocol(system_id, component_id, last_msg);
5812 mavlink_test_timesync(system_id, component_id, last_msg);
5813 mavlink_test_camera_trigger(system_id, component_id, last_msg);
5814 mavlink_test_hil_gps(system_id, component_id, last_msg);
5815 mavlink_test_hil_optical_flow(system_id, component_id, last_msg);
5816 mavlink_test_hil_state_quaternion(system_id, component_id, last_msg);
5817 mavlink_test_scaled_imu2(system_id, component_id, last_msg);
5818 mavlink_test_log_request_list(system_id, component_id, last_msg);
5819 mavlink_test_log_entry(system_id, component_id, last_msg);
5820 mavlink_test_log_request_data(system_id, component_id, last_msg);
5821 mavlink_test_log_data(system_id, component_id, last_msg);
5822 mavlink_test_log_erase(system_id, component_id, last_msg);
5823 mavlink_test_log_request_end(system_id, component_id, last_msg);
5824 mavlink_test_gps_inject_data(system_id, component_id, last_msg);
5825 mavlink_test_gps2_raw(system_id, component_id, last_msg);
5826 mavlink_test_power_status(system_id, component_id, last_msg);
5827 mavlink_test_serial_control(system_id, component_id, last_msg);
5828 mavlink_test_gps_rtk(system_id, component_id, last_msg);
5829 mavlink_test_gps2_rtk(system_id, component_id, last_msg);
5830 mavlink_test_scaled_imu3(system_id, component_id, last_msg);
5831 mavlink_test_data_transmission_handshake(system_id, component_id, last_msg);
5832 mavlink_test_encapsulated_data(system_id, component_id, last_msg);
5833 mavlink_test_distance_sensor(system_id, component_id, last_msg);
5834 mavlink_test_terrain_request(system_id, component_id, last_msg);
5835 mavlink_test_terrain_data(system_id, component_id, last_msg);
5836 mavlink_test_terrain_check(system_id, component_id, last_msg);
5837 mavlink_test_terrain_report(system_id, component_id, last_msg);
5838 mavlink_test_scaled_pressure2(system_id, component_id, last_msg);
5839 mavlink_test_att_pos_mocap(system_id, component_id, last_msg);
5840 mavlink_test_set_actuator_control_target(system_id, component_id, last_msg);
5841 mavlink_test_actuator_control_target(system_id, component_id, last_msg);
5842 mavlink_test_battery_status(system_id, component_id, last_msg);
5843 mavlink_test_autopilot_version(system_id, component_id, last_msg);
5844 mavlink_test_v2_extension(system_id, component_id, last_msg);
5845 mavlink_test_memory_vect(system_id, component_id, last_msg);
5846 mavlink_test_debug_vect(system_id, component_id, last_msg);
5847 mavlink_test_named_value_float(system_id, component_id, last_msg);
5848 mavlink_test_named_value_int(system_id, component_id, last_msg);
5849 mavlink_test_statustext(system_id, component_id, last_msg);
5850 mavlink_test_debug(system_id, component_id, last_msg);
5853 #ifdef __cplusplus
5855 #endif // __cplusplus
5856 #endif // COMMON_TESTSUITE_H