common/testsuite.h
Go to the documentation of this file.
1 
5 #ifndef COMMON_TESTSUITE_H
6 #define COMMON_TESTSUITE_H
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 #ifndef MAVLINK_TEST_ALL
13 #define MAVLINK_TEST_ALL
14 
15 static void mavlink_test_common(uint8_t, uint8_t, mavlink_message_t *last_msg);
16 
17 static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
18 {
19 
20  mavlink_test_common(system_id, component_id, last_msg);
21 }
22 #endif
23 
24 
25 
26 
27 static void mavlink_test_heartbeat(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
28 {
29  mavlink_message_t msg;
31  uint16_t i;
32  mavlink_heartbeat_t packet_in = {
33  963497464,17,84,151,218,3
34  };
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;
43 
44 
45 
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);
50 
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);
55 
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);
60 
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]);
65  }
66  mavlink_msg_heartbeat_decode(last_msg, &packet2);
67  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
68 
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);
73 }
74 
75 static void mavlink_test_sys_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
76 {
77  mavlink_message_t msg;
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
82  };
83  mavlink_sys_status_t packet1, packet2;
84  memset(&packet1, 0, sizeof(packet1));
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;
98 
99 
100 
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);
105 
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);
110 
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);
115 
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]);
120  }
121  mavlink_msg_sys_status_decode(last_msg, &packet2);
122  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
123 
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);
128 }
129 
130 static void mavlink_test_system_time(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
131 {
132  mavlink_message_t msg;
134  uint16_t i;
135  mavlink_system_time_t packet_in = {
136  93372036854775807ULL,963497880
137  };
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;
142 
143 
144 
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);
149 
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);
154 
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);
159 
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]);
164  }
165  mavlink_msg_system_time_decode(last_msg, &packet2);
166  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
167 
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);
172 }
173 
174 static void mavlink_test_ping(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
175 {
176  mavlink_message_t msg;
178  uint16_t i;
179  mavlink_ping_t packet_in = {
180  93372036854775807ULL,963497880,41,108
181  };
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;
188 
189 
190 
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);
195 
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);
200 
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);
205 
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]);
210  }
211  mavlink_msg_ping_decode(last_msg, &packet2);
212  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
213 
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);
218 }
219 
220 static void mavlink_test_change_operator_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
221 {
222  mavlink_message_t msg;
224  uint16_t i;
226  5,72,139,"DEFGHIJKLMNOPQRSTUVWXYZA"
227  };
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;
233 
234  mav_array_memcpy(packet1.passkey, packet_in.passkey, sizeof(char)*25);
235 
236 
237  memset(&packet2, 0, sizeof(packet2));
238  mavlink_msg_change_operator_control_encode(system_id, component_id, &msg, &packet1);
240  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
241 
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 );
245  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
246 
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 );
250  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
251 
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]);
256  }
257  mavlink_msg_change_operator_control_decode(last_msg, &packet2);
258  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
259 
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);
264 }
265 
266 static void mavlink_test_change_operator_control_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
267 {
268  mavlink_message_t msg;
270  uint16_t i;
272  5,72,139
273  };
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;
279 
280 
281 
282  memset(&packet2, 0, sizeof(packet2));
283  mavlink_msg_change_operator_control_ack_encode(system_id, component_id, &msg, &packet1);
285  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
286 
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 );
290  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
291 
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 );
295  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
296 
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]);
301  }
303  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
304 
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 );
308  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
309 }
310 
311 static void mavlink_test_auth_key(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
312 {
313  mavlink_message_t msg;
315  uint16_t i;
316  mavlink_auth_key_t packet_in = {
317  "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDE"
318  };
319  mavlink_auth_key_t packet1, packet2;
320  memset(&packet1, 0, sizeof(packet1));
321 
322  mav_array_memcpy(packet1.key, packet_in.key, sizeof(char)*32);
323 
324 
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);
329 
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);
334 
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);
339 
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]);
344  }
345  mavlink_msg_auth_key_decode(last_msg, &packet2);
346  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
347 
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);
352 }
353 
354 static void mavlink_test_set_mode(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
355 {
356  mavlink_message_t msg;
358  uint16_t i;
359  mavlink_set_mode_t packet_in = {
360  963497464,17,84
361  };
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;
367 
368 
369 
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);
374 
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);
379 
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);
384 
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]);
389  }
390  mavlink_msg_set_mode_decode(last_msg, &packet2);
391  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
392 
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);
397 }
398 
399 static void mavlink_test_param_request_read(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
400 {
401  mavlink_message_t msg;
403  uint16_t i;
404  mavlink_param_request_read_t packet_in = {
405  17235,139,206,"EFGHIJKLMNOPQRS"
406  };
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;
412 
413  mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
414 
415 
416  memset(&packet2, 0, sizeof(packet2));
417  mavlink_msg_param_request_read_encode(system_id, component_id, &msg, &packet1);
419  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
420 
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 );
424  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
425 
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 );
429  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
430 
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]);
435  }
436  mavlink_msg_param_request_read_decode(last_msg, &packet2);
437  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
438 
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);
443 }
444 
445 static void mavlink_test_param_request_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
446 {
447  mavlink_message_t msg;
449  uint16_t i;
450  mavlink_param_request_list_t packet_in = {
451  5,72
452  };
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;
457 
458 
459 
460  memset(&packet2, 0, sizeof(packet2));
461  mavlink_msg_param_request_list_encode(system_id, component_id, &msg, &packet1);
463  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
464 
465  memset(&packet2, 0, sizeof(packet2));
466  mavlink_msg_param_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
468  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
469 
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 );
473  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
474 
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]);
479  }
480  mavlink_msg_param_request_list_decode(last_msg, &packet2);
481  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
482 
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);
487 }
488 
489 static void mavlink_test_param_value(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
490 {
491  mavlink_message_t msg;
493  uint16_t i;
494  mavlink_param_value_t packet_in = {
495  17.0,17443,17547,"IJKLMNOPQRSTUVW",77
496  };
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;
503 
504  mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
505 
506 
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);
511 
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);
516 
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);
521 
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]);
526  }
527  mavlink_msg_param_value_decode(last_msg, &packet2);
528  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
529 
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);
534 }
535 
536 static void mavlink_test_param_set(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
537 {
538  mavlink_message_t msg;
540  uint16_t i;
541  mavlink_param_set_t packet_in = {
542  17.0,17,84,"GHIJKLMNOPQRSTU",199
543  };
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;
550 
551  mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
552 
553 
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);
558 
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);
563 
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);
568 
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]);
573  }
574  mavlink_msg_param_set_decode(last_msg, &packet2);
575  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
576 
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);
581 }
582 
583 static void mavlink_test_gps_raw_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
584 {
585  mavlink_message_t msg;
587  uint16_t i;
588  mavlink_gps_raw_int_t packet_in = {
589  93372036854775807ULL,963497880,963498088,963498296,18275,18379,18483,18587,89,156
590  };
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;
603 
604 
605 
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);
610 
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);
615 
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);
620 
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]);
625  }
626  mavlink_msg_gps_raw_int_decode(last_msg, &packet2);
627  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
628 
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);
633 }
634 
635 static void mavlink_test_gps_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
636 {
637  mavlink_message_t msg;
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 }
642  };
643  mavlink_gps_status_t packet1, packet2;
644  memset(&packet1, 0, sizeof(packet1));
645  packet1.satellites_visible = packet_in.satellites_visible;
646 
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);
652 
653 
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);
658 
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);
663 
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);
668 
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]);
673  }
674  mavlink_msg_gps_status_decode(last_msg, &packet2);
675  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
676 
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);
681 }
682 
683 static void mavlink_test_scaled_imu(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
684 {
685  mavlink_message_t msg;
687  uint16_t i;
688  mavlink_scaled_imu_t packet_in = {
689  963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275
690  };
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;
703 
704 
705 
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);
710 
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);
715 
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);
720 
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]);
725  }
726  mavlink_msg_scaled_imu_decode(last_msg, &packet2);
727  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
728 
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);
733 }
734 
735 static void mavlink_test_raw_imu(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
736 {
737  mavlink_message_t msg;
739  uint16_t i;
740  mavlink_raw_imu_t packet_in = {
741  93372036854775807ULL,17651,17755,17859,17963,18067,18171,18275,18379,18483
742  };
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;
755 
756 
757 
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);
762 
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);
767 
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);
772 
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]);
777  }
778  mavlink_msg_raw_imu_decode(last_msg, &packet2);
779  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
780 
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);
785 }
786 
787 static void mavlink_test_raw_pressure(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
788 {
789  mavlink_message_t msg;
791  uint16_t i;
792  mavlink_raw_pressure_t packet_in = {
793  93372036854775807ULL,17651,17755,17859,17963
794  };
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;
802 
803 
804 
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);
809 
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);
814 
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);
819 
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]);
824  }
825  mavlink_msg_raw_pressure_decode(last_msg, &packet2);
826  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
827 
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);
832 }
833 
834 static void mavlink_test_scaled_pressure(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
835 {
836  mavlink_message_t msg;
838  uint16_t i;
839  mavlink_scaled_pressure_t packet_in = {
840  963497464,45.0,73.0,17859
841  };
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;
848 
849 
850 
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);
855 
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);
860 
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);
865 
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]);
870  }
871  mavlink_msg_scaled_pressure_decode(last_msg, &packet2);
872  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
873 
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);
878 }
879 
880 static void mavlink_test_attitude(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
881 {
882  mavlink_message_t msg;
884  uint16_t i;
885  mavlink_attitude_t packet_in = {
886  963497464,45.0,73.0,101.0,129.0,157.0,185.0
887  };
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;
897 
898 
899 
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);
904 
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);
909 
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);
914 
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]);
919  }
920  mavlink_msg_attitude_decode(last_msg, &packet2);
921  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
922 
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);
927 }
928 
929 static void mavlink_test_attitude_quaternion(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
930 {
931  mavlink_message_t msg;
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
936  };
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;
947 
948 
949 
950  memset(&packet2, 0, sizeof(packet2));
951  mavlink_msg_attitude_quaternion_encode(system_id, component_id, &msg, &packet1);
953  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
954 
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 );
958  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
959 
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 );
963  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
964 
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]);
969  }
970  mavlink_msg_attitude_quaternion_decode(last_msg, &packet2);
971  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
972 
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);
977 }
978 
979 static void mavlink_test_local_position_ned(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
980 {
981  mavlink_message_t msg;
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
986  };
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;
996 
997 
998 
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);
1003 
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);
1008 
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);
1013 
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]);
1018  }
1019  mavlink_msg_local_position_ned_decode(last_msg, &packet2);
1020  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1021 
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);
1026 }
1027 
1028 static void mavlink_test_global_position_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1029 {
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
1035  };
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;
1047 
1048 
1049 
1050  memset(&packet2, 0, sizeof(packet2));
1051  mavlink_msg_global_position_int_encode(system_id, component_id, &msg, &packet1);
1053  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1054 
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 );
1058  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1059 
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 );
1063  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1064 
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]);
1069  }
1070  mavlink_msg_global_position_int_decode(last_msg, &packet2);
1071  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1072 
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);
1077 }
1078 
1079 static void mavlink_test_rc_channels_scaled(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1080 {
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
1086  };
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;
1100 
1101 
1102 
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);
1107 
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);
1112 
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);
1117 
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]);
1122  }
1123  mavlink_msg_rc_channels_scaled_decode(last_msg, &packet2);
1124  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1125 
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);
1130 }
1131 
1132 static void mavlink_test_rc_channels_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1133 {
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
1139  };
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;
1153 
1154 
1155 
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);
1160 
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);
1165 
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);
1170 
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]);
1175  }
1176  mavlink_msg_rc_channels_raw_decode(last_msg, &packet2);
1177  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1178 
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);
1183 }
1184 
1185 static void mavlink_test_servo_output_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1186 {
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
1192  };
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;
1205 
1206 
1207 
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);
1212 
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);
1217 
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);
1222 
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]);
1227  }
1228  mavlink_msg_servo_output_raw_decode(last_msg, &packet2);
1229  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1230 
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);
1235 }
1236 
1237 static void mavlink_test_mission_request_partial_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1238 {
1239  mavlink_message_t msg;
1240  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1241  uint16_t i;
1243  17235,17339,17,84
1244  };
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;
1251 
1252 
1253 
1254  memset(&packet2, 0, sizeof(packet2));
1255  mavlink_msg_mission_request_partial_list_encode(system_id, component_id, &msg, &packet1);
1257  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1258 
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 );
1262  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1263 
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 );
1267  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1268 
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]);
1273  }
1275  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1276 
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 );
1280  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1281 }
1282 
1283 static void mavlink_test_mission_write_partial_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1284 {
1285  mavlink_message_t msg;
1286  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1287  uint16_t i;
1289  17235,17339,17,84
1290  };
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;
1297 
1298 
1299 
1300  memset(&packet2, 0, sizeof(packet2));
1301  mavlink_msg_mission_write_partial_list_encode(system_id, component_id, &msg, &packet1);
1303  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1304 
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 );
1308  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1309 
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 );
1313  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1314 
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]);
1319  }
1321  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1322 
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 );
1326  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1327 }
1328 
1329 static void mavlink_test_mission_item(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1330 {
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
1336  };
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;
1353 
1354 
1355 
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);
1360 
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);
1365 
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);
1370 
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]);
1375  }
1376  mavlink_msg_mission_item_decode(last_msg, &packet2);
1377  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1378 
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);
1383 }
1384 
1385 static void mavlink_test_mission_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1386 {
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
1392  };
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;
1398 
1399 
1400 
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);
1405 
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);
1410 
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);
1415 
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]);
1420  }
1421  mavlink_msg_mission_request_decode(last_msg, &packet2);
1422  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1423 
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);
1428 }
1429 
1430 static void mavlink_test_mission_set_current(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1431 {
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
1437  };
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;
1443 
1444 
1445 
1446  memset(&packet2, 0, sizeof(packet2));
1447  mavlink_msg_mission_set_current_encode(system_id, component_id, &msg, &packet1);
1449  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1450 
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 );
1454  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1455 
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 );
1459  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1460 
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]);
1465  }
1466  mavlink_msg_mission_set_current_decode(last_msg, &packet2);
1467  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1468 
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);
1473 }
1474 
1475 static void mavlink_test_mission_current(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1476 {
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
1482  };
1483  mavlink_mission_current_t packet1, packet2;
1484  memset(&packet1, 0, sizeof(packet1));
1485  packet1.seq = packet_in.seq;
1486 
1487 
1488 
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);
1493 
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);
1498 
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);
1503 
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]);
1508  }
1509  mavlink_msg_mission_current_decode(last_msg, &packet2);
1510  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1511 
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);
1516 }
1517 
1518 static void mavlink_test_mission_request_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1519 {
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
1525  };
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;
1530 
1531 
1532 
1533  memset(&packet2, 0, sizeof(packet2));
1534  mavlink_msg_mission_request_list_encode(system_id, component_id, &msg, &packet1);
1536  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1537 
1538  memset(&packet2, 0, sizeof(packet2));
1539  mavlink_msg_mission_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
1541  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1542 
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 );
1546  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1547 
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]);
1552  }
1553  mavlink_msg_mission_request_list_decode(last_msg, &packet2);
1554  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1555 
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);
1560 }
1561 
1562 static void mavlink_test_mission_count(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1563 {
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
1569  };
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;
1575 
1576 
1577 
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);
1582 
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);
1587 
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);
1592 
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]);
1597  }
1598  mavlink_msg_mission_count_decode(last_msg, &packet2);
1599  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1600 
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);
1605 }
1606 
1607 static void mavlink_test_mission_clear_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1608 {
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
1614  };
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;
1619 
1620 
1621 
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);
1626 
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);
1631 
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);
1636 
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]);
1641  }
1642  mavlink_msg_mission_clear_all_decode(last_msg, &packet2);
1643  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1644 
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);
1649 }
1650 
1651 static void mavlink_test_mission_item_reached(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1652 {
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
1658  };
1659  mavlink_mission_item_reached_t packet1, packet2;
1660  memset(&packet1, 0, sizeof(packet1));
1661  packet1.seq = packet_in.seq;
1662 
1663 
1664 
1665  memset(&packet2, 0, sizeof(packet2));
1666  mavlink_msg_mission_item_reached_encode(system_id, component_id, &msg, &packet1);
1668  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1669 
1670  memset(&packet2, 0, sizeof(packet2));
1671  mavlink_msg_mission_item_reached_pack(system_id, component_id, &msg , packet1.seq );
1673  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1674 
1675  memset(&packet2, 0, sizeof(packet2));
1676  mavlink_msg_mission_item_reached_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seq );
1678  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1679 
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]);
1684  }
1685  mavlink_msg_mission_item_reached_decode(last_msg, &packet2);
1686  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1687 
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);
1692 }
1693 
1694 static void mavlink_test_mission_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1695 {
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
1701  };
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;
1707 
1708 
1709 
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);
1714 
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);
1719 
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);
1724 
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]);
1729  }
1730  mavlink_msg_mission_ack_decode(last_msg, &packet2);
1731  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1732 
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);
1737 }
1738 
1739 static void mavlink_test_set_gps_global_origin(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1740 {
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
1746  };
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;
1753 
1754 
1755 
1756  memset(&packet2, 0, sizeof(packet2));
1757  mavlink_msg_set_gps_global_origin_encode(system_id, component_id, &msg, &packet1);
1759  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1760 
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 );
1764  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1765 
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 );
1769  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1770 
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]);
1775  }
1776  mavlink_msg_set_gps_global_origin_decode(last_msg, &packet2);
1777  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1778 
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);
1783 }
1784 
1785 static void mavlink_test_gps_global_origin(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1786 {
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
1792  };
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;
1798 
1799 
1800 
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);
1805 
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);
1810 
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);
1815 
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]);
1820  }
1821  mavlink_msg_gps_global_origin_decode(last_msg, &packet2);
1822  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1823 
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);
1828 }
1829 
1830 static void mavlink_test_param_map_rc(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1831 {
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
1837  };
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;
1848 
1849  mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
1850 
1851 
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);
1856 
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);
1861 
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);
1866 
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]);
1871  }
1872  mavlink_msg_param_map_rc_decode(last_msg, &packet2);
1873  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1874 
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);
1879 }
1880 
1881 static void mavlink_test_mission_request_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1882 {
1883  mavlink_message_t msg;
1884  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1885  uint16_t i;
1886  mavlink_mission_request_int_t packet_in = {
1887  17235,139,206
1888  };
1889  mavlink_mission_request_int_t packet1, packet2;
1890  memset(&packet1, 0, sizeof(packet1));
1891  packet1.seq = packet_in.seq;
1892  packet1.target_system = packet_in.target_system;
1893  packet1.target_component = packet_in.target_component;
1894 
1895 
1896 
1897  memset(&packet2, 0, sizeof(packet2));
1898  mavlink_msg_mission_request_int_encode(system_id, component_id, &msg, &packet1);
1900  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1901 
1902  memset(&packet2, 0, sizeof(packet2));
1903  mavlink_msg_mission_request_int_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq );
1905  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1906 
1907  memset(&packet2, 0, sizeof(packet2));
1908  mavlink_msg_mission_request_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq );
1910  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1911 
1912  memset(&packet2, 0, sizeof(packet2));
1913  mavlink_msg_to_send_buffer(buffer, &msg);
1914  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1915  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1916  }
1917  mavlink_msg_mission_request_int_decode(last_msg, &packet2);
1918  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1919 
1920  memset(&packet2, 0, sizeof(packet2));
1921  mavlink_msg_mission_request_int_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seq );
1922  mavlink_msg_mission_request_int_decode(last_msg, &packet2);
1923  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1924 }
1925 
1926 static void mavlink_test_safety_set_allowed_area(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1927 {
1928  mavlink_message_t msg;
1929  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1930  uint16_t i;
1931  mavlink_safety_set_allowed_area_t packet_in = {
1932  17.0,45.0,73.0,101.0,129.0,157.0,77,144,211
1933  };
1934  mavlink_safety_set_allowed_area_t packet1, packet2;
1935  memset(&packet1, 0, sizeof(packet1));
1936  packet1.p1x = packet_in.p1x;
1937  packet1.p1y = packet_in.p1y;
1938  packet1.p1z = packet_in.p1z;
1939  packet1.p2x = packet_in.p2x;
1940  packet1.p2y = packet_in.p2y;
1941  packet1.p2z = packet_in.p2z;
1942  packet1.target_system = packet_in.target_system;
1943  packet1.target_component = packet_in.target_component;
1944  packet1.frame = packet_in.frame;
1945 
1946 
1947 
1948  memset(&packet2, 0, sizeof(packet2));
1949  mavlink_msg_safety_set_allowed_area_encode(system_id, component_id, &msg, &packet1);
1951  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1952 
1953  memset(&packet2, 0, sizeof(packet2));
1954  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 );
1956  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1957 
1958  memset(&packet2, 0, sizeof(packet2));
1959  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 );
1961  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1962 
1963  memset(&packet2, 0, sizeof(packet2));
1964  mavlink_msg_to_send_buffer(buffer, &msg);
1965  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1966  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1967  }
1968  mavlink_msg_safety_set_allowed_area_decode(last_msg, &packet2);
1969  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1970 
1971  memset(&packet2, 0, sizeof(packet2));
1972  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 );
1973  mavlink_msg_safety_set_allowed_area_decode(last_msg, &packet2);
1974  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1975 }
1976 
1977 static void mavlink_test_safety_allowed_area(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1978 {
1979  mavlink_message_t msg;
1980  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1981  uint16_t i;
1982  mavlink_safety_allowed_area_t packet_in = {
1983  17.0,45.0,73.0,101.0,129.0,157.0,77
1984  };
1985  mavlink_safety_allowed_area_t packet1, packet2;
1986  memset(&packet1, 0, sizeof(packet1));
1987  packet1.p1x = packet_in.p1x;
1988  packet1.p1y = packet_in.p1y;
1989  packet1.p1z = packet_in.p1z;
1990  packet1.p2x = packet_in.p2x;
1991  packet1.p2y = packet_in.p2y;
1992  packet1.p2z = packet_in.p2z;
1993  packet1.frame = packet_in.frame;
1994 
1995 
1996 
1997  memset(&packet2, 0, sizeof(packet2));
1998  mavlink_msg_safety_allowed_area_encode(system_id, component_id, &msg, &packet1);
2000  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2001 
2002  memset(&packet2, 0, sizeof(packet2));
2003  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 );
2005  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2006 
2007  memset(&packet2, 0, sizeof(packet2));
2008  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 );
2010  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2011 
2012  memset(&packet2, 0, sizeof(packet2));
2013  mavlink_msg_to_send_buffer(buffer, &msg);
2014  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2015  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2016  }
2017  mavlink_msg_safety_allowed_area_decode(last_msg, &packet2);
2018  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2019 
2020  memset(&packet2, 0, sizeof(packet2));
2021  mavlink_msg_safety_allowed_area_send(MAVLINK_COMM_1 , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z );
2022  mavlink_msg_safety_allowed_area_decode(last_msg, &packet2);
2023  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2024 }
2025 
2026 static void mavlink_test_attitude_quaternion_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2027 {
2028  mavlink_message_t msg;
2029  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2030  uint16_t i;
2031  mavlink_attitude_quaternion_cov_t packet_in = {
2032  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 }
2033  };
2034  mavlink_attitude_quaternion_cov_t packet1, packet2;
2035  memset(&packet1, 0, sizeof(packet1));
2036  packet1.time_boot_ms = packet_in.time_boot_ms;
2037  packet1.rollspeed = packet_in.rollspeed;
2038  packet1.pitchspeed = packet_in.pitchspeed;
2039  packet1.yawspeed = packet_in.yawspeed;
2040 
2041  mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
2042  mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*9);
2043 
2044 
2045  memset(&packet2, 0, sizeof(packet2));
2046  mavlink_msg_attitude_quaternion_cov_encode(system_id, component_id, &msg, &packet1);
2048  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2049 
2050  memset(&packet2, 0, sizeof(packet2));
2051  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 );
2053  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2054 
2055  memset(&packet2, 0, sizeof(packet2));
2056  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 );
2058  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2059 
2060  memset(&packet2, 0, sizeof(packet2));
2061  mavlink_msg_to_send_buffer(buffer, &msg);
2062  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2063  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2064  }
2065  mavlink_msg_attitude_quaternion_cov_decode(last_msg, &packet2);
2066  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2067 
2068  memset(&packet2, 0, sizeof(packet2));
2069  mavlink_msg_attitude_quaternion_cov_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.q , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.covariance );
2070  mavlink_msg_attitude_quaternion_cov_decode(last_msg, &packet2);
2071  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2072 }
2073 
2074 static void mavlink_test_nav_controller_output(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2075 {
2076  mavlink_message_t msg;
2077  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2078  uint16_t i;
2079  mavlink_nav_controller_output_t packet_in = {
2080  17.0,45.0,73.0,101.0,129.0,18275,18379,18483
2081  };
2082  mavlink_nav_controller_output_t packet1, packet2;
2083  memset(&packet1, 0, sizeof(packet1));
2084  packet1.nav_roll = packet_in.nav_roll;
2085  packet1.nav_pitch = packet_in.nav_pitch;
2086  packet1.alt_error = packet_in.alt_error;
2087  packet1.aspd_error = packet_in.aspd_error;
2088  packet1.xtrack_error = packet_in.xtrack_error;
2089  packet1.nav_bearing = packet_in.nav_bearing;
2090  packet1.target_bearing = packet_in.target_bearing;
2091  packet1.wp_dist = packet_in.wp_dist;
2092 
2093 
2094 
2095  memset(&packet2, 0, sizeof(packet2));
2096  mavlink_msg_nav_controller_output_encode(system_id, component_id, &msg, &packet1);
2098  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2099 
2100  memset(&packet2, 0, sizeof(packet2));
2101  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 );
2103  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2104 
2105  memset(&packet2, 0, sizeof(packet2));
2106  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 );
2108  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2109 
2110  memset(&packet2, 0, sizeof(packet2));
2111  mavlink_msg_to_send_buffer(buffer, &msg);
2112  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2113  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2114  }
2115  mavlink_msg_nav_controller_output_decode(last_msg, &packet2);
2116  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2117 
2118  memset(&packet2, 0, sizeof(packet2));
2119  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 );
2120  mavlink_msg_nav_controller_output_decode(last_msg, &packet2);
2121  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2122 }
2123 
2124 static void mavlink_test_global_position_int_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2125 {
2126  mavlink_message_t msg;
2127  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2128  uint16_t i;
2129  mavlink_global_position_int_cov_t packet_in = {
2130  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
2131  };
2132  mavlink_global_position_int_cov_t packet1, packet2;
2133  memset(&packet1, 0, sizeof(packet1));
2134  packet1.time_utc = packet_in.time_utc;
2135  packet1.time_boot_ms = packet_in.time_boot_ms;
2136  packet1.lat = packet_in.lat;
2137  packet1.lon = packet_in.lon;
2138  packet1.alt = packet_in.alt;
2139  packet1.relative_alt = packet_in.relative_alt;
2140  packet1.vx = packet_in.vx;
2141  packet1.vy = packet_in.vy;
2142  packet1.vz = packet_in.vz;
2143  packet1.estimator_type = packet_in.estimator_type;
2144 
2145  mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*36);
2146 
2147 
2148  memset(&packet2, 0, sizeof(packet2));
2149  mavlink_msg_global_position_int_cov_encode(system_id, component_id, &msg, &packet1);
2151  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2152 
2153  memset(&packet2, 0, sizeof(packet2));
2154  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 );
2156  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2157 
2158  memset(&packet2, 0, sizeof(packet2));
2159  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 );
2161  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2162 
2163  memset(&packet2, 0, sizeof(packet2));
2164  mavlink_msg_to_send_buffer(buffer, &msg);
2165  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2166  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2167  }
2168  mavlink_msg_global_position_int_cov_decode(last_msg, &packet2);
2169  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2170 
2171  memset(&packet2, 0, sizeof(packet2));
2172  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 );
2173  mavlink_msg_global_position_int_cov_decode(last_msg, &packet2);
2174  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2175 }
2176 
2177 static void mavlink_test_local_position_ned_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2178 {
2179  mavlink_message_t msg;
2180  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2181  uint16_t i;
2182  mavlink_local_position_ned_cov_t packet_in = {
2183  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
2184  };
2185  mavlink_local_position_ned_cov_t packet1, packet2;
2186  memset(&packet1, 0, sizeof(packet1));
2187  packet1.time_utc = packet_in.time_utc;
2188  packet1.time_boot_ms = packet_in.time_boot_ms;
2189  packet1.x = packet_in.x;
2190  packet1.y = packet_in.y;
2191  packet1.z = packet_in.z;
2192  packet1.vx = packet_in.vx;
2193  packet1.vy = packet_in.vy;
2194  packet1.vz = packet_in.vz;
2195  packet1.ax = packet_in.ax;
2196  packet1.ay = packet_in.ay;
2197  packet1.az = packet_in.az;
2198  packet1.estimator_type = packet_in.estimator_type;
2199 
2200  mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*45);
2201 
2202 
2203  memset(&packet2, 0, sizeof(packet2));
2204  mavlink_msg_local_position_ned_cov_encode(system_id, component_id, &msg, &packet1);
2206  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2207 
2208  memset(&packet2, 0, sizeof(packet2));
2209  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 );
2211  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2212 
2213  memset(&packet2, 0, sizeof(packet2));
2214  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 );
2216  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2217 
2218  memset(&packet2, 0, sizeof(packet2));
2219  mavlink_msg_to_send_buffer(buffer, &msg);
2220  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2221  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2222  }
2223  mavlink_msg_local_position_ned_cov_decode(last_msg, &packet2);
2224  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2225 
2226  memset(&packet2, 0, sizeof(packet2));
2227  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 );
2228  mavlink_msg_local_position_ned_cov_decode(last_msg, &packet2);
2229  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2230 }
2231 
2232 static void mavlink_test_rc_channels(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2233 {
2234  mavlink_message_t msg;
2235  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2236  uint16_t i;
2237  mavlink_rc_channels_t packet_in = {
2238  963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275,18379,18483,18587,18691,18795,18899,19003,19107,19211,125,192
2239  };
2240  mavlink_rc_channels_t packet1, packet2;
2241  memset(&packet1, 0, sizeof(packet1));
2242  packet1.time_boot_ms = packet_in.time_boot_ms;
2243  packet1.chan1_raw = packet_in.chan1_raw;
2244  packet1.chan2_raw = packet_in.chan2_raw;
2245  packet1.chan3_raw = packet_in.chan3_raw;
2246  packet1.chan4_raw = packet_in.chan4_raw;
2247  packet1.chan5_raw = packet_in.chan5_raw;
2248  packet1.chan6_raw = packet_in.chan6_raw;
2249  packet1.chan7_raw = packet_in.chan7_raw;
2250  packet1.chan8_raw = packet_in.chan8_raw;
2251  packet1.chan9_raw = packet_in.chan9_raw;
2252  packet1.chan10_raw = packet_in.chan10_raw;
2253  packet1.chan11_raw = packet_in.chan11_raw;
2254  packet1.chan12_raw = packet_in.chan12_raw;
2255  packet1.chan13_raw = packet_in.chan13_raw;
2256  packet1.chan14_raw = packet_in.chan14_raw;
2257  packet1.chan15_raw = packet_in.chan15_raw;
2258  packet1.chan16_raw = packet_in.chan16_raw;
2259  packet1.chan17_raw = packet_in.chan17_raw;
2260  packet1.chan18_raw = packet_in.chan18_raw;
2261  packet1.chancount = packet_in.chancount;
2262  packet1.rssi = packet_in.rssi;
2263 
2264 
2265 
2266  memset(&packet2, 0, sizeof(packet2));
2267  mavlink_msg_rc_channels_encode(system_id, component_id, &msg, &packet1);
2268  mavlink_msg_rc_channels_decode(&msg, &packet2);
2269  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2270 
2271  memset(&packet2, 0, sizeof(packet2));
2272  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 );
2273  mavlink_msg_rc_channels_decode(&msg, &packet2);
2274  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2275 
2276  memset(&packet2, 0, sizeof(packet2));
2277  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 );
2278  mavlink_msg_rc_channels_decode(&msg, &packet2);
2279  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2280 
2281  memset(&packet2, 0, sizeof(packet2));
2282  mavlink_msg_to_send_buffer(buffer, &msg);
2283  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2284  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2285  }
2286  mavlink_msg_rc_channels_decode(last_msg, &packet2);
2287  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2288 
2289  memset(&packet2, 0, sizeof(packet2));
2290  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 );
2291  mavlink_msg_rc_channels_decode(last_msg, &packet2);
2292  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2293 }
2294 
2295 static void mavlink_test_request_data_stream(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2296 {
2297  mavlink_message_t msg;
2298  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2299  uint16_t i;
2300  mavlink_request_data_stream_t packet_in = {
2301  17235,139,206,17,84
2302  };
2303  mavlink_request_data_stream_t packet1, packet2;
2304  memset(&packet1, 0, sizeof(packet1));
2305  packet1.req_message_rate = packet_in.req_message_rate;
2306  packet1.target_system = packet_in.target_system;
2307  packet1.target_component = packet_in.target_component;
2308  packet1.req_stream_id = packet_in.req_stream_id;
2309  packet1.start_stop = packet_in.start_stop;
2310 
2311 
2312 
2313  memset(&packet2, 0, sizeof(packet2));
2314  mavlink_msg_request_data_stream_encode(system_id, component_id, &msg, &packet1);
2316  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2317 
2318  memset(&packet2, 0, sizeof(packet2));
2319  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 );
2321  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2322 
2323  memset(&packet2, 0, sizeof(packet2));
2324  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 );
2326  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2327 
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]);
2332  }
2333  mavlink_msg_request_data_stream_decode(last_msg, &packet2);
2334  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2335 
2336  memset(&packet2, 0, sizeof(packet2));
2337  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 );
2338  mavlink_msg_request_data_stream_decode(last_msg, &packet2);
2339  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2340 }
2341 
2342 static void mavlink_test_data_stream(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2343 {
2344  mavlink_message_t msg;
2345  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2346  uint16_t i;
2347  mavlink_data_stream_t packet_in = {
2348  17235,139,206
2349  };
2350  mavlink_data_stream_t packet1, packet2;
2351  memset(&packet1, 0, sizeof(packet1));
2352  packet1.message_rate = packet_in.message_rate;
2353  packet1.stream_id = packet_in.stream_id;
2354  packet1.on_off = packet_in.on_off;
2355 
2356 
2357 
2358  memset(&packet2, 0, sizeof(packet2));
2359  mavlink_msg_data_stream_encode(system_id, component_id, &msg, &packet1);
2360  mavlink_msg_data_stream_decode(&msg, &packet2);
2361  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2362 
2363  memset(&packet2, 0, sizeof(packet2));
2364  mavlink_msg_data_stream_pack(system_id, component_id, &msg , packet1.stream_id , packet1.message_rate , packet1.on_off );
2365  mavlink_msg_data_stream_decode(&msg, &packet2);
2366  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2367 
2368  memset(&packet2, 0, sizeof(packet2));
2369  mavlink_msg_data_stream_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.stream_id , packet1.message_rate , packet1.on_off );
2370  mavlink_msg_data_stream_decode(&msg, &packet2);
2371  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2372 
2373  memset(&packet2, 0, sizeof(packet2));
2374  mavlink_msg_to_send_buffer(buffer, &msg);
2375  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2376  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2377  }
2378  mavlink_msg_data_stream_decode(last_msg, &packet2);
2379  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2380 
2381  memset(&packet2, 0, sizeof(packet2));
2382  mavlink_msg_data_stream_send(MAVLINK_COMM_1 , packet1.stream_id , packet1.message_rate , packet1.on_off );
2383  mavlink_msg_data_stream_decode(last_msg, &packet2);
2384  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2385 }
2386 
2387 static void mavlink_test_manual_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2388 {
2389  mavlink_message_t msg;
2390  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2391  uint16_t i;
2392  mavlink_manual_control_t packet_in = {
2393  17235,17339,17443,17547,17651,163
2394  };
2395  mavlink_manual_control_t packet1, packet2;
2396  memset(&packet1, 0, sizeof(packet1));
2397  packet1.x = packet_in.x;
2398  packet1.y = packet_in.y;
2399  packet1.z = packet_in.z;
2400  packet1.r = packet_in.r;
2401  packet1.buttons = packet_in.buttons;
2402  packet1.target = packet_in.target;
2403 
2404 
2405 
2406  memset(&packet2, 0, sizeof(packet2));
2407  mavlink_msg_manual_control_encode(system_id, component_id, &msg, &packet1);
2408  mavlink_msg_manual_control_decode(&msg, &packet2);
2409  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2410 
2411  memset(&packet2, 0, sizeof(packet2));
2412  mavlink_msg_manual_control_pack(system_id, component_id, &msg , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons );
2413  mavlink_msg_manual_control_decode(&msg, &packet2);
2414  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2415 
2416  memset(&packet2, 0, sizeof(packet2));
2417  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 );
2418  mavlink_msg_manual_control_decode(&msg, &packet2);
2419  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2420 
2421  memset(&packet2, 0, sizeof(packet2));
2422  mavlink_msg_to_send_buffer(buffer, &msg);
2423  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2424  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2425  }
2426  mavlink_msg_manual_control_decode(last_msg, &packet2);
2427  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2428 
2429  memset(&packet2, 0, sizeof(packet2));
2430  mavlink_msg_manual_control_send(MAVLINK_COMM_1 , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons );
2431  mavlink_msg_manual_control_decode(last_msg, &packet2);
2432  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2433 }
2434 
2435 static void mavlink_test_rc_channels_override(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2436 {
2437  mavlink_message_t msg;
2438  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2439  uint16_t i;
2440  mavlink_rc_channels_override_t packet_in = {
2441  17235,17339,17443,17547,17651,17755,17859,17963,53,120
2442  };
2443  mavlink_rc_channels_override_t packet1, packet2;
2444  memset(&packet1, 0, sizeof(packet1));
2445  packet1.chan1_raw = packet_in.chan1_raw;
2446  packet1.chan2_raw = packet_in.chan2_raw;
2447  packet1.chan3_raw = packet_in.chan3_raw;
2448  packet1.chan4_raw = packet_in.chan4_raw;
2449  packet1.chan5_raw = packet_in.chan5_raw;
2450  packet1.chan6_raw = packet_in.chan6_raw;
2451  packet1.chan7_raw = packet_in.chan7_raw;
2452  packet1.chan8_raw = packet_in.chan8_raw;
2453  packet1.target_system = packet_in.target_system;
2454  packet1.target_component = packet_in.target_component;
2455 
2456 
2457 
2458  memset(&packet2, 0, sizeof(packet2));
2459  mavlink_msg_rc_channels_override_encode(system_id, component_id, &msg, &packet1);
2461  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2462 
2463  memset(&packet2, 0, sizeof(packet2));
2464  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 );
2466  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2467 
2468  memset(&packet2, 0, sizeof(packet2));
2469  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 );
2471  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2472 
2473  memset(&packet2, 0, sizeof(packet2));
2474  mavlink_msg_to_send_buffer(buffer, &msg);
2475  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2476  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2477  }
2478  mavlink_msg_rc_channels_override_decode(last_msg, &packet2);
2479  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2480 
2481  memset(&packet2, 0, sizeof(packet2));
2482  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 );
2483  mavlink_msg_rc_channels_override_decode(last_msg, &packet2);
2484  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2485 }
2486 
2487 static void mavlink_test_mission_item_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2488 {
2489  mavlink_message_t msg;
2490  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2491  uint16_t i;
2492  mavlink_mission_item_int_t packet_in = {
2493  17.0,45.0,73.0,101.0,963498296,963498504,185.0,18691,18795,101,168,235,46,113
2494  };
2495  mavlink_mission_item_int_t packet1, packet2;
2496  memset(&packet1, 0, sizeof(packet1));
2497  packet1.param1 = packet_in.param1;
2498  packet1.param2 = packet_in.param2;
2499  packet1.param3 = packet_in.param3;
2500  packet1.param4 = packet_in.param4;
2501  packet1.x = packet_in.x;
2502  packet1.y = packet_in.y;
2503  packet1.z = packet_in.z;
2504  packet1.seq = packet_in.seq;
2505  packet1.command = packet_in.command;
2506  packet1.target_system = packet_in.target_system;
2507  packet1.target_component = packet_in.target_component;
2508  packet1.frame = packet_in.frame;
2509  packet1.current = packet_in.current;
2510  packet1.autocontinue = packet_in.autocontinue;
2511 
2512 
2513 
2514  memset(&packet2, 0, sizeof(packet2));
2515  mavlink_msg_mission_item_int_encode(system_id, component_id, &msg, &packet1);
2516  mavlink_msg_mission_item_int_decode(&msg, &packet2);
2517  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2518 
2519  memset(&packet2, 0, sizeof(packet2));
2520  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 );
2521  mavlink_msg_mission_item_int_decode(&msg, &packet2);
2522  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2523 
2524  memset(&packet2, 0, sizeof(packet2));
2525  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 );
2526  mavlink_msg_mission_item_int_decode(&msg, &packet2);
2527  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2528 
2529  memset(&packet2, 0, sizeof(packet2));
2530  mavlink_msg_to_send_buffer(buffer, &msg);
2531  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2532  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2533  }
2534  mavlink_msg_mission_item_int_decode(last_msg, &packet2);
2535  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2536 
2537  memset(&packet2, 0, sizeof(packet2));
2538  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 );
2539  mavlink_msg_mission_item_int_decode(last_msg, &packet2);
2540  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2541 }
2542 
2543 static void mavlink_test_vfr_hud(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2544 {
2545  mavlink_message_t msg;
2546  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2547  uint16_t i;
2548  mavlink_vfr_hud_t packet_in = {
2549  17.0,45.0,73.0,101.0,18067,18171
2550  };
2551  mavlink_vfr_hud_t packet1, packet2;
2552  memset(&packet1, 0, sizeof(packet1));
2553  packet1.airspeed = packet_in.airspeed;
2554  packet1.groundspeed = packet_in.groundspeed;
2555  packet1.alt = packet_in.alt;
2556  packet1.climb = packet_in.climb;
2557  packet1.heading = packet_in.heading;
2558  packet1.throttle = packet_in.throttle;
2559 
2560 
2561 
2562  memset(&packet2, 0, sizeof(packet2));
2563  mavlink_msg_vfr_hud_encode(system_id, component_id, &msg, &packet1);
2564  mavlink_msg_vfr_hud_decode(&msg, &packet2);
2565  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2566 
2567  memset(&packet2, 0, sizeof(packet2));
2568  mavlink_msg_vfr_hud_pack(system_id, component_id, &msg , packet1.airspeed , packet1.groundspeed , packet1.heading , packet1.throttle , packet1.alt , packet1.climb );
2569  mavlink_msg_vfr_hud_decode(&msg, &packet2);
2570  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2571 
2572  memset(&packet2, 0, sizeof(packet2));
2573  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 );
2574  mavlink_msg_vfr_hud_decode(&msg, &packet2);
2575  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2576 
2577  memset(&packet2, 0, sizeof(packet2));
2578  mavlink_msg_to_send_buffer(buffer, &msg);
2579  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2580  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2581  }
2582  mavlink_msg_vfr_hud_decode(last_msg, &packet2);
2583  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2584 
2585  memset(&packet2, 0, sizeof(packet2));
2586  mavlink_msg_vfr_hud_send(MAVLINK_COMM_1 , packet1.airspeed , packet1.groundspeed , packet1.heading , packet1.throttle , packet1.alt , packet1.climb );
2587  mavlink_msg_vfr_hud_decode(last_msg, &packet2);
2588  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2589 }
2590 
2591 static void mavlink_test_command_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2592 {
2593  mavlink_message_t msg;
2594  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2595  uint16_t i;
2596  mavlink_command_int_t packet_in = {
2597  17.0,45.0,73.0,101.0,963498296,963498504,185.0,18691,223,34,101,168,235
2598  };
2599  mavlink_command_int_t packet1, packet2;
2600  memset(&packet1, 0, sizeof(packet1));
2601  packet1.param1 = packet_in.param1;
2602  packet1.param2 = packet_in.param2;
2603  packet1.param3 = packet_in.param3;
2604  packet1.param4 = packet_in.param4;
2605  packet1.x = packet_in.x;
2606  packet1.y = packet_in.y;
2607  packet1.z = packet_in.z;
2608  packet1.command = packet_in.command;
2609  packet1.target_system = packet_in.target_system;
2610  packet1.target_component = packet_in.target_component;
2611  packet1.frame = packet_in.frame;
2612  packet1.current = packet_in.current;
2613  packet1.autocontinue = packet_in.autocontinue;
2614 
2615 
2616 
2617  memset(&packet2, 0, sizeof(packet2));
2618  mavlink_msg_command_int_encode(system_id, component_id, &msg, &packet1);
2619  mavlink_msg_command_int_decode(&msg, &packet2);
2620  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2621 
2622  memset(&packet2, 0, sizeof(packet2));
2623  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 );
2624  mavlink_msg_command_int_decode(&msg, &packet2);
2625  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2626 
2627  memset(&packet2, 0, sizeof(packet2));
2628  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 );
2629  mavlink_msg_command_int_decode(&msg, &packet2);
2630  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2631 
2632  memset(&packet2, 0, sizeof(packet2));
2633  mavlink_msg_to_send_buffer(buffer, &msg);
2634  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2635  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2636  }
2637  mavlink_msg_command_int_decode(last_msg, &packet2);
2638  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2639 
2640  memset(&packet2, 0, sizeof(packet2));
2641  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 );
2642  mavlink_msg_command_int_decode(last_msg, &packet2);
2643  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2644 }
2645 
2646 static void mavlink_test_command_long(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2647 {
2648  mavlink_message_t msg;
2649  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2650  uint16_t i;
2651  mavlink_command_long_t packet_in = {
2652  17.0,45.0,73.0,101.0,129.0,157.0,185.0,18691,223,34,101
2653  };
2654  mavlink_command_long_t packet1, packet2;
2655  memset(&packet1, 0, sizeof(packet1));
2656  packet1.param1 = packet_in.param1;
2657  packet1.param2 = packet_in.param2;
2658  packet1.param3 = packet_in.param3;
2659  packet1.param4 = packet_in.param4;
2660  packet1.param5 = packet_in.param5;
2661  packet1.param6 = packet_in.param6;
2662  packet1.param7 = packet_in.param7;
2663  packet1.command = packet_in.command;
2664  packet1.target_system = packet_in.target_system;
2665  packet1.target_component = packet_in.target_component;
2666  packet1.confirmation = packet_in.confirmation;
2667 
2668 
2669 
2670  memset(&packet2, 0, sizeof(packet2));
2671  mavlink_msg_command_long_encode(system_id, component_id, &msg, &packet1);
2672  mavlink_msg_command_long_decode(&msg, &packet2);
2673  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2674 
2675  memset(&packet2, 0, sizeof(packet2));
2676  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 );
2677  mavlink_msg_command_long_decode(&msg, &packet2);
2678  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2679 
2680  memset(&packet2, 0, sizeof(packet2));
2681  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 );
2682  mavlink_msg_command_long_decode(&msg, &packet2);
2683  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2684 
2685  memset(&packet2, 0, sizeof(packet2));
2686  mavlink_msg_to_send_buffer(buffer, &msg);
2687  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2688  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2689  }
2690  mavlink_msg_command_long_decode(last_msg, &packet2);
2691  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2692 
2693  memset(&packet2, 0, sizeof(packet2));
2694  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 );
2695  mavlink_msg_command_long_decode(last_msg, &packet2);
2696  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2697 }
2698 
2699 static void mavlink_test_command_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2700 {
2701  mavlink_message_t msg;
2702  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2703  uint16_t i;
2704  mavlink_command_ack_t packet_in = {
2705  17235,139
2706  };
2707  mavlink_command_ack_t packet1, packet2;
2708  memset(&packet1, 0, sizeof(packet1));
2709  packet1.command = packet_in.command;
2710  packet1.result = packet_in.result;
2711 
2712 
2713 
2714  memset(&packet2, 0, sizeof(packet2));
2715  mavlink_msg_command_ack_encode(system_id, component_id, &msg, &packet1);
2716  mavlink_msg_command_ack_decode(&msg, &packet2);
2717  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2718 
2719  memset(&packet2, 0, sizeof(packet2));
2720  mavlink_msg_command_ack_pack(system_id, component_id, &msg , packet1.command , packet1.result );
2721  mavlink_msg_command_ack_decode(&msg, &packet2);
2722  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2723 
2724  memset(&packet2, 0, sizeof(packet2));
2725  mavlink_msg_command_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.command , packet1.result );
2726  mavlink_msg_command_ack_decode(&msg, &packet2);
2727  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2728 
2729  memset(&packet2, 0, sizeof(packet2));
2730  mavlink_msg_to_send_buffer(buffer, &msg);
2731  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2732  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2733  }
2734  mavlink_msg_command_ack_decode(last_msg, &packet2);
2735  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2736 
2737  memset(&packet2, 0, sizeof(packet2));
2738  mavlink_msg_command_ack_send(MAVLINK_COMM_1 , packet1.command , packet1.result );
2739  mavlink_msg_command_ack_decode(last_msg, &packet2);
2740  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2741 }
2742 
2743 static void mavlink_test_manual_setpoint(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2744 {
2745  mavlink_message_t msg;
2746  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2747  uint16_t i;
2748  mavlink_manual_setpoint_t packet_in = {
2749  963497464,45.0,73.0,101.0,129.0,65,132
2750  };
2751  mavlink_manual_setpoint_t packet1, packet2;
2752  memset(&packet1, 0, sizeof(packet1));
2753  packet1.time_boot_ms = packet_in.time_boot_ms;
2754  packet1.roll = packet_in.roll;
2755  packet1.pitch = packet_in.pitch;
2756  packet1.yaw = packet_in.yaw;
2757  packet1.thrust = packet_in.thrust;
2758  packet1.mode_switch = packet_in.mode_switch;
2759  packet1.manual_override_switch = packet_in.manual_override_switch;
2760 
2761 
2762 
2763  memset(&packet2, 0, sizeof(packet2));
2764  mavlink_msg_manual_setpoint_encode(system_id, component_id, &msg, &packet1);
2765  mavlink_msg_manual_setpoint_decode(&msg, &packet2);
2766  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2767 
2768  memset(&packet2, 0, sizeof(packet2));
2769  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 );
2770  mavlink_msg_manual_setpoint_decode(&msg, &packet2);
2771  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2772 
2773  memset(&packet2, 0, sizeof(packet2));
2774  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 );
2775  mavlink_msg_manual_setpoint_decode(&msg, &packet2);
2776  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2777 
2778  memset(&packet2, 0, sizeof(packet2));
2779  mavlink_msg_to_send_buffer(buffer, &msg);
2780  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2781  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2782  }
2783  mavlink_msg_manual_setpoint_decode(last_msg, &packet2);
2784  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2785 
2786  memset(&packet2, 0, sizeof(packet2));
2787  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 );
2788  mavlink_msg_manual_setpoint_decode(last_msg, &packet2);
2789  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2790 }
2791 
2792 static void mavlink_test_set_attitude_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2793 {
2794  mavlink_message_t msg;
2795  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2796  uint16_t i;
2797  mavlink_set_attitude_target_t packet_in = {
2798  963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,241.0,113,180,247
2799  };
2800  mavlink_set_attitude_target_t packet1, packet2;
2801  memset(&packet1, 0, sizeof(packet1));
2802  packet1.time_boot_ms = packet_in.time_boot_ms;
2803  packet1.body_roll_rate = packet_in.body_roll_rate;
2804  packet1.body_pitch_rate = packet_in.body_pitch_rate;
2805  packet1.body_yaw_rate = packet_in.body_yaw_rate;
2806  packet1.thrust = packet_in.thrust;
2807  packet1.target_system = packet_in.target_system;
2808  packet1.target_component = packet_in.target_component;
2809  packet1.type_mask = packet_in.type_mask;
2810 
2811  mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
2812 
2813 
2814  memset(&packet2, 0, sizeof(packet2));
2815  mavlink_msg_set_attitude_target_encode(system_id, component_id, &msg, &packet1);
2817  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2818 
2819  memset(&packet2, 0, sizeof(packet2));
2820  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 );
2822  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2823 
2824  memset(&packet2, 0, sizeof(packet2));
2825  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 );
2827  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2828 
2829  memset(&packet2, 0, sizeof(packet2));
2830  mavlink_msg_to_send_buffer(buffer, &msg);
2831  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2832  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2833  }
2834  mavlink_msg_set_attitude_target_decode(last_msg, &packet2);
2835  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2836 
2837  memset(&packet2, 0, sizeof(packet2));
2838  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 );
2839  mavlink_msg_set_attitude_target_decode(last_msg, &packet2);
2840  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2841 }
2842 
2843 static void mavlink_test_attitude_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2844 {
2845  mavlink_message_t msg;
2846  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2847  uint16_t i;
2848  mavlink_attitude_target_t packet_in = {
2849  963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,241.0,113
2850  };
2851  mavlink_attitude_target_t packet1, packet2;
2852  memset(&packet1, 0, sizeof(packet1));
2853  packet1.time_boot_ms = packet_in.time_boot_ms;
2854  packet1.body_roll_rate = packet_in.body_roll_rate;
2855  packet1.body_pitch_rate = packet_in.body_pitch_rate;
2856  packet1.body_yaw_rate = packet_in.body_yaw_rate;
2857  packet1.thrust = packet_in.thrust;
2858  packet1.type_mask = packet_in.type_mask;
2859 
2860  mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
2861 
2862 
2863  memset(&packet2, 0, sizeof(packet2));
2864  mavlink_msg_attitude_target_encode(system_id, component_id, &msg, &packet1);
2865  mavlink_msg_attitude_target_decode(&msg, &packet2);
2866  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2867 
2868  memset(&packet2, 0, sizeof(packet2));
2869  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 );
2870  mavlink_msg_attitude_target_decode(&msg, &packet2);
2871  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2872 
2873  memset(&packet2, 0, sizeof(packet2));
2874  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 );
2875  mavlink_msg_attitude_target_decode(&msg, &packet2);
2876  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2877 
2878  memset(&packet2, 0, sizeof(packet2));
2879  mavlink_msg_to_send_buffer(buffer, &msg);
2880  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2881  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2882  }
2883  mavlink_msg_attitude_target_decode(last_msg, &packet2);
2884  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2885 
2886  memset(&packet2, 0, sizeof(packet2));
2887  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 );
2888  mavlink_msg_attitude_target_decode(last_msg, &packet2);
2889  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2890 }
2891 
2892 static void mavlink_test_set_position_target_local_ned(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2893 {
2894  mavlink_message_t msg;
2895  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2896  uint16_t i;
2898  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
2899  };
2900  mavlink_set_position_target_local_ned_t packet1, packet2;
2901  memset(&packet1, 0, sizeof(packet1));
2902  packet1.time_boot_ms = packet_in.time_boot_ms;
2903  packet1.x = packet_in.x;
2904  packet1.y = packet_in.y;
2905  packet1.z = packet_in.z;
2906  packet1.vx = packet_in.vx;
2907  packet1.vy = packet_in.vy;
2908  packet1.vz = packet_in.vz;
2909  packet1.afx = packet_in.afx;
2910  packet1.afy = packet_in.afy;
2911  packet1.afz = packet_in.afz;
2912  packet1.yaw = packet_in.yaw;
2913  packet1.yaw_rate = packet_in.yaw_rate;
2914  packet1.type_mask = packet_in.type_mask;
2915  packet1.target_system = packet_in.target_system;
2916  packet1.target_component = packet_in.target_component;
2917  packet1.coordinate_frame = packet_in.coordinate_frame;
2918 
2919 
2920 
2921  memset(&packet2, 0, sizeof(packet2));
2922  mavlink_msg_set_position_target_local_ned_encode(system_id, component_id, &msg, &packet1);
2924  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2925 
2926  memset(&packet2, 0, sizeof(packet2));
2927  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 );
2929  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2930 
2931  memset(&packet2, 0, sizeof(packet2));
2932  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 );
2934  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2935 
2936  memset(&packet2, 0, sizeof(packet2));
2937  mavlink_msg_to_send_buffer(buffer, &msg);
2938  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2939  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2940  }
2942  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2943 
2944  memset(&packet2, 0, sizeof(packet2));
2945  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 );
2947  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2948 }
2949 
2950 static void mavlink_test_position_target_local_ned(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2951 {
2952  mavlink_message_t msg;
2953  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2954  uint16_t i;
2956  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
2957  };
2958  mavlink_position_target_local_ned_t packet1, packet2;
2959  memset(&packet1, 0, sizeof(packet1));
2960  packet1.time_boot_ms = packet_in.time_boot_ms;
2961  packet1.x = packet_in.x;
2962  packet1.y = packet_in.y;
2963  packet1.z = packet_in.z;
2964  packet1.vx = packet_in.vx;
2965  packet1.vy = packet_in.vy;
2966  packet1.vz = packet_in.vz;
2967  packet1.afx = packet_in.afx;
2968  packet1.afy = packet_in.afy;
2969  packet1.afz = packet_in.afz;
2970  packet1.yaw = packet_in.yaw;
2971  packet1.yaw_rate = packet_in.yaw_rate;
2972  packet1.type_mask = packet_in.type_mask;
2973  packet1.coordinate_frame = packet_in.coordinate_frame;
2974 
2975 
2976 
2977  memset(&packet2, 0, sizeof(packet2));
2978  mavlink_msg_position_target_local_ned_encode(system_id, component_id, &msg, &packet1);
2980  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2981 
2982  memset(&packet2, 0, sizeof(packet2));
2983  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 );
2985  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2986 
2987  memset(&packet2, 0, sizeof(packet2));
2988  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 );
2990  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2991 
2992  memset(&packet2, 0, sizeof(packet2));
2993  mavlink_msg_to_send_buffer(buffer, &msg);
2994  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2995  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2996  }
2998  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2999 
3000  memset(&packet2, 0, sizeof(packet2));
3001  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 );
3003  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3004 }
3005 
3006 static void mavlink_test_set_position_target_global_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3007 {
3008  mavlink_message_t msg;
3009  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3010  uint16_t i;
3012  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
3013  };
3015  memset(&packet1, 0, sizeof(packet1));
3016  packet1.time_boot_ms = packet_in.time_boot_ms;
3017  packet1.lat_int = packet_in.lat_int;
3018  packet1.lon_int = packet_in.lon_int;
3019  packet1.alt = packet_in.alt;
3020  packet1.vx = packet_in.vx;
3021  packet1.vy = packet_in.vy;
3022  packet1.vz = packet_in.vz;
3023  packet1.afx = packet_in.afx;
3024  packet1.afy = packet_in.afy;
3025  packet1.afz = packet_in.afz;
3026  packet1.yaw = packet_in.yaw;
3027  packet1.yaw_rate = packet_in.yaw_rate;
3028  packet1.type_mask = packet_in.type_mask;
3029  packet1.target_system = packet_in.target_system;
3030  packet1.target_component = packet_in.target_component;
3031  packet1.coordinate_frame = packet_in.coordinate_frame;
3032 
3033 
3034 
3035  memset(&packet2, 0, sizeof(packet2));
3036  mavlink_msg_set_position_target_global_int_encode(system_id, component_id, &msg, &packet1);
3038  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3039 
3040  memset(&packet2, 0, sizeof(packet2));
3041  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 );
3043  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3044 
3045  memset(&packet2, 0, sizeof(packet2));
3046  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 );
3048  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3049 
3050  memset(&packet2, 0, sizeof(packet2));
3051  mavlink_msg_to_send_buffer(buffer, &msg);
3052  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3053  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3054  }
3056  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3057 
3058  memset(&packet2, 0, sizeof(packet2));
3059  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 );
3061  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3062 }
3063 
3064 static void mavlink_test_position_target_global_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3065 {
3066  mavlink_message_t msg;
3067  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3068  uint16_t i;
3070  963497464,963497672,963497880,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27
3071  };
3072  mavlink_position_target_global_int_t packet1, packet2;
3073  memset(&packet1, 0, sizeof(packet1));
3074  packet1.time_boot_ms = packet_in.time_boot_ms;
3075  packet1.lat_int = packet_in.lat_int;
3076  packet1.lon_int = packet_in.lon_int;
3077  packet1.alt = packet_in.alt;
3078  packet1.vx = packet_in.vx;
3079  packet1.vy = packet_in.vy;
3080  packet1.vz = packet_in.vz;
3081  packet1.afx = packet_in.afx;
3082  packet1.afy = packet_in.afy;
3083  packet1.afz = packet_in.afz;
3084  packet1.yaw = packet_in.yaw;
3085  packet1.yaw_rate = packet_in.yaw_rate;
3086  packet1.type_mask = packet_in.type_mask;
3087  packet1.coordinate_frame = packet_in.coordinate_frame;
3088 
3089 
3090 
3091  memset(&packet2, 0, sizeof(packet2));
3092  mavlink_msg_position_target_global_int_encode(system_id, component_id, &msg, &packet1);
3094  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3095 
3096  memset(&packet2, 0, sizeof(packet2));
3097  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 );
3099  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3100 
3101  memset(&packet2, 0, sizeof(packet2));
3102  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 );
3104  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3105 
3106  memset(&packet2, 0, sizeof(packet2));
3107  mavlink_msg_to_send_buffer(buffer, &msg);
3108  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3109  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3110  }
3112  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3113 
3114  memset(&packet2, 0, sizeof(packet2));
3115  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 );
3117  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3118 }
3119 
3120 static void mavlink_test_local_position_ned_system_global_offset(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3121 {
3122  mavlink_message_t msg;
3123  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3124  uint16_t i;
3126  963497464,45.0,73.0,101.0,129.0,157.0,185.0
3127  };
3129  memset(&packet1, 0, sizeof(packet1));
3130  packet1.time_boot_ms = packet_in.time_boot_ms;
3131  packet1.x = packet_in.x;
3132  packet1.y = packet_in.y;
3133  packet1.z = packet_in.z;
3134  packet1.roll = packet_in.roll;
3135  packet1.pitch = packet_in.pitch;
3136  packet1.yaw = packet_in.yaw;
3137 
3138 
3139 
3140  memset(&packet2, 0, sizeof(packet2));
3141  mavlink_msg_local_position_ned_system_global_offset_encode(system_id, component_id, &msg, &packet1);
3143  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3144 
3145  memset(&packet2, 0, sizeof(packet2));
3146  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 );
3148  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3149 
3150  memset(&packet2, 0, sizeof(packet2));
3151  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 );
3153  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3154 
3155  memset(&packet2, 0, sizeof(packet2));
3156  mavlink_msg_to_send_buffer(buffer, &msg);
3157  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3158  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3159  }
3161  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3162 
3163  memset(&packet2, 0, sizeof(packet2));
3164  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 );
3166  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3167 }
3168 
3169 static void mavlink_test_hil_state(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3170 {
3171  mavlink_message_t msg;
3172  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3173  uint16_t i;
3174  mavlink_hil_state_t packet_in = {
3175  93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,963499128,963499336,963499544,19523,19627,19731,19835,19939,20043
3176  };
3177  mavlink_hil_state_t packet1, packet2;
3178  memset(&packet1, 0, sizeof(packet1));
3179  packet1.time_usec = packet_in.time_usec;
3180  packet1.roll = packet_in.roll;
3181  packet1.pitch = packet_in.pitch;
3182  packet1.yaw = packet_in.yaw;
3183  packet1.rollspeed = packet_in.rollspeed;
3184  packet1.pitchspeed = packet_in.pitchspeed;
3185  packet1.yawspeed = packet_in.yawspeed;
3186  packet1.lat = packet_in.lat;
3187  packet1.lon = packet_in.lon;
3188  packet1.alt = packet_in.alt;
3189  packet1.vx = packet_in.vx;
3190  packet1.vy = packet_in.vy;
3191  packet1.vz = packet_in.vz;
3192  packet1.xacc = packet_in.xacc;
3193  packet1.yacc = packet_in.yacc;
3194  packet1.zacc = packet_in.zacc;
3195 
3196 
3197 
3198  memset(&packet2, 0, sizeof(packet2));
3199  mavlink_msg_hil_state_encode(system_id, component_id, &msg, &packet1);
3200  mavlink_msg_hil_state_decode(&msg, &packet2);
3201  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3202 
3203  memset(&packet2, 0, sizeof(packet2));
3204  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 );
3205  mavlink_msg_hil_state_decode(&msg, &packet2);
3206  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3207 
3208  memset(&packet2, 0, sizeof(packet2));
3209  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 );
3210  mavlink_msg_hil_state_decode(&msg, &packet2);
3211  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3212 
3213  memset(&packet2, 0, sizeof(packet2));
3214  mavlink_msg_to_send_buffer(buffer, &msg);
3215  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3216  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3217  }
3218  mavlink_msg_hil_state_decode(last_msg, &packet2);
3219  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3220 
3221  memset(&packet2, 0, sizeof(packet2));
3222  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 );
3223  mavlink_msg_hil_state_decode(last_msg, &packet2);
3224  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3225 }
3226 
3227 static void mavlink_test_hil_controls(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3228 {
3229  mavlink_message_t msg;
3230  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3231  uint16_t i;
3232  mavlink_hil_controls_t packet_in = {
3233  93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,125,192
3234  };
3235  mavlink_hil_controls_t packet1, packet2;
3236  memset(&packet1, 0, sizeof(packet1));
3237  packet1.time_usec = packet_in.time_usec;
3238  packet1.roll_ailerons = packet_in.roll_ailerons;
3239  packet1.pitch_elevator = packet_in.pitch_elevator;
3240  packet1.yaw_rudder = packet_in.yaw_rudder;
3241  packet1.throttle = packet_in.throttle;
3242  packet1.aux1 = packet_in.aux1;
3243  packet1.aux2 = packet_in.aux2;
3244  packet1.aux3 = packet_in.aux3;
3245  packet1.aux4 = packet_in.aux4;
3246  packet1.mode = packet_in.mode;
3247  packet1.nav_mode = packet_in.nav_mode;
3248 
3249 
3250 
3251  memset(&packet2, 0, sizeof(packet2));
3252  mavlink_msg_hil_controls_encode(system_id, component_id, &msg, &packet1);
3253  mavlink_msg_hil_controls_decode(&msg, &packet2);
3254  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3255 
3256  memset(&packet2, 0, sizeof(packet2));
3257  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 );
3258  mavlink_msg_hil_controls_decode(&msg, &packet2);
3259  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3260 
3261  memset(&packet2, 0, sizeof(packet2));
3262  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 );
3263  mavlink_msg_hil_controls_decode(&msg, &packet2);
3264  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3265 
3266  memset(&packet2, 0, sizeof(packet2));
3267  mavlink_msg_to_send_buffer(buffer, &msg);
3268  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3269  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3270  }
3271  mavlink_msg_hil_controls_decode(last_msg, &packet2);
3272  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3273 
3274  memset(&packet2, 0, sizeof(packet2));
3275  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 );
3276  mavlink_msg_hil_controls_decode(last_msg, &packet2);
3277  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3278 }
3279 
3280 static void mavlink_test_hil_rc_inputs_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3281 {
3282  mavlink_message_t msg;
3283  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3284  uint16_t i;
3285  mavlink_hil_rc_inputs_raw_t packet_in = {
3286  93372036854775807ULL,17651,17755,17859,17963,18067,18171,18275,18379,18483,18587,18691,18795,101
3287  };
3288  mavlink_hil_rc_inputs_raw_t packet1, packet2;
3289  memset(&packet1, 0, sizeof(packet1));
3290  packet1.time_usec = packet_in.time_usec;
3291  packet1.chan1_raw = packet_in.chan1_raw;
3292  packet1.chan2_raw = packet_in.chan2_raw;
3293  packet1.chan3_raw = packet_in.chan3_raw;
3294  packet1.chan4_raw = packet_in.chan4_raw;
3295  packet1.chan5_raw = packet_in.chan5_raw;
3296  packet1.chan6_raw = packet_in.chan6_raw;
3297  packet1.chan7_raw = packet_in.chan7_raw;
3298  packet1.chan8_raw = packet_in.chan8_raw;
3299  packet1.chan9_raw = packet_in.chan9_raw;
3300  packet1.chan10_raw = packet_in.chan10_raw;
3301  packet1.chan11_raw = packet_in.chan11_raw;
3302  packet1.chan12_raw = packet_in.chan12_raw;
3303  packet1.rssi = packet_in.rssi;
3304 
3305 
3306 
3307  memset(&packet2, 0, sizeof(packet2));
3308  mavlink_msg_hil_rc_inputs_raw_encode(system_id, component_id, &msg, &packet1);
3309  mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2);
3310  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3311 
3312  memset(&packet2, 0, sizeof(packet2));
3313  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 );
3314  mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2);
3315  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3316 
3317  memset(&packet2, 0, sizeof(packet2));
3318  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 );
3319  mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2);
3320  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3321 
3322  memset(&packet2, 0, sizeof(packet2));
3323  mavlink_msg_to_send_buffer(buffer, &msg);
3324  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3325  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3326  }
3327  mavlink_msg_hil_rc_inputs_raw_decode(last_msg, &packet2);
3328  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3329 
3330  memset(&packet2, 0, sizeof(packet2));
3331  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 );
3332  mavlink_msg_hil_rc_inputs_raw_decode(last_msg, &packet2);
3333  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3334 }
3335 
3336 static void mavlink_test_optical_flow(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3337 {
3338  mavlink_message_t msg;
3339  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3340  uint16_t i;
3341  mavlink_optical_flow_t packet_in = {
3342  93372036854775807ULL,73.0,101.0,129.0,18275,18379,77,144
3343  };
3344  mavlink_optical_flow_t packet1, packet2;
3345  memset(&packet1, 0, sizeof(packet1));
3346  packet1.time_usec = packet_in.time_usec;
3347  packet1.flow_comp_m_x = packet_in.flow_comp_m_x;
3348  packet1.flow_comp_m_y = packet_in.flow_comp_m_y;
3349  packet1.ground_distance = packet_in.ground_distance;
3350  packet1.flow_x = packet_in.flow_x;
3351  packet1.flow_y = packet_in.flow_y;
3352  packet1.sensor_id = packet_in.sensor_id;
3353  packet1.quality = packet_in.quality;
3354 
3355 
3356 
3357  memset(&packet2, 0, sizeof(packet2));
3358  mavlink_msg_optical_flow_encode(system_id, component_id, &msg, &packet1);
3359  mavlink_msg_optical_flow_decode(&msg, &packet2);
3360  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3361 
3362  memset(&packet2, 0, sizeof(packet2));
3363  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 );
3364  mavlink_msg_optical_flow_decode(&msg, &packet2);
3365  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3366 
3367  memset(&packet2, 0, sizeof(packet2));
3368  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 );
3369  mavlink_msg_optical_flow_decode(&msg, &packet2);
3370  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3371 
3372  memset(&packet2, 0, sizeof(packet2));
3373  mavlink_msg_to_send_buffer(buffer, &msg);
3374  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3375  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3376  }
3377  mavlink_msg_optical_flow_decode(last_msg, &packet2);
3378  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3379 
3380  memset(&packet2, 0, sizeof(packet2));
3381  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 );
3382  mavlink_msg_optical_flow_decode(last_msg, &packet2);
3383  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3384 }
3385 
3386 static void mavlink_test_global_vision_position_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3387 {
3388  mavlink_message_t msg;
3389  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3390  uint16_t i;
3392  93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0
3393  };
3395  memset(&packet1, 0, sizeof(packet1));
3396  packet1.usec = packet_in.usec;
3397  packet1.x = packet_in.x;
3398  packet1.y = packet_in.y;
3399  packet1.z = packet_in.z;
3400  packet1.roll = packet_in.roll;
3401  packet1.pitch = packet_in.pitch;
3402  packet1.yaw = packet_in.yaw;
3403 
3404 
3405 
3406  memset(&packet2, 0, sizeof(packet2));
3407  mavlink_msg_global_vision_position_estimate_encode(system_id, component_id, &msg, &packet1);
3409  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3410 
3411  memset(&packet2, 0, sizeof(packet2));
3412  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 );
3414  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3415 
3416  memset(&packet2, 0, sizeof(packet2));
3417  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 );
3419  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3420 
3421  memset(&packet2, 0, sizeof(packet2));
3422  mavlink_msg_to_send_buffer(buffer, &msg);
3423  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3424  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3425  }
3427  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3428 
3429  memset(&packet2, 0, sizeof(packet2));
3430  mavlink_msg_global_vision_position_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
3432  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3433 }
3434 
3435 static void mavlink_test_vision_position_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3436 {
3437  mavlink_message_t msg;
3438  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3439  uint16_t i;
3441  93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0
3442  };
3443  mavlink_vision_position_estimate_t packet1, packet2;
3444  memset(&packet1, 0, sizeof(packet1));
3445  packet1.usec = packet_in.usec;
3446  packet1.x = packet_in.x;
3447  packet1.y = packet_in.y;
3448  packet1.z = packet_in.z;
3449  packet1.roll = packet_in.roll;
3450  packet1.pitch = packet_in.pitch;
3451  packet1.yaw = packet_in.yaw;
3452 
3453 
3454 
3455  memset(&packet2, 0, sizeof(packet2));
3456  mavlink_msg_vision_position_estimate_encode(system_id, component_id, &msg, &packet1);
3458  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3459 
3460  memset(&packet2, 0, sizeof(packet2));
3461  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 );
3463  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3464 
3465  memset(&packet2, 0, sizeof(packet2));
3466  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 );
3468  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3469 
3470  memset(&packet2, 0, sizeof(packet2));
3471  mavlink_msg_to_send_buffer(buffer, &msg);
3472  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3473  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3474  }
3475  mavlink_msg_vision_position_estimate_decode(last_msg, &packet2);
3476  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3477 
3478  memset(&packet2, 0, sizeof(packet2));
3479  mavlink_msg_vision_position_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
3480  mavlink_msg_vision_position_estimate_decode(last_msg, &packet2);
3481  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3482 }
3483 
3484 static void mavlink_test_vision_speed_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3485 {
3486  mavlink_message_t msg;
3487  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3488  uint16_t i;
3489  mavlink_vision_speed_estimate_t packet_in = {
3490  93372036854775807ULL,73.0,101.0,129.0
3491  };
3492  mavlink_vision_speed_estimate_t packet1, packet2;
3493  memset(&packet1, 0, sizeof(packet1));
3494  packet1.usec = packet_in.usec;
3495  packet1.x = packet_in.x;
3496  packet1.y = packet_in.y;
3497  packet1.z = packet_in.z;
3498 
3499 
3500 
3501  memset(&packet2, 0, sizeof(packet2));
3502  mavlink_msg_vision_speed_estimate_encode(system_id, component_id, &msg, &packet1);
3504  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3505 
3506  memset(&packet2, 0, sizeof(packet2));
3507  mavlink_msg_vision_speed_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z );
3509  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3510 
3511  memset(&packet2, 0, sizeof(packet2));
3512  mavlink_msg_vision_speed_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z );
3514  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3515 
3516  memset(&packet2, 0, sizeof(packet2));
3517  mavlink_msg_to_send_buffer(buffer, &msg);
3518  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3519  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3520  }
3521  mavlink_msg_vision_speed_estimate_decode(last_msg, &packet2);
3522  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3523 
3524  memset(&packet2, 0, sizeof(packet2));
3525  mavlink_msg_vision_speed_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z );
3526  mavlink_msg_vision_speed_estimate_decode(last_msg, &packet2);
3527  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3528 }
3529 
3530 static void mavlink_test_vicon_position_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3531 {
3532  mavlink_message_t msg;
3533  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3534  uint16_t i;
3535  mavlink_vicon_position_estimate_t packet_in = {
3536  93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0
3537  };
3538  mavlink_vicon_position_estimate_t packet1, packet2;
3539  memset(&packet1, 0, sizeof(packet1));
3540  packet1.usec = packet_in.usec;
3541  packet1.x = packet_in.x;
3542  packet1.y = packet_in.y;
3543  packet1.z = packet_in.z;
3544  packet1.roll = packet_in.roll;
3545  packet1.pitch = packet_in.pitch;
3546  packet1.yaw = packet_in.yaw;
3547 
3548 
3549 
3550  memset(&packet2, 0, sizeof(packet2));
3551  mavlink_msg_vicon_position_estimate_encode(system_id, component_id, &msg, &packet1);
3553  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3554 
3555  memset(&packet2, 0, sizeof(packet2));
3556  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 );
3558  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3559 
3560  memset(&packet2, 0, sizeof(packet2));
3561  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 );
3563  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3564 
3565  memset(&packet2, 0, sizeof(packet2));
3566  mavlink_msg_to_send_buffer(buffer, &msg);
3567  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3568  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3569  }
3570  mavlink_msg_vicon_position_estimate_decode(last_msg, &packet2);
3571  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3572 
3573  memset(&packet2, 0, sizeof(packet2));
3574  mavlink_msg_vicon_position_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
3575  mavlink_msg_vicon_position_estimate_decode(last_msg, &packet2);
3576  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3577 }
3578 
3579 static void mavlink_test_highres_imu(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3580 {
3581  mavlink_message_t msg;
3582  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3583  uint16_t i;
3584  mavlink_highres_imu_t packet_in = {
3585  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
3586  };
3587  mavlink_highres_imu_t packet1, packet2;
3588  memset(&packet1, 0, sizeof(packet1));
3589  packet1.time_usec = packet_in.time_usec;
3590  packet1.xacc = packet_in.xacc;
3591  packet1.yacc = packet_in.yacc;
3592  packet1.zacc = packet_in.zacc;
3593  packet1.xgyro = packet_in.xgyro;
3594  packet1.ygyro = packet_in.ygyro;
3595  packet1.zgyro = packet_in.zgyro;
3596  packet1.xmag = packet_in.xmag;
3597  packet1.ymag = packet_in.ymag;
3598  packet1.zmag = packet_in.zmag;
3599  packet1.abs_pressure = packet_in.abs_pressure;
3600  packet1.diff_pressure = packet_in.diff_pressure;
3601  packet1.pressure_alt = packet_in.pressure_alt;
3602  packet1.temperature = packet_in.temperature;
3603  packet1.fields_updated = packet_in.fields_updated;
3604 
3605 
3606 
3607  memset(&packet2, 0, sizeof(packet2));
3608  mavlink_msg_highres_imu_encode(system_id, component_id, &msg, &packet1);
3609  mavlink_msg_highres_imu_decode(&msg, &packet2);
3610  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3611 
3612  memset(&packet2, 0, sizeof(packet2));
3613  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 );
3614  mavlink_msg_highres_imu_decode(&msg, &packet2);
3615  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3616 
3617  memset(&packet2, 0, sizeof(packet2));
3618  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 );
3619  mavlink_msg_highres_imu_decode(&msg, &packet2);
3620  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3621 
3622  memset(&packet2, 0, sizeof(packet2));
3623  mavlink_msg_to_send_buffer(buffer, &msg);
3624  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3625  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3626  }
3627  mavlink_msg_highres_imu_decode(last_msg, &packet2);
3628  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3629 
3630  memset(&packet2, 0, sizeof(packet2));
3631  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 );
3632  mavlink_msg_highres_imu_decode(last_msg, &packet2);
3633  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3634 }
3635 
3636 static void mavlink_test_optical_flow_rad(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3637 {
3638  mavlink_message_t msg;
3639  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3640  uint16_t i;
3641  mavlink_optical_flow_rad_t packet_in = {
3642  93372036854775807ULL,963497880,101.0,129.0,157.0,185.0,213.0,963499128,269.0,19315,3,70
3643  };
3644  mavlink_optical_flow_rad_t packet1, packet2;
3645  memset(&packet1, 0, sizeof(packet1));
3646  packet1.time_usec = packet_in.time_usec;
3647  packet1.integration_time_us = packet_in.integration_time_us;
3648  packet1.integrated_x = packet_in.integrated_x;
3649  packet1.integrated_y = packet_in.integrated_y;
3650  packet1.integrated_xgyro = packet_in.integrated_xgyro;
3651  packet1.integrated_ygyro = packet_in.integrated_ygyro;
3652  packet1.integrated_zgyro = packet_in.integrated_zgyro;
3653  packet1.time_delta_distance_us = packet_in.time_delta_distance_us;
3654  packet1.distance = packet_in.distance;
3655  packet1.temperature = packet_in.temperature;
3656  packet1.sensor_id = packet_in.sensor_id;
3657  packet1.quality = packet_in.quality;
3658 
3659 
3660 
3661  memset(&packet2, 0, sizeof(packet2));
3662  mavlink_msg_optical_flow_rad_encode(system_id, component_id, &msg, &packet1);
3663  mavlink_msg_optical_flow_rad_decode(&msg, &packet2);
3664  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3665 
3666  memset(&packet2, 0, sizeof(packet2));
3667  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 );
3668  mavlink_msg_optical_flow_rad_decode(&msg, &packet2);
3669  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3670 
3671  memset(&packet2, 0, sizeof(packet2));
3672  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 );
3673  mavlink_msg_optical_flow_rad_decode(&msg, &packet2);
3674  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3675 
3676  memset(&packet2, 0, sizeof(packet2));
3677  mavlink_msg_to_send_buffer(buffer, &msg);
3678  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3679  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3680  }
3681  mavlink_msg_optical_flow_rad_decode(last_msg, &packet2);
3682  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3683 
3684  memset(&packet2, 0, sizeof(packet2));
3685  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 );
3686  mavlink_msg_optical_flow_rad_decode(last_msg, &packet2);
3687  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3688 }
3689 
3690 static void mavlink_test_hil_sensor(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3691 {
3692  mavlink_message_t msg;
3693  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3694  uint16_t i;
3695  mavlink_hil_sensor_t packet_in = {
3696  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
3697  };
3698  mavlink_hil_sensor_t packet1, packet2;
3699  memset(&packet1, 0, sizeof(packet1));
3700  packet1.time_usec = packet_in.time_usec;
3701  packet1.xacc = packet_in.xacc;
3702  packet1.yacc = packet_in.yacc;
3703  packet1.zacc = packet_in.zacc;
3704  packet1.xgyro = packet_in.xgyro;
3705  packet1.ygyro = packet_in.ygyro;
3706  packet1.zgyro = packet_in.zgyro;
3707  packet1.xmag = packet_in.xmag;
3708  packet1.ymag = packet_in.ymag;
3709  packet1.zmag = packet_in.zmag;
3710  packet1.abs_pressure = packet_in.abs_pressure;
3711  packet1.diff_pressure = packet_in.diff_pressure;
3712  packet1.pressure_alt = packet_in.pressure_alt;
3713  packet1.temperature = packet_in.temperature;
3714  packet1.fields_updated = packet_in.fields_updated;
3715 
3716 
3717 
3718  memset(&packet2, 0, sizeof(packet2));
3719  mavlink_msg_hil_sensor_encode(system_id, component_id, &msg, &packet1);
3720  mavlink_msg_hil_sensor_decode(&msg, &packet2);
3721  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3722 
3723  memset(&packet2, 0, sizeof(packet2));
3724  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 );
3725  mavlink_msg_hil_sensor_decode(&msg, &packet2);
3726  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3727 
3728  memset(&packet2, 0, sizeof(packet2));
3729  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 );
3730  mavlink_msg_hil_sensor_decode(&msg, &packet2);
3731  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3732 
3733  memset(&packet2, 0, sizeof(packet2));
3734  mavlink_msg_to_send_buffer(buffer, &msg);
3735  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3736  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3737  }
3738  mavlink_msg_hil_sensor_decode(last_msg, &packet2);
3739  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3740 
3741  memset(&packet2, 0, sizeof(packet2));
3742  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 );
3743  mavlink_msg_hil_sensor_decode(last_msg, &packet2);
3744  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3745 }
3746 
3747 static void mavlink_test_sim_state(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3748 {
3749  mavlink_message_t msg;
3750  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3751  uint16_t i;
3752  mavlink_sim_state_t packet_in = {
3753  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
3754  };
3755  mavlink_sim_state_t packet1, packet2;
3756  memset(&packet1, 0, sizeof(packet1));
3757  packet1.q1 = packet_in.q1;
3758  packet1.q2 = packet_in.q2;
3759  packet1.q3 = packet_in.q3;
3760  packet1.q4 = packet_in.q4;
3761  packet1.roll = packet_in.roll;
3762  packet1.pitch = packet_in.pitch;
3763  packet1.yaw = packet_in.yaw;
3764  packet1.xacc = packet_in.xacc;
3765  packet1.yacc = packet_in.yacc;
3766  packet1.zacc = packet_in.zacc;
3767  packet1.xgyro = packet_in.xgyro;
3768  packet1.ygyro = packet_in.ygyro;
3769  packet1.