NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
testsuite.h
Go to the documentation of this file.
1 
5 #ifndef ARDUPILOTMEGA_TESTSUITE_H
6 #define ARDUPILOTMEGA_TESTSUITE_H
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 #ifndef MAVLINK_TEST_ALL
13 #define MAVLINK_TEST_ALL
14 static void mavlink_test_common(uint8_t, uint8_t, mavlink_message_t *last_msg);
15 static void mavlink_test_ardupilotmega(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  mavlink_test_common(system_id, component_id, last_msg);
20  mavlink_test_ardupilotmega(system_id, component_id, last_msg);
21 }
22 #endif
23 
24 #include "../common/testsuite.h"
25 
26 
27 static void mavlink_test_sensor_offsets(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
28 {
29  mavlink_message_t msg;
30  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
31  uint16_t i;
32  mavlink_sensor_offsets_t packet_in = {
33  17.0,963497672,963497880,101.0,129.0,157.0,185.0,213.0,241.0,19107,19211,19315
34  };
35  mavlink_sensor_offsets_t packet1, packet2;
36  memset(&packet1, 0, sizeof(packet1));
37  packet1.mag_declination = packet_in.mag_declination;
38  packet1.raw_press = packet_in.raw_press;
39  packet1.raw_temp = packet_in.raw_temp;
40  packet1.gyro_cal_x = packet_in.gyro_cal_x;
41  packet1.gyro_cal_y = packet_in.gyro_cal_y;
42  packet1.gyro_cal_z = packet_in.gyro_cal_z;
43  packet1.accel_cal_x = packet_in.accel_cal_x;
44  packet1.accel_cal_y = packet_in.accel_cal_y;
45  packet1.accel_cal_z = packet_in.accel_cal_z;
46  packet1.mag_ofs_x = packet_in.mag_ofs_x;
47  packet1.mag_ofs_y = packet_in.mag_ofs_y;
48  packet1.mag_ofs_z = packet_in.mag_ofs_z;
49 
50 
51 
52  memset(&packet2, 0, sizeof(packet2));
53  mavlink_msg_sensor_offsets_encode(system_id, component_id, &msg, &packet1);
54  mavlink_msg_sensor_offsets_decode(&msg, &packet2);
55  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
56 
57  memset(&packet2, 0, sizeof(packet2));
58  mavlink_msg_sensor_offsets_pack(system_id, component_id, &msg , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z , packet1.mag_declination , packet1.raw_press , packet1.raw_temp , packet1.gyro_cal_x , packet1.gyro_cal_y , packet1.gyro_cal_z , packet1.accel_cal_x , packet1.accel_cal_y , packet1.accel_cal_z );
59  mavlink_msg_sensor_offsets_decode(&msg, &packet2);
60  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
61 
62  memset(&packet2, 0, sizeof(packet2));
63  mavlink_msg_sensor_offsets_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z , packet1.mag_declination , packet1.raw_press , packet1.raw_temp , packet1.gyro_cal_x , packet1.gyro_cal_y , packet1.gyro_cal_z , packet1.accel_cal_x , packet1.accel_cal_y , packet1.accel_cal_z );
64  mavlink_msg_sensor_offsets_decode(&msg, &packet2);
65  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
66 
67  memset(&packet2, 0, sizeof(packet2));
68  mavlink_msg_to_send_buffer(buffer, &msg);
69  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
70  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
71  }
72  mavlink_msg_sensor_offsets_decode(last_msg, &packet2);
73  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
74 
75  memset(&packet2, 0, sizeof(packet2));
76  mavlink_msg_sensor_offsets_send(MAVLINK_COMM_1 , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z , packet1.mag_declination , packet1.raw_press , packet1.raw_temp , packet1.gyro_cal_x , packet1.gyro_cal_y , packet1.gyro_cal_z , packet1.accel_cal_x , packet1.accel_cal_y , packet1.accel_cal_z );
77  mavlink_msg_sensor_offsets_decode(last_msg, &packet2);
78  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
79 }
80 
81 static void mavlink_test_set_mag_offsets(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
82 {
83  mavlink_message_t msg;
84  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
85  uint16_t i;
86  mavlink_set_mag_offsets_t packet_in = {
87  17235,17339,17443,151,218
88  };
89  mavlink_set_mag_offsets_t packet1, packet2;
90  memset(&packet1, 0, sizeof(packet1));
91  packet1.mag_ofs_x = packet_in.mag_ofs_x;
92  packet1.mag_ofs_y = packet_in.mag_ofs_y;
93  packet1.mag_ofs_z = packet_in.mag_ofs_z;
94  packet1.target_system = packet_in.target_system;
95  packet1.target_component = packet_in.target_component;
96 
97 
98 
99  memset(&packet2, 0, sizeof(packet2));
100  mavlink_msg_set_mag_offsets_encode(system_id, component_id, &msg, &packet1);
101  mavlink_msg_set_mag_offsets_decode(&msg, &packet2);
102  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
103 
104  memset(&packet2, 0, sizeof(packet2));
105  mavlink_msg_set_mag_offsets_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z );
106  mavlink_msg_set_mag_offsets_decode(&msg, &packet2);
107  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
108 
109  memset(&packet2, 0, sizeof(packet2));
110  mavlink_msg_set_mag_offsets_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z );
111  mavlink_msg_set_mag_offsets_decode(&msg, &packet2);
112  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
113 
114  memset(&packet2, 0, sizeof(packet2));
115  mavlink_msg_to_send_buffer(buffer, &msg);
116  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
117  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
118  }
119  mavlink_msg_set_mag_offsets_decode(last_msg, &packet2);
120  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
121 
122  memset(&packet2, 0, sizeof(packet2));
123  mavlink_msg_set_mag_offsets_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z );
124  mavlink_msg_set_mag_offsets_decode(last_msg, &packet2);
125  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
126 }
127 
128 static void mavlink_test_meminfo(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
129 {
130  mavlink_message_t msg;
131  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
132  uint16_t i;
133  mavlink_meminfo_t packet_in = {
134  17235,17339
135  };
136  mavlink_meminfo_t packet1, packet2;
137  memset(&packet1, 0, sizeof(packet1));
138  packet1.brkval = packet_in.brkval;
139  packet1.freemem = packet_in.freemem;
140 
141 
142 
143  memset(&packet2, 0, sizeof(packet2));
144  mavlink_msg_meminfo_encode(system_id, component_id, &msg, &packet1);
145  mavlink_msg_meminfo_decode(&msg, &packet2);
146  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
147 
148  memset(&packet2, 0, sizeof(packet2));
149  mavlink_msg_meminfo_pack(system_id, component_id, &msg , packet1.brkval , packet1.freemem );
150  mavlink_msg_meminfo_decode(&msg, &packet2);
151  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
152 
153  memset(&packet2, 0, sizeof(packet2));
154  mavlink_msg_meminfo_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.brkval , packet1.freemem );
155  mavlink_msg_meminfo_decode(&msg, &packet2);
156  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
157 
158  memset(&packet2, 0, sizeof(packet2));
159  mavlink_msg_to_send_buffer(buffer, &msg);
160  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
161  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
162  }
163  mavlink_msg_meminfo_decode(last_msg, &packet2);
164  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
165 
166  memset(&packet2, 0, sizeof(packet2));
167  mavlink_msg_meminfo_send(MAVLINK_COMM_1 , packet1.brkval , packet1.freemem );
168  mavlink_msg_meminfo_decode(last_msg, &packet2);
169  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
170 }
171 
172 static void mavlink_test_ap_adc(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
173 {
174  mavlink_message_t msg;
175  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
176  uint16_t i;
177  mavlink_ap_adc_t packet_in = {
178  17235,17339,17443,17547,17651,17755
179  };
180  mavlink_ap_adc_t packet1, packet2;
181  memset(&packet1, 0, sizeof(packet1));
182  packet1.adc1 = packet_in.adc1;
183  packet1.adc2 = packet_in.adc2;
184  packet1.adc3 = packet_in.adc3;
185  packet1.adc4 = packet_in.adc4;
186  packet1.adc5 = packet_in.adc5;
187  packet1.adc6 = packet_in.adc6;
188 
189 
190 
191  memset(&packet2, 0, sizeof(packet2));
192  mavlink_msg_ap_adc_encode(system_id, component_id, &msg, &packet1);
193  mavlink_msg_ap_adc_decode(&msg, &packet2);
194  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
195 
196  memset(&packet2, 0, sizeof(packet2));
197  mavlink_msg_ap_adc_pack(system_id, component_id, &msg , packet1.adc1 , packet1.adc2 , packet1.adc3 , packet1.adc4 , packet1.adc5 , packet1.adc6 );
198  mavlink_msg_ap_adc_decode(&msg, &packet2);
199  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
200 
201  memset(&packet2, 0, sizeof(packet2));
202  mavlink_msg_ap_adc_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.adc1 , packet1.adc2 , packet1.adc3 , packet1.adc4 , packet1.adc5 , packet1.adc6 );
203  mavlink_msg_ap_adc_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_ap_adc_decode(last_msg, &packet2);
212  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
213 
214  memset(&packet2, 0, sizeof(packet2));
215  mavlink_msg_ap_adc_send(MAVLINK_COMM_1 , packet1.adc1 , packet1.adc2 , packet1.adc3 , packet1.adc4 , packet1.adc5 , packet1.adc6 );
216  mavlink_msg_ap_adc_decode(last_msg, &packet2);
217  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
218 }
219 
220 static void mavlink_test_digicam_configure(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
221 {
222  mavlink_message_t msg;
223  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
224  uint16_t i;
225  mavlink_digicam_configure_t packet_in = {
226  17.0,17443,151,218,29,96,163,230,41,108,175
227  };
228  mavlink_digicam_configure_t packet1, packet2;
229  memset(&packet1, 0, sizeof(packet1));
230  packet1.extra_value = packet_in.extra_value;
231  packet1.shutter_speed = packet_in.shutter_speed;
232  packet1.target_system = packet_in.target_system;
233  packet1.target_component = packet_in.target_component;
234  packet1.mode = packet_in.mode;
235  packet1.aperture = packet_in.aperture;
236  packet1.iso = packet_in.iso;
237  packet1.exposure_type = packet_in.exposure_type;
238  packet1.command_id = packet_in.command_id;
239  packet1.engine_cut_off = packet_in.engine_cut_off;
240  packet1.extra_param = packet_in.extra_param;
241 
242 
243 
244  memset(&packet2, 0, sizeof(packet2));
245  mavlink_msg_digicam_configure_encode(system_id, component_id, &msg, &packet1);
246  mavlink_msg_digicam_configure_decode(&msg, &packet2);
247  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
248 
249  memset(&packet2, 0, sizeof(packet2));
250  mavlink_msg_digicam_configure_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.mode , packet1.shutter_speed , packet1.aperture , packet1.iso , packet1.exposure_type , packet1.command_id , packet1.engine_cut_off , packet1.extra_param , packet1.extra_value );
251  mavlink_msg_digicam_configure_decode(&msg, &packet2);
252  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
253 
254  memset(&packet2, 0, sizeof(packet2));
255  mavlink_msg_digicam_configure_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.mode , packet1.shutter_speed , packet1.aperture , packet1.iso , packet1.exposure_type , packet1.command_id , packet1.engine_cut_off , packet1.extra_param , packet1.extra_value );
256  mavlink_msg_digicam_configure_decode(&msg, &packet2);
257  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
258 
259  memset(&packet2, 0, sizeof(packet2));
260  mavlink_msg_to_send_buffer(buffer, &msg);
261  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
262  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
263  }
264  mavlink_msg_digicam_configure_decode(last_msg, &packet2);
265  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
266 
267  memset(&packet2, 0, sizeof(packet2));
268  mavlink_msg_digicam_configure_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.mode , packet1.shutter_speed , packet1.aperture , packet1.iso , packet1.exposure_type , packet1.command_id , packet1.engine_cut_off , packet1.extra_param , packet1.extra_value );
269  mavlink_msg_digicam_configure_decode(last_msg, &packet2);
270  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
271 }
272 
273 static void mavlink_test_digicam_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
274 {
275  mavlink_message_t msg;
276  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
277  uint16_t i;
278  mavlink_digicam_control_t packet_in = {
279  17.0,17,84,151,218,29,96,163,230,41
280  };
281  mavlink_digicam_control_t packet1, packet2;
282  memset(&packet1, 0, sizeof(packet1));
283  packet1.extra_value = packet_in.extra_value;
284  packet1.target_system = packet_in.target_system;
285  packet1.target_component = packet_in.target_component;
286  packet1.session = packet_in.session;
287  packet1.zoom_pos = packet_in.zoom_pos;
288  packet1.zoom_step = packet_in.zoom_step;
289  packet1.focus_lock = packet_in.focus_lock;
290  packet1.shot = packet_in.shot;
291  packet1.command_id = packet_in.command_id;
292  packet1.extra_param = packet_in.extra_param;
293 
294 
295 
296  memset(&packet2, 0, sizeof(packet2));
297  mavlink_msg_digicam_control_encode(system_id, component_id, &msg, &packet1);
298  mavlink_msg_digicam_control_decode(&msg, &packet2);
299  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
300 
301  memset(&packet2, 0, sizeof(packet2));
302  mavlink_msg_digicam_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.session , packet1.zoom_pos , packet1.zoom_step , packet1.focus_lock , packet1.shot , packet1.command_id , packet1.extra_param , packet1.extra_value );
303  mavlink_msg_digicam_control_decode(&msg, &packet2);
304  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
305 
306  memset(&packet2, 0, sizeof(packet2));
307  mavlink_msg_digicam_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.session , packet1.zoom_pos , packet1.zoom_step , packet1.focus_lock , packet1.shot , packet1.command_id , packet1.extra_param , packet1.extra_value );
308  mavlink_msg_digicam_control_decode(&msg, &packet2);
309  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
310 
311  memset(&packet2, 0, sizeof(packet2));
312  mavlink_msg_to_send_buffer(buffer, &msg);
313  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
314  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
315  }
316  mavlink_msg_digicam_control_decode(last_msg, &packet2);
317  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
318 
319  memset(&packet2, 0, sizeof(packet2));
320  mavlink_msg_digicam_control_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.session , packet1.zoom_pos , packet1.zoom_step , packet1.focus_lock , packet1.shot , packet1.command_id , packet1.extra_param , packet1.extra_value );
321  mavlink_msg_digicam_control_decode(last_msg, &packet2);
322  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
323 }
324 
325 static void mavlink_test_mount_configure(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
326 {
327  mavlink_message_t msg;
328  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
329  uint16_t i;
330  mavlink_mount_configure_t packet_in = {
331  5,72,139,206,17,84
332  };
333  mavlink_mount_configure_t packet1, packet2;
334  memset(&packet1, 0, sizeof(packet1));
335  packet1.target_system = packet_in.target_system;
336  packet1.target_component = packet_in.target_component;
337  packet1.mount_mode = packet_in.mount_mode;
338  packet1.stab_roll = packet_in.stab_roll;
339  packet1.stab_pitch = packet_in.stab_pitch;
340  packet1.stab_yaw = packet_in.stab_yaw;
341 
342 
343 
344  memset(&packet2, 0, sizeof(packet2));
345  mavlink_msg_mount_configure_encode(system_id, component_id, &msg, &packet1);
346  mavlink_msg_mount_configure_decode(&msg, &packet2);
347  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
348 
349  memset(&packet2, 0, sizeof(packet2));
350  mavlink_msg_mount_configure_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.mount_mode , packet1.stab_roll , packet1.stab_pitch , packet1.stab_yaw );
351  mavlink_msg_mount_configure_decode(&msg, &packet2);
352  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
353 
354  memset(&packet2, 0, sizeof(packet2));
355  mavlink_msg_mount_configure_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.mount_mode , packet1.stab_roll , packet1.stab_pitch , packet1.stab_yaw );
356  mavlink_msg_mount_configure_decode(&msg, &packet2);
357  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
358 
359  memset(&packet2, 0, sizeof(packet2));
360  mavlink_msg_to_send_buffer(buffer, &msg);
361  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
362  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
363  }
364  mavlink_msg_mount_configure_decode(last_msg, &packet2);
365  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
366 
367  memset(&packet2, 0, sizeof(packet2));
368  mavlink_msg_mount_configure_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.mount_mode , packet1.stab_roll , packet1.stab_pitch , packet1.stab_yaw );
369  mavlink_msg_mount_configure_decode(last_msg, &packet2);
370  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
371 }
372 
373 static void mavlink_test_mount_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
374 {
375  mavlink_message_t msg;
376  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
377  uint16_t i;
378  mavlink_mount_control_t packet_in = {
379  963497464,963497672,963497880,41,108,175
380  };
381  mavlink_mount_control_t packet1, packet2;
382  memset(&packet1, 0, sizeof(packet1));
383  packet1.input_a = packet_in.input_a;
384  packet1.input_b = packet_in.input_b;
385  packet1.input_c = packet_in.input_c;
386  packet1.target_system = packet_in.target_system;
387  packet1.target_component = packet_in.target_component;
388  packet1.save_position = packet_in.save_position;
389 
390 
391 
392  memset(&packet2, 0, sizeof(packet2));
393  mavlink_msg_mount_control_encode(system_id, component_id, &msg, &packet1);
394  mavlink_msg_mount_control_decode(&msg, &packet2);
395  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
396 
397  memset(&packet2, 0, sizeof(packet2));
398  mavlink_msg_mount_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.input_a , packet1.input_b , packet1.input_c , packet1.save_position );
399  mavlink_msg_mount_control_decode(&msg, &packet2);
400  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
401 
402  memset(&packet2, 0, sizeof(packet2));
403  mavlink_msg_mount_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.input_a , packet1.input_b , packet1.input_c , packet1.save_position );
404  mavlink_msg_mount_control_decode(&msg, &packet2);
405  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
406 
407  memset(&packet2, 0, sizeof(packet2));
408  mavlink_msg_to_send_buffer(buffer, &msg);
409  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
410  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
411  }
412  mavlink_msg_mount_control_decode(last_msg, &packet2);
413  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
414 
415  memset(&packet2, 0, sizeof(packet2));
416  mavlink_msg_mount_control_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.input_a , packet1.input_b , packet1.input_c , packet1.save_position );
417  mavlink_msg_mount_control_decode(last_msg, &packet2);
418  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
419 }
420 
421 static void mavlink_test_mount_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
422 {
423  mavlink_message_t msg;
424  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
425  uint16_t i;
426  mavlink_mount_status_t packet_in = {
427  963497464,963497672,963497880,41,108
428  };
429  mavlink_mount_status_t packet1, packet2;
430  memset(&packet1, 0, sizeof(packet1));
431  packet1.pointing_a = packet_in.pointing_a;
432  packet1.pointing_b = packet_in.pointing_b;
433  packet1.pointing_c = packet_in.pointing_c;
434  packet1.target_system = packet_in.target_system;
435  packet1.target_component = packet_in.target_component;
436 
437 
438 
439  memset(&packet2, 0, sizeof(packet2));
440  mavlink_msg_mount_status_encode(system_id, component_id, &msg, &packet1);
441  mavlink_msg_mount_status_decode(&msg, &packet2);
442  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
443 
444  memset(&packet2, 0, sizeof(packet2));
445  mavlink_msg_mount_status_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.pointing_a , packet1.pointing_b , packet1.pointing_c );
446  mavlink_msg_mount_status_decode(&msg, &packet2);
447  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
448 
449  memset(&packet2, 0, sizeof(packet2));
450  mavlink_msg_mount_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.pointing_a , packet1.pointing_b , packet1.pointing_c );
451  mavlink_msg_mount_status_decode(&msg, &packet2);
452  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
453 
454  memset(&packet2, 0, sizeof(packet2));
455  mavlink_msg_to_send_buffer(buffer, &msg);
456  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
457  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
458  }
459  mavlink_msg_mount_status_decode(last_msg, &packet2);
460  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
461 
462  memset(&packet2, 0, sizeof(packet2));
463  mavlink_msg_mount_status_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.pointing_a , packet1.pointing_b , packet1.pointing_c );
464  mavlink_msg_mount_status_decode(last_msg, &packet2);
465  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
466 }
467 
468 static void mavlink_test_fence_point(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
469 {
470  mavlink_message_t msg;
471  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
472  uint16_t i;
473  mavlink_fence_point_t packet_in = {
474  17.0,45.0,29,96,163,230
475  };
476  mavlink_fence_point_t packet1, packet2;
477  memset(&packet1, 0, sizeof(packet1));
478  packet1.lat = packet_in.lat;
479  packet1.lng = packet_in.lng;
480  packet1.target_system = packet_in.target_system;
481  packet1.target_component = packet_in.target_component;
482  packet1.idx = packet_in.idx;
483  packet1.count = packet_in.count;
484 
485 
486 
487  memset(&packet2, 0, sizeof(packet2));
488  mavlink_msg_fence_point_encode(system_id, component_id, &msg, &packet1);
489  mavlink_msg_fence_point_decode(&msg, &packet2);
490  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
491 
492  memset(&packet2, 0, sizeof(packet2));
493  mavlink_msg_fence_point_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng );
494  mavlink_msg_fence_point_decode(&msg, &packet2);
495  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
496 
497  memset(&packet2, 0, sizeof(packet2));
498  mavlink_msg_fence_point_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng );
499  mavlink_msg_fence_point_decode(&msg, &packet2);
500  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
501 
502  memset(&packet2, 0, sizeof(packet2));
503  mavlink_msg_to_send_buffer(buffer, &msg);
504  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
505  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
506  }
507  mavlink_msg_fence_point_decode(last_msg, &packet2);
508  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
509 
510  memset(&packet2, 0, sizeof(packet2));
511  mavlink_msg_fence_point_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng );
512  mavlink_msg_fence_point_decode(last_msg, &packet2);
513  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
514 }
515 
516 static void mavlink_test_fence_fetch_point(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
517 {
518  mavlink_message_t msg;
519  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
520  uint16_t i;
521  mavlink_fence_fetch_point_t packet_in = {
522  5,72,139
523  };
524  mavlink_fence_fetch_point_t packet1, packet2;
525  memset(&packet1, 0, sizeof(packet1));
526  packet1.target_system = packet_in.target_system;
527  packet1.target_component = packet_in.target_component;
528  packet1.idx = packet_in.idx;
529 
530 
531 
532  memset(&packet2, 0, sizeof(packet2));
533  mavlink_msg_fence_fetch_point_encode(system_id, component_id, &msg, &packet1);
534  mavlink_msg_fence_fetch_point_decode(&msg, &packet2);
535  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
536 
537  memset(&packet2, 0, sizeof(packet2));
538  mavlink_msg_fence_fetch_point_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.idx );
539  mavlink_msg_fence_fetch_point_decode(&msg, &packet2);
540  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
541 
542  memset(&packet2, 0, sizeof(packet2));
543  mavlink_msg_fence_fetch_point_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.idx );
544  mavlink_msg_fence_fetch_point_decode(&msg, &packet2);
545  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
546 
547  memset(&packet2, 0, sizeof(packet2));
548  mavlink_msg_to_send_buffer(buffer, &msg);
549  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
550  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
551  }
552  mavlink_msg_fence_fetch_point_decode(last_msg, &packet2);
553  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
554 
555  memset(&packet2, 0, sizeof(packet2));
556  mavlink_msg_fence_fetch_point_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.idx );
557  mavlink_msg_fence_fetch_point_decode(last_msg, &packet2);
558  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
559 }
560 
561 static void mavlink_test_fence_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
562 {
563  mavlink_message_t msg;
564  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
565  uint16_t i;
566  mavlink_fence_status_t packet_in = {
567  963497464,17443,151,218
568  };
569  mavlink_fence_status_t packet1, packet2;
570  memset(&packet1, 0, sizeof(packet1));
571  packet1.breach_time = packet_in.breach_time;
572  packet1.breach_count = packet_in.breach_count;
573  packet1.breach_status = packet_in.breach_status;
574  packet1.breach_type = packet_in.breach_type;
575 
576 
577 
578  memset(&packet2, 0, sizeof(packet2));
579  mavlink_msg_fence_status_encode(system_id, component_id, &msg, &packet1);
580  mavlink_msg_fence_status_decode(&msg, &packet2);
581  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
582 
583  memset(&packet2, 0, sizeof(packet2));
584  mavlink_msg_fence_status_pack(system_id, component_id, &msg , packet1.breach_status , packet1.breach_count , packet1.breach_type , packet1.breach_time );
585  mavlink_msg_fence_status_decode(&msg, &packet2);
586  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
587 
588  memset(&packet2, 0, sizeof(packet2));
589  mavlink_msg_fence_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.breach_status , packet1.breach_count , packet1.breach_type , packet1.breach_time );
590  mavlink_msg_fence_status_decode(&msg, &packet2);
591  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
592 
593  memset(&packet2, 0, sizeof(packet2));
594  mavlink_msg_to_send_buffer(buffer, &msg);
595  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
596  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
597  }
598  mavlink_msg_fence_status_decode(last_msg, &packet2);
599  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
600 
601  memset(&packet2, 0, sizeof(packet2));
602  mavlink_msg_fence_status_send(MAVLINK_COMM_1 , packet1.breach_status , packet1.breach_count , packet1.breach_type , packet1.breach_time );
603  mavlink_msg_fence_status_decode(last_msg, &packet2);
604  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
605 }
606 
607 static void mavlink_test_ahrs(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
608 {
609  mavlink_message_t msg;
610  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
611  uint16_t i;
612  mavlink_ahrs_t packet_in = {
613  17.0,45.0,73.0,101.0,129.0,157.0,185.0
614  };
615  mavlink_ahrs_t packet1, packet2;
616  memset(&packet1, 0, sizeof(packet1));
617  packet1.omegaIx = packet_in.omegaIx;
618  packet1.omegaIy = packet_in.omegaIy;
619  packet1.omegaIz = packet_in.omegaIz;
620  packet1.accel_weight = packet_in.accel_weight;
621  packet1.renorm_val = packet_in.renorm_val;
622  packet1.error_rp = packet_in.error_rp;
623  packet1.error_yaw = packet_in.error_yaw;
624 
625 
626 
627  memset(&packet2, 0, sizeof(packet2));
628  mavlink_msg_ahrs_encode(system_id, component_id, &msg, &packet1);
629  mavlink_msg_ahrs_decode(&msg, &packet2);
630  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
631 
632  memset(&packet2, 0, sizeof(packet2));
633  mavlink_msg_ahrs_pack(system_id, component_id, &msg , packet1.omegaIx , packet1.omegaIy , packet1.omegaIz , packet1.accel_weight , packet1.renorm_val , packet1.error_rp , packet1.error_yaw );
634  mavlink_msg_ahrs_decode(&msg, &packet2);
635  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
636 
637  memset(&packet2, 0, sizeof(packet2));
638  mavlink_msg_ahrs_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.omegaIx , packet1.omegaIy , packet1.omegaIz , packet1.accel_weight , packet1.renorm_val , packet1.error_rp , packet1.error_yaw );
639  mavlink_msg_ahrs_decode(&msg, &packet2);
640  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
641 
642  memset(&packet2, 0, sizeof(packet2));
643  mavlink_msg_to_send_buffer(buffer, &msg);
644  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
645  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
646  }
647  mavlink_msg_ahrs_decode(last_msg, &packet2);
648  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
649 
650  memset(&packet2, 0, sizeof(packet2));
651  mavlink_msg_ahrs_send(MAVLINK_COMM_1 , packet1.omegaIx , packet1.omegaIy , packet1.omegaIz , packet1.accel_weight , packet1.renorm_val , packet1.error_rp , packet1.error_yaw );
652  mavlink_msg_ahrs_decode(last_msg, &packet2);
653  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
654 }
655 
656 static void mavlink_test_simstate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
657 {
658  mavlink_message_t msg;
659  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
660  uint16_t i;
661  mavlink_simstate_t packet_in = {
662  17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,963499336,963499544
663  };
664  mavlink_simstate_t packet1, packet2;
665  memset(&packet1, 0, sizeof(packet1));
666  packet1.roll = packet_in.roll;
667  packet1.pitch = packet_in.pitch;
668  packet1.yaw = packet_in.yaw;
669  packet1.xacc = packet_in.xacc;
670  packet1.yacc = packet_in.yacc;
671  packet1.zacc = packet_in.zacc;
672  packet1.xgyro = packet_in.xgyro;
673  packet1.ygyro = packet_in.ygyro;
674  packet1.zgyro = packet_in.zgyro;
675  packet1.lat = packet_in.lat;
676  packet1.lng = packet_in.lng;
677 
678 
679 
680  memset(&packet2, 0, sizeof(packet2));
681  mavlink_msg_simstate_encode(system_id, component_id, &msg, &packet1);
682  mavlink_msg_simstate_decode(&msg, &packet2);
683  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
684 
685  memset(&packet2, 0, sizeof(packet2));
686  mavlink_msg_simstate_pack(system_id, component_id, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lng );
687  mavlink_msg_simstate_decode(&msg, &packet2);
688  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
689 
690  memset(&packet2, 0, sizeof(packet2));
691  mavlink_msg_simstate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lng );
692  mavlink_msg_simstate_decode(&msg, &packet2);
693  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
694 
695  memset(&packet2, 0, sizeof(packet2));
696  mavlink_msg_to_send_buffer(buffer, &msg);
697  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
698  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
699  }
700  mavlink_msg_simstate_decode(last_msg, &packet2);
701  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
702 
703  memset(&packet2, 0, sizeof(packet2));
704  mavlink_msg_simstate_send(MAVLINK_COMM_1 , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lng );
705  mavlink_msg_simstate_decode(last_msg, &packet2);
706  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
707 }
708 
709 static void mavlink_test_hwstatus(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
710 {
711  mavlink_message_t msg;
712  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
713  uint16_t i;
714  mavlink_hwstatus_t packet_in = {
715  17235,139
716  };
717  mavlink_hwstatus_t packet1, packet2;
718  memset(&packet1, 0, sizeof(packet1));
719  packet1.Vcc = packet_in.Vcc;
720  packet1.I2Cerr = packet_in.I2Cerr;
721 
722 
723 
724  memset(&packet2, 0, sizeof(packet2));
725  mavlink_msg_hwstatus_encode(system_id, component_id, &msg, &packet1);
726  mavlink_msg_hwstatus_decode(&msg, &packet2);
727  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
728 
729  memset(&packet2, 0, sizeof(packet2));
730  mavlink_msg_hwstatus_pack(system_id, component_id, &msg , packet1.Vcc , packet1.I2Cerr );
731  mavlink_msg_hwstatus_decode(&msg, &packet2);
732  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
733 
734  memset(&packet2, 0, sizeof(packet2));
735  mavlink_msg_hwstatus_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.Vcc , packet1.I2Cerr );
736  mavlink_msg_hwstatus_decode(&msg, &packet2);
737  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
738 
739  memset(&packet2, 0, sizeof(packet2));
740  mavlink_msg_to_send_buffer(buffer, &msg);
741  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
742  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
743  }
744  mavlink_msg_hwstatus_decode(last_msg, &packet2);
745  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
746 
747  memset(&packet2, 0, sizeof(packet2));
748  mavlink_msg_hwstatus_send(MAVLINK_COMM_1 , packet1.Vcc , packet1.I2Cerr );
749  mavlink_msg_hwstatus_decode(last_msg, &packet2);
750  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
751 }
752 
753 static void mavlink_test_radio(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
754 {
755  mavlink_message_t msg;
756  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
757  uint16_t i;
758  mavlink_radio_t packet_in = {
759  17235,17339,17,84,151,218,29
760  };
761  mavlink_radio_t packet1, packet2;
762  memset(&packet1, 0, sizeof(packet1));
763  packet1.rxerrors = packet_in.rxerrors;
764  packet1.fixed = packet_in.fixed;
765  packet1.rssi = packet_in.rssi;
766  packet1.remrssi = packet_in.remrssi;
767  packet1.txbuf = packet_in.txbuf;
768  packet1.noise = packet_in.noise;
769  packet1.remnoise = packet_in.remnoise;
770 
771 
772 
773  memset(&packet2, 0, sizeof(packet2));
774  mavlink_msg_radio_encode(system_id, component_id, &msg, &packet1);
775  mavlink_msg_radio_decode(&msg, &packet2);
776  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
777 
778  memset(&packet2, 0, sizeof(packet2));
779  mavlink_msg_radio_pack(system_id, component_id, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
780  mavlink_msg_radio_decode(&msg, &packet2);
781  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
782 
783  memset(&packet2, 0, sizeof(packet2));
784  mavlink_msg_radio_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
785  mavlink_msg_radio_decode(&msg, &packet2);
786  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
787 
788  memset(&packet2, 0, sizeof(packet2));
789  mavlink_msg_to_send_buffer(buffer, &msg);
790  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
791  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
792  }
793  mavlink_msg_radio_decode(last_msg, &packet2);
794  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
795 
796  memset(&packet2, 0, sizeof(packet2));
797  mavlink_msg_radio_send(MAVLINK_COMM_1 , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
798  mavlink_msg_radio_decode(last_msg, &packet2);
799  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
800 }
801 
802 static void mavlink_test_limits_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
803 {
804  mavlink_message_t msg;
805  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
806  uint16_t i;
807  mavlink_limits_status_t packet_in = {
808  963497464,963497672,963497880,963498088,18067,187,254,65,132
809  };
810  mavlink_limits_status_t packet1, packet2;
811  memset(&packet1, 0, sizeof(packet1));
812  packet1.last_trigger = packet_in.last_trigger;
813  packet1.last_action = packet_in.last_action;
814  packet1.last_recovery = packet_in.last_recovery;
815  packet1.last_clear = packet_in.last_clear;
816  packet1.breach_count = packet_in.breach_count;
817  packet1.limits_state = packet_in.limits_state;
818  packet1.mods_enabled = packet_in.mods_enabled;
819  packet1.mods_required = packet_in.mods_required;
820  packet1.mods_triggered = packet_in.mods_triggered;
821 
822 
823 
824  memset(&packet2, 0, sizeof(packet2));
825  mavlink_msg_limits_status_encode(system_id, component_id, &msg, &packet1);
826  mavlink_msg_limits_status_decode(&msg, &packet2);
827  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
828 
829  memset(&packet2, 0, sizeof(packet2));
830  mavlink_msg_limits_status_pack(system_id, component_id, &msg , packet1.limits_state , packet1.last_trigger , packet1.last_action , packet1.last_recovery , packet1.last_clear , packet1.breach_count , packet1.mods_enabled , packet1.mods_required , packet1.mods_triggered );
831  mavlink_msg_limits_status_decode(&msg, &packet2);
832  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
833 
834  memset(&packet2, 0, sizeof(packet2));
835  mavlink_msg_limits_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.limits_state , packet1.last_trigger , packet1.last_action , packet1.last_recovery , packet1.last_clear , packet1.breach_count , packet1.mods_enabled , packet1.mods_required , packet1.mods_triggered );
836  mavlink_msg_limits_status_decode(&msg, &packet2);
837  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
838 
839  memset(&packet2, 0, sizeof(packet2));
840  mavlink_msg_to_send_buffer(buffer, &msg);
841  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
842  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
843  }
844  mavlink_msg_limits_status_decode(last_msg, &packet2);
845  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
846 
847  memset(&packet2, 0, sizeof(packet2));
848  mavlink_msg_limits_status_send(MAVLINK_COMM_1 , packet1.limits_state , packet1.last_trigger , packet1.last_action , packet1.last_recovery , packet1.last_clear , packet1.breach_count , packet1.mods_enabled , packet1.mods_required , packet1.mods_triggered );
849  mavlink_msg_limits_status_decode(last_msg, &packet2);
850  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
851 }
852 
853 static void mavlink_test_wind(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
854 {
855  mavlink_message_t msg;
856  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
857  uint16_t i;
858  mavlink_wind_t packet_in = {
859  17.0,45.0,73.0
860  };
861  mavlink_wind_t packet1, packet2;
862  memset(&packet1, 0, sizeof(packet1));
863  packet1.direction = packet_in.direction;
864  packet1.speed = packet_in.speed;
865  packet1.speed_z = packet_in.speed_z;
866 
867 
868 
869  memset(&packet2, 0, sizeof(packet2));
870  mavlink_msg_wind_encode(system_id, component_id, &msg, &packet1);
871  mavlink_msg_wind_decode(&msg, &packet2);
872  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
873 
874  memset(&packet2, 0, sizeof(packet2));
875  mavlink_msg_wind_pack(system_id, component_id, &msg , packet1.direction , packet1.speed , packet1.speed_z );
876  mavlink_msg_wind_decode(&msg, &packet2);
877  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
878 
879  memset(&packet2, 0, sizeof(packet2));
880  mavlink_msg_wind_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.direction , packet1.speed , packet1.speed_z );
881  mavlink_msg_wind_decode(&msg, &packet2);
882  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
883 
884  memset(&packet2, 0, sizeof(packet2));
885  mavlink_msg_to_send_buffer(buffer, &msg);
886  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
887  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
888  }
889  mavlink_msg_wind_decode(last_msg, &packet2);
890  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
891 
892  memset(&packet2, 0, sizeof(packet2));
893  mavlink_msg_wind_send(MAVLINK_COMM_1 , packet1.direction , packet1.speed , packet1.speed_z );
894  mavlink_msg_wind_decode(last_msg, &packet2);
895  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
896 }
897 
898 static void mavlink_test_data16(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
899 {
900  mavlink_message_t msg;
901  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
902  uint16_t i;
903  mavlink_data16_t packet_in = {
904  5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154 }
905  };
906  mavlink_data16_t packet1, packet2;
907  memset(&packet1, 0, sizeof(packet1));
908  packet1.type = packet_in.type;
909  packet1.len = packet_in.len;
910 
911  mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*16);
912 
913 
914  memset(&packet2, 0, sizeof(packet2));
915  mavlink_msg_data16_encode(system_id, component_id, &msg, &packet1);
916  mavlink_msg_data16_decode(&msg, &packet2);
917  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
918 
919  memset(&packet2, 0, sizeof(packet2));
920  mavlink_msg_data16_pack(system_id, component_id, &msg , packet1.type , packet1.len , packet1.data );
921  mavlink_msg_data16_decode(&msg, &packet2);
922  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
923 
924  memset(&packet2, 0, sizeof(packet2));
925  mavlink_msg_data16_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.len , packet1.data );
926  mavlink_msg_data16_decode(&msg, &packet2);
927  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
928 
929  memset(&packet2, 0, sizeof(packet2));
930  mavlink_msg_to_send_buffer(buffer, &msg);
931  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
932  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
933  }
934  mavlink_msg_data16_decode(last_msg, &packet2);
935  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
936 
937  memset(&packet2, 0, sizeof(packet2));
938  mavlink_msg_data16_send(MAVLINK_COMM_1 , packet1.type , packet1.len , packet1.data );
939  mavlink_msg_data16_decode(last_msg, &packet2);
940  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
941 }
942 
943 static void mavlink_test_data32(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
944 {
945  mavlink_message_t msg;
946  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
947  uint16_t i;
948  mavlink_data32_t packet_in = {
949  5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170 }
950  };
951  mavlink_data32_t packet1, packet2;
952  memset(&packet1, 0, sizeof(packet1));
953  packet1.type = packet_in.type;
954  packet1.len = packet_in.len;
955 
956  mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*32);
957 
958 
959  memset(&packet2, 0, sizeof(packet2));
960  mavlink_msg_data32_encode(system_id, component_id, &msg, &packet1);
961  mavlink_msg_data32_decode(&msg, &packet2);
962  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
963 
964  memset(&packet2, 0, sizeof(packet2));
965  mavlink_msg_data32_pack(system_id, component_id, &msg , packet1.type , packet1.len , packet1.data );
966  mavlink_msg_data32_decode(&msg, &packet2);
967  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
968 
969  memset(&packet2, 0, sizeof(packet2));
970  mavlink_msg_data32_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.len , packet1.data );
971  mavlink_msg_data32_decode(&msg, &packet2);
972  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
973 
974  memset(&packet2, 0, sizeof(packet2));
975  mavlink_msg_to_send_buffer(buffer, &msg);
976  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
977  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
978  }
979  mavlink_msg_data32_decode(last_msg, &packet2);
980  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
981 
982  memset(&packet2, 0, sizeof(packet2));
983  mavlink_msg_data32_send(MAVLINK_COMM_1 , packet1.type , packet1.len , packet1.data );
984  mavlink_msg_data32_decode(last_msg, &packet2);
985  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
986 }
987 
988 static void mavlink_test_data64(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
989 {
990  mavlink_message_t msg;
991  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
992  uint16_t i;
993  mavlink_data64_t packet_in = {
994  5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202 }
995  };
996  mavlink_data64_t packet1, packet2;
997  memset(&packet1, 0, sizeof(packet1));
998  packet1.type = packet_in.type;
999  packet1.len = packet_in.len;
1000 
1001  mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*64);
1002 
1003 
1004  memset(&packet2, 0, sizeof(packet2));
1005  mavlink_msg_data64_encode(system_id, component_id, &msg, &packet1);
1006  mavlink_msg_data64_decode(&msg, &packet2);
1007  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1008 
1009  memset(&packet2, 0, sizeof(packet2));
1010  mavlink_msg_data64_pack(system_id, component_id, &msg , packet1.type , packet1.len , packet1.data );
1011  mavlink_msg_data64_decode(&msg, &packet2);
1012  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1013 
1014  memset(&packet2, 0, sizeof(packet2));
1015  mavlink_msg_data64_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.len , packet1.data );
1016  mavlink_msg_data64_decode(&msg, &packet2);
1017  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1018 
1019  memset(&packet2, 0, sizeof(packet2));
1020  mavlink_msg_to_send_buffer(buffer, &msg);
1021  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1022  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1023  }
1024  mavlink_msg_data64_decode(last_msg, &packet2);
1025  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1026 
1027  memset(&packet2, 0, sizeof(packet2));
1028  mavlink_msg_data64_send(MAVLINK_COMM_1 , packet1.type , packet1.len , packet1.data );
1029  mavlink_msg_data64_decode(last_msg, &packet2);
1030  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1031 }
1032 
1033 static void mavlink_test_data96(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1034 {
1035  mavlink_message_t msg;
1036  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1037  uint16_t i;
1038  mavlink_data96_t packet_in = {
1039  5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234 }
1040  };
1041  mavlink_data96_t packet1, packet2;
1042  memset(&packet1, 0, sizeof(packet1));
1043  packet1.type = packet_in.type;
1044  packet1.len = packet_in.len;
1045 
1046  mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*96);
1047 
1048 
1049  memset(&packet2, 0, sizeof(packet2));
1050  mavlink_msg_data96_encode(system_id, component_id, &msg, &packet1);
1051  mavlink_msg_data96_decode(&msg, &packet2);
1052  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1053 
1054  memset(&packet2, 0, sizeof(packet2));
1055  mavlink_msg_data96_pack(system_id, component_id, &msg , packet1.type , packet1.len , packet1.data );
1056  mavlink_msg_data96_decode(&msg, &packet2);
1057  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1058 
1059  memset(&packet2, 0, sizeof(packet2));
1060  mavlink_msg_data96_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.len , packet1.data );
1061  mavlink_msg_data96_decode(&msg, &packet2);
1062  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1063 
1064  memset(&packet2, 0, sizeof(packet2));
1065  mavlink_msg_to_send_buffer(buffer, &msg);
1066  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1067  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1068  }
1069  mavlink_msg_data96_decode(last_msg, &packet2);
1070  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1071 
1072  memset(&packet2, 0, sizeof(packet2));
1073  mavlink_msg_data96_send(MAVLINK_COMM_1 , packet1.type , packet1.len , packet1.data );
1074  mavlink_msg_data96_decode(last_msg, &packet2);
1075  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1076 }
1077 
1078 static void mavlink_test_rangefinder(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1079 {
1080  mavlink_message_t msg;
1081  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1082  uint16_t i;
1083  mavlink_rangefinder_t packet_in = {
1084  17.0,45.0
1085  };
1086  mavlink_rangefinder_t packet1, packet2;
1087  memset(&packet1, 0, sizeof(packet1));
1088  packet1.distance = packet_in.distance;
1089  packet1.voltage = packet_in.voltage;
1090 
1091 
1092 
1093  memset(&packet2, 0, sizeof(packet2));
1094  mavlink_msg_rangefinder_encode(system_id, component_id, &msg, &packet1);
1095  mavlink_msg_rangefinder_decode(&msg, &packet2);
1096  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1097 
1098  memset(&packet2, 0, sizeof(packet2));
1099  mavlink_msg_rangefinder_pack(system_id, component_id, &msg , packet1.distance , packet1.voltage );
1100  mavlink_msg_rangefinder_decode(&msg, &packet2);
1101  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1102 
1103  memset(&packet2, 0, sizeof(packet2));
1104  mavlink_msg_rangefinder_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.distance , packet1.voltage );
1105  mavlink_msg_rangefinder_decode(&msg, &packet2);
1106  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1107 
1108  memset(&packet2, 0, sizeof(packet2));
1109  mavlink_msg_to_send_buffer(buffer, &msg);
1110  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1111  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1112  }
1113  mavlink_msg_rangefinder_decode(last_msg, &packet2);
1114  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1115 
1116  memset(&packet2, 0, sizeof(packet2));
1117  mavlink_msg_rangefinder_send(MAVLINK_COMM_1 , packet1.distance , packet1.voltage );
1118  mavlink_msg_rangefinder_decode(last_msg, &packet2);
1119  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1120 }
1121 
1122 static void mavlink_test_airspeed_autocal(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1123 {
1124  mavlink_message_t msg;
1125  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1126  uint16_t i;
1127  mavlink_airspeed_autocal_t packet_in = {
1128  17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0
1129  };
1130  mavlink_airspeed_autocal_t packet1, packet2;
1131  memset(&packet1, 0, sizeof(packet1));
1132  packet1.vx = packet_in.vx;
1133  packet1.vy = packet_in.vy;
1134  packet1.vz = packet_in.vz;
1135  packet1.diff_pressure = packet_in.diff_pressure;
1136  packet1.EAS2TAS = packet_in.EAS2TAS;
1137  packet1.ratio = packet_in.ratio;
1138  packet1.state_x = packet_in.state_x;
1139  packet1.state_y = packet_in.state_y;
1140  packet1.state_z = packet_in.state_z;
1141  packet1.Pax = packet_in.Pax;
1142  packet1.Pby = packet_in.Pby;
1143  packet1.Pcz = packet_in.Pcz;
1144 
1145 
1146 
1147  memset(&packet2, 0, sizeof(packet2));
1148  mavlink_msg_airspeed_autocal_encode(system_id, component_id, &msg, &packet1);
1149  mavlink_msg_airspeed_autocal_decode(&msg, &packet2);
1150  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1151 
1152  memset(&packet2, 0, sizeof(packet2));
1153  mavlink_msg_airspeed_autocal_pack(system_id, component_id, &msg , packet1.vx , packet1.vy , packet1.vz , packet1.diff_pressure , packet1.EAS2TAS , packet1.ratio , packet1.state_x , packet1.state_y , packet1.state_z , packet1.Pax , packet1.Pby , packet1.Pcz );
1154  mavlink_msg_airspeed_autocal_decode(&msg, &packet2);
1155  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1156 
1157  memset(&packet2, 0, sizeof(packet2));
1158  mavlink_msg_airspeed_autocal_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.vx , packet1.vy , packet1.vz , packet1.diff_pressure , packet1.EAS2TAS , packet1.ratio , packet1.state_x , packet1.state_y , packet1.state_z , packet1.Pax , packet1.Pby , packet1.Pcz );
1159  mavlink_msg_airspeed_autocal_decode(&msg, &packet2);
1160  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1161 
1162  memset(&packet2, 0, sizeof(packet2));
1163  mavlink_msg_to_send_buffer(buffer, &msg);
1164  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1165  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1166  }
1167  mavlink_msg_airspeed_autocal_decode(last_msg, &packet2);
1168  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1169 
1170  memset(&packet2, 0, sizeof(packet2));
1171  mavlink_msg_airspeed_autocal_send(MAVLINK_COMM_1 , packet1.vx , packet1.vy , packet1.vz , packet1.diff_pressure , packet1.EAS2TAS , packet1.ratio , packet1.state_x , packet1.state_y , packet1.state_z , packet1.Pax , packet1.Pby , packet1.Pcz );
1172  mavlink_msg_airspeed_autocal_decode(last_msg, &packet2);
1173  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1174 }
1175 
1176 static void mavlink_test_rally_point(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1177 {
1178  mavlink_message_t msg;
1179  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1180  uint16_t i;
1181  mavlink_rally_point_t packet_in = {
1182  963497464,963497672,17651,17755,17859,175,242,53,120,187
1183  };
1184  mavlink_rally_point_t packet1, packet2;
1185  memset(&packet1, 0, sizeof(packet1));
1186  packet1.lat = packet_in.lat;
1187  packet1.lng = packet_in.lng;
1188  packet1.alt = packet_in.alt;
1189  packet1.break_alt = packet_in.break_alt;
1190  packet1.land_dir = packet_in.land_dir;
1191  packet1.target_system = packet_in.target_system;
1192  packet1.target_component = packet_in.target_component;
1193  packet1.idx = packet_in.idx;
1194  packet1.count = packet_in.count;
1195  packet1.flags = packet_in.flags;
1196 
1197 
1198 
1199  memset(&packet2, 0, sizeof(packet2));
1200  mavlink_msg_rally_point_encode(system_id, component_id, &msg, &packet1);
1201  mavlink_msg_rally_point_decode(&msg, &packet2);
1202  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1203 
1204  memset(&packet2, 0, sizeof(packet2));
1205  mavlink_msg_rally_point_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng , packet1.alt , packet1.break_alt , packet1.land_dir , packet1.flags );
1206  mavlink_msg_rally_point_decode(&msg, &packet2);
1207  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1208 
1209  memset(&packet2, 0, sizeof(packet2));
1210  mavlink_msg_rally_point_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng , packet1.alt , packet1.break_alt , packet1.land_dir , packet1.flags );
1211  mavlink_msg_rally_point_decode(&msg, &packet2);
1212  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1213 
1214  memset(&packet2, 0, sizeof(packet2));
1215  mavlink_msg_to_send_buffer(buffer, &msg);
1216  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1217  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1218  }
1219  mavlink_msg_rally_point_decode(last_msg, &packet2);
1220  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1221 
1222  memset(&packet2, 0, sizeof(packet2));
1223  mavlink_msg_rally_point_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng , packet1.alt , packet1.break_alt , packet1.land_dir , packet1.flags );
1224  mavlink_msg_rally_point_decode(last_msg, &packet2);
1225  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1226 }
1227 
1228 static void mavlink_test_rally_fetch_point(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1229 {
1230  mavlink_message_t msg;
1231  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1232  uint16_t i;
1233  mavlink_rally_fetch_point_t packet_in = {
1234  5,72,139
1235  };
1236  mavlink_rally_fetch_point_t packet1, packet2;
1237  memset(&packet1, 0, sizeof(packet1));
1238  packet1.target_system = packet_in.target_system;
1239  packet1.target_component = packet_in.target_component;
1240  packet1.idx = packet_in.idx;
1241 
1242 
1243 
1244  memset(&packet2, 0, sizeof(packet2));
1245  mavlink_msg_rally_fetch_point_encode(system_id, component_id, &msg, &packet1);
1246  mavlink_msg_rally_fetch_point_decode(&msg, &packet2);
1247  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1248 
1249  memset(&packet2, 0, sizeof(packet2));
1250  mavlink_msg_rally_fetch_point_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.idx );
1251  mavlink_msg_rally_fetch_point_decode(&msg, &packet2);
1252  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1253 
1254  memset(&packet2, 0, sizeof(packet2));
1255  mavlink_msg_rally_fetch_point_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.idx );
1256  mavlink_msg_rally_fetch_point_decode(&msg, &packet2);
1257  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1258 
1259  memset(&packet2, 0, sizeof(packet2));
1260  mavlink_msg_to_send_buffer(buffer, &msg);
1261  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1262  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1263  }
1264  mavlink_msg_rally_fetch_point_decode(last_msg, &packet2);
1265  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1266 
1267  memset(&packet2, 0, sizeof(packet2));
1268  mavlink_msg_rally_fetch_point_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.idx );
1269  mavlink_msg_rally_fetch_point_decode(last_msg, &packet2);
1270  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1271 }
1272 
1273 static void mavlink_test_compassmot_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1274 {
1275  mavlink_message_t msg;
1276  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1277  uint16_t i;
1278  mavlink_compassmot_status_t packet_in = {
1279  17.0,45.0,73.0,101.0,18067,18171
1280  };
1281  mavlink_compassmot_status_t packet1, packet2;
1282  memset(&packet1, 0, sizeof(packet1));
1283  packet1.current = packet_in.current;
1284  packet1.CompensationX = packet_in.CompensationX;
1285  packet1.CompensationY = packet_in.CompensationY;
1286  packet1.CompensationZ = packet_in.CompensationZ;
1287  packet1.throttle = packet_in.throttle;
1288  packet1.interference = packet_in.interference;
1289 
1290 
1291 
1292  memset(&packet2, 0, sizeof(packet2));
1293  mavlink_msg_compassmot_status_encode(system_id, component_id, &msg, &packet1);
1294  mavlink_msg_compassmot_status_decode(&msg, &packet2);
1295  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1296 
1297  memset(&packet2, 0, sizeof(packet2));
1298  mavlink_msg_compassmot_status_pack(system_id, component_id, &msg , packet1.throttle , packet1.current , packet1.interference , packet1.CompensationX , packet1.CompensationY , packet1.CompensationZ );
1299  mavlink_msg_compassmot_status_decode(&msg, &packet2);
1300  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1301 
1302  memset(&packet2, 0, sizeof(packet2));
1303  mavlink_msg_compassmot_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.throttle , packet1.current , packet1.interference , packet1.CompensationX , packet1.CompensationY , packet1.CompensationZ );
1304  mavlink_msg_compassmot_status_decode(&msg, &packet2);
1305  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1306 
1307  memset(&packet2, 0, sizeof(packet2));
1308  mavlink_msg_to_send_buffer(buffer, &msg);
1309  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1310  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1311  }
1312  mavlink_msg_compassmot_status_decode(last_msg, &packet2);
1313  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1314 
1315  memset(&packet2, 0, sizeof(packet2));
1316  mavlink_msg_compassmot_status_send(MAVLINK_COMM_1 , packet1.throttle , packet1.current , packet1.interference , packet1.CompensationX , packet1.CompensationY , packet1.CompensationZ );
1317  mavlink_msg_compassmot_status_decode(last_msg, &packet2);
1318  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1319 }
1320 
1321 static void mavlink_test_ahrs2(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1322 {
1323  mavlink_message_t msg;
1324  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1325  uint16_t i;
1326  mavlink_ahrs2_t packet_in = {
1327  17.0,45.0,73.0,101.0,963498296,963498504
1328  };
1329  mavlink_ahrs2_t packet1, packet2;
1330  memset(&packet1, 0, sizeof(packet1));
1331  packet1.roll = packet_in.roll;
1332  packet1.pitch = packet_in.pitch;
1333  packet1.yaw = packet_in.yaw;
1334  packet1.altitude = packet_in.altitude;
1335  packet1.lat = packet_in.lat;
1336  packet1.lng = packet_in.lng;
1337 
1338 
1339 
1340  memset(&packet2, 0, sizeof(packet2));
1341  mavlink_msg_ahrs2_encode(system_id, component_id, &msg, &packet1);
1342  mavlink_msg_ahrs2_decode(&msg, &packet2);
1343  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1344 
1345  memset(&packet2, 0, sizeof(packet2));
1346  mavlink_msg_ahrs2_pack(system_id, component_id, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.altitude , packet1.lat , packet1.lng );
1347  mavlink_msg_ahrs2_decode(&msg, &packet2);
1348  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1349 
1350  memset(&packet2, 0, sizeof(packet2));
1351  mavlink_msg_ahrs2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.altitude , packet1.lat , packet1.lng );
1352  mavlink_msg_ahrs2_decode(&msg, &packet2);
1353  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1354 
1355  memset(&packet2, 0, sizeof(packet2));
1356  mavlink_msg_to_send_buffer(buffer, &msg);
1357  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1358  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1359  }
1360  mavlink_msg_ahrs2_decode(last_msg, &packet2);
1361  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1362 
1363  memset(&packet2, 0, sizeof(packet2));
1364  mavlink_msg_ahrs2_send(MAVLINK_COMM_1 , packet1.roll , packet1.pitch , packet1.yaw , packet1.altitude , packet1.lat , packet1.lng );
1365  mavlink_msg_ahrs2_decode(last_msg, &packet2);
1366  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1367 }
1368 
1369 static void mavlink_test_camera_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1370 {
1371  mavlink_message_t msg;
1372  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1373  uint16_t i;
1374  mavlink_camera_status_t packet_in = {
1375  93372036854775807ULL,73.0,101.0,129.0,157.0,18483,211,22,89
1376  };
1377  mavlink_camera_status_t packet1, packet2;
1378  memset(&packet1, 0, sizeof(packet1));
1379  packet1.time_usec = packet_in.time_usec;
1380  packet1.p1 = packet_in.p1;
1381  packet1.p2 = packet_in.p2;
1382  packet1.p3 = packet_in.p3;
1383  packet1.p4 = packet_in.p4;
1384  packet1.img_idx = packet_in.img_idx;
1385  packet1.target_system = packet_in.target_system;
1386  packet1.cam_idx = packet_in.cam_idx;
1387  packet1.event_id = packet_in.event_id;
1388 
1389 
1390 
1391  memset(&packet2, 0, sizeof(packet2));
1392  mavlink_msg_camera_status_encode(system_id, component_id, &msg, &packet1);
1393  mavlink_msg_camera_status_decode(&msg, &packet2);
1394  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1395 
1396  memset(&packet2, 0, sizeof(packet2));
1397  mavlink_msg_camera_status_pack(system_id, component_id, &msg , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.event_id , packet1.p1 , packet1.p2 , packet1.p3 , packet1.p4 );
1398  mavlink_msg_camera_status_decode(&msg, &packet2);
1399  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1400 
1401  memset(&packet2, 0, sizeof(packet2));
1402  mavlink_msg_camera_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.event_id , packet1.p1 , packet1.p2 , packet1.p3 , packet1.p4 );
1403  mavlink_msg_camera_status_decode(&msg, &packet2);
1404  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1405 
1406  memset(&packet2, 0, sizeof(packet2));
1407  mavlink_msg_to_send_buffer(buffer, &msg);
1408  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1409  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1410  }
1411  mavlink_msg_camera_status_decode(last_msg, &packet2);
1412  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1413 
1414  memset(&packet2, 0, sizeof(packet2));
1415  mavlink_msg_camera_status_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.event_id , packet1.p1 , packet1.p2 , packet1.p3 , packet1.p4 );
1416  mavlink_msg_camera_status_decode(last_msg, &packet2);
1417  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1418 }
1419 
1420 static void mavlink_test_camera_feedback(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1421 {
1422  mavlink_message_t msg;
1423  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1424  uint16_t i;
1425  mavlink_camera_feedback_t packet_in = {
1426  93372036854775807ULL,963497880,963498088,129.0,157.0,185.0,213.0,241.0,269.0,19315,3,70,137
1427  };
1428  mavlink_camera_feedback_t packet1, packet2;
1429  memset(&packet1, 0, sizeof(packet1));
1430  packet1.time_usec = packet_in.time_usec;
1431  packet1.lat = packet_in.lat;
1432  packet1.lng = packet_in.lng;
1433  packet1.alt_msl = packet_in.alt_msl;
1434  packet1.alt_rel = packet_in.alt_rel;
1435  packet1.roll = packet_in.roll;
1436  packet1.pitch = packet_in.pitch;
1437  packet1.yaw = packet_in.yaw;
1438  packet1.foc_len = packet_in.foc_len;
1439  packet1.img_idx = packet_in.img_idx;
1440  packet1.target_system = packet_in.target_system;
1441  packet1.cam_idx = packet_in.cam_idx;
1442  packet1.flags = packet_in.flags;
1443 
1444 
1445 
1446  memset(&packet2, 0, sizeof(packet2));
1447  mavlink_msg_camera_feedback_encode(system_id, component_id, &msg, &packet1);
1448  mavlink_msg_camera_feedback_decode(&msg, &packet2);
1449  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1450 
1451  memset(&packet2, 0, sizeof(packet2));
1452  mavlink_msg_camera_feedback_pack(system_id, component_id, &msg , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.lat , packet1.lng , packet1.alt_msl , packet1.alt_rel , packet1.roll , packet1.pitch , packet1.yaw , packet1.foc_len , packet1.flags );
1453  mavlink_msg_camera_feedback_decode(&msg, &packet2);
1454  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1455 
1456  memset(&packet2, 0, sizeof(packet2));
1457  mavlink_msg_camera_feedback_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.lat , packet1.lng , packet1.alt_msl , packet1.alt_rel , packet1.roll , packet1.pitch , packet1.yaw , packet1.foc_len , packet1.flags );
1458  mavlink_msg_camera_feedback_decode(&msg, &packet2);
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_camera_feedback_decode(last_msg, &packet2);
1467  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1468 
1469  memset(&packet2, 0, sizeof(packet2));
1470  mavlink_msg_camera_feedback_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.lat , packet1.lng , packet1.alt_msl , packet1.alt_rel , packet1.roll , packet1.pitch , packet1.yaw , packet1.foc_len , packet1.flags );
1471  mavlink_msg_camera_feedback_decode(last_msg, &packet2);
1472  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1473 }
1474 
1475 static void mavlink_test_battery2(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_battery2_t packet_in = {
1481  17235,17339
1482  };
1483  mavlink_battery2_t packet1, packet2;
1484  memset(&packet1, 0, sizeof(packet1));
1485  packet1.voltage = packet_in.voltage;
1486  packet1.current_battery = packet_in.current_battery;
1487 
1488 
1489 
1490  memset(&packet2, 0, sizeof(packet2));
1491  mavlink_msg_battery2_encode(system_id, component_id, &msg, &packet1);
1492  mavlink_msg_battery2_decode(&msg, &packet2);
1493  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1494 
1495  memset(&packet2, 0, sizeof(packet2));
1496  mavlink_msg_battery2_pack(system_id, component_id, &msg , packet1.voltage , packet1.current_battery );
1497  mavlink_msg_battery2_decode(&msg, &packet2);
1498  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1499 
1500  memset(&packet2, 0, sizeof(packet2));
1501  mavlink_msg_battery2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.voltage , packet1.current_battery );
1502  mavlink_msg_battery2_decode(&msg, &packet2);
1503  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1504 
1505  memset(&packet2, 0, sizeof(packet2));
1506  mavlink_msg_to_send_buffer(buffer, &msg);
1507  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1508  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1509  }
1510  mavlink_msg_battery2_decode(last_msg, &packet2);
1511  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1512 
1513  memset(&packet2, 0, sizeof(packet2));
1514  mavlink_msg_battery2_send(MAVLINK_COMM_1 , packet1.voltage , packet1.current_battery );
1515  mavlink_msg_battery2_decode(last_msg, &packet2);
1516  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1517 }
1518 
1519 static void mavlink_test_ahrs3(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1520 {
1521  mavlink_message_t msg;
1522  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1523  uint16_t i;
1524  mavlink_ahrs3_t packet_in = {
1525  17.0,45.0,73.0,101.0,963498296,963498504,185.0,213.0,241.0,269.0
1526  };
1527  mavlink_ahrs3_t packet1, packet2;
1528  memset(&packet1, 0, sizeof(packet1));
1529  packet1.roll = packet_in.roll;
1530  packet1.pitch = packet_in.pitch;
1531  packet1.yaw = packet_in.yaw;
1532  packet1.altitude = packet_in.altitude;
1533  packet1.lat = packet_in.lat;
1534  packet1.lng = packet_in.lng;
1535  packet1.v1 = packet_in.v1;
1536  packet1.v2 = packet_in.v2;
1537  packet1.v3 = packet_in.v3;
1538  packet1.v4 = packet_in.v4;
1539 
1540 
1541 
1542  memset(&packet2, 0, sizeof(packet2));
1543  mavlink_msg_ahrs3_encode(system_id, component_id, &msg, &packet1);
1544  mavlink_msg_ahrs3_decode(&msg, &packet2);
1545  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1546 
1547  memset(&packet2, 0, sizeof(packet2));
1548  mavlink_msg_ahrs3_pack(system_id, component_id, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.altitude , packet1.lat , packet1.lng , packet1.v1 , packet1.v2 , packet1.v3 , packet1.v4 );
1549  mavlink_msg_ahrs3_decode(&msg, &packet2);
1550  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1551 
1552  memset(&packet2, 0, sizeof(packet2));
1553  mavlink_msg_ahrs3_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.altitude , packet1.lat , packet1.lng , packet1.v1 , packet1.v2 , packet1.v3 , packet1.v4 );
1554  mavlink_msg_ahrs3_decode(&msg, &packet2);
1555  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1556 
1557  memset(&packet2, 0, sizeof(packet2));
1558  mavlink_msg_to_send_buffer(buffer, &msg);
1559  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1560  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1561  }
1562  mavlink_msg_ahrs3_decode(last_msg, &packet2);
1563  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1564 
1565  memset(&packet2, 0, sizeof(packet2));
1566  mavlink_msg_ahrs3_send(MAVLINK_COMM_1 , packet1.roll , packet1.pitch , packet1.yaw , packet1.altitude , packet1.lat , packet1.lng , packet1.v1 , packet1.v2 , packet1.v3 , packet1.v4 );
1567  mavlink_msg_ahrs3_decode(last_msg, &packet2);
1568  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1569 }
1570 
1571 static void mavlink_test_autopilot_version_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1572 {
1573  mavlink_message_t msg;
1574  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1575  uint16_t i;
1577  5,72
1578  };
1579  mavlink_autopilot_version_request_t packet1, packet2;
1580  memset(&packet1, 0, sizeof(packet1));
1581  packet1.target_system = packet_in.target_system;
1582  packet1.target_component = packet_in.target_component;
1583 
1584 
1585 
1586  memset(&packet2, 0, sizeof(packet2));
1587  mavlink_msg_autopilot_version_request_encode(system_id, component_id, &msg, &packet1);
1588  mavlink_msg_autopilot_version_request_decode(&msg, &packet2);
1589  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1590 
1591  memset(&packet2, 0, sizeof(packet2));
1592  mavlink_msg_autopilot_version_request_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
1593  mavlink_msg_autopilot_version_request_decode(&msg, &packet2);
1594  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1595 
1596  memset(&packet2, 0, sizeof(packet2));
1597  mavlink_msg_autopilot_version_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
1598  mavlink_msg_autopilot_version_request_decode(&msg, &packet2);
1599  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1600 
1601  memset(&packet2, 0, sizeof(packet2));
1602  mavlink_msg_to_send_buffer(buffer, &msg);
1603  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1604  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1605  }
1606  mavlink_msg_autopilot_version_request_decode(last_msg, &packet2);
1607  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1608 
1609  memset(&packet2, 0, sizeof(packet2));
1610  mavlink_msg_autopilot_version_request_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
1611  mavlink_msg_autopilot_version_request_decode(last_msg, &packet2);
1612  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1613 }
1614 
1615 static void mavlink_test_led_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1616 {
1617  mavlink_message_t msg;
1618  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1619  uint16_t i;
1620  mavlink_led_control_t packet_in = {
1621  5,72,139,206,17,{ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107 }
1622  };
1623  mavlink_led_control_t packet1, packet2;
1624  memset(&packet1, 0, sizeof(packet1));
1625  packet1.target_system = packet_in.target_system;
1626  packet1.target_component = packet_in.target_component;
1627  packet1.instance = packet_in.instance;
1628  packet1.pattern = packet_in.pattern;
1629  packet1.custom_len = packet_in.custom_len;
1630 
1631  mav_array_memcpy(packet1.custom_bytes, packet_in.custom_bytes, sizeof(uint8_t)*24);
1632 
1633 
1634  memset(&packet2, 0, sizeof(packet2));
1635  mavlink_msg_led_control_encode(system_id, component_id, &msg, &packet1);
1636  mavlink_msg_led_control_decode(&msg, &packet2);
1637  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1638 
1639  memset(&packet2, 0, sizeof(packet2));
1640  mavlink_msg_led_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.instance , packet1.pattern , packet1.custom_len , packet1.custom_bytes );
1641  mavlink_msg_led_control_decode(&msg, &packet2);
1642  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1643 
1644  memset(&packet2, 0, sizeof(packet2));
1645  mavlink_msg_led_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.instance , packet1.pattern , packet1.custom_len , packet1.custom_bytes );
1646  mavlink_msg_led_control_decode(&msg, &packet2);
1647  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1648 
1649  memset(&packet2, 0, sizeof(packet2));
1650  mavlink_msg_to_send_buffer(buffer, &msg);
1651  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1652  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1653  }
1654  mavlink_msg_led_control_decode(last_msg, &packet2);
1655  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1656 
1657  memset(&packet2, 0, sizeof(packet2));
1658  mavlink_msg_led_control_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.instance , packet1.pattern , packet1.custom_len , packet1.custom_bytes );
1659  mavlink_msg_led_control_decode(last_msg, &packet2);
1660  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1661 }
1662 
1663 static void mavlink_test_mag_cal_progress(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1664 {
1665  mavlink_message_t msg;
1666  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1667  uint16_t i;
1668  mavlink_mag_cal_progress_t packet_in = {
1669  17.0,45.0,73.0,41,108,175,242,53,{ 120, 121, 122, 123, 124, 125, 126, 127, 128, 129 }
1670  };
1671  mavlink_mag_cal_progress_t packet1, packet2;
1672  memset(&packet1, 0, sizeof(packet1));
1673  packet1.direction_x = packet_in.direction_x;
1674  packet1.direction_y = packet_in.direction_y;
1675  packet1.direction_z = packet_in.direction_z;
1676  packet1.compass_id = packet_in.compass_id;
1677  packet1.cal_mask = packet_in.cal_mask;
1678  packet1.cal_status = packet_in.cal_status;
1679  packet1.attempt = packet_in.attempt;
1680  packet1.completion_pct = packet_in.completion_pct;
1681 
1682  mav_array_memcpy(packet1.completion_mask, packet_in.completion_mask, sizeof(uint8_t)*10);
1683 
1684 
1685  memset(&packet2, 0, sizeof(packet2));
1686  mavlink_msg_mag_cal_progress_encode(system_id, component_id, &msg, &packet1);
1687  mavlink_msg_mag_cal_progress_decode(&msg, &packet2);
1688  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1689 
1690  memset(&packet2, 0, sizeof(packet2));
1691  mavlink_msg_mag_cal_progress_pack(system_id, component_id, &msg , packet1.compass_id , packet1.cal_mask , packet1.cal_status , packet1.attempt , packet1.completion_pct , packet1.completion_mask , packet1.direction_x , packet1.direction_y , packet1.direction_z );
1692  mavlink_msg_mag_cal_progress_decode(&msg, &packet2);
1693  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1694 
1695  memset(&packet2, 0, sizeof(packet2));
1696  mavlink_msg_mag_cal_progress_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.compass_id , packet1.cal_mask , packet1.cal_status , packet1.attempt , packet1.completion_pct , packet1.completion_mask , packet1.direction_x , packet1.direction_y , packet1.direction_z );
1697  mavlink_msg_mag_cal_progress_decode(&msg, &packet2);
1698  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1699 
1700  memset(&packet2, 0, sizeof(packet2));
1701  mavlink_msg_to_send_buffer(buffer, &msg);
1702  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1703  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1704  }
1705  mavlink_msg_mag_cal_progress_decode(last_msg, &packet2);
1706  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1707 
1708  memset(&packet2, 0, sizeof(packet2));
1709  mavlink_msg_mag_cal_progress_send(MAVLINK_COMM_1 , packet1.compass_id , packet1.cal_mask , packet1.cal_status , packet1.attempt , packet1.completion_pct , packet1.completion_mask , packet1.direction_x , packet1.direction_y , packet1.direction_z );
1710  mavlink_msg_mag_cal_progress_decode(last_msg, &packet2);
1711  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1712 }
1713 
1714 static void mavlink_test_mag_cal_report(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1715 {
1716  mavlink_message_t msg;
1717  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1718  uint16_t i;
1719  mavlink_mag_cal_report_t packet_in = {
1720  17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,125,192,3,70
1721  };
1722  mavlink_mag_cal_report_t packet1, packet2;
1723  memset(&packet1, 0, sizeof(packet1));
1724  packet1.fitness = packet_in.fitness;
1725  packet1.ofs_x = packet_in.ofs_x;
1726  packet1.ofs_y = packet_in.ofs_y;
1727  packet1.ofs_z = packet_in.ofs_z;
1728  packet1.diag_x = packet_in.diag_x;
1729  packet1.diag_y = packet_in.diag_y;
1730  packet1.diag_z = packet_in.diag_z;
1731  packet1.offdiag_x = packet_in.offdiag_x;
1732  packet1.offdiag_y = packet_in.offdiag_y;
1733  packet1.offdiag_z = packet_in.offdiag_z;
1734  packet1.compass_id = packet_in.compass_id;
1735  packet1.cal_mask = packet_in.cal_mask;
1736  packet1.cal_status = packet_in.cal_status;
1737  packet1.autosaved = packet_in.autosaved;
1738 
1739 
1740 
1741  memset(&packet2, 0, sizeof(packet2));
1742  mavlink_msg_mag_cal_report_encode(system_id, component_id, &msg, &packet1);
1743  mavlink_msg_mag_cal_report_decode(&msg, &packet2);
1744  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1745 
1746  memset(&packet2, 0, sizeof(packet2));
1747  mavlink_msg_mag_cal_report_pack(system_id, component_id, &msg , packet1.compass_id , packet1.cal_mask , packet1.cal_status , packet1.autosaved , packet1.fitness , packet1.ofs_x , packet1.ofs_y , packet1.ofs_z , packet1.diag_x , packet1.diag_y , packet1.diag_z , packet1.offdiag_x , packet1.offdiag_y , packet1.offdiag_z );
1748  mavlink_msg_mag_cal_report_decode(&msg, &packet2);
1749  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1750 
1751  memset(&packet2, 0, sizeof(packet2));
1752  mavlink_msg_mag_cal_report_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.compass_id , packet1.cal_mask , packet1.cal_status , packet1.autosaved , packet1.fitness , packet1.ofs_x , packet1.ofs_y , packet1.ofs_z , packet1.diag_x , packet1.diag_y , packet1.diag_z , packet1.offdiag_x , packet1.offdiag_y , packet1.offdiag_z );
1753  mavlink_msg_mag_cal_report_decode(&msg, &packet2);
1754  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1755 
1756  memset(&packet2, 0, sizeof(packet2));
1757  mavlink_msg_to_send_buffer(buffer, &msg);
1758  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1759  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1760  }
1761  mavlink_msg_mag_cal_report_decode(last_msg, &packet2);
1762  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1763 
1764  memset(&packet2, 0, sizeof(packet2));
1765  mavlink_msg_mag_cal_report_send(MAVLINK_COMM_1 , packet1.compass_id , packet1.cal_mask , packet1.cal_status , packet1.autosaved , packet1.fitness , packet1.ofs_x , packet1.ofs_y , packet1.ofs_z , packet1.diag_x , packet1.diag_y , packet1.diag_z , packet1.offdiag_x , packet1.offdiag_y , packet1.offdiag_z );
1766  mavlink_msg_mag_cal_report_decode(last_msg, &packet2);
1767  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1768 }
1769 
1770 static void mavlink_test_ekf_status_report(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1771 {
1772  mavlink_message_t msg;
1773  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1774  uint16_t i;
1775  mavlink_ekf_status_report_t packet_in = {
1776  17.0,45.0,73.0,101.0,129.0,18275
1777  };
1778  mavlink_ekf_status_report_t packet1, packet2;
1779  memset(&packet1, 0, sizeof(packet1));
1780  packet1.velocity_variance = packet_in.velocity_variance;
1781  packet1.pos_horiz_variance = packet_in.pos_horiz_variance;
1782  packet1.pos_vert_variance = packet_in.pos_vert_variance;
1783  packet1.compass_variance = packet_in.compass_variance;
1784  packet1.terrain_alt_variance = packet_in.terrain_alt_variance;
1785  packet1.flags = packet_in.flags;
1786 
1787 
1788 
1789  memset(&packet2, 0, sizeof(packet2));
1790  mavlink_msg_ekf_status_report_encode(system_id, component_id, &msg, &packet1);
1791  mavlink_msg_ekf_status_report_decode(&msg, &packet2);
1792  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1793 
1794  memset(&packet2, 0, sizeof(packet2));
1795  mavlink_msg_ekf_status_report_pack(system_id, component_id, &msg , packet1.flags , packet1.velocity_variance , packet1.pos_horiz_variance , packet1.pos_vert_variance , packet1.compass_variance , packet1.terrain_alt_variance );
1796  mavlink_msg_ekf_status_report_decode(&msg, &packet2);
1797  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1798 
1799  memset(&packet2, 0, sizeof(packet2));
1800  mavlink_msg_ekf_status_report_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.flags , packet1.velocity_variance , packet1.pos_horiz_variance , packet1.pos_vert_variance , packet1.compass_variance , packet1.terrain_alt_variance );
1801  mavlink_msg_ekf_status_report_decode(&msg, &packet2);
1802  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1803 
1804  memset(&packet2, 0, sizeof(packet2));
1805  mavlink_msg_to_send_buffer(buffer, &msg);
1806  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1807  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1808  }
1809  mavlink_msg_ekf_status_report_decode(last_msg, &packet2);
1810  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1811 
1812  memset(&packet2, 0, sizeof(packet2));
1813  mavlink_msg_ekf_status_report_send(MAVLINK_COMM_1 , packet1.flags , packet1.velocity_variance , packet1.pos_horiz_variance , packet1.pos_vert_variance , packet1.compass_variance , packet1.terrain_alt_variance );
1814  mavlink_msg_ekf_status_report_decode(last_msg, &packet2);
1815  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1816 }
1817 
1818 static void mavlink_test_gimbal_report(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1819 {
1820  mavlink_message_t msg;
1821  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1822  uint16_t i;
1823  mavlink_gimbal_report_t packet_in = {
1824  17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,125,192
1825  };
1826  mavlink_gimbal_report_t packet1, packet2;
1827  memset(&packet1, 0, sizeof(packet1));
1828  packet1.delta_time = packet_in.delta_time;
1829  packet1.delta_angle_x = packet_in.delta_angle_x;
1830  packet1.delta_angle_y = packet_in.delta_angle_y;
1831  packet1.delta_angle_z = packet_in.delta_angle_z;
1832  packet1.delta_velocity_x = packet_in.delta_velocity_x;
1833  packet1.delta_velocity_y = packet_in.delta_velocity_y;
1834  packet1.delta_velocity_z = packet_in.delta_velocity_z;
1835  packet1.joint_roll = packet_in.joint_roll;
1836  packet1.joint_el = packet_in.joint_el;
1837  packet1.joint_az = packet_in.joint_az;
1838  packet1.target_system = packet_in.target_system;
1839  packet1.target_component = packet_in.target_component;
1840 
1841 
1842 
1843  memset(&packet2, 0, sizeof(packet2));
1844  mavlink_msg_gimbal_report_encode(system_id, component_id, &msg, &packet1);
1845  mavlink_msg_gimbal_report_decode(&msg, &packet2);
1846  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1847 
1848  memset(&packet2, 0, sizeof(packet2));
1849  mavlink_msg_gimbal_report_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.delta_time , packet1.delta_angle_x , packet1.delta_angle_y , packet1.delta_angle_z , packet1.delta_velocity_x , packet1.delta_velocity_y , packet1.delta_velocity_z , packet1.joint_roll , packet1.joint_el , packet1.joint_az );
1850  mavlink_msg_gimbal_report_decode(&msg, &packet2);
1851  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1852 
1853  memset(&packet2, 0, sizeof(packet2));
1854  mavlink_msg_gimbal_report_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.delta_time , packet1.delta_angle_x , packet1.delta_angle_y , packet1.delta_angle_z , packet1.delta_velocity_x , packet1.delta_velocity_y , packet1.delta_velocity_z , packet1.joint_roll , packet1.joint_el , packet1.joint_az );
1855  mavlink_msg_gimbal_report_decode(&msg, &packet2);
1856  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1857 
1858  memset(&packet2, 0, sizeof(packet2));
1859  mavlink_msg_to_send_buffer(buffer, &msg);
1860  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1861  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1862  }
1863  mavlink_msg_gimbal_report_decode(last_msg, &packet2);
1864  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1865 
1866  memset(&packet2, 0, sizeof(packet2));
1867  mavlink_msg_gimbal_report_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.delta_time , packet1.delta_angle_x , packet1.delta_angle_y , packet1.delta_angle_z , packet1.delta_velocity_x , packet1.delta_velocity_y , packet1.delta_velocity_z , packet1.joint_roll , packet1.joint_el , packet1.joint_az );
1868  mavlink_msg_gimbal_report_decode(last_msg, &packet2);
1869  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1870 }
1871 
1872 static void mavlink_test_gimbal_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1873 {
1874  mavlink_message_t msg;
1875  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1876  uint16_t i;
1877  mavlink_gimbal_control_t packet_in = {
1878  17.0,45.0,73.0,41,108
1879  };
1880  mavlink_gimbal_control_t packet1, packet2;
1881  memset(&packet1, 0, sizeof(packet1));
1882  packet1.demanded_rate_x = packet_in.demanded_rate_x;
1883  packet1.demanded_rate_y = packet_in.demanded_rate_y;
1884  packet1.demanded_rate_z = packet_in.demanded_rate_z;
1885  packet1.target_system = packet_in.target_system;
1886  packet1.target_component = packet_in.target_component;
1887 
1888 
1889 
1890  memset(&packet2, 0, sizeof(packet2));
1891  mavlink_msg_gimbal_control_encode(system_id, component_id, &msg, &packet1);
1892  mavlink_msg_gimbal_control_decode(&msg, &packet2);
1893  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1894 
1895  memset(&packet2, 0, sizeof(packet2));
1896  mavlink_msg_gimbal_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.demanded_rate_x , packet1.demanded_rate_y , packet1.demanded_rate_z );
1897  mavlink_msg_gimbal_control_decode(&msg, &packet2);
1898  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1899 
1900  memset(&packet2, 0, sizeof(packet2));
1901  mavlink_msg_gimbal_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.demanded_rate_x , packet1.demanded_rate_y , packet1.demanded_rate_z );
1902  mavlink_msg_gimbal_control_decode(&msg, &packet2);
1903  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1904 
1905  memset(&packet2, 0, sizeof(packet2));
1906  mavlink_msg_to_send_buffer(buffer, &msg);
1907  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1908  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1909  }
1910  mavlink_msg_gimbal_control_decode(last_msg, &packet2);
1911  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1912 
1913  memset(&packet2, 0, sizeof(packet2));
1914  mavlink_msg_gimbal_control_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.demanded_rate_x , packet1.demanded_rate_y , packet1.demanded_rate_z );
1915  mavlink_msg_gimbal_control_decode(last_msg, &packet2);
1916  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1917 }
1918 
1919 static void mavlink_test_gimbal_reset(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1920 {
1921  mavlink_message_t msg;
1922  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1923  uint16_t i;
1924  mavlink_gimbal_reset_t packet_in = {
1925  5,72
1926  };
1927  mavlink_gimbal_reset_t packet1, packet2;
1928  memset(&packet1, 0, sizeof(packet1));
1929  packet1.target_system = packet_in.target_system;
1930  packet1.target_component = packet_in.target_component;
1931 
1932 
1933 
1934  memset(&packet2, 0, sizeof(packet2));
1935  mavlink_msg_gimbal_reset_encode(system_id, component_id, &msg, &packet1);
1936  mavlink_msg_gimbal_reset_decode(&msg, &packet2);
1937  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1938 
1939  memset(&packet2, 0, sizeof(packet2));
1940  mavlink_msg_gimbal_reset_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
1941  mavlink_msg_gimbal_reset_decode(&msg, &packet2);
1942  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1943 
1944  memset(&packet2, 0, sizeof(packet2));
1945  mavlink_msg_gimbal_reset_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
1946  mavlink_msg_gimbal_reset_decode(&msg, &packet2);
1947  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1948 
1949  memset(&packet2, 0, sizeof(packet2));
1950  mavlink_msg_to_send_buffer(buffer, &msg);
1951  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1952  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1953  }
1954  mavlink_msg_gimbal_reset_decode(last_msg, &packet2);
1955  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1956 
1957  memset(&packet2, 0, sizeof(packet2));
1958  mavlink_msg_gimbal_reset_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
1959  mavlink_msg_gimbal_reset_decode(last_msg, &packet2);
1960  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1961 }
1962 
1963 static void mavlink_test_gimbal_axis_calibration_progress(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1964 {
1965  mavlink_message_t msg;
1966  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1967  uint16_t i;
1969  5,72,139
1970  };
1972  memset(&packet1, 0, sizeof(packet1));
1973  packet1.calibration_axis = packet_in.calibration_axis;
1974  packet1.calibration_progress = packet_in.calibration_progress;
1975  packet1.calibration_status = packet_in.calibration_status;
1976 
1977 
1978 
1979  memset(&packet2, 0, sizeof(packet2));
1980  mavlink_msg_gimbal_axis_calibration_progress_encode(system_id, component_id, &msg, &packet1);
1981  mavlink_msg_gimbal_axis_calibration_progress_decode(&msg, &packet2);
1982  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1983 
1984  memset(&packet2, 0, sizeof(packet2));
1985  mavlink_msg_gimbal_axis_calibration_progress_pack(system_id, component_id, &msg , packet1.calibration_axis , packet1.calibration_progress , packet1.calibration_status );
1986  mavlink_msg_gimbal_axis_calibration_progress_decode(&msg, &packet2);
1987  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1988 
1989  memset(&packet2, 0, sizeof(packet2));
1990  mavlink_msg_gimbal_axis_calibration_progress_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.calibration_axis , packet1.calibration_progress , packet1.calibration_status );
1991  mavlink_msg_gimbal_axis_calibration_progress_decode(&msg, &packet2);
1992  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1993 
1994  memset(&packet2, 0, sizeof(packet2));
1995  mavlink_msg_to_send_buffer(buffer, &msg);
1996  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1997  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1998  }
1999  mavlink_msg_gimbal_axis_calibration_progress_decode(last_msg, &packet2);
2000  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2001 
2002  memset(&packet2, 0, sizeof(packet2));
2003  mavlink_msg_gimbal_axis_calibration_progress_send(MAVLINK_COMM_1 , packet1.calibration_axis , packet1.calibration_progress , packet1.calibration_status );
2004  mavlink_msg_gimbal_axis_calibration_progress_decode(last_msg, &packet2);
2005  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2006 }
2007 
2008 static void mavlink_test_gimbal_set_home_offsets(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2009 {
2010  mavlink_message_t msg;
2011  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2012  uint16_t i;
2013  mavlink_gimbal_set_home_offsets_t packet_in = {
2014  5,72
2015  };
2016  mavlink_gimbal_set_home_offsets_t packet1, packet2;
2017  memset(&packet1, 0, sizeof(packet1));
2018  packet1.target_system = packet_in.target_system;
2019  packet1.target_component = packet_in.target_component;
2020 
2021 
2022 
2023  memset(&packet2, 0, sizeof(packet2));
2024  mavlink_msg_gimbal_set_home_offsets_encode(system_id, component_id, &msg, &packet1);
2025  mavlink_msg_gimbal_set_home_offsets_decode(&msg, &packet2);
2026  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2027 
2028  memset(&packet2, 0, sizeof(packet2));
2029  mavlink_msg_gimbal_set_home_offsets_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
2030  mavlink_msg_gimbal_set_home_offsets_decode(&msg, &packet2);
2031  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2032 
2033  memset(&packet2, 0, sizeof(packet2));
2034  mavlink_msg_gimbal_set_home_offsets_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
2035  mavlink_msg_gimbal_set_home_offsets_decode(&msg, &packet2);
2036  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2037 
2038  memset(&packet2, 0, sizeof(packet2));
2039  mavlink_msg_to_send_buffer(buffer, &msg);
2040  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2041  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2042  }
2043  mavlink_msg_gimbal_set_home_offsets_decode(last_msg, &packet2);
2044  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2045 
2046  memset(&packet2, 0, sizeof(packet2));
2047  mavlink_msg_gimbal_set_home_offsets_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
2048  mavlink_msg_gimbal_set_home_offsets_decode(last_msg, &packet2);
2049  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2050 }
2051 
2052 static void mavlink_test_gimbal_home_offset_calibration_result(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2053 {
2054  mavlink_message_t msg;
2055  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2056  uint16_t i;
2058  5
2059  };
2061  memset(&packet1, 0, sizeof(packet1));
2062  packet1.calibration_result = packet_in.calibration_result;
2063 
2064 
2065 
2066  memset(&packet2, 0, sizeof(packet2));
2067  mavlink_msg_gimbal_home_offset_calibration_result_encode(system_id, component_id, &msg, &packet1);
2068  mavlink_msg_gimbal_home_offset_calibration_result_decode(&msg, &packet2);
2069  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2070 
2071  memset(&packet2, 0, sizeof(packet2));
2072  mavlink_msg_gimbal_home_offset_calibration_result_pack(system_id, component_id, &msg , packet1.calibration_result );
2073  mavlink_msg_gimbal_home_offset_calibration_result_decode(&msg, &packet2);
2074  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2075 
2076  memset(&packet2, 0, sizeof(packet2));
2077  mavlink_msg_gimbal_home_offset_calibration_result_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.calibration_result );
2078  mavlink_msg_gimbal_home_offset_calibration_result_decode(&msg, &packet2);
2079  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2080 
2081  memset(&packet2, 0, sizeof(packet2));
2082  mavlink_msg_to_send_buffer(buffer, &msg);
2083  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2084  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2085  }
2086  mavlink_msg_gimbal_home_offset_calibration_result_decode(last_msg, &packet2);
2087  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2088 
2089  memset(&packet2, 0, sizeof(packet2));
2090  mavlink_msg_gimbal_home_offset_calibration_result_send(MAVLINK_COMM_1 , packet1.calibration_result );
2091  mavlink_msg_gimbal_home_offset_calibration_result_decode(last_msg, &packet2);
2092  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2093 }
2094 
2095 static void mavlink_test_gimbal_set_factory_parameters(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2096 {
2097  mavlink_message_t msg;
2098  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2099  uint16_t i;
2101  963497464,963497672,963497880,963498088,963498296,963498504,18483,211,22,89,156,223,34,101
2102  };
2103  mavlink_gimbal_set_factory_parameters_t packet1, packet2;
2104  memset(&packet1, 0, sizeof(packet1));
2105  packet1.magic_1 = packet_in.magic_1;
2106  packet1.magic_2 = packet_in.magic_2;
2107  packet1.magic_3 = packet_in.magic_3;
2108  packet1.serial_number_pt_1 = packet_in.serial_number_pt_1;
2109  packet1.serial_number_pt_2 = packet_in.serial_number_pt_2;
2110  packet1.serial_number_pt_3 = packet_in.serial_number_pt_3;
2111  packet1.assembly_year = packet_in.assembly_year;
2112  packet1.target_system = packet_in.target_system;
2113  packet1.target_component = packet_in.target_component;
2114  packet1.assembly_month = packet_in.assembly_month;
2115  packet1.assembly_day = packet_in.assembly_day;
2116  packet1.assembly_hour = packet_in.assembly_hour;
2117  packet1.assembly_minute = packet_in.assembly_minute;
2118  packet1.assembly_second = packet_in.assembly_second;
2119 
2120 
2121 
2122  memset(&packet2, 0, sizeof(packet2));
2123  mavlink_msg_gimbal_set_factory_parameters_encode(system_id, component_id, &msg, &packet1);
2124  mavlink_msg_gimbal_set_factory_parameters_decode(&msg, &packet2);
2125  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2126 
2127  memset(&packet2, 0, sizeof(packet2));
2128  mavlink_msg_gimbal_set_factory_parameters_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.magic_1 , packet1.magic_2 , packet1.magic_3 , packet1.assembly_year , packet1.assembly_month , packet1.assembly_day , packet1.assembly_hour , packet1.assembly_minute , packet1.assembly_second , packet1.serial_number_pt_1 , packet1.serial_number_pt_2 , packet1.serial_number_pt_3 );
2129  mavlink_msg_gimbal_set_factory_parameters_decode(&msg, &packet2);
2130  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2131 
2132  memset(&packet2, 0, sizeof(packet2));
2133  mavlink_msg_gimbal_set_factory_parameters_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.magic_1 , packet1.magic_2 , packet1.magic_3 , packet1.assembly_year , packet1.assembly_month , packet1.assembly_day , packet1.assembly_hour , packet1.assembly_minute , packet1.assembly_second , packet1.serial_number_pt_1 , packet1.serial_number_pt_2 , packet1.serial_number_pt_3 );
2134  mavlink_msg_gimbal_set_factory_parameters_decode(&msg, &packet2);
2135  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2136 
2137  memset(&packet2, 0, sizeof(packet2));
2138  mavlink_msg_to_send_buffer(buffer, &msg);
2139  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2140  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2141  }
2142  mavlink_msg_gimbal_set_factory_parameters_decode(last_msg, &packet2);
2143  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2144 
2145  memset(&packet2, 0, sizeof(packet2));
2146  mavlink_msg_gimbal_set_factory_parameters_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.magic_1 , packet1.magic_2 , packet1.magic_3 , packet1.assembly_year , packet1.assembly_month , packet1.assembly_day , packet1.assembly_hour , packet1.assembly_minute , packet1.assembly_second , packet1.serial_number_pt_1 , packet1.serial_number_pt_2 , packet1.serial_number_pt_3 );
2147  mavlink_msg_gimbal_set_factory_parameters_decode(last_msg, &packet2);
2148  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2149 }
2150 
2151 static void mavlink_test_gimbal_factory_parameters_loaded(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2152 {
2153  mavlink_message_t msg;
2154  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2155  uint16_t i;
2157  5
2158  };
2160  memset(&packet1, 0, sizeof(packet1));
2161  packet1.dummy = packet_in.dummy;
2162 
2163 
2164 
2165  memset(&packet2, 0, sizeof(packet2));
2166  mavlink_msg_gimbal_factory_parameters_loaded_encode(system_id, component_id, &msg, &packet1);
2167  mavlink_msg_gimbal_factory_parameters_loaded_decode(&msg, &packet2);
2168  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2169 
2170  memset(&packet2, 0, sizeof(packet2));
2171  mavlink_msg_gimbal_factory_parameters_loaded_pack(system_id, component_id, &msg , packet1.dummy );
2172  mavlink_msg_gimbal_factory_parameters_loaded_decode(&msg, &packet2);
2173  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2174 
2175  memset(&packet2, 0, sizeof(packet2));
2176  mavlink_msg_gimbal_factory_parameters_loaded_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.dummy );
2177  mavlink_msg_gimbal_factory_parameters_loaded_decode(&msg, &packet2);
2178  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2179 
2180  memset(&packet2, 0, sizeof(packet2));
2181  mavlink_msg_to_send_buffer(buffer, &msg);
2182  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2183  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2184  }
2185  mavlink_msg_gimbal_factory_parameters_loaded_decode(last_msg, &packet2);
2186  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2187 
2188  memset(&packet2, 0, sizeof(packet2));
2189  mavlink_msg_gimbal_factory_parameters_loaded_send(MAVLINK_COMM_1 , packet1.dummy );
2190  mavlink_msg_gimbal_factory_parameters_loaded_decode(last_msg, &packet2);
2191  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2192 }
2193 
2194 static void mavlink_test_gimbal_erase_firmware_and_config(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2195 {
2196  mavlink_message_t msg;
2197  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2198  uint16_t i;
2200  963497464,17,84
2201  };
2203  memset(&packet1, 0, sizeof(packet1));
2204  packet1.knock = packet_in.knock;
2205  packet1.target_system = packet_in.target_system;
2206  packet1.target_component = packet_in.target_component;
2207 
2208 
2209 
2210  memset(&packet2, 0, sizeof(packet2));
2211  mavlink_msg_gimbal_erase_firmware_and_config_encode(system_id, component_id, &msg, &packet1);
2212  mavlink_msg_gimbal_erase_firmware_and_config_decode(&msg, &packet2);
2213  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2214 
2215  memset(&packet2, 0, sizeof(packet2));
2216  mavlink_msg_gimbal_erase_firmware_and_config_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.knock );
2217  mavlink_msg_gimbal_erase_firmware_and_config_decode(&msg, &packet2);
2218  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2219 
2220  memset(&packet2, 0, sizeof(packet2));
2221  mavlink_msg_gimbal_erase_firmware_and_config_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.knock );
2222  mavlink_msg_gimbal_erase_firmware_and_config_decode(&msg, &packet2);
2223  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2224 
2225  memset(&packet2, 0, sizeof(packet2));
2226  mavlink_msg_to_send_buffer(buffer, &msg);
2227  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2228  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2229  }
2230  mavlink_msg_gimbal_erase_firmware_and_config_decode(last_msg, &packet2);
2231  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2232 
2233  memset(&packet2, 0, sizeof(packet2));
2234  mavlink_msg_gimbal_erase_firmware_and_config_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.knock );
2235  mavlink_msg_gimbal_erase_firmware_and_config_decode(last_msg, &packet2);
2236  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2237 }
2238 
2239 static void mavlink_test_gimbal_perform_factory_tests(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2240 {
2241  mavlink_message_t msg;
2242  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2243  uint16_t i;
2245  5,72
2246  };
2247  mavlink_gimbal_perform_factory_tests_t packet1, packet2;
2248  memset(&packet1, 0, sizeof(packet1));
2249  packet1.target_system = packet_in.target_system;
2250  packet1.target_component = packet_in.target_component;
2251 
2252 
2253 
2254  memset(&packet2, 0, sizeof(packet2));
2255  mavlink_msg_gimbal_perform_factory_tests_encode(system_id, component_id, &msg, &packet1);
2256  mavlink_msg_gimbal_perform_factory_tests_decode(&msg, &packet2);
2257  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2258 
2259  memset(&packet2, 0, sizeof(packet2));
2260  mavlink_msg_gimbal_perform_factory_tests_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
2261  mavlink_msg_gimbal_perform_factory_tests_decode(&msg, &packet2);
2262  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2263 
2264  memset(&packet2, 0, sizeof(packet2));
2265  mavlink_msg_gimbal_perform_factory_tests_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
2266  mavlink_msg_gimbal_perform_factory_tests_decode(&msg, &packet2);
2267  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2268 
2269  memset(&packet2, 0, sizeof(packet2));
2270  mavlink_msg_to_send_buffer(buffer, &msg);
2271  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2272  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2273  }
2274  mavlink_msg_gimbal_perform_factory_tests_decode(last_msg, &packet2);
2275  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2276 
2277  memset(&packet2, 0, sizeof(packet2));
2278  mavlink_msg_gimbal_perform_factory_tests_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
2279  mavlink_msg_gimbal_perform_factory_tests_decode(last_msg, &packet2);
2280  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2281 }
2282 
2283 static void mavlink_test_gimbal_report_factory_tests_progress(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2284 {
2285  mavlink_message_t msg;
2286  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2287  uint16_t i;
2289  5,72,139,206
2290  };
2292  memset(&packet1, 0, sizeof(packet1));
2293  packet1.test = packet_in.test;
2294  packet1.test_section = packet_in.test_section;
2295  packet1.test_section_progress = packet_in.test_section_progress;
2296  packet1.test_status = packet_in.test_status;
2297 
2298 
2299 
2300  memset(&packet2, 0, sizeof(packet2));
2301  mavlink_msg_gimbal_report_factory_tests_progress_encode(system_id, component_id, &msg, &packet1);
2302  mavlink_msg_gimbal_report_factory_tests_progress_decode(&msg, &packet2);
2303  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2304 
2305  memset(&packet2, 0, sizeof(packet2));
2306  mavlink_msg_gimbal_report_factory_tests_progress_pack(system_id, component_id, &msg , packet1.test , packet1.test_section , packet1.test_section_progress , packet1.test_status );
2307  mavlink_msg_gimbal_report_factory_tests_progress_decode(&msg, &packet2);
2308  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2309 
2310  memset(&packet2, 0, sizeof(packet2));
2311  mavlink_msg_gimbal_report_factory_tests_progress_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.test , packet1.test_section , packet1.test_section_progress , packet1.test_status );
2312  mavlink_msg_gimbal_report_factory_tests_progress_decode(&msg, &packet2);
2313  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2314 
2315  memset(&packet2, 0, sizeof(packet2));
2316  mavlink_msg_to_send_buffer(buffer, &msg);
2317  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2318  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2319  }
2320  mavlink_msg_gimbal_report_factory_tests_progress_decode(last_msg, &packet2);
2321  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2322 
2323  memset(&packet2, 0, sizeof(packet2));
2324  mavlink_msg_gimbal_report_factory_tests_progress_send(MAVLINK_COMM_1 , packet1.test , packet1.test_section , packet1.test_section_progress , packet1.test_status );
2325  mavlink_msg_gimbal_report_factory_tests_progress_decode(last_msg, &packet2);
2326  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2327 }
2328 
2329 static void mavlink_test_gopro_power_on(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2330 {
2331  mavlink_message_t msg;
2332  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2333  uint16_t i;
2334  mavlink_gopro_power_on_t packet_in = {
2335  5,72
2336  };
2337  mavlink_gopro_power_on_t packet1, packet2;
2338  memset(&packet1, 0, sizeof(packet1));
2339  packet1.target_system = packet_in.target_system;
2340  packet1.target_component = packet_in.target_component;
2341 
2342 
2343 
2344  memset(&packet2, 0, sizeof(packet2));
2345  mavlink_msg_gopro_power_on_encode(system_id, component_id, &msg, &packet1);
2346  mavlink_msg_gopro_power_on_decode(&msg, &packet2);
2347  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2348 
2349  memset(&packet2, 0, sizeof(packet2));
2350  mavlink_msg_gopro_power_on_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
2351  mavlink_msg_gopro_power_on_decode(&msg, &packet2);
2352  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2353 
2354  memset(&packet2, 0, sizeof(packet2));
2355  mavlink_msg_gopro_power_on_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
2356  mavlink_msg_gopro_power_on_decode(&msg, &packet2);
2357  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2358 
2359  memset(&packet2, 0, sizeof(packet2));
2360  mavlink_msg_to_send_buffer(buffer, &msg);
2361  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2362  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2363  }
2364  mavlink_msg_gopro_power_on_decode(last_msg, &packet2);
2365  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2366 
2367  memset(&packet2, 0, sizeof(packet2));
2368  mavlink_msg_gopro_power_on_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
2369  mavlink_msg_gopro_power_on_decode(last_msg, &packet2);
2370  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2371 }
2372 
2373 static void mavlink_test_gopro_power_off(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2374 {
2375  mavlink_message_t msg;
2376  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2377  uint16_t i;
2378  mavlink_gopro_power_off_t packet_in = {
2379  5,72
2380  };
2381  mavlink_gopro_power_off_t packet1, packet2;
2382  memset(&packet1, 0, sizeof(packet1));
2383  packet1.target_system = packet_in.target_system;
2384  packet1.target_component = packet_in.target_component;
2385 
2386 
2387 
2388  memset(&packet2, 0, sizeof(packet2));
2389  mavlink_msg_gopro_power_off_encode(system_id, component_id, &msg, &packet1);
2390  mavlink_msg_gopro_power_off_decode(&msg, &packet2);
2391  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2392 
2393  memset(&packet2, 0, sizeof(packet2));
2394  mavlink_msg_gopro_power_off_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
2395  mavlink_msg_gopro_power_off_decode(&msg, &packet2);
2396  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2397 
2398  memset(&packet2, 0, sizeof(packet2));
2399  mavlink_msg_gopro_power_off_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
2400  mavlink_msg_gopro_power_off_decode(&msg, &packet2);
2401  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2402 
2403  memset(&packet2, 0, sizeof(packet2));
2404  mavlink_msg_to_send_buffer(buffer, &msg);
2405  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2406  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2407  }
2408  mavlink_msg_gopro_power_off_decode(last_msg, &packet2);
2409  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2410 
2411  memset(&packet2, 0, sizeof(packet2));
2412  mavlink_msg_gopro_power_off_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
2413  mavlink_msg_gopro_power_off_decode(last_msg, &packet2);
2414  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2415 }
2416 
2417 static void mavlink_test_gopro_command(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2418 {
2419  mavlink_message_t msg;
2420  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2421  uint16_t i;
2422  mavlink_gopro_command_t packet_in = {
2423  5,72,139,206,17
2424  };
2425  mavlink_gopro_command_t packet1, packet2;
2426  memset(&packet1, 0, sizeof(packet1));
2427  packet1.target_system = packet_in.target_system;
2428  packet1.target_component = packet_in.target_component;
2429  packet1.gp_cmd_name_1 = packet_in.gp_cmd_name_1;
2430  packet1.gp_cmd_name_2 = packet_in.gp_cmd_name_2;
2431  packet1.gp_cmd_parm = packet_in.gp_cmd_parm;
2432 
2433 
2434 
2435  memset(&packet2, 0, sizeof(packet2));
2436  mavlink_msg_gopro_command_encode(system_id, component_id, &msg, &packet1);
2437  mavlink_msg_gopro_command_decode(&msg, &packet2);
2438  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2439 
2440  memset(&packet2, 0, sizeof(packet2));
2441  mavlink_msg_gopro_command_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.gp_cmd_name_1 , packet1.gp_cmd_name_2 , packet1.gp_cmd_parm );
2442  mavlink_msg_gopro_command_decode(&msg, &packet2);
2443  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2444 
2445  memset(&packet2, 0, sizeof(packet2));
2446  mavlink_msg_gopro_command_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.gp_cmd_name_1 , packet1.gp_cmd_name_2 , packet1.gp_cmd_parm );
2447  mavlink_msg_gopro_command_decode(&msg, &packet2);
2448  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2449 
2450  memset(&packet2, 0, sizeof(packet2));
2451  mavlink_msg_to_send_buffer(buffer, &msg);
2452  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2453  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2454  }
2455  mavlink_msg_gopro_command_decode(last_msg, &packet2);
2456  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2457 
2458  memset(&packet2, 0, sizeof(packet2));
2459  mavlink_msg_gopro_command_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.gp_cmd_name_1 , packet1.gp_cmd_name_2 , packet1.gp_cmd_parm );
2460  mavlink_msg_gopro_command_decode(last_msg, &packet2);
2461  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2462 }
2463 
2464 static void mavlink_test_gopro_response(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2465 {
2466  mavlink_message_t msg;
2467  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2468  uint16_t i;
2469  mavlink_gopro_response_t packet_in = {
2470  17235,139,206,17,84
2471  };
2472  mavlink_gopro_response_t packet1, packet2;
2473  memset(&packet1, 0, sizeof(packet1));
2474  packet1.gp_cmd_result = packet_in.gp_cmd_result;
2475  packet1.gp_cmd_name_1 = packet_in.gp_cmd_name_1;
2476  packet1.gp_cmd_name_2 = packet_in.gp_cmd_name_2;
2477  packet1.gp_cmd_response_status = packet_in.gp_cmd_response_status;
2479 
2480 
2481 
2482  memset(&packet2, 0, sizeof(packet2));
2483  mavlink_msg_gopro_response_encode(system_id, component_id, &msg, &packet1);
2484  mavlink_msg_gopro_response_decode(&msg, &packet2);
2485  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2486 
2487  memset(&packet2, 0, sizeof(packet2));
2488  mavlink_msg_gopro_response_pack(system_id, component_id, &msg , packet1.gp_cmd_name_1 , packet1.gp_cmd_name_2 , packet1.gp_cmd_response_status , packet1.gp_cmd_response_argument , packet1.gp_cmd_result );
2489  mavlink_msg_gopro_response_decode(&msg, &packet2);
2490  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2491 
2492  memset(&packet2, 0, sizeof(packet2));
2493  mavlink_msg_gopro_response_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.gp_cmd_name_1 , packet1.gp_cmd_name_2 , packet1.gp_cmd_response_status , packet1.gp_cmd_response_argument , packet1.gp_cmd_result );
2494  mavlink_msg_gopro_response_decode(&msg, &packet2);
2495  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2496 
2497  memset(&packet2, 0, sizeof(packet2));
2498  mavlink_msg_to_send_buffer(buffer, &msg);
2499  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2500  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2501  }
2502  mavlink_msg_gopro_response_decode(last_msg, &packet2);
2503  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2504 
2505  memset(&packet2, 0, sizeof(packet2));
2506  mavlink_msg_gopro_response_send(MAVLINK_COMM_1 , packet1.gp_cmd_name_1 , packet1.gp_cmd_name_2 , packet1.gp_cmd_response_status , packet1.gp_cmd_response_argument , packet1.gp_cmd_result );
2507  mavlink_msg_gopro_response_decode(last_msg, &packet2);
2508  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2509 }
2510 
2511 static void mavlink_test_ardupilotmega(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2512 {
2513  mavlink_test_sensor_offsets(system_id, component_id, last_msg);
2514  mavlink_test_set_mag_offsets(system_id, component_id, last_msg);
2515  mavlink_test_meminfo(system_id, component_id, last_msg);
2516  mavlink_test_ap_adc(system_id, component_id, last_msg);
2517  mavlink_test_digicam_configure(system_id, component_id, last_msg);
2518  mavlink_test_digicam_control(system_id, component_id, last_msg);
2519  mavlink_test_mount_configure(system_id, component_id, last_msg);
2520  mavlink_test_mount_control(system_id, component_id, last_msg);
2521  mavlink_test_mount_status(system_id, component_id, last_msg);
2522  mavlink_test_fence_point(system_id, component_id, last_msg);
2523  mavlink_test_fence_fetch_point(system_id, component_id, last_msg);
2524  mavlink_test_fence_status(system_id, component_id, last_msg);
2525  mavlink_test_ahrs(system_id, component_id, last_msg);
2526  mavlink_test_simstate(system_id, component_id, last_msg);
2527  mavlink_test_hwstatus(system_id, component_id, last_msg);
2528  mavlink_test_radio(system_id, component_id, last_msg);
2529  mavlink_test_limits_status(system_id, component_id, last_msg);
2530  mavlink_test_wind(system_id, component_id, last_msg);
2531  mavlink_test_data16(system_id, component_id, last_msg);
2532  mavlink_test_data32(system_id, component_id, last_msg);
2533  mavlink_test_data64(system_id, component_id, last_msg);
2534  mavlink_test_data96(system_id, component_id, last_msg);
2535  mavlink_test_rangefinder(system_id, component_id, last_msg);
2536  mavlink_test_airspeed_autocal(system_id, component_id, last_msg);
2537  mavlink_test_rally_point(system_id, component_id, last_msg);
2538  mavlink_test_rally_fetch_point(system_id, component_id, last_msg);
2539  mavlink_test_compassmot_status(system_id, component_id, last_msg);
2540  mavlink_test_ahrs2(system_id, component_id, last_msg);
2541  mavlink_test_camera_status(system_id, component_id, last_msg);
2542  mavlink_test_camera_feedback(system_id, component_id, last_msg);
2543  mavlink_test_battery2(system_id, component_id, last_msg);
2544  mavlink_test_ahrs3(system_id, component_id, last_msg);
2545  mavlink_test_autopilot_version_request(system_id, component_id, last_msg);
2546  mavlink_test_led_control(system_id, component_id, last_msg);
2547  mavlink_test_mag_cal_progress(system_id, component_id, last_msg);
2548  mavlink_test_mag_cal_report(system_id, component_id, last_msg);
2549  mavlink_test_ekf_status_report(system_id, component_id, last_msg);
2550  mavlink_test_gimbal_report(system_id, component_id, last_msg);
2551  mavlink_test_gimbal_control(system_id, component_id, last_msg);
2552  mavlink_test_gimbal_reset(system_id, component_id, last_msg);
2553  mavlink_test_gimbal_axis_calibration_progress(system_id, component_id, last_msg);
2554  mavlink_test_gimbal_set_home_offsets(system_id, component_id, last_msg);
2555  mavlink_test_gimbal_home_offset_calibration_result(system_id, component_id, last_msg);
2556  mavlink_test_gimbal_set_factory_parameters(system_id, component_id, last_msg);
2557  mavlink_test_gimbal_factory_parameters_loaded(system_id, component_id, last_msg);
2558  mavlink_test_gimbal_erase_firmware_and_config(system_id, component_id, last_msg);
2559  mavlink_test_gimbal_perform_factory_tests(system_id, component_id, last_msg);
2560  mavlink_test_gimbal_report_factory_tests_progress(system_id, component_id, last_msg);
2561  mavlink_test_gopro_power_on(system_id, component_id, last_msg);
2562  mavlink_test_gopro_power_off(system_id, component_id, last_msg);
2563  mavlink_test_gopro_command(system_id, component_id, last_msg);
2564  mavlink_test_gopro_response(system_id, component_id, last_msg);
2565 }
2566 
2567 #ifdef __cplusplus
2568 }
2569 #endif // __cplusplus
2570 #endif // ARDUPILOTMEGA_TESTSUITE_H
#define MAVLINK_ASSERT(x)
Definition: protocol.h:26