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 MATRIXPILOT_TESTSUITE_H
6 #define MATRIXPILOT_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_matrixpilot(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_matrixpilot(system_id, component_id, last_msg);
21 }
22 #endif
23 
24 #include "../common/testsuite.h"
25 
26 
27 static void mavlink_test_flexifunction_set(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_flexifunction_set_t packet_in = {
33  5,72
34  };
35  mavlink_flexifunction_set_t packet1, packet2;
36  memset(&packet1, 0, sizeof(packet1));
37  packet1.target_system = packet_in.target_system;
38  packet1.target_component = packet_in.target_component;
39 
40 
41 
42  memset(&packet2, 0, sizeof(packet2));
43  mavlink_msg_flexifunction_set_encode(system_id, component_id, &msg, &packet1);
44  mavlink_msg_flexifunction_set_decode(&msg, &packet2);
45  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
46 
47  memset(&packet2, 0, sizeof(packet2));
48  mavlink_msg_flexifunction_set_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
49  mavlink_msg_flexifunction_set_decode(&msg, &packet2);
50  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
51 
52  memset(&packet2, 0, sizeof(packet2));
53  mavlink_msg_flexifunction_set_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
54  mavlink_msg_flexifunction_set_decode(&msg, &packet2);
55  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
56 
57  memset(&packet2, 0, sizeof(packet2));
58  mavlink_msg_to_send_buffer(buffer, &msg);
59  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
60  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
61  }
62  mavlink_msg_flexifunction_set_decode(last_msg, &packet2);
63  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
64 
65  memset(&packet2, 0, sizeof(packet2));
66  mavlink_msg_flexifunction_set_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
67  mavlink_msg_flexifunction_set_decode(last_msg, &packet2);
68  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
69 }
70 
71 static void mavlink_test_flexifunction_read_req(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
72 {
73  mavlink_message_t msg;
74  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
75  uint16_t i;
77  17235,17339,17,84
78  };
79  mavlink_flexifunction_read_req_t packet1, packet2;
80  memset(&packet1, 0, sizeof(packet1));
81  packet1.read_req_type = packet_in.read_req_type;
82  packet1.data_index = packet_in.data_index;
83  packet1.target_system = packet_in.target_system;
84  packet1.target_component = packet_in.target_component;
85 
86 
87 
88  memset(&packet2, 0, sizeof(packet2));
89  mavlink_msg_flexifunction_read_req_encode(system_id, component_id, &msg, &packet1);
90  mavlink_msg_flexifunction_read_req_decode(&msg, &packet2);
91  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
92 
93  memset(&packet2, 0, sizeof(packet2));
94  mavlink_msg_flexifunction_read_req_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.read_req_type , packet1.data_index );
95  mavlink_msg_flexifunction_read_req_decode(&msg, &packet2);
96  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
97 
98  memset(&packet2, 0, sizeof(packet2));
99  mavlink_msg_flexifunction_read_req_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.read_req_type , packet1.data_index );
100  mavlink_msg_flexifunction_read_req_decode(&msg, &packet2);
101  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
102 
103  memset(&packet2, 0, sizeof(packet2));
104  mavlink_msg_to_send_buffer(buffer, &msg);
105  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
106  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
107  }
108  mavlink_msg_flexifunction_read_req_decode(last_msg, &packet2);
109  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
110 
111  memset(&packet2, 0, sizeof(packet2));
112  mavlink_msg_flexifunction_read_req_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.read_req_type , packet1.data_index );
113  mavlink_msg_flexifunction_read_req_decode(last_msg, &packet2);
114  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
115 }
116 
117 static void mavlink_test_flexifunction_buffer_function(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
118 {
119  mavlink_message_t msg;
120  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
121  uint16_t i;
123  17235,17339,17443,17547,29,96,{ 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 }
124  };
126  memset(&packet1, 0, sizeof(packet1));
127  packet1.func_index = packet_in.func_index;
128  packet1.func_count = packet_in.func_count;
129  packet1.data_address = packet_in.data_address;
130  packet1.data_size = packet_in.data_size;
131  packet1.target_system = packet_in.target_system;
132  packet1.target_component = packet_in.target_component;
133 
134  mav_array_memcpy(packet1.data, packet_in.data, sizeof(int8_t)*48);
135 
136 
137  memset(&packet2, 0, sizeof(packet2));
138  mavlink_msg_flexifunction_buffer_function_encode(system_id, component_id, &msg, &packet1);
139  mavlink_msg_flexifunction_buffer_function_decode(&msg, &packet2);
140  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
141 
142  memset(&packet2, 0, sizeof(packet2));
143  mavlink_msg_flexifunction_buffer_function_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.func_index , packet1.func_count , packet1.data_address , packet1.data_size , packet1.data );
144  mavlink_msg_flexifunction_buffer_function_decode(&msg, &packet2);
145  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
146 
147  memset(&packet2, 0, sizeof(packet2));
148  mavlink_msg_flexifunction_buffer_function_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.func_index , packet1.func_count , packet1.data_address , packet1.data_size , packet1.data );
149  mavlink_msg_flexifunction_buffer_function_decode(&msg, &packet2);
150  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
151 
152  memset(&packet2, 0, sizeof(packet2));
153  mavlink_msg_to_send_buffer(buffer, &msg);
154  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
155  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
156  }
157  mavlink_msg_flexifunction_buffer_function_decode(last_msg, &packet2);
158  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
159 
160  memset(&packet2, 0, sizeof(packet2));
161  mavlink_msg_flexifunction_buffer_function_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.func_index , packet1.func_count , packet1.data_address , packet1.data_size , packet1.data );
162  mavlink_msg_flexifunction_buffer_function_decode(last_msg, &packet2);
163  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
164 }
165 
166 static void mavlink_test_flexifunction_buffer_function_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
167 {
168  mavlink_message_t msg;
169  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
170  uint16_t i;
172  17235,17339,17,84
173  };
175  memset(&packet1, 0, sizeof(packet1));
176  packet1.func_index = packet_in.func_index;
177  packet1.result = packet_in.result;
178  packet1.target_system = packet_in.target_system;
179  packet1.target_component = packet_in.target_component;
180 
181 
182 
183  memset(&packet2, 0, sizeof(packet2));
184  mavlink_msg_flexifunction_buffer_function_ack_encode(system_id, component_id, &msg, &packet1);
185  mavlink_msg_flexifunction_buffer_function_ack_decode(&msg, &packet2);
186  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
187 
188  memset(&packet2, 0, sizeof(packet2));
189  mavlink_msg_flexifunction_buffer_function_ack_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.func_index , packet1.result );
190  mavlink_msg_flexifunction_buffer_function_ack_decode(&msg, &packet2);
191  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
192 
193  memset(&packet2, 0, sizeof(packet2));
194  mavlink_msg_flexifunction_buffer_function_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.func_index , packet1.result );
195  mavlink_msg_flexifunction_buffer_function_ack_decode(&msg, &packet2);
196  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
197 
198  memset(&packet2, 0, sizeof(packet2));
199  mavlink_msg_to_send_buffer(buffer, &msg);
200  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
201  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
202  }
203  mavlink_msg_flexifunction_buffer_function_ack_decode(last_msg, &packet2);
204  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
205 
206  memset(&packet2, 0, sizeof(packet2));
207  mavlink_msg_flexifunction_buffer_function_ack_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.func_index , packet1.result );
208  mavlink_msg_flexifunction_buffer_function_ack_decode(last_msg, &packet2);
209  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
210 }
211 
212 static void mavlink_test_flexifunction_directory(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
213 {
214  mavlink_message_t msg;
215  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
216  uint16_t i;
218  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, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131 }
219  };
220  mavlink_flexifunction_directory_t packet1, packet2;
221  memset(&packet1, 0, sizeof(packet1));
222  packet1.target_system = packet_in.target_system;
223  packet1.target_component = packet_in.target_component;
224  packet1.directory_type = packet_in.directory_type;
225  packet1.start_index = packet_in.start_index;
226  packet1.count = packet_in.count;
227 
228  mav_array_memcpy(packet1.directory_data, packet_in.directory_data, sizeof(int8_t)*48);
229 
230 
231  memset(&packet2, 0, sizeof(packet2));
232  mavlink_msg_flexifunction_directory_encode(system_id, component_id, &msg, &packet1);
233  mavlink_msg_flexifunction_directory_decode(&msg, &packet2);
234  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
235 
236  memset(&packet2, 0, sizeof(packet2));
237  mavlink_msg_flexifunction_directory_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.directory_type , packet1.start_index , packet1.count , packet1.directory_data );
238  mavlink_msg_flexifunction_directory_decode(&msg, &packet2);
239  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
240 
241  memset(&packet2, 0, sizeof(packet2));
242  mavlink_msg_flexifunction_directory_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.directory_type , packet1.start_index , packet1.count , packet1.directory_data );
243  mavlink_msg_flexifunction_directory_decode(&msg, &packet2);
244  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
245 
246  memset(&packet2, 0, sizeof(packet2));
247  mavlink_msg_to_send_buffer(buffer, &msg);
248  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
249  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
250  }
251  mavlink_msg_flexifunction_directory_decode(last_msg, &packet2);
252  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
253 
254  memset(&packet2, 0, sizeof(packet2));
255  mavlink_msg_flexifunction_directory_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.directory_type , packet1.start_index , packet1.count , packet1.directory_data );
256  mavlink_msg_flexifunction_directory_decode(last_msg, &packet2);
257  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
258 }
259 
260 static void mavlink_test_flexifunction_directory_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
261 {
262  mavlink_message_t msg;
263  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
264  uint16_t i;
266  17235,139,206,17,84,151
267  };
268  mavlink_flexifunction_directory_ack_t packet1, packet2;
269  memset(&packet1, 0, sizeof(packet1));
270  packet1.result = packet_in.result;
271  packet1.target_system = packet_in.target_system;
272  packet1.target_component = packet_in.target_component;
273  packet1.directory_type = packet_in.directory_type;
274  packet1.start_index = packet_in.start_index;
275  packet1.count = packet_in.count;
276 
277 
278 
279  memset(&packet2, 0, sizeof(packet2));
280  mavlink_msg_flexifunction_directory_ack_encode(system_id, component_id, &msg, &packet1);
281  mavlink_msg_flexifunction_directory_ack_decode(&msg, &packet2);
282  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
283 
284  memset(&packet2, 0, sizeof(packet2));
285  mavlink_msg_flexifunction_directory_ack_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.directory_type , packet1.start_index , packet1.count , packet1.result );
286  mavlink_msg_flexifunction_directory_ack_decode(&msg, &packet2);
287  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
288 
289  memset(&packet2, 0, sizeof(packet2));
290  mavlink_msg_flexifunction_directory_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.directory_type , packet1.start_index , packet1.count , packet1.result );
291  mavlink_msg_flexifunction_directory_ack_decode(&msg, &packet2);
292  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
293 
294  memset(&packet2, 0, sizeof(packet2));
295  mavlink_msg_to_send_buffer(buffer, &msg);
296  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
297  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
298  }
299  mavlink_msg_flexifunction_directory_ack_decode(last_msg, &packet2);
300  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
301 
302  memset(&packet2, 0, sizeof(packet2));
303  mavlink_msg_flexifunction_directory_ack_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.directory_type , packet1.start_index , packet1.count , packet1.result );
304  mavlink_msg_flexifunction_directory_ack_decode(last_msg, &packet2);
305  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
306 }
307 
308 static void mavlink_test_flexifunction_command(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
309 {
310  mavlink_message_t msg;
311  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
312  uint16_t i;
313  mavlink_flexifunction_command_t packet_in = {
314  5,72,139
315  };
316  mavlink_flexifunction_command_t packet1, packet2;
317  memset(&packet1, 0, sizeof(packet1));
318  packet1.target_system = packet_in.target_system;
319  packet1.target_component = packet_in.target_component;
320  packet1.command_type = packet_in.command_type;
321 
322 
323 
324  memset(&packet2, 0, sizeof(packet2));
325  mavlink_msg_flexifunction_command_encode(system_id, component_id, &msg, &packet1);
326  mavlink_msg_flexifunction_command_decode(&msg, &packet2);
327  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
328 
329  memset(&packet2, 0, sizeof(packet2));
330  mavlink_msg_flexifunction_command_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.command_type );
331  mavlink_msg_flexifunction_command_decode(&msg, &packet2);
332  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
333 
334  memset(&packet2, 0, sizeof(packet2));
335  mavlink_msg_flexifunction_command_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.command_type );
336  mavlink_msg_flexifunction_command_decode(&msg, &packet2);
337  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
338 
339  memset(&packet2, 0, sizeof(packet2));
340  mavlink_msg_to_send_buffer(buffer, &msg);
341  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
342  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
343  }
344  mavlink_msg_flexifunction_command_decode(last_msg, &packet2);
345  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
346 
347  memset(&packet2, 0, sizeof(packet2));
348  mavlink_msg_flexifunction_command_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.command_type );
349  mavlink_msg_flexifunction_command_decode(last_msg, &packet2);
350  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
351 }
352 
353 static void mavlink_test_flexifunction_command_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
354 {
355  mavlink_message_t msg;
356  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
357  uint16_t i;
359  17235,17339
360  };
361  mavlink_flexifunction_command_ack_t packet1, packet2;
362  memset(&packet1, 0, sizeof(packet1));
363  packet1.command_type = packet_in.command_type;
364  packet1.result = packet_in.result;
365 
366 
367 
368  memset(&packet2, 0, sizeof(packet2));
369  mavlink_msg_flexifunction_command_ack_encode(system_id, component_id, &msg, &packet1);
370  mavlink_msg_flexifunction_command_ack_decode(&msg, &packet2);
371  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
372 
373  memset(&packet2, 0, sizeof(packet2));
374  mavlink_msg_flexifunction_command_ack_pack(system_id, component_id, &msg , packet1.command_type , packet1.result );
375  mavlink_msg_flexifunction_command_ack_decode(&msg, &packet2);
376  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
377 
378  memset(&packet2, 0, sizeof(packet2));
379  mavlink_msg_flexifunction_command_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.command_type , packet1.result );
380  mavlink_msg_flexifunction_command_ack_decode(&msg, &packet2);
381  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
382 
383  memset(&packet2, 0, sizeof(packet2));
384  mavlink_msg_to_send_buffer(buffer, &msg);
385  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
386  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
387  }
388  mavlink_msg_flexifunction_command_ack_decode(last_msg, &packet2);
389  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
390 
391  memset(&packet2, 0, sizeof(packet2));
392  mavlink_msg_flexifunction_command_ack_send(MAVLINK_COMM_1 , packet1.command_type , packet1.result );
393  mavlink_msg_flexifunction_command_ack_decode(last_msg, &packet2);
394  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
395 }
396 
397 static void mavlink_test_serial_udb_extra_f2_a(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
398 {
399  mavlink_message_t msg;
400  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
401  uint16_t i;
402  mavlink_serial_udb_extra_f2_a_t packet_in = {
403  963497464,963497672,963497880,963498088,18067,18171,18275,18379,18483,18587,18691,18795,18899,19003,19107,19211,19315,19419,19523,19627,19731,19835,19939,20043,20147,20251,20355,63
404  };
405  mavlink_serial_udb_extra_f2_a_t packet1, packet2;
406  memset(&packet1, 0, sizeof(packet1));
407  packet1.sue_time = packet_in.sue_time;
408  packet1.sue_latitude = packet_in.sue_latitude;
409  packet1.sue_longitude = packet_in.sue_longitude;
410  packet1.sue_altitude = packet_in.sue_altitude;
411  packet1.sue_waypoint_index = packet_in.sue_waypoint_index;
412  packet1.sue_rmat0 = packet_in.sue_rmat0;
413  packet1.sue_rmat1 = packet_in.sue_rmat1;
414  packet1.sue_rmat2 = packet_in.sue_rmat2;
415  packet1.sue_rmat3 = packet_in.sue_rmat3;
416  packet1.sue_rmat4 = packet_in.sue_rmat4;
417  packet1.sue_rmat5 = packet_in.sue_rmat5;
418  packet1.sue_rmat6 = packet_in.sue_rmat6;
419  packet1.sue_rmat7 = packet_in.sue_rmat7;
420  packet1.sue_rmat8 = packet_in.sue_rmat8;
421  packet1.sue_cog = packet_in.sue_cog;
422  packet1.sue_sog = packet_in.sue_sog;
423  packet1.sue_cpu_load = packet_in.sue_cpu_load;
424  packet1.sue_voltage_milis = packet_in.sue_voltage_milis;
425  packet1.sue_air_speed_3DIMU = packet_in.sue_air_speed_3DIMU;
426  packet1.sue_estimated_wind_0 = packet_in.sue_estimated_wind_0;
427  packet1.sue_estimated_wind_1 = packet_in.sue_estimated_wind_1;
428  packet1.sue_estimated_wind_2 = packet_in.sue_estimated_wind_2;
429  packet1.sue_magFieldEarth0 = packet_in.sue_magFieldEarth0;
430  packet1.sue_magFieldEarth1 = packet_in.sue_magFieldEarth1;
431  packet1.sue_magFieldEarth2 = packet_in.sue_magFieldEarth2;
432  packet1.sue_svs = packet_in.sue_svs;
433  packet1.sue_hdop = packet_in.sue_hdop;
434  packet1.sue_status = packet_in.sue_status;
435 
436 
437 
438  memset(&packet2, 0, sizeof(packet2));
439  mavlink_msg_serial_udb_extra_f2_a_encode(system_id, component_id, &msg, &packet1);
440  mavlink_msg_serial_udb_extra_f2_a_decode(&msg, &packet2);
441  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
442 
443  memset(&packet2, 0, sizeof(packet2));
444  mavlink_msg_serial_udb_extra_f2_a_pack(system_id, component_id, &msg , packet1.sue_time , packet1.sue_status , packet1.sue_latitude , packet1.sue_longitude , packet1.sue_altitude , packet1.sue_waypoint_index , packet1.sue_rmat0 , packet1.sue_rmat1 , packet1.sue_rmat2 , packet1.sue_rmat3 , packet1.sue_rmat4 , packet1.sue_rmat5 , packet1.sue_rmat6 , packet1.sue_rmat7 , packet1.sue_rmat8 , packet1.sue_cog , packet1.sue_sog , packet1.sue_cpu_load , packet1.sue_voltage_milis , packet1.sue_air_speed_3DIMU , packet1.sue_estimated_wind_0 , packet1.sue_estimated_wind_1 , packet1.sue_estimated_wind_2 , packet1.sue_magFieldEarth0 , packet1.sue_magFieldEarth1 , packet1.sue_magFieldEarth2 , packet1.sue_svs , packet1.sue_hdop );
445  mavlink_msg_serial_udb_extra_f2_a_decode(&msg, &packet2);
446  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
447 
448  memset(&packet2, 0, sizeof(packet2));
449  mavlink_msg_serial_udb_extra_f2_a_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.sue_time , packet1.sue_status , packet1.sue_latitude , packet1.sue_longitude , packet1.sue_altitude , packet1.sue_waypoint_index , packet1.sue_rmat0 , packet1.sue_rmat1 , packet1.sue_rmat2 , packet1.sue_rmat3 , packet1.sue_rmat4 , packet1.sue_rmat5 , packet1.sue_rmat6 , packet1.sue_rmat7 , packet1.sue_rmat8 , packet1.sue_cog , packet1.sue_sog , packet1.sue_cpu_load , packet1.sue_voltage_milis , packet1.sue_air_speed_3DIMU , packet1.sue_estimated_wind_0 , packet1.sue_estimated_wind_1 , packet1.sue_estimated_wind_2 , packet1.sue_magFieldEarth0 , packet1.sue_magFieldEarth1 , packet1.sue_magFieldEarth2 , packet1.sue_svs , packet1.sue_hdop );
450  mavlink_msg_serial_udb_extra_f2_a_decode(&msg, &packet2);
451  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
452 
453  memset(&packet2, 0, sizeof(packet2));
454  mavlink_msg_to_send_buffer(buffer, &msg);
455  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
456  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
457  }
458  mavlink_msg_serial_udb_extra_f2_a_decode(last_msg, &packet2);
459  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
460 
461  memset(&packet2, 0, sizeof(packet2));
462  mavlink_msg_serial_udb_extra_f2_a_send(MAVLINK_COMM_1 , packet1.sue_time , packet1.sue_status , packet1.sue_latitude , packet1.sue_longitude , packet1.sue_altitude , packet1.sue_waypoint_index , packet1.sue_rmat0 , packet1.sue_rmat1 , packet1.sue_rmat2 , packet1.sue_rmat3 , packet1.sue_rmat4 , packet1.sue_rmat5 , packet1.sue_rmat6 , packet1.sue_rmat7 , packet1.sue_rmat8 , packet1.sue_cog , packet1.sue_sog , packet1.sue_cpu_load , packet1.sue_voltage_milis , packet1.sue_air_speed_3DIMU , packet1.sue_estimated_wind_0 , packet1.sue_estimated_wind_1 , packet1.sue_estimated_wind_2 , packet1.sue_magFieldEarth0 , packet1.sue_magFieldEarth1 , packet1.sue_magFieldEarth2 , packet1.sue_svs , packet1.sue_hdop );
463  mavlink_msg_serial_udb_extra_f2_a_decode(last_msg, &packet2);
464  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
465 }
466 
467 static void mavlink_test_serial_udb_extra_f2_b(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
468 {
469  mavlink_message_t msg;
470  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
471  uint16_t i;
472  mavlink_serial_udb_extra_f2_b_t packet_in = {
473  963497464,963497672,17651,17755,17859,17963,18067,18171,18275,18379,18483,18587,18691,18795,18899,19003,19107,19211,19315,19419,19523,19627,19731,19835,19939,20043,20147,20251,20355,20459,20563,20667,20771
474  };
475  mavlink_serial_udb_extra_f2_b_t packet1, packet2;
476  memset(&packet1, 0, sizeof(packet1));
477  packet1.sue_time = packet_in.sue_time;
478  packet1.sue_flags = packet_in.sue_flags;
479  packet1.sue_pwm_input_1 = packet_in.sue_pwm_input_1;
480  packet1.sue_pwm_input_2 = packet_in.sue_pwm_input_2;
481  packet1.sue_pwm_input_3 = packet_in.sue_pwm_input_3;
482  packet1.sue_pwm_input_4 = packet_in.sue_pwm_input_4;
483  packet1.sue_pwm_input_5 = packet_in.sue_pwm_input_5;
484  packet1.sue_pwm_input_6 = packet_in.sue_pwm_input_6;
485  packet1.sue_pwm_input_7 = packet_in.sue_pwm_input_7;
486  packet1.sue_pwm_input_8 = packet_in.sue_pwm_input_8;
487  packet1.sue_pwm_input_9 = packet_in.sue_pwm_input_9;
488  packet1.sue_pwm_input_10 = packet_in.sue_pwm_input_10;
489  packet1.sue_pwm_output_1 = packet_in.sue_pwm_output_1;
490  packet1.sue_pwm_output_2 = packet_in.sue_pwm_output_2;
491  packet1.sue_pwm_output_3 = packet_in.sue_pwm_output_3;
492  packet1.sue_pwm_output_4 = packet_in.sue_pwm_output_4;
493  packet1.sue_pwm_output_5 = packet_in.sue_pwm_output_5;
494  packet1.sue_pwm_output_6 = packet_in.sue_pwm_output_6;
495  packet1.sue_pwm_output_7 = packet_in.sue_pwm_output_7;
496  packet1.sue_pwm_output_8 = packet_in.sue_pwm_output_8;
497  packet1.sue_pwm_output_9 = packet_in.sue_pwm_output_9;
498  packet1.sue_pwm_output_10 = packet_in.sue_pwm_output_10;
499  packet1.sue_imu_location_x = packet_in.sue_imu_location_x;
500  packet1.sue_imu_location_y = packet_in.sue_imu_location_y;
501  packet1.sue_imu_location_z = packet_in.sue_imu_location_z;
502  packet1.sue_osc_fails = packet_in.sue_osc_fails;
503  packet1.sue_imu_velocity_x = packet_in.sue_imu_velocity_x;
504  packet1.sue_imu_velocity_y = packet_in.sue_imu_velocity_y;
505  packet1.sue_imu_velocity_z = packet_in.sue_imu_velocity_z;
506  packet1.sue_waypoint_goal_x = packet_in.sue_waypoint_goal_x;
507  packet1.sue_waypoint_goal_y = packet_in.sue_waypoint_goal_y;
508  packet1.sue_waypoint_goal_z = packet_in.sue_waypoint_goal_z;
509  packet1.sue_memory_stack_free = packet_in.sue_memory_stack_free;
510 
511 
512 
513  memset(&packet2, 0, sizeof(packet2));
514  mavlink_msg_serial_udb_extra_f2_b_encode(system_id, component_id, &msg, &packet1);
515  mavlink_msg_serial_udb_extra_f2_b_decode(&msg, &packet2);
516  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
517 
518  memset(&packet2, 0, sizeof(packet2));
519  mavlink_msg_serial_udb_extra_f2_b_pack(system_id, component_id, &msg , packet1.sue_time , packet1.sue_pwm_input_1 , packet1.sue_pwm_input_2 , packet1.sue_pwm_input_3 , packet1.sue_pwm_input_4 , packet1.sue_pwm_input_5 , packet1.sue_pwm_input_6 , packet1.sue_pwm_input_7 , packet1.sue_pwm_input_8 , packet1.sue_pwm_input_9 , packet1.sue_pwm_input_10 , packet1.sue_pwm_output_1 , packet1.sue_pwm_output_2 , packet1.sue_pwm_output_3 , packet1.sue_pwm_output_4 , packet1.sue_pwm_output_5 , packet1.sue_pwm_output_6 , packet1.sue_pwm_output_7 , packet1.sue_pwm_output_8 , packet1.sue_pwm_output_9 , packet1.sue_pwm_output_10 , packet1.sue_imu_location_x , packet1.sue_imu_location_y , packet1.sue_imu_location_z , packet1.sue_flags , packet1.sue_osc_fails , packet1.sue_imu_velocity_x , packet1.sue_imu_velocity_y , packet1.sue_imu_velocity_z , packet1.sue_waypoint_goal_x , packet1.sue_waypoint_goal_y , packet1.sue_waypoint_goal_z , packet1.sue_memory_stack_free );
520  mavlink_msg_serial_udb_extra_f2_b_decode(&msg, &packet2);
521  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
522 
523  memset(&packet2, 0, sizeof(packet2));
524  mavlink_msg_serial_udb_extra_f2_b_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.sue_time , packet1.sue_pwm_input_1 , packet1.sue_pwm_input_2 , packet1.sue_pwm_input_3 , packet1.sue_pwm_input_4 , packet1.sue_pwm_input_5 , packet1.sue_pwm_input_6 , packet1.sue_pwm_input_7 , packet1.sue_pwm_input_8 , packet1.sue_pwm_input_9 , packet1.sue_pwm_input_10 , packet1.sue_pwm_output_1 , packet1.sue_pwm_output_2 , packet1.sue_pwm_output_3 , packet1.sue_pwm_output_4 , packet1.sue_pwm_output_5 , packet1.sue_pwm_output_6 , packet1.sue_pwm_output_7 , packet1.sue_pwm_output_8 , packet1.sue_pwm_output_9 , packet1.sue_pwm_output_10 , packet1.sue_imu_location_x , packet1.sue_imu_location_y , packet1.sue_imu_location_z , packet1.sue_flags , packet1.sue_osc_fails , packet1.sue_imu_velocity_x , packet1.sue_imu_velocity_y , packet1.sue_imu_velocity_z , packet1.sue_waypoint_goal_x , packet1.sue_waypoint_goal_y , packet1.sue_waypoint_goal_z , packet1.sue_memory_stack_free );
525  mavlink_msg_serial_udb_extra_f2_b_decode(&msg, &packet2);
526  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
527 
528  memset(&packet2, 0, sizeof(packet2));
529  mavlink_msg_to_send_buffer(buffer, &msg);
530  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
531  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
532  }
533  mavlink_msg_serial_udb_extra_f2_b_decode(last_msg, &packet2);
534  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
535 
536  memset(&packet2, 0, sizeof(packet2));
537  mavlink_msg_serial_udb_extra_f2_b_send(MAVLINK_COMM_1 , packet1.sue_time , packet1.sue_pwm_input_1 , packet1.sue_pwm_input_2 , packet1.sue_pwm_input_3 , packet1.sue_pwm_input_4 , packet1.sue_pwm_input_5 , packet1.sue_pwm_input_6 , packet1.sue_pwm_input_7 , packet1.sue_pwm_input_8 , packet1.sue_pwm_input_9 , packet1.sue_pwm_input_10 , packet1.sue_pwm_output_1 , packet1.sue_pwm_output_2 , packet1.sue_pwm_output_3 , packet1.sue_pwm_output_4 , packet1.sue_pwm_output_5 , packet1.sue_pwm_output_6 , packet1.sue_pwm_output_7 , packet1.sue_pwm_output_8 , packet1.sue_pwm_output_9 , packet1.sue_pwm_output_10 , packet1.sue_imu_location_x , packet1.sue_imu_location_y , packet1.sue_imu_location_z , packet1.sue_flags , packet1.sue_osc_fails , packet1.sue_imu_velocity_x , packet1.sue_imu_velocity_y , packet1.sue_imu_velocity_z , packet1.sue_waypoint_goal_x , packet1.sue_waypoint_goal_y , packet1.sue_waypoint_goal_z , packet1.sue_memory_stack_free );
538  mavlink_msg_serial_udb_extra_f2_b_decode(last_msg, &packet2);
539  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
540 }
541 
542 static void mavlink_test_serial_udb_extra_f4(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
543 {
544  mavlink_message_t msg;
545  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
546  uint16_t i;
547  mavlink_serial_udb_extra_f4_t packet_in = {
548  5,72,139,206,17,84,151,218,29,96
549  };
550  mavlink_serial_udb_extra_f4_t packet1, packet2;
551  memset(&packet1, 0, sizeof(packet1));
558  packet1.sue_RUDDER_NAVIGATION = packet_in.sue_RUDDER_NAVIGATION;
561  packet1.sue_RACING_MODE = packet_in.sue_RACING_MODE;
562 
563 
564 
565  memset(&packet2, 0, sizeof(packet2));
566  mavlink_msg_serial_udb_extra_f4_encode(system_id, component_id, &msg, &packet1);
567  mavlink_msg_serial_udb_extra_f4_decode(&msg, &packet2);
568  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
569 
570  memset(&packet2, 0, sizeof(packet2));
571  mavlink_msg_serial_udb_extra_f4_pack(system_id, component_id, &msg , packet1.sue_ROLL_STABILIZATION_AILERONS , packet1.sue_ROLL_STABILIZATION_RUDDER , packet1.sue_PITCH_STABILIZATION , packet1.sue_YAW_STABILIZATION_RUDDER , packet1.sue_YAW_STABILIZATION_AILERON , packet1.sue_AILERON_NAVIGATION , packet1.sue_RUDDER_NAVIGATION , packet1.sue_ALTITUDEHOLD_STABILIZED , packet1.sue_ALTITUDEHOLD_WAYPOINT , packet1.sue_RACING_MODE );
572  mavlink_msg_serial_udb_extra_f4_decode(&msg, &packet2);
573  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
574 
575  memset(&packet2, 0, sizeof(packet2));
576  mavlink_msg_serial_udb_extra_f4_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.sue_ROLL_STABILIZATION_AILERONS , packet1.sue_ROLL_STABILIZATION_RUDDER , packet1.sue_PITCH_STABILIZATION , packet1.sue_YAW_STABILIZATION_RUDDER , packet1.sue_YAW_STABILIZATION_AILERON , packet1.sue_AILERON_NAVIGATION , packet1.sue_RUDDER_NAVIGATION , packet1.sue_ALTITUDEHOLD_STABILIZED , packet1.sue_ALTITUDEHOLD_WAYPOINT , packet1.sue_RACING_MODE );
577  mavlink_msg_serial_udb_extra_f4_decode(&msg, &packet2);
578  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
579 
580  memset(&packet2, 0, sizeof(packet2));
581  mavlink_msg_to_send_buffer(buffer, &msg);
582  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
583  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
584  }
585  mavlink_msg_serial_udb_extra_f4_decode(last_msg, &packet2);
586  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
587 
588  memset(&packet2, 0, sizeof(packet2));
590  mavlink_msg_serial_udb_extra_f4_decode(last_msg, &packet2);
591  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
592 }
593 
594 static void mavlink_test_serial_udb_extra_f5(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
595 {
596  mavlink_message_t msg;
597  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
598  uint16_t i;
599  mavlink_serial_udb_extra_f5_t packet_in = {
600  17.0,45.0,73.0,101.0,129.0,157.0
601  };
602  mavlink_serial_udb_extra_f5_t packet1, packet2;
603  memset(&packet1, 0, sizeof(packet1));
604  packet1.sue_YAWKP_AILERON = packet_in.sue_YAWKP_AILERON;
605  packet1.sue_YAWKD_AILERON = packet_in.sue_YAWKD_AILERON;
606  packet1.sue_ROLLKP = packet_in.sue_ROLLKP;
607  packet1.sue_ROLLKD = packet_in.sue_ROLLKD;
609  packet1.sue_AILERON_BOOST = packet_in.sue_AILERON_BOOST;
610 
611 
612 
613  memset(&packet2, 0, sizeof(packet2));
614  mavlink_msg_serial_udb_extra_f5_encode(system_id, component_id, &msg, &packet1);
615  mavlink_msg_serial_udb_extra_f5_decode(&msg, &packet2);
616  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
617 
618  memset(&packet2, 0, sizeof(packet2));
619  mavlink_msg_serial_udb_extra_f5_pack(system_id, component_id, &msg , packet1.sue_YAWKP_AILERON , packet1.sue_YAWKD_AILERON , packet1.sue_ROLLKP , packet1.sue_ROLLKD , packet1.sue_YAW_STABILIZATION_AILERON , packet1.sue_AILERON_BOOST );
620  mavlink_msg_serial_udb_extra_f5_decode(&msg, &packet2);
621  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
622 
623  memset(&packet2, 0, sizeof(packet2));
624  mavlink_msg_serial_udb_extra_f5_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.sue_YAWKP_AILERON , packet1.sue_YAWKD_AILERON , packet1.sue_ROLLKP , packet1.sue_ROLLKD , packet1.sue_YAW_STABILIZATION_AILERON , packet1.sue_AILERON_BOOST );
625  mavlink_msg_serial_udb_extra_f5_decode(&msg, &packet2);
626  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
627 
628  memset(&packet2, 0, sizeof(packet2));
629  mavlink_msg_to_send_buffer(buffer, &msg);
630  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
631  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
632  }
633  mavlink_msg_serial_udb_extra_f5_decode(last_msg, &packet2);
634  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
635 
636  memset(&packet2, 0, sizeof(packet2));
637  mavlink_msg_serial_udb_extra_f5_send(MAVLINK_COMM_1 , packet1.sue_YAWKP_AILERON , packet1.sue_YAWKD_AILERON , packet1.sue_ROLLKP , packet1.sue_ROLLKD , packet1.sue_YAW_STABILIZATION_AILERON , packet1.sue_AILERON_BOOST );
638  mavlink_msg_serial_udb_extra_f5_decode(last_msg, &packet2);
639  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
640 }
641 
642 static void mavlink_test_serial_udb_extra_f6(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
643 {
644  mavlink_message_t msg;
645  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
646  uint16_t i;
647  mavlink_serial_udb_extra_f6_t packet_in = {
648  17.0,45.0,73.0,101.0,129.0
649  };
650  mavlink_serial_udb_extra_f6_t packet1, packet2;
651  memset(&packet1, 0, sizeof(packet1));
652  packet1.sue_PITCHGAIN = packet_in.sue_PITCHGAIN;
653  packet1.sue_PITCHKD = packet_in.sue_PITCHKD;
654  packet1.sue_RUDDER_ELEV_MIX = packet_in.sue_RUDDER_ELEV_MIX;
655  packet1.sue_ROLL_ELEV_MIX = packet_in.sue_ROLL_ELEV_MIX;
656  packet1.sue_ELEVATOR_BOOST = packet_in.sue_ELEVATOR_BOOST;
657 
658 
659 
660  memset(&packet2, 0, sizeof(packet2));
661  mavlink_msg_serial_udb_extra_f6_encode(system_id, component_id, &msg, &packet1);
662  mavlink_msg_serial_udb_extra_f6_decode(&msg, &packet2);
663  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
664 
665  memset(&packet2, 0, sizeof(packet2));
666  mavlink_msg_serial_udb_extra_f6_pack(system_id, component_id, &msg , packet1.sue_PITCHGAIN , packet1.sue_PITCHKD , packet1.sue_RUDDER_ELEV_MIX , packet1.sue_ROLL_ELEV_MIX , packet1.sue_ELEVATOR_BOOST );
667  mavlink_msg_serial_udb_extra_f6_decode(&msg, &packet2);
668  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
669 
670  memset(&packet2, 0, sizeof(packet2));
671  mavlink_msg_serial_udb_extra_f6_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.sue_PITCHGAIN , packet1.sue_PITCHKD , packet1.sue_RUDDER_ELEV_MIX , packet1.sue_ROLL_ELEV_MIX , packet1.sue_ELEVATOR_BOOST );
672  mavlink_msg_serial_udb_extra_f6_decode(&msg, &packet2);
673  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
674 
675  memset(&packet2, 0, sizeof(packet2));
676  mavlink_msg_to_send_buffer(buffer, &msg);
677  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
678  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
679  }
680  mavlink_msg_serial_udb_extra_f6_decode(last_msg, &packet2);
681  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
682 
683  memset(&packet2, 0, sizeof(packet2));
684  mavlink_msg_serial_udb_extra_f6_send(MAVLINK_COMM_1 , packet1.sue_PITCHGAIN , packet1.sue_PITCHKD , packet1.sue_RUDDER_ELEV_MIX , packet1.sue_ROLL_ELEV_MIX , packet1.sue_ELEVATOR_BOOST );
685  mavlink_msg_serial_udb_extra_f6_decode(last_msg, &packet2);
686  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
687 }
688 
689 static void mavlink_test_serial_udb_extra_f7(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
690 {
691  mavlink_message_t msg;
692  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
693  uint16_t i;
694  mavlink_serial_udb_extra_f7_t packet_in = {
695  17.0,45.0,73.0,101.0,129.0,157.0
696  };
697  mavlink_serial_udb_extra_f7_t packet1, packet2;
698  memset(&packet1, 0, sizeof(packet1));
699  packet1.sue_YAWKP_RUDDER = packet_in.sue_YAWKP_RUDDER;
700  packet1.sue_YAWKD_RUDDER = packet_in.sue_YAWKD_RUDDER;
701  packet1.sue_ROLLKP_RUDDER = packet_in.sue_ROLLKP_RUDDER;
702  packet1.sue_ROLLKD_RUDDER = packet_in.sue_ROLLKD_RUDDER;
703  packet1.sue_RUDDER_BOOST = packet_in.sue_RUDDER_BOOST;
704  packet1.sue_RTL_PITCH_DOWN = packet_in.sue_RTL_PITCH_DOWN;
705 
706 
707 
708  memset(&packet2, 0, sizeof(packet2));
709  mavlink_msg_serial_udb_extra_f7_encode(system_id, component_id, &msg, &packet1);
710  mavlink_msg_serial_udb_extra_f7_decode(&msg, &packet2);
711  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
712 
713  memset(&packet2, 0, sizeof(packet2));
714  mavlink_msg_serial_udb_extra_f7_pack(system_id, component_id, &msg , packet1.sue_YAWKP_RUDDER , packet1.sue_YAWKD_RUDDER , packet1.sue_ROLLKP_RUDDER , packet1.sue_ROLLKD_RUDDER , packet1.sue_RUDDER_BOOST , packet1.sue_RTL_PITCH_DOWN );
715  mavlink_msg_serial_udb_extra_f7_decode(&msg, &packet2);
716  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
717 
718  memset(&packet2, 0, sizeof(packet2));
719  mavlink_msg_serial_udb_extra_f7_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.sue_YAWKP_RUDDER , packet1.sue_YAWKD_RUDDER , packet1.sue_ROLLKP_RUDDER , packet1.sue_ROLLKD_RUDDER , packet1.sue_RUDDER_BOOST , packet1.sue_RTL_PITCH_DOWN );
720  mavlink_msg_serial_udb_extra_f7_decode(&msg, &packet2);
721  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
722 
723  memset(&packet2, 0, sizeof(packet2));
724  mavlink_msg_to_send_buffer(buffer, &msg);
725  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
726  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
727  }
728  mavlink_msg_serial_udb_extra_f7_decode(last_msg, &packet2);
729  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
730 
731  memset(&packet2, 0, sizeof(packet2));
732  mavlink_msg_serial_udb_extra_f7_send(MAVLINK_COMM_1 , packet1.sue_YAWKP_RUDDER , packet1.sue_YAWKD_RUDDER , packet1.sue_ROLLKP_RUDDER , packet1.sue_ROLLKD_RUDDER , packet1.sue_RUDDER_BOOST , packet1.sue_RTL_PITCH_DOWN );
733  mavlink_msg_serial_udb_extra_f7_decode(last_msg, &packet2);
734  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
735 }
736 
737 static void mavlink_test_serial_udb_extra_f8(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
738 {
739  mavlink_message_t msg;
740  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
741  uint16_t i;
742  mavlink_serial_udb_extra_f8_t packet_in = {
743  17.0,45.0,73.0,101.0,129.0,157.0,185.0
744  };
745  mavlink_serial_udb_extra_f8_t packet1, packet2;
746  memset(&packet1, 0, sizeof(packet1));
747  packet1.sue_HEIGHT_TARGET_MAX = packet_in.sue_HEIGHT_TARGET_MAX;
748  packet1.sue_HEIGHT_TARGET_MIN = packet_in.sue_HEIGHT_TARGET_MIN;
754 
755 
756 
757  memset(&packet2, 0, sizeof(packet2));
758  mavlink_msg_serial_udb_extra_f8_encode(system_id, component_id, &msg, &packet1);
759  mavlink_msg_serial_udb_extra_f8_decode(&msg, &packet2);
760  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
761 
762  memset(&packet2, 0, sizeof(packet2));
763  mavlink_msg_serial_udb_extra_f8_pack(system_id, component_id, &msg , packet1.sue_HEIGHT_TARGET_MAX , packet1.sue_HEIGHT_TARGET_MIN , packet1.sue_ALT_HOLD_THROTTLE_MIN , packet1.sue_ALT_HOLD_THROTTLE_MAX , packet1.sue_ALT_HOLD_PITCH_MIN , packet1.sue_ALT_HOLD_PITCH_MAX , packet1.sue_ALT_HOLD_PITCH_HIGH );
764  mavlink_msg_serial_udb_extra_f8_decode(&msg, &packet2);
765  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
766 
767  memset(&packet2, 0, sizeof(packet2));
768  mavlink_msg_serial_udb_extra_f8_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.sue_HEIGHT_TARGET_MAX , packet1.sue_HEIGHT_TARGET_MIN , packet1.sue_ALT_HOLD_THROTTLE_MIN , packet1.sue_ALT_HOLD_THROTTLE_MAX , packet1.sue_ALT_HOLD_PITCH_MIN , packet1.sue_ALT_HOLD_PITCH_MAX , packet1.sue_ALT_HOLD_PITCH_HIGH );
769  mavlink_msg_serial_udb_extra_f8_decode(&msg, &packet2);
770  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
771 
772  memset(&packet2, 0, sizeof(packet2));
773  mavlink_msg_to_send_buffer(buffer, &msg);
774  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
775  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
776  }
777  mavlink_msg_serial_udb_extra_f8_decode(last_msg, &packet2);
778  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
779 
780  memset(&packet2, 0, sizeof(packet2));
781  mavlink_msg_serial_udb_extra_f8_send(MAVLINK_COMM_1 , packet1.sue_HEIGHT_TARGET_MAX , packet1.sue_HEIGHT_TARGET_MIN , packet1.sue_ALT_HOLD_THROTTLE_MIN , packet1.sue_ALT_HOLD_THROTTLE_MAX , packet1.sue_ALT_HOLD_PITCH_MIN , packet1.sue_ALT_HOLD_PITCH_MAX , packet1.sue_ALT_HOLD_PITCH_HIGH );
782  mavlink_msg_serial_udb_extra_f8_decode(last_msg, &packet2);
783  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
784 }
785 
786 static void mavlink_test_serial_udb_extra_f13(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
787 {
788  mavlink_message_t msg;
789  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
790  uint16_t i;
791  mavlink_serial_udb_extra_f13_t packet_in = {
792  963497464,963497672,963497880,17859
793  };
794  mavlink_serial_udb_extra_f13_t packet1, packet2;
795  memset(&packet1, 0, sizeof(packet1));
796  packet1.sue_lat_origin = packet_in.sue_lat_origin;
797  packet1.sue_lon_origin = packet_in.sue_lon_origin;
798  packet1.sue_alt_origin = packet_in.sue_alt_origin;
799  packet1.sue_week_no = packet_in.sue_week_no;
800 
801 
802 
803  memset(&packet2, 0, sizeof(packet2));
804  mavlink_msg_serial_udb_extra_f13_encode(system_id, component_id, &msg, &packet1);
805  mavlink_msg_serial_udb_extra_f13_decode(&msg, &packet2);
806  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
807 
808  memset(&packet2, 0, sizeof(packet2));
809  mavlink_msg_serial_udb_extra_f13_pack(system_id, component_id, &msg , packet1.sue_week_no , packet1.sue_lat_origin , packet1.sue_lon_origin , packet1.sue_alt_origin );
810  mavlink_msg_serial_udb_extra_f13_decode(&msg, &packet2);
811  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
812 
813  memset(&packet2, 0, sizeof(packet2));
814  mavlink_msg_serial_udb_extra_f13_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.sue_week_no , packet1.sue_lat_origin , packet1.sue_lon_origin , packet1.sue_alt_origin );
815  mavlink_msg_serial_udb_extra_f13_decode(&msg, &packet2);
816  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
817 
818  memset(&packet2, 0, sizeof(packet2));
819  mavlink_msg_to_send_buffer(buffer, &msg);
820  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
821  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
822  }
823  mavlink_msg_serial_udb_extra_f13_decode(last_msg, &packet2);
824  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
825 
826  memset(&packet2, 0, sizeof(packet2));
827  mavlink_msg_serial_udb_extra_f13_send(MAVLINK_COMM_1 , packet1.sue_week_no , packet1.sue_lat_origin , packet1.sue_lon_origin , packet1.sue_alt_origin );
828  mavlink_msg_serial_udb_extra_f13_decode(last_msg, &packet2);
829  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
830 }
831 
832 static void mavlink_test_serial_udb_extra_f14(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
833 {
834  mavlink_message_t msg;
835  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
836  uint16_t i;
837  mavlink_serial_udb_extra_f14_t packet_in = {
838  963497464,17443,17547,17651,163,230,41,108,175,242,53
839  };
840  mavlink_serial_udb_extra_f14_t packet1, packet2;
841  memset(&packet1, 0, sizeof(packet1));
842  packet1.sue_TRAP_SOURCE = packet_in.sue_TRAP_SOURCE;
843  packet1.sue_RCON = packet_in.sue_RCON;
844  packet1.sue_TRAP_FLAGS = packet_in.sue_TRAP_FLAGS;
845  packet1.sue_osc_fail_count = packet_in.sue_osc_fail_count;
846  packet1.sue_WIND_ESTIMATION = packet_in.sue_WIND_ESTIMATION;
847  packet1.sue_GPS_TYPE = packet_in.sue_GPS_TYPE;
848  packet1.sue_DR = packet_in.sue_DR;
849  packet1.sue_BOARD_TYPE = packet_in.sue_BOARD_TYPE;
850  packet1.sue_AIRFRAME = packet_in.sue_AIRFRAME;
851  packet1.sue_CLOCK_CONFIG = packet_in.sue_CLOCK_CONFIG;
852  packet1.sue_FLIGHT_PLAN_TYPE = packet_in.sue_FLIGHT_PLAN_TYPE;
853 
854 
855 
856  memset(&packet2, 0, sizeof(packet2));
857  mavlink_msg_serial_udb_extra_f14_encode(system_id, component_id, &msg, &packet1);
858  mavlink_msg_serial_udb_extra_f14_decode(&msg, &packet2);
859  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
860 
861  memset(&packet2, 0, sizeof(packet2));
862  mavlink_msg_serial_udb_extra_f14_pack(system_id, component_id, &msg , packet1.sue_WIND_ESTIMATION , packet1.sue_GPS_TYPE , packet1.sue_DR , packet1.sue_BOARD_TYPE , packet1.sue_AIRFRAME , packet1.sue_RCON , packet1.sue_TRAP_FLAGS , packet1.sue_TRAP_SOURCE , packet1.sue_osc_fail_count , packet1.sue_CLOCK_CONFIG , packet1.sue_FLIGHT_PLAN_TYPE );
863  mavlink_msg_serial_udb_extra_f14_decode(&msg, &packet2);
864  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
865 
866  memset(&packet2, 0, sizeof(packet2));
867  mavlink_msg_serial_udb_extra_f14_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.sue_WIND_ESTIMATION , packet1.sue_GPS_TYPE , packet1.sue_DR , packet1.sue_BOARD_TYPE , packet1.sue_AIRFRAME , packet1.sue_RCON , packet1.sue_TRAP_FLAGS , packet1.sue_TRAP_SOURCE , packet1.sue_osc_fail_count , packet1.sue_CLOCK_CONFIG , packet1.sue_FLIGHT_PLAN_TYPE );
868  mavlink_msg_serial_udb_extra_f14_decode(&msg, &packet2);
869  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
870 
871  memset(&packet2, 0, sizeof(packet2));
872  mavlink_msg_to_send_buffer(buffer, &msg);
873  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
874  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
875  }
876  mavlink_msg_serial_udb_extra_f14_decode(last_msg, &packet2);
877  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
878 
879  memset(&packet2, 0, sizeof(packet2));
880  mavlink_msg_serial_udb_extra_f14_send(MAVLINK_COMM_1 , packet1.sue_WIND_ESTIMATION , packet1.sue_GPS_TYPE , packet1.sue_DR , packet1.sue_BOARD_TYPE , packet1.sue_AIRFRAME , packet1.sue_RCON , packet1.sue_TRAP_FLAGS , packet1.sue_TRAP_SOURCE , packet1.sue_osc_fail_count , packet1.sue_CLOCK_CONFIG , packet1.sue_FLIGHT_PLAN_TYPE );
881  mavlink_msg_serial_udb_extra_f14_decode(last_msg, &packet2);
882  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
883 }
884 
885 static void mavlink_test_serial_udb_extra_f15(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
886 {
887  mavlink_message_t msg;
888  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
889  uint16_t i;
890  mavlink_serial_udb_extra_f15_t packet_in = {
891  { 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44 },{ 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 }
892  };
893  mavlink_serial_udb_extra_f15_t packet1, packet2;
894  memset(&packet1, 0, sizeof(packet1));
895 
896  mav_array_memcpy(packet1.sue_ID_VEHICLE_MODEL_NAME, packet_in.sue_ID_VEHICLE_MODEL_NAME, sizeof(uint8_t)*40);
897  mav_array_memcpy(packet1.sue_ID_VEHICLE_REGISTRATION, packet_in.sue_ID_VEHICLE_REGISTRATION, sizeof(uint8_t)*20);
898 
899 
900  memset(&packet2, 0, sizeof(packet2));
901  mavlink_msg_serial_udb_extra_f15_encode(system_id, component_id, &msg, &packet1);
902  mavlink_msg_serial_udb_extra_f15_decode(&msg, &packet2);
903  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
904 
905  memset(&packet2, 0, sizeof(packet2));
906  mavlink_msg_serial_udb_extra_f15_pack(system_id, component_id, &msg , packet1.sue_ID_VEHICLE_MODEL_NAME , packet1.sue_ID_VEHICLE_REGISTRATION );
907  mavlink_msg_serial_udb_extra_f15_decode(&msg, &packet2);
908  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
909 
910  memset(&packet2, 0, sizeof(packet2));
911  mavlink_msg_serial_udb_extra_f15_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.sue_ID_VEHICLE_MODEL_NAME , packet1.sue_ID_VEHICLE_REGISTRATION );
912  mavlink_msg_serial_udb_extra_f15_decode(&msg, &packet2);
913  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
914 
915  memset(&packet2, 0, sizeof(packet2));
916  mavlink_msg_to_send_buffer(buffer, &msg);
917  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
918  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
919  }
920  mavlink_msg_serial_udb_extra_f15_decode(last_msg, &packet2);
921  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
922 
923  memset(&packet2, 0, sizeof(packet2));
924  mavlink_msg_serial_udb_extra_f15_send(MAVLINK_COMM_1 , packet1.sue_ID_VEHICLE_MODEL_NAME , packet1.sue_ID_VEHICLE_REGISTRATION );
925  mavlink_msg_serial_udb_extra_f15_decode(last_msg, &packet2);
926  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
927 }
928 
929 static void mavlink_test_serial_udb_extra_f16(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
930 {
931  mavlink_message_t msg;
932  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
933  uint16_t i;
934  mavlink_serial_udb_extra_f16_t packet_in = {
935  { 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44 },{ 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194 }
936  };
937  mavlink_serial_udb_extra_f16_t packet1, packet2;
938  memset(&packet1, 0, sizeof(packet1));
939 
940  mav_array_memcpy(packet1.sue_ID_LEAD_PILOT, packet_in.sue_ID_LEAD_PILOT, sizeof(uint8_t)*40);
941  mav_array_memcpy(packet1.sue_ID_DIY_DRONES_URL, packet_in.sue_ID_DIY_DRONES_URL, sizeof(uint8_t)*70);
942 
943 
944  memset(&packet2, 0, sizeof(packet2));
945  mavlink_msg_serial_udb_extra_f16_encode(system_id, component_id, &msg, &packet1);
946  mavlink_msg_serial_udb_extra_f16_decode(&msg, &packet2);
947  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
948 
949  memset(&packet2, 0, sizeof(packet2));
950  mavlink_msg_serial_udb_extra_f16_pack(system_id, component_id, &msg , packet1.sue_ID_LEAD_PILOT , packet1.sue_ID_DIY_DRONES_URL );
951  mavlink_msg_serial_udb_extra_f16_decode(&msg, &packet2);
952  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
953 
954  memset(&packet2, 0, sizeof(packet2));
955  mavlink_msg_serial_udb_extra_f16_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.sue_ID_LEAD_PILOT , packet1.sue_ID_DIY_DRONES_URL );
956  mavlink_msg_serial_udb_extra_f16_decode(&msg, &packet2);
957  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
958 
959  memset(&packet2, 0, sizeof(packet2));
960  mavlink_msg_to_send_buffer(buffer, &msg);
961  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
962  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
963  }
964  mavlink_msg_serial_udb_extra_f16_decode(last_msg, &packet2);
965  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
966 
967  memset(&packet2, 0, sizeof(packet2));
968  mavlink_msg_serial_udb_extra_f16_send(MAVLINK_COMM_1 , packet1.sue_ID_LEAD_PILOT , packet1.sue_ID_DIY_DRONES_URL );
969  mavlink_msg_serial_udb_extra_f16_decode(last_msg, &packet2);
970  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
971 }
972 
973 static void mavlink_test_altitudes(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
974 {
975  mavlink_message_t msg;
976  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
977  uint16_t i;
978  mavlink_altitudes_t packet_in = {
979  963497464,963497672,963497880,963498088,963498296,963498504,963498712
980  };
981  mavlink_altitudes_t packet1, packet2;
982  memset(&packet1, 0, sizeof(packet1));
983  packet1.time_boot_ms = packet_in.time_boot_ms;
984  packet1.alt_gps = packet_in.alt_gps;
985  packet1.alt_imu = packet_in.alt_imu;
986  packet1.alt_barometric = packet_in.alt_barometric;
987  packet1.alt_optical_flow = packet_in.alt_optical_flow;
988  packet1.alt_range_finder = packet_in.alt_range_finder;
989  packet1.alt_extra = packet_in.alt_extra;
990 
991 
992 
993  memset(&packet2, 0, sizeof(packet2));
994  mavlink_msg_altitudes_encode(system_id, component_id, &msg, &packet1);
995  mavlink_msg_altitudes_decode(&msg, &packet2);
996  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
997 
998  memset(&packet2, 0, sizeof(packet2));
999  mavlink_msg_altitudes_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.alt_gps , packet1.alt_imu , packet1.alt_barometric , packet1.alt_optical_flow , packet1.alt_range_finder , packet1.alt_extra );
1000  mavlink_msg_altitudes_decode(&msg, &packet2);
1001  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1002 
1003  memset(&packet2, 0, sizeof(packet2));
1004  mavlink_msg_altitudes_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.alt_gps , packet1.alt_imu , packet1.alt_barometric , packet1.alt_optical_flow , packet1.alt_range_finder , packet1.alt_extra );
1005  mavlink_msg_altitudes_decode(&msg, &packet2);
1006  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1007 
1008  memset(&packet2, 0, sizeof(packet2));
1009  mavlink_msg_to_send_buffer(buffer, &msg);
1010  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1011  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1012  }
1013  mavlink_msg_altitudes_decode(last_msg, &packet2);
1014  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1015 
1016  memset(&packet2, 0, sizeof(packet2));
1017  mavlink_msg_altitudes_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.alt_gps , packet1.alt_imu , packet1.alt_barometric , packet1.alt_optical_flow , packet1.alt_range_finder , packet1.alt_extra );
1018  mavlink_msg_altitudes_decode(last_msg, &packet2);
1019  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1020 }
1021 
1022 static void mavlink_test_airspeeds(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1023 {
1024  mavlink_message_t msg;
1025  uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1026  uint16_t i;
1027  mavlink_airspeeds_t packet_in = {
1028  963497464,17443,17547,17651,17755,17859,17963
1029  };
1030  mavlink_airspeeds_t packet1, packet2;
1031  memset(&packet1, 0, sizeof(packet1));
1032  packet1.time_boot_ms = packet_in.time_boot_ms;
1033  packet1.airspeed_imu = packet_in.airspeed_imu;
1034  packet1.airspeed_pitot = packet_in.airspeed_pitot;
1035  packet1.airspeed_hot_wire = packet_in.airspeed_hot_wire;
1036  packet1.airspeed_ultrasonic = packet_in.airspeed_ultrasonic;
1037  packet1.aoa = packet_in.aoa;
1038  packet1.aoy = packet_in.aoy;
1039 
1040 
1041 
1042  memset(&packet2, 0, sizeof(packet2));
1043  mavlink_msg_airspeeds_encode(system_id, component_id, &msg, &packet1);
1044  mavlink_msg_airspeeds_decode(&msg, &packet2);
1045  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1046 
1047  memset(&packet2, 0, sizeof(packet2));
1048  mavlink_msg_airspeeds_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.airspeed_imu , packet1.airspeed_pitot , packet1.airspeed_hot_wire , packet1.airspeed_ultrasonic , packet1.aoa , packet1.aoy );
1049  mavlink_msg_airspeeds_decode(&msg, &packet2);
1050  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1051 
1052  memset(&packet2, 0, sizeof(packet2));
1053  mavlink_msg_airspeeds_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.airspeed_imu , packet1.airspeed_pitot , packet1.airspeed_hot_wire , packet1.airspeed_ultrasonic , packet1.aoa , packet1.aoy );
1054  mavlink_msg_airspeeds_decode(&msg, &packet2);
1055  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1056 
1057  memset(&packet2, 0, sizeof(packet2));
1058  mavlink_msg_to_send_buffer(buffer, &msg);
1059  for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1060  comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1061  }
1062  mavlink_msg_airspeeds_decode(last_msg, &packet2);
1063  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1064 
1065  memset(&packet2, 0, sizeof(packet2));
1066  mavlink_msg_airspeeds_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.airspeed_imu , packet1.airspeed_pitot , packet1.airspeed_hot_wire , packet1.airspeed_ultrasonic , packet1.aoa , packet1.aoy );
1067  mavlink_msg_airspeeds_decode(last_msg, &packet2);
1068  MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1069 }
1070 
1071 static void mavlink_test_matrixpilot(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1072 {
1073  mavlink_test_flexifunction_set(system_id, component_id, last_msg);
1074  mavlink_test_flexifunction_read_req(system_id, component_id, last_msg);
1075  mavlink_test_flexifunction_buffer_function(system_id, component_id, last_msg);
1076  mavlink_test_flexifunction_buffer_function_ack(system_id, component_id, last_msg);
1077  mavlink_test_flexifunction_directory(system_id, component_id, last_msg);
1078  mavlink_test_flexifunction_directory_ack(system_id, component_id, last_msg);
1079  mavlink_test_flexifunction_command(system_id, component_id, last_msg);
1080  mavlink_test_flexifunction_command_ack(system_id, component_id, last_msg);
1081  mavlink_test_serial_udb_extra_f2_a(system_id, component_id, last_msg);
1082  mavlink_test_serial_udb_extra_f2_b(system_id, component_id, last_msg);
1083  mavlink_test_serial_udb_extra_f4(system_id, component_id, last_msg);
1084  mavlink_test_serial_udb_extra_f5(system_id, component_id, last_msg);
1085  mavlink_test_serial_udb_extra_f6(system_id, component_id, last_msg);
1086  mavlink_test_serial_udb_extra_f7(system_id, component_id, last_msg);
1087  mavlink_test_serial_udb_extra_f8(system_id, component_id, last_msg);
1088  mavlink_test_serial_udb_extra_f13(system_id, component_id, last_msg);
1089  mavlink_test_serial_udb_extra_f14(system_id, component_id, last_msg);
1090  mavlink_test_serial_udb_extra_f15(system_id, component_id, last_msg);
1091  mavlink_test_serial_udb_extra_f16(system_id, component_id, last_msg);
1092  mavlink_test_altitudes(system_id, component_id, last_msg);
1093  mavlink_test_airspeeds(system_id, component_id, last_msg);
1094 }
1095 
1096 #ifdef __cplusplus
1097 }
1098 #endif // __cplusplus
1099 #endif // MATRIXPILOT_TESTSUITE_H
#define MAVLINK_ASSERT(x)
Definition: protocol.h:26