RflySimSDK v3.08
RflySimSDK说明文档
载入中...
搜索中...
未找到
testsuite.h
浏览该文件的文档.
1/** @file
2 * @brief MAVLink comm protocol testsuite generated from matrixpilot.xml
3 * @see http://qgroundcontrol.org/mavlink/
4 */
5#pragma once
6#ifndef MATRIXPILOT_TESTSUITE_H
7#define MATRIXPILOT_TESTSUITE_H
8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
13#ifndef MAVLINK_TEST_ALL
14#define MAVLINK_TEST_ALL
15static void mavlink_test_common(uint8_t, uint8_t, mavlink_message_t *last_msg);
16static void mavlink_test_matrixpilot(uint8_t, uint8_t, mavlink_message_t *last_msg);
17
18static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
19{
20 mavlink_test_common(system_id, component_id, last_msg);
21 mavlink_test_matrixpilot(system_id, component_id, last_msg);
22}
23#endif
24
25#include "../common/testsuite.h"
26
27
28static void mavlink_test_flexifunction_set(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
29{
30#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
31 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
32 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FLEXIFUNCTION_SET >= 256) {
33 return;
34 }
35#endif
36 mavlink_message_t msg;
37 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
38 uint16_t i;
39 mavlink_flexifunction_set_t packet_in = {
40 5,72
41 };
42 mavlink_flexifunction_set_t packet1, packet2;
43 memset(&packet1, 0, sizeof(packet1));
44 packet1.target_system = packet_in.target_system;
45 packet1.target_component = packet_in.target_component;
46
47
48#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
49 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
50 // cope with extensions
51 memset(MAVLINK_MSG_ID_FLEXIFUNCTION_SET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FLEXIFUNCTION_SET_MIN_LEN);
52 }
53#endif
54 memset(&packet2, 0, sizeof(packet2));
55 mavlink_msg_flexifunction_set_encode(system_id, component_id, &msg, &packet1);
56 mavlink_msg_flexifunction_set_decode(&msg, &packet2);
57 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
58
59 memset(&packet2, 0, sizeof(packet2));
60 mavlink_msg_flexifunction_set_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
61 mavlink_msg_flexifunction_set_decode(&msg, &packet2);
62 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
63
64 memset(&packet2, 0, sizeof(packet2));
65 mavlink_msg_flexifunction_set_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
66 mavlink_msg_flexifunction_set_decode(&msg, &packet2);
67 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
68
69 memset(&packet2, 0, sizeof(packet2));
70 mavlink_msg_to_send_buffer(buffer, &msg);
71 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
72 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
73 }
74 mavlink_msg_flexifunction_set_decode(last_msg, &packet2);
75 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
76
77 memset(&packet2, 0, sizeof(packet2));
78 mavlink_msg_flexifunction_set_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
79 mavlink_msg_flexifunction_set_decode(last_msg, &packet2);
80 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
81}
82
83static void mavlink_test_flexifunction_read_req(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
84{
85#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
86 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
87 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FLEXIFUNCTION_READ_REQ >= 256) {
88 return;
89 }
90#endif
91 mavlink_message_t msg;
92 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
93 uint16_t i;
94 mavlink_flexifunction_read_req_t packet_in = {
95 17235,17339,17,84
96 };
97 mavlink_flexifunction_read_req_t packet1, packet2;
98 memset(&packet1, 0, sizeof(packet1));
99 packet1.read_req_type = packet_in.read_req_type;
100 packet1.data_index = packet_in.data_index;
101 packet1.target_system = packet_in.target_system;
102 packet1.target_component = packet_in.target_component;
103
104
105#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
106 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
107 // cope with extensions
108 memset(MAVLINK_MSG_ID_FLEXIFUNCTION_READ_REQ_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FLEXIFUNCTION_READ_REQ_MIN_LEN);
109 }
110#endif
111 memset(&packet2, 0, sizeof(packet2));
112 mavlink_msg_flexifunction_read_req_encode(system_id, component_id, &msg, &packet1);
113 mavlink_msg_flexifunction_read_req_decode(&msg, &packet2);
114 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
115
116 memset(&packet2, 0, sizeof(packet2));
117 mavlink_msg_flexifunction_read_req_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.read_req_type , packet1.data_index );
118 mavlink_msg_flexifunction_read_req_decode(&msg, &packet2);
119 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
120
121 memset(&packet2, 0, sizeof(packet2));
122 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 );
123 mavlink_msg_flexifunction_read_req_decode(&msg, &packet2);
124 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
125
126 memset(&packet2, 0, sizeof(packet2));
127 mavlink_msg_to_send_buffer(buffer, &msg);
128 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
129 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
130 }
131 mavlink_msg_flexifunction_read_req_decode(last_msg, &packet2);
132 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
133
134 memset(&packet2, 0, sizeof(packet2));
135 mavlink_msg_flexifunction_read_req_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.read_req_type , packet1.data_index );
136 mavlink_msg_flexifunction_read_req_decode(last_msg, &packet2);
137 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
138}
139
140static void mavlink_test_flexifunction_buffer_function(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
141{
142#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
143 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
144 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FLEXIFUNCTION_BUFFER_FUNCTION >= 256) {
145 return;
146 }
147#endif
148 mavlink_message_t msg;
149 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
150 uint16_t i;
151 mavlink_flexifunction_buffer_function_t packet_in = {
152 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 }
153 };
154 mavlink_flexifunction_buffer_function_t packet1, packet2;
155 memset(&packet1, 0, sizeof(packet1));
156 packet1.func_index = packet_in.func_index;
157 packet1.func_count = packet_in.func_count;
158 packet1.data_address = packet_in.data_address;
159 packet1.data_size = packet_in.data_size;
160 packet1.target_system = packet_in.target_system;
161 packet1.target_component = packet_in.target_component;
162
163 mav_array_memcpy(packet1.data, packet_in.data, sizeof(int8_t)*48);
164
165#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
166 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
167 // cope with extensions
168 memset(MAVLINK_MSG_ID_FLEXIFUNCTION_BUFFER_FUNCTION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FLEXIFUNCTION_BUFFER_FUNCTION_MIN_LEN);
169 }
170#endif
171 memset(&packet2, 0, sizeof(packet2));
172 mavlink_msg_flexifunction_buffer_function_encode(system_id, component_id, &msg, &packet1);
173 mavlink_msg_flexifunction_buffer_function_decode(&msg, &packet2);
174 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
175
176 memset(&packet2, 0, sizeof(packet2));
177 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 );
178 mavlink_msg_flexifunction_buffer_function_decode(&msg, &packet2);
179 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
180
181 memset(&packet2, 0, sizeof(packet2));
182 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 );
183 mavlink_msg_flexifunction_buffer_function_decode(&msg, &packet2);
184 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
185
186 memset(&packet2, 0, sizeof(packet2));
187 mavlink_msg_to_send_buffer(buffer, &msg);
188 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
189 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
190 }
191 mavlink_msg_flexifunction_buffer_function_decode(last_msg, &packet2);
192 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
193
194 memset(&packet2, 0, sizeof(packet2));
195 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 );
196 mavlink_msg_flexifunction_buffer_function_decode(last_msg, &packet2);
197 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
198}
199
200static void mavlink_test_flexifunction_buffer_function_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
201{
202#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
203 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
204 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FLEXIFUNCTION_BUFFER_FUNCTION_ACK >= 256) {
205 return;
206 }
207#endif
208 mavlink_message_t msg;
209 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
210 uint16_t i;
211 mavlink_flexifunction_buffer_function_ack_t packet_in = {
212 17235,17339,17,84
213 };
214 mavlink_flexifunction_buffer_function_ack_t packet1, packet2;
215 memset(&packet1, 0, sizeof(packet1));
216 packet1.func_index = packet_in.func_index;
217 packet1.result = packet_in.result;
218 packet1.target_system = packet_in.target_system;
219 packet1.target_component = packet_in.target_component;
220
221
222#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
223 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
224 // cope with extensions
225 memset(MAVLINK_MSG_ID_FLEXIFUNCTION_BUFFER_FUNCTION_ACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FLEXIFUNCTION_BUFFER_FUNCTION_ACK_MIN_LEN);
226 }
227#endif
228 memset(&packet2, 0, sizeof(packet2));
229 mavlink_msg_flexifunction_buffer_function_ack_encode(system_id, component_id, &msg, &packet1);
230 mavlink_msg_flexifunction_buffer_function_ack_decode(&msg, &packet2);
231 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
232
233 memset(&packet2, 0, sizeof(packet2));
234 mavlink_msg_flexifunction_buffer_function_ack_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.func_index , packet1.result );
235 mavlink_msg_flexifunction_buffer_function_ack_decode(&msg, &packet2);
236 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
237
238 memset(&packet2, 0, sizeof(packet2));
239 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 );
240 mavlink_msg_flexifunction_buffer_function_ack_decode(&msg, &packet2);
241 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
242
243 memset(&packet2, 0, sizeof(packet2));
244 mavlink_msg_to_send_buffer(buffer, &msg);
245 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
246 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
247 }
248 mavlink_msg_flexifunction_buffer_function_ack_decode(last_msg, &packet2);
249 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
250
251 memset(&packet2, 0, sizeof(packet2));
252 mavlink_msg_flexifunction_buffer_function_ack_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.func_index , packet1.result );
253 mavlink_msg_flexifunction_buffer_function_ack_decode(last_msg, &packet2);
254 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
255}
256
257static void mavlink_test_flexifunction_directory(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
258{
259#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
260 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
261 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY >= 256) {
262 return;
263 }
264#endif
265 mavlink_message_t msg;
266 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
267 uint16_t i;
268 mavlink_flexifunction_directory_t packet_in = {
269 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 }
270 };
271 mavlink_flexifunction_directory_t packet1, packet2;
272 memset(&packet1, 0, sizeof(packet1));
273 packet1.target_system = packet_in.target_system;
274 packet1.target_component = packet_in.target_component;
275 packet1.directory_type = packet_in.directory_type;
276 packet1.start_index = packet_in.start_index;
277 packet1.count = packet_in.count;
278
279 mav_array_memcpy(packet1.directory_data, packet_in.directory_data, sizeof(int8_t)*48);
280
281#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
282 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
283 // cope with extensions
284 memset(MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY_MIN_LEN);
285 }
286#endif
287 memset(&packet2, 0, sizeof(packet2));
288 mavlink_msg_flexifunction_directory_encode(system_id, component_id, &msg, &packet1);
289 mavlink_msg_flexifunction_directory_decode(&msg, &packet2);
290 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
291
292 memset(&packet2, 0, sizeof(packet2));
293 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 );
294 mavlink_msg_flexifunction_directory_decode(&msg, &packet2);
295 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
296
297 memset(&packet2, 0, sizeof(packet2));
298 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 );
299 mavlink_msg_flexifunction_directory_decode(&msg, &packet2);
300 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
301
302 memset(&packet2, 0, sizeof(packet2));
303 mavlink_msg_to_send_buffer(buffer, &msg);
304 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
305 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
306 }
307 mavlink_msg_flexifunction_directory_decode(last_msg, &packet2);
308 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
309
310 memset(&packet2, 0, sizeof(packet2));
311 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 );
312 mavlink_msg_flexifunction_directory_decode(last_msg, &packet2);
313 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
314}
315
316static void mavlink_test_flexifunction_directory_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
317{
318#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
319 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
320 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY_ACK >= 256) {
321 return;
322 }
323#endif
324 mavlink_message_t msg;
325 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
326 uint16_t i;
327 mavlink_flexifunction_directory_ack_t packet_in = {
328 17235,139,206,17,84,151
329 };
330 mavlink_flexifunction_directory_ack_t packet1, packet2;
331 memset(&packet1, 0, sizeof(packet1));
332 packet1.result = packet_in.result;
333 packet1.target_system = packet_in.target_system;
334 packet1.target_component = packet_in.target_component;
335 packet1.directory_type = packet_in.directory_type;
336 packet1.start_index = packet_in.start_index;
337 packet1.count = packet_in.count;
338
339
340#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
341 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
342 // cope with extensions
343 memset(MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY_ACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY_ACK_MIN_LEN);
344 }
345#endif
346 memset(&packet2, 0, sizeof(packet2));
347 mavlink_msg_flexifunction_directory_ack_encode(system_id, component_id, &msg, &packet1);
348 mavlink_msg_flexifunction_directory_ack_decode(&msg, &packet2);
349 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
350
351 memset(&packet2, 0, sizeof(packet2));
352 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 );
353 mavlink_msg_flexifunction_directory_ack_decode(&msg, &packet2);
354 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
355
356 memset(&packet2, 0, sizeof(packet2));
357 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 );
358 mavlink_msg_flexifunction_directory_ack_decode(&msg, &packet2);
359 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
360
361 memset(&packet2, 0, sizeof(packet2));
362 mavlink_msg_to_send_buffer(buffer, &msg);
363 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
364 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
365 }
366 mavlink_msg_flexifunction_directory_ack_decode(last_msg, &packet2);
367 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
368
369 memset(&packet2, 0, sizeof(packet2));
370 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 );
371 mavlink_msg_flexifunction_directory_ack_decode(last_msg, &packet2);
372 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
373}
374
375static void mavlink_test_flexifunction_command(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
376{
377#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
378 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
379 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FLEXIFUNCTION_COMMAND >= 256) {
380 return;
381 }
382#endif
383 mavlink_message_t msg;
384 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
385 uint16_t i;
386 mavlink_flexifunction_command_t packet_in = {
387 5,72,139
388 };
389 mavlink_flexifunction_command_t packet1, packet2;
390 memset(&packet1, 0, sizeof(packet1));
391 packet1.target_system = packet_in.target_system;
392 packet1.target_component = packet_in.target_component;
393 packet1.command_type = packet_in.command_type;
394
395
396#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
397 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
398 // cope with extensions
399 memset(MAVLINK_MSG_ID_FLEXIFUNCTION_COMMAND_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FLEXIFUNCTION_COMMAND_MIN_LEN);
400 }
401#endif
402 memset(&packet2, 0, sizeof(packet2));
403 mavlink_msg_flexifunction_command_encode(system_id, component_id, &msg, &packet1);
404 mavlink_msg_flexifunction_command_decode(&msg, &packet2);
405 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
406
407 memset(&packet2, 0, sizeof(packet2));
408 mavlink_msg_flexifunction_command_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.command_type );
409 mavlink_msg_flexifunction_command_decode(&msg, &packet2);
410 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
411
412 memset(&packet2, 0, sizeof(packet2));
413 mavlink_msg_flexifunction_command_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.command_type );
414 mavlink_msg_flexifunction_command_decode(&msg, &packet2);
415 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
416
417 memset(&packet2, 0, sizeof(packet2));
418 mavlink_msg_to_send_buffer(buffer, &msg);
419 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
420 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
421 }
422 mavlink_msg_flexifunction_command_decode(last_msg, &packet2);
423 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
424
425 memset(&packet2, 0, sizeof(packet2));
426 mavlink_msg_flexifunction_command_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.command_type );
427 mavlink_msg_flexifunction_command_decode(last_msg, &packet2);
428 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
429}
430
431static void mavlink_test_flexifunction_command_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
432{
433#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
434 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
435 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FLEXIFUNCTION_COMMAND_ACK >= 256) {
436 return;
437 }
438#endif
439 mavlink_message_t msg;
440 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
441 uint16_t i;
442 mavlink_flexifunction_command_ack_t packet_in = {
443 17235,17339
444 };
445 mavlink_flexifunction_command_ack_t packet1, packet2;
446 memset(&packet1, 0, sizeof(packet1));
447 packet1.command_type = packet_in.command_type;
448 packet1.result = packet_in.result;
449
450
451#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
452 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
453 // cope with extensions
454 memset(MAVLINK_MSG_ID_FLEXIFUNCTION_COMMAND_ACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FLEXIFUNCTION_COMMAND_ACK_MIN_LEN);
455 }
456#endif
457 memset(&packet2, 0, sizeof(packet2));
458 mavlink_msg_flexifunction_command_ack_encode(system_id, component_id, &msg, &packet1);
459 mavlink_msg_flexifunction_command_ack_decode(&msg, &packet2);
460 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
461
462 memset(&packet2, 0, sizeof(packet2));
463 mavlink_msg_flexifunction_command_ack_pack(system_id, component_id, &msg , packet1.command_type , packet1.result );
464 mavlink_msg_flexifunction_command_ack_decode(&msg, &packet2);
465 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
466
467 memset(&packet2, 0, sizeof(packet2));
468 mavlink_msg_flexifunction_command_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.command_type , packet1.result );
469 mavlink_msg_flexifunction_command_ack_decode(&msg, &packet2);
470 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
471
472 memset(&packet2, 0, sizeof(packet2));
473 mavlink_msg_to_send_buffer(buffer, &msg);
474 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
475 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
476 }
477 mavlink_msg_flexifunction_command_ack_decode(last_msg, &packet2);
478 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
479
480 memset(&packet2, 0, sizeof(packet2));
481 mavlink_msg_flexifunction_command_ack_send(MAVLINK_COMM_1 , packet1.command_type , packet1.result );
482 mavlink_msg_flexifunction_command_ack_decode(last_msg, &packet2);
483 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
484}
485
486static void mavlink_test_serial_udb_extra_f2_a(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
487{
488#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
489 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
490 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F2_A >= 256) {
491 return;
492 }
493#endif
494 mavlink_message_t msg;
495 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
496 uint16_t i;
497 mavlink_serial_udb_extra_f2_a_t packet_in = {
498 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,185
499 };
500 mavlink_serial_udb_extra_f2_a_t packet1, packet2;
501 memset(&packet1, 0, sizeof(packet1));
502 packet1.sue_time = packet_in.sue_time;
503 packet1.sue_latitude = packet_in.sue_latitude;
504 packet1.sue_longitude = packet_in.sue_longitude;
505 packet1.sue_altitude = packet_in.sue_altitude;
506 packet1.sue_waypoint_index = packet_in.sue_waypoint_index;
507 packet1.sue_rmat0 = packet_in.sue_rmat0;
508 packet1.sue_rmat1 = packet_in.sue_rmat1;
509 packet1.sue_rmat2 = packet_in.sue_rmat2;
510 packet1.sue_rmat3 = packet_in.sue_rmat3;
511 packet1.sue_rmat4 = packet_in.sue_rmat4;
512 packet1.sue_rmat5 = packet_in.sue_rmat5;
513 packet1.sue_rmat6 = packet_in.sue_rmat6;
514 packet1.sue_rmat7 = packet_in.sue_rmat7;
515 packet1.sue_rmat8 = packet_in.sue_rmat8;
516 packet1.sue_cog = packet_in.sue_cog;
517 packet1.sue_sog = packet_in.sue_sog;
518 packet1.sue_cpu_load = packet_in.sue_cpu_load;
519 packet1.sue_air_speed_3DIMU = packet_in.sue_air_speed_3DIMU;
520 packet1.sue_estimated_wind_0 = packet_in.sue_estimated_wind_0;
521 packet1.sue_estimated_wind_1 = packet_in.sue_estimated_wind_1;
522 packet1.sue_estimated_wind_2 = packet_in.sue_estimated_wind_2;
523 packet1.sue_magFieldEarth0 = packet_in.sue_magFieldEarth0;
524 packet1.sue_magFieldEarth1 = packet_in.sue_magFieldEarth1;
525 packet1.sue_magFieldEarth2 = packet_in.sue_magFieldEarth2;
526 packet1.sue_svs = packet_in.sue_svs;
527 packet1.sue_hdop = packet_in.sue_hdop;
528 packet1.sue_status = packet_in.sue_status;
529
530
531#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
532 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
533 // cope with extensions
534 memset(MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F2_A_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F2_A_MIN_LEN);
535 }
536#endif
537 memset(&packet2, 0, sizeof(packet2));
538 mavlink_msg_serial_udb_extra_f2_a_encode(system_id, component_id, &msg, &packet1);
539 mavlink_msg_serial_udb_extra_f2_a_decode(&msg, &packet2);
540 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
541
542 memset(&packet2, 0, sizeof(packet2));
543 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_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 );
544 mavlink_msg_serial_udb_extra_f2_a_decode(&msg, &packet2);
545 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
546
547 memset(&packet2, 0, sizeof(packet2));
548 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_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 );
549 mavlink_msg_serial_udb_extra_f2_a_decode(&msg, &packet2);
550 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
551
552 memset(&packet2, 0, sizeof(packet2));
553 mavlink_msg_to_send_buffer(buffer, &msg);
554 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
555 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
556 }
557 mavlink_msg_serial_udb_extra_f2_a_decode(last_msg, &packet2);
558 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
559
560 memset(&packet2, 0, sizeof(packet2));
561 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_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 );
562 mavlink_msg_serial_udb_extra_f2_a_decode(last_msg, &packet2);
563 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
564}
565
566static void mavlink_test_serial_udb_extra_f2_b(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
567{
568#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
569 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
570 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F2_B >= 256) {
571 return;
572 }
573#endif
574 mavlink_message_t msg;
575 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
576 uint16_t i;
577 mavlink_serial_udb_extra_f2_b_t packet_in = {
578 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,20459,20563,20667,20771,20875,20979,21083,21187,21291,21395,21499,21603,21707,21811,21915,22019,22123,22227,22331,22435,22539,22643,22747
579 };
580 mavlink_serial_udb_extra_f2_b_t packet1, packet2;
581 memset(&packet1, 0, sizeof(packet1));
582 packet1.sue_time = packet_in.sue_time;
583 packet1.sue_flags = packet_in.sue_flags;
584 packet1.sue_barom_press = packet_in.sue_barom_press;
585 packet1.sue_barom_alt = packet_in.sue_barom_alt;
586 packet1.sue_pwm_input_1 = packet_in.sue_pwm_input_1;
587 packet1.sue_pwm_input_2 = packet_in.sue_pwm_input_2;
588 packet1.sue_pwm_input_3 = packet_in.sue_pwm_input_3;
589 packet1.sue_pwm_input_4 = packet_in.sue_pwm_input_4;
590 packet1.sue_pwm_input_5 = packet_in.sue_pwm_input_5;
591 packet1.sue_pwm_input_6 = packet_in.sue_pwm_input_6;
592 packet1.sue_pwm_input_7 = packet_in.sue_pwm_input_7;
593 packet1.sue_pwm_input_8 = packet_in.sue_pwm_input_8;
594 packet1.sue_pwm_input_9 = packet_in.sue_pwm_input_9;
595 packet1.sue_pwm_input_10 = packet_in.sue_pwm_input_10;
596 packet1.sue_pwm_input_11 = packet_in.sue_pwm_input_11;
597 packet1.sue_pwm_input_12 = packet_in.sue_pwm_input_12;
598 packet1.sue_pwm_output_1 = packet_in.sue_pwm_output_1;
599 packet1.sue_pwm_output_2 = packet_in.sue_pwm_output_2;
600 packet1.sue_pwm_output_3 = packet_in.sue_pwm_output_3;
601 packet1.sue_pwm_output_4 = packet_in.sue_pwm_output_4;
602 packet1.sue_pwm_output_5 = packet_in.sue_pwm_output_5;
603 packet1.sue_pwm_output_6 = packet_in.sue_pwm_output_6;
604 packet1.sue_pwm_output_7 = packet_in.sue_pwm_output_7;
605 packet1.sue_pwm_output_8 = packet_in.sue_pwm_output_8;
606 packet1.sue_pwm_output_9 = packet_in.sue_pwm_output_9;
607 packet1.sue_pwm_output_10 = packet_in.sue_pwm_output_10;
608 packet1.sue_pwm_output_11 = packet_in.sue_pwm_output_11;
609 packet1.sue_pwm_output_12 = packet_in.sue_pwm_output_12;
610 packet1.sue_imu_location_x = packet_in.sue_imu_location_x;
611 packet1.sue_imu_location_y = packet_in.sue_imu_location_y;
612 packet1.sue_imu_location_z = packet_in.sue_imu_location_z;
613 packet1.sue_location_error_earth_x = packet_in.sue_location_error_earth_x;
614 packet1.sue_location_error_earth_y = packet_in.sue_location_error_earth_y;
615 packet1.sue_location_error_earth_z = packet_in.sue_location_error_earth_z;
616 packet1.sue_osc_fails = packet_in.sue_osc_fails;
617 packet1.sue_imu_velocity_x = packet_in.sue_imu_velocity_x;
618 packet1.sue_imu_velocity_y = packet_in.sue_imu_velocity_y;
619 packet1.sue_imu_velocity_z = packet_in.sue_imu_velocity_z;
620 packet1.sue_waypoint_goal_x = packet_in.sue_waypoint_goal_x;
621 packet1.sue_waypoint_goal_y = packet_in.sue_waypoint_goal_y;
622 packet1.sue_waypoint_goal_z = packet_in.sue_waypoint_goal_z;
623 packet1.sue_aero_x = packet_in.sue_aero_x;
624 packet1.sue_aero_y = packet_in.sue_aero_y;
625 packet1.sue_aero_z = packet_in.sue_aero_z;
626 packet1.sue_barom_temp = packet_in.sue_barom_temp;
627 packet1.sue_bat_volt = packet_in.sue_bat_volt;
628 packet1.sue_bat_amp = packet_in.sue_bat_amp;
629 packet1.sue_bat_amp_hours = packet_in.sue_bat_amp_hours;
630 packet1.sue_desired_height = packet_in.sue_desired_height;
631 packet1.sue_memory_stack_free = packet_in.sue_memory_stack_free;
632
633
634#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
635 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
636 // cope with extensions
637 memset(MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F2_B_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F2_B_MIN_LEN);
638 }
639#endif
640 memset(&packet2, 0, sizeof(packet2));
641 mavlink_msg_serial_udb_extra_f2_b_encode(system_id, component_id, &msg, &packet1);
642 mavlink_msg_serial_udb_extra_f2_b_decode(&msg, &packet2);
643 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
644
645 memset(&packet2, 0, sizeof(packet2));
646 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_input_11 , packet1.sue_pwm_input_12 , 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_pwm_output_11 , packet1.sue_pwm_output_12 , packet1.sue_imu_location_x , packet1.sue_imu_location_y , packet1.sue_imu_location_z , packet1.sue_location_error_earth_x , packet1.sue_location_error_earth_y , packet1.sue_location_error_earth_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_aero_x , packet1.sue_aero_y , packet1.sue_aero_z , packet1.sue_barom_temp , packet1.sue_barom_press , packet1.sue_barom_alt , packet1.sue_bat_volt , packet1.sue_bat_amp , packet1.sue_bat_amp_hours , packet1.sue_desired_height , packet1.sue_memory_stack_free );
647 mavlink_msg_serial_udb_extra_f2_b_decode(&msg, &packet2);
648 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
649
650 memset(&packet2, 0, sizeof(packet2));
651 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_input_11 , packet1.sue_pwm_input_12 , 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_pwm_output_11 , packet1.sue_pwm_output_12 , packet1.sue_imu_location_x , packet1.sue_imu_location_y , packet1.sue_imu_location_z , packet1.sue_location_error_earth_x , packet1.sue_location_error_earth_y , packet1.sue_location_error_earth_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_aero_x , packet1.sue_aero_y , packet1.sue_aero_z , packet1.sue_barom_temp , packet1.sue_barom_press , packet1.sue_barom_alt , packet1.sue_bat_volt , packet1.sue_bat_amp , packet1.sue_bat_amp_hours , packet1.sue_desired_height , packet1.sue_memory_stack_free );
652 mavlink_msg_serial_udb_extra_f2_b_decode(&msg, &packet2);
653 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
654
655 memset(&packet2, 0, sizeof(packet2));
656 mavlink_msg_to_send_buffer(buffer, &msg);
657 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
658 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
659 }
660 mavlink_msg_serial_udb_extra_f2_b_decode(last_msg, &packet2);
661 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
662
663 memset(&packet2, 0, sizeof(packet2));
664 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_input_11 , packet1.sue_pwm_input_12 , 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_pwm_output_11 , packet1.sue_pwm_output_12 , packet1.sue_imu_location_x , packet1.sue_imu_location_y , packet1.sue_imu_location_z , packet1.sue_location_error_earth_x , packet1.sue_location_error_earth_y , packet1.sue_location_error_earth_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_aero_x , packet1.sue_aero_y , packet1.sue_aero_z , packet1.sue_barom_temp , packet1.sue_barom_press , packet1.sue_barom_alt , packet1.sue_bat_volt , packet1.sue_bat_amp , packet1.sue_bat_amp_hours , packet1.sue_desired_height , packet1.sue_memory_stack_free );
665 mavlink_msg_serial_udb_extra_f2_b_decode(last_msg, &packet2);
666 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
667}
668
669static void mavlink_test_serial_udb_extra_f4(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
670{
671#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
672 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
673 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F4 >= 256) {
674 return;
675 }
676#endif
677 mavlink_message_t msg;
678 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
679 uint16_t i;
680 mavlink_serial_udb_extra_f4_t packet_in = {
681 5,72,139,206,17,84,151,218,29,96
682 };
683 mavlink_serial_udb_extra_f4_t packet1, packet2;
684 memset(&packet1, 0, sizeof(packet1));
685 packet1.sue_ROLL_STABILIZATION_AILERONS = packet_in.sue_ROLL_STABILIZATION_AILERONS;
686 packet1.sue_ROLL_STABILIZATION_RUDDER = packet_in.sue_ROLL_STABILIZATION_RUDDER;
687 packet1.sue_PITCH_STABILIZATION = packet_in.sue_PITCH_STABILIZATION;
688 packet1.sue_YAW_STABILIZATION_RUDDER = packet_in.sue_YAW_STABILIZATION_RUDDER;
689 packet1.sue_YAW_STABILIZATION_AILERON = packet_in.sue_YAW_STABILIZATION_AILERON;
690 packet1.sue_AILERON_NAVIGATION = packet_in.sue_AILERON_NAVIGATION;
691 packet1.sue_RUDDER_NAVIGATION = packet_in.sue_RUDDER_NAVIGATION;
692 packet1.sue_ALTITUDEHOLD_STABILIZED = packet_in.sue_ALTITUDEHOLD_STABILIZED;
693 packet1.sue_ALTITUDEHOLD_WAYPOINT = packet_in.sue_ALTITUDEHOLD_WAYPOINT;
694 packet1.sue_RACING_MODE = packet_in.sue_RACING_MODE;
695
696
697#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
698 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
699 // cope with extensions
700 memset(MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F4_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F4_MIN_LEN);
701 }
702#endif
703 memset(&packet2, 0, sizeof(packet2));
704 mavlink_msg_serial_udb_extra_f4_encode(system_id, component_id, &msg, &packet1);
705 mavlink_msg_serial_udb_extra_f4_decode(&msg, &packet2);
706 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
707
708 memset(&packet2, 0, sizeof(packet2));
709 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 );
710 mavlink_msg_serial_udb_extra_f4_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_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 );
715 mavlink_msg_serial_udb_extra_f4_decode(&msg, &packet2);
716 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
717
718 memset(&packet2, 0, sizeof(packet2));
719 mavlink_msg_to_send_buffer(buffer, &msg);
720 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
721 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
722 }
723 mavlink_msg_serial_udb_extra_f4_decode(last_msg, &packet2);
724 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
725
726 memset(&packet2, 0, sizeof(packet2));
727 mavlink_msg_serial_udb_extra_f4_send(MAVLINK_COMM_1 , 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 );
728 mavlink_msg_serial_udb_extra_f4_decode(last_msg, &packet2);
729 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
730}
731
732static void mavlink_test_serial_udb_extra_f5(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
733{
734#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
735 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
736 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F5 >= 256) {
737 return;
738 }
739#endif
740 mavlink_message_t msg;
741 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
742 uint16_t i;
743 mavlink_serial_udb_extra_f5_t packet_in = {
744 17.0,45.0,73.0,101.0
745 };
746 mavlink_serial_udb_extra_f5_t packet1, packet2;
747 memset(&packet1, 0, sizeof(packet1));
748 packet1.sue_YAWKP_AILERON = packet_in.sue_YAWKP_AILERON;
749 packet1.sue_YAWKD_AILERON = packet_in.sue_YAWKD_AILERON;
750 packet1.sue_ROLLKP = packet_in.sue_ROLLKP;
751 packet1.sue_ROLLKD = packet_in.sue_ROLLKD;
752
753
754#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
755 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
756 // cope with extensions
757 memset(MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F5_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F5_MIN_LEN);
758 }
759#endif
760 memset(&packet2, 0, sizeof(packet2));
761 mavlink_msg_serial_udb_extra_f5_encode(system_id, component_id, &msg, &packet1);
762 mavlink_msg_serial_udb_extra_f5_decode(&msg, &packet2);
763 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
764
765 memset(&packet2, 0, sizeof(packet2));
766 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 );
767 mavlink_msg_serial_udb_extra_f5_decode(&msg, &packet2);
768 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
769
770 memset(&packet2, 0, sizeof(packet2));
771 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 );
772 mavlink_msg_serial_udb_extra_f5_decode(&msg, &packet2);
773 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
774
775 memset(&packet2, 0, sizeof(packet2));
776 mavlink_msg_to_send_buffer(buffer, &msg);
777 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
778 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
779 }
780 mavlink_msg_serial_udb_extra_f5_decode(last_msg, &packet2);
781 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
782
783 memset(&packet2, 0, sizeof(packet2));
784 mavlink_msg_serial_udb_extra_f5_send(MAVLINK_COMM_1 , packet1.sue_YAWKP_AILERON , packet1.sue_YAWKD_AILERON , packet1.sue_ROLLKP , packet1.sue_ROLLKD );
785 mavlink_msg_serial_udb_extra_f5_decode(last_msg, &packet2);
786 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
787}
788
789static void mavlink_test_serial_udb_extra_f6(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
790{
791#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
792 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
793 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F6 >= 256) {
794 return;
795 }
796#endif
797 mavlink_message_t msg;
798 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
799 uint16_t i;
800 mavlink_serial_udb_extra_f6_t packet_in = {
801 17.0,45.0,73.0,101.0,129.0
802 };
803 mavlink_serial_udb_extra_f6_t packet1, packet2;
804 memset(&packet1, 0, sizeof(packet1));
805 packet1.sue_PITCHGAIN = packet_in.sue_PITCHGAIN;
806 packet1.sue_PITCHKD = packet_in.sue_PITCHKD;
807 packet1.sue_RUDDER_ELEV_MIX = packet_in.sue_RUDDER_ELEV_MIX;
808 packet1.sue_ROLL_ELEV_MIX = packet_in.sue_ROLL_ELEV_MIX;
809 packet1.sue_ELEVATOR_BOOST = packet_in.sue_ELEVATOR_BOOST;
810
811
812#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
813 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
814 // cope with extensions
815 memset(MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F6_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F6_MIN_LEN);
816 }
817#endif
818 memset(&packet2, 0, sizeof(packet2));
819 mavlink_msg_serial_udb_extra_f6_encode(system_id, component_id, &msg, &packet1);
820 mavlink_msg_serial_udb_extra_f6_decode(&msg, &packet2);
821 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
822
823 memset(&packet2, 0, sizeof(packet2));
824 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 );
825 mavlink_msg_serial_udb_extra_f6_decode(&msg, &packet2);
826 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
827
828 memset(&packet2, 0, sizeof(packet2));
829 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 );
830 mavlink_msg_serial_udb_extra_f6_decode(&msg, &packet2);
831 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
832
833 memset(&packet2, 0, sizeof(packet2));
834 mavlink_msg_to_send_buffer(buffer, &msg);
835 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
836 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
837 }
838 mavlink_msg_serial_udb_extra_f6_decode(last_msg, &packet2);
839 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
840
841 memset(&packet2, 0, sizeof(packet2));
842 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 );
843 mavlink_msg_serial_udb_extra_f6_decode(last_msg, &packet2);
844 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
845}
846
847static void mavlink_test_serial_udb_extra_f7(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
848{
849#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
850 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
851 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F7 >= 256) {
852 return;
853 }
854#endif
855 mavlink_message_t msg;
856 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
857 uint16_t i;
858 mavlink_serial_udb_extra_f7_t packet_in = {
859 17.0,45.0,73.0,101.0,129.0,157.0
860 };
861 mavlink_serial_udb_extra_f7_t packet1, packet2;
862 memset(&packet1, 0, sizeof(packet1));
863 packet1.sue_YAWKP_RUDDER = packet_in.sue_YAWKP_RUDDER;
864 packet1.sue_YAWKD_RUDDER = packet_in.sue_YAWKD_RUDDER;
865 packet1.sue_ROLLKP_RUDDER = packet_in.sue_ROLLKP_RUDDER;
866 packet1.sue_ROLLKD_RUDDER = packet_in.sue_ROLLKD_RUDDER;
867 packet1.sue_RUDDER_BOOST = packet_in.sue_RUDDER_BOOST;
868 packet1.sue_RTL_PITCH_DOWN = packet_in.sue_RTL_PITCH_DOWN;
869
870
871#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
872 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
873 // cope with extensions
874 memset(MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F7_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F7_MIN_LEN);
875 }
876#endif
877 memset(&packet2, 0, sizeof(packet2));
878 mavlink_msg_serial_udb_extra_f7_encode(system_id, component_id, &msg, &packet1);
879 mavlink_msg_serial_udb_extra_f7_decode(&msg, &packet2);
880 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
881
882 memset(&packet2, 0, sizeof(packet2));
883 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 );
884 mavlink_msg_serial_udb_extra_f7_decode(&msg, &packet2);
885 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
886
887 memset(&packet2, 0, sizeof(packet2));
888 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 );
889 mavlink_msg_serial_udb_extra_f7_decode(&msg, &packet2);
890 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
891
892 memset(&packet2, 0, sizeof(packet2));
893 mavlink_msg_to_send_buffer(buffer, &msg);
894 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
895 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
896 }
897 mavlink_msg_serial_udb_extra_f7_decode(last_msg, &packet2);
898 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
899
900 memset(&packet2, 0, sizeof(packet2));
901 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 );
902 mavlink_msg_serial_udb_extra_f7_decode(last_msg, &packet2);
903 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
904}
905
906static void mavlink_test_serial_udb_extra_f8(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
907{
908#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
909 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
910 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F8 >= 256) {
911 return;
912 }
913#endif
914 mavlink_message_t msg;
915 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
916 uint16_t i;
917 mavlink_serial_udb_extra_f8_t packet_in = {
918 17.0,45.0,73.0,101.0,129.0,157.0,185.0
919 };
920 mavlink_serial_udb_extra_f8_t packet1, packet2;
921 memset(&packet1, 0, sizeof(packet1));
922 packet1.sue_HEIGHT_TARGET_MAX = packet_in.sue_HEIGHT_TARGET_MAX;
923 packet1.sue_HEIGHT_TARGET_MIN = packet_in.sue_HEIGHT_TARGET_MIN;
924 packet1.sue_ALT_HOLD_THROTTLE_MIN = packet_in.sue_ALT_HOLD_THROTTLE_MIN;
925 packet1.sue_ALT_HOLD_THROTTLE_MAX = packet_in.sue_ALT_HOLD_THROTTLE_MAX;
926 packet1.sue_ALT_HOLD_PITCH_MIN = packet_in.sue_ALT_HOLD_PITCH_MIN;
927 packet1.sue_ALT_HOLD_PITCH_MAX = packet_in.sue_ALT_HOLD_PITCH_MAX;
928 packet1.sue_ALT_HOLD_PITCH_HIGH = packet_in.sue_ALT_HOLD_PITCH_HIGH;
929
930
931#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
932 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
933 // cope with extensions
934 memset(MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F8_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F8_MIN_LEN);
935 }
936#endif
937 memset(&packet2, 0, sizeof(packet2));
938 mavlink_msg_serial_udb_extra_f8_encode(system_id, component_id, &msg, &packet1);
939 mavlink_msg_serial_udb_extra_f8_decode(&msg, &packet2);
940 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
941
942 memset(&packet2, 0, sizeof(packet2));
943 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 );
944 mavlink_msg_serial_udb_extra_f8_decode(&msg, &packet2);
945 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
946
947 memset(&packet2, 0, sizeof(packet2));
948 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 );
949 mavlink_msg_serial_udb_extra_f8_decode(&msg, &packet2);
950 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
951
952 memset(&packet2, 0, sizeof(packet2));
953 mavlink_msg_to_send_buffer(buffer, &msg);
954 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
955 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
956 }
957 mavlink_msg_serial_udb_extra_f8_decode(last_msg, &packet2);
958 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
959
960 memset(&packet2, 0, sizeof(packet2));
961 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 );
962 mavlink_msg_serial_udb_extra_f8_decode(last_msg, &packet2);
963 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
964}
965
966static void mavlink_test_serial_udb_extra_f13(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
967{
968#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
969 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
970 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F13 >= 256) {
971 return;
972 }
973#endif
974 mavlink_message_t msg;
975 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
976 uint16_t i;
977 mavlink_serial_udb_extra_f13_t packet_in = {
978 963497464,963497672,963497880,17859
979 };
980 mavlink_serial_udb_extra_f13_t packet1, packet2;
981 memset(&packet1, 0, sizeof(packet1));
982 packet1.sue_lat_origin = packet_in.sue_lat_origin;
983 packet1.sue_lon_origin = packet_in.sue_lon_origin;
984 packet1.sue_alt_origin = packet_in.sue_alt_origin;
985 packet1.sue_week_no = packet_in.sue_week_no;
986
987
988#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
989 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
990 // cope with extensions
991 memset(MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F13_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F13_MIN_LEN);
992 }
993#endif
994 memset(&packet2, 0, sizeof(packet2));
995 mavlink_msg_serial_udb_extra_f13_encode(system_id, component_id, &msg, &packet1);
996 mavlink_msg_serial_udb_extra_f13_decode(&msg, &packet2);
997 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
998
999 memset(&packet2, 0, sizeof(packet2));
1000 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 );
1001 mavlink_msg_serial_udb_extra_f13_decode(&msg, &packet2);
1002 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1003
1004 memset(&packet2, 0, sizeof(packet2));
1005 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 );
1006 mavlink_msg_serial_udb_extra_f13_decode(&msg, &packet2);
1007 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1008
1009 memset(&packet2, 0, sizeof(packet2));
1010 mavlink_msg_to_send_buffer(buffer, &msg);
1011 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1012 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1013 }
1014 mavlink_msg_serial_udb_extra_f13_decode(last_msg, &packet2);
1015 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1016
1017 memset(&packet2, 0, sizeof(packet2));
1018 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 );
1019 mavlink_msg_serial_udb_extra_f13_decode(last_msg, &packet2);
1020 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1021}
1022
1023static void mavlink_test_serial_udb_extra_f14(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1024{
1025#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1026 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1027 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F14 >= 256) {
1028 return;
1029 }
1030#endif
1031 mavlink_message_t msg;
1032 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1033 uint16_t i;
1034 mavlink_serial_udb_extra_f14_t packet_in = {
1035 963497464,17443,17547,17651,163,230,41,108,175,242,53
1036 };
1037 mavlink_serial_udb_extra_f14_t packet1, packet2;
1038 memset(&packet1, 0, sizeof(packet1));
1039 packet1.sue_TRAP_SOURCE = packet_in.sue_TRAP_SOURCE;
1040 packet1.sue_RCON = packet_in.sue_RCON;
1041 packet1.sue_TRAP_FLAGS = packet_in.sue_TRAP_FLAGS;
1042 packet1.sue_osc_fail_count = packet_in.sue_osc_fail_count;
1043 packet1.sue_WIND_ESTIMATION = packet_in.sue_WIND_ESTIMATION;
1044 packet1.sue_GPS_TYPE = packet_in.sue_GPS_TYPE;
1045 packet1.sue_DR = packet_in.sue_DR;
1046 packet1.sue_BOARD_TYPE = packet_in.sue_BOARD_TYPE;
1047 packet1.sue_AIRFRAME = packet_in.sue_AIRFRAME;
1048 packet1.sue_CLOCK_CONFIG = packet_in.sue_CLOCK_CONFIG;
1049 packet1.sue_FLIGHT_PLAN_TYPE = packet_in.sue_FLIGHT_PLAN_TYPE;
1050
1051
1052#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1053 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1054 // cope with extensions
1055 memset(MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F14_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F14_MIN_LEN);
1056 }
1057#endif
1058 memset(&packet2, 0, sizeof(packet2));
1059 mavlink_msg_serial_udb_extra_f14_encode(system_id, component_id, &msg, &packet1);
1060 mavlink_msg_serial_udb_extra_f14_decode(&msg, &packet2);
1061 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1062
1063 memset(&packet2, 0, sizeof(packet2));
1064 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 );
1065 mavlink_msg_serial_udb_extra_f14_decode(&msg, &packet2);
1066 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1067
1068 memset(&packet2, 0, sizeof(packet2));
1069 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 );
1070 mavlink_msg_serial_udb_extra_f14_decode(&msg, &packet2);
1071 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1072
1073 memset(&packet2, 0, sizeof(packet2));
1074 mavlink_msg_to_send_buffer(buffer, &msg);
1075 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1076 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1077 }
1078 mavlink_msg_serial_udb_extra_f14_decode(last_msg, &packet2);
1079 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1080
1081 memset(&packet2, 0, sizeof(packet2));
1082 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 );
1083 mavlink_msg_serial_udb_extra_f14_decode(last_msg, &packet2);
1084 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1085}
1086
1087static void mavlink_test_serial_udb_extra_f15(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1088{
1089#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1090 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1091 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F15 >= 256) {
1092 return;
1093 }
1094#endif
1095 mavlink_message_t msg;
1096 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1097 uint16_t i;
1098 mavlink_serial_udb_extra_f15_t packet_in = {
1099 { 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 }
1100 };
1101 mavlink_serial_udb_extra_f15_t packet1, packet2;
1102 memset(&packet1, 0, sizeof(packet1));
1103
1104 mav_array_memcpy(packet1.sue_ID_VEHICLE_MODEL_NAME, packet_in.sue_ID_VEHICLE_MODEL_NAME, sizeof(uint8_t)*40);
1105 mav_array_memcpy(packet1.sue_ID_VEHICLE_REGISTRATION, packet_in.sue_ID_VEHICLE_REGISTRATION, sizeof(uint8_t)*20);
1106
1107#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1108 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1109 // cope with extensions
1110 memset(MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F15_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F15_MIN_LEN);
1111 }
1112#endif
1113 memset(&packet2, 0, sizeof(packet2));
1114 mavlink_msg_serial_udb_extra_f15_encode(system_id, component_id, &msg, &packet1);
1115 mavlink_msg_serial_udb_extra_f15_decode(&msg, &packet2);
1116 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1117
1118 memset(&packet2, 0, sizeof(packet2));
1119 mavlink_msg_serial_udb_extra_f15_pack(system_id, component_id, &msg , packet1.sue_ID_VEHICLE_MODEL_NAME , packet1.sue_ID_VEHICLE_REGISTRATION );
1120 mavlink_msg_serial_udb_extra_f15_decode(&msg, &packet2);
1121 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1122
1123 memset(&packet2, 0, sizeof(packet2));
1124 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 );
1125 mavlink_msg_serial_udb_extra_f15_decode(&msg, &packet2);
1126 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1127
1128 memset(&packet2, 0, sizeof(packet2));
1129 mavlink_msg_to_send_buffer(buffer, &msg);
1130 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1131 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1132 }
1133 mavlink_msg_serial_udb_extra_f15_decode(last_msg, &packet2);
1134 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1135
1136 memset(&packet2, 0, sizeof(packet2));
1137 mavlink_msg_serial_udb_extra_f15_send(MAVLINK_COMM_1 , packet1.sue_ID_VEHICLE_MODEL_NAME , packet1.sue_ID_VEHICLE_REGISTRATION );
1138 mavlink_msg_serial_udb_extra_f15_decode(last_msg, &packet2);
1139 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1140}
1141
1142static void mavlink_test_serial_udb_extra_f16(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1143{
1144#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1145 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1146 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F16 >= 256) {
1147 return;
1148 }
1149#endif
1150 mavlink_message_t msg;
1151 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1152 uint16_t i;
1153 mavlink_serial_udb_extra_f16_t packet_in = {
1154 { 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 }
1155 };
1156 mavlink_serial_udb_extra_f16_t packet1, packet2;
1157 memset(&packet1, 0, sizeof(packet1));
1158
1159 mav_array_memcpy(packet1.sue_ID_LEAD_PILOT, packet_in.sue_ID_LEAD_PILOT, sizeof(uint8_t)*40);
1160 mav_array_memcpy(packet1.sue_ID_DIY_DRONES_URL, packet_in.sue_ID_DIY_DRONES_URL, sizeof(uint8_t)*70);
1161
1162#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1163 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1164 // cope with extensions
1165 memset(MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F16_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F16_MIN_LEN);
1166 }
1167#endif
1168 memset(&packet2, 0, sizeof(packet2));
1169 mavlink_msg_serial_udb_extra_f16_encode(system_id, component_id, &msg, &packet1);
1170 mavlink_msg_serial_udb_extra_f16_decode(&msg, &packet2);
1171 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1172
1173 memset(&packet2, 0, sizeof(packet2));
1174 mavlink_msg_serial_udb_extra_f16_pack(system_id, component_id, &msg , packet1.sue_ID_LEAD_PILOT , packet1.sue_ID_DIY_DRONES_URL );
1175 mavlink_msg_serial_udb_extra_f16_decode(&msg, &packet2);
1176 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1177
1178 memset(&packet2, 0, sizeof(packet2));
1179 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 );
1180 mavlink_msg_serial_udb_extra_f16_decode(&msg, &packet2);
1181 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1182
1183 memset(&packet2, 0, sizeof(packet2));
1184 mavlink_msg_to_send_buffer(buffer, &msg);
1185 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1186 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1187 }
1188 mavlink_msg_serial_udb_extra_f16_decode(last_msg, &packet2);
1189 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1190
1191 memset(&packet2, 0, sizeof(packet2));
1192 mavlink_msg_serial_udb_extra_f16_send(MAVLINK_COMM_1 , packet1.sue_ID_LEAD_PILOT , packet1.sue_ID_DIY_DRONES_URL );
1193 mavlink_msg_serial_udb_extra_f16_decode(last_msg, &packet2);
1194 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1195}
1196
1197static void mavlink_test_altitudes(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1198{
1199#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1200 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1201 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ALTITUDES >= 256) {
1202 return;
1203 }
1204#endif
1205 mavlink_message_t msg;
1206 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1207 uint16_t i;
1208 mavlink_altitudes_t packet_in = {
1209 963497464,963497672,963497880,963498088,963498296,963498504,963498712
1210 };
1211 mavlink_altitudes_t packet1, packet2;
1212 memset(&packet1, 0, sizeof(packet1));
1213 packet1.time_boot_ms = packet_in.time_boot_ms;
1214 packet1.alt_gps = packet_in.alt_gps;
1215 packet1.alt_imu = packet_in.alt_imu;
1216 packet1.alt_barometric = packet_in.alt_barometric;
1217 packet1.alt_optical_flow = packet_in.alt_optical_flow;
1218 packet1.alt_range_finder = packet_in.alt_range_finder;
1219 packet1.alt_extra = packet_in.alt_extra;
1220
1221
1222#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1223 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1224 // cope with extensions
1225 memset(MAVLINK_MSG_ID_ALTITUDES_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ALTITUDES_MIN_LEN);
1226 }
1227#endif
1228 memset(&packet2, 0, sizeof(packet2));
1229 mavlink_msg_altitudes_encode(system_id, component_id, &msg, &packet1);
1230 mavlink_msg_altitudes_decode(&msg, &packet2);
1231 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1232
1233 memset(&packet2, 0, sizeof(packet2));
1234 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 );
1235 mavlink_msg_altitudes_decode(&msg, &packet2);
1236 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1237
1238 memset(&packet2, 0, sizeof(packet2));
1239 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 );
1240 mavlink_msg_altitudes_decode(&msg, &packet2);
1241 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1242
1243 memset(&packet2, 0, sizeof(packet2));
1244 mavlink_msg_to_send_buffer(buffer, &msg);
1245 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1246 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1247 }
1248 mavlink_msg_altitudes_decode(last_msg, &packet2);
1249 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1250
1251 memset(&packet2, 0, sizeof(packet2));
1252 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 );
1253 mavlink_msg_altitudes_decode(last_msg, &packet2);
1254 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1255}
1256
1257static void mavlink_test_airspeeds(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1258{
1259#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1260 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1261 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AIRSPEEDS >= 256) {
1262 return;
1263 }
1264#endif
1265 mavlink_message_t msg;
1266 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1267 uint16_t i;
1268 mavlink_airspeeds_t packet_in = {
1269 963497464,17443,17547,17651,17755,17859,17963
1270 };
1271 mavlink_airspeeds_t packet1, packet2;
1272 memset(&packet1, 0, sizeof(packet1));
1273 packet1.time_boot_ms = packet_in.time_boot_ms;
1274 packet1.airspeed_imu = packet_in.airspeed_imu;
1275 packet1.airspeed_pitot = packet_in.airspeed_pitot;
1276 packet1.airspeed_hot_wire = packet_in.airspeed_hot_wire;
1277 packet1.airspeed_ultrasonic = packet_in.airspeed_ultrasonic;
1278 packet1.aoa = packet_in.aoa;
1279 packet1.aoy = packet_in.aoy;
1280
1281
1282#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1283 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1284 // cope with extensions
1285 memset(MAVLINK_MSG_ID_AIRSPEEDS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AIRSPEEDS_MIN_LEN);
1286 }
1287#endif
1288 memset(&packet2, 0, sizeof(packet2));
1289 mavlink_msg_airspeeds_encode(system_id, component_id, &msg, &packet1);
1290 mavlink_msg_airspeeds_decode(&msg, &packet2);
1291 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1292
1293 memset(&packet2, 0, sizeof(packet2));
1294 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 );
1295 mavlink_msg_airspeeds_decode(&msg, &packet2);
1296 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1297
1298 memset(&packet2, 0, sizeof(packet2));
1299 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 );
1300 mavlink_msg_airspeeds_decode(&msg, &packet2);
1301 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1302
1303 memset(&packet2, 0, sizeof(packet2));
1304 mavlink_msg_to_send_buffer(buffer, &msg);
1305 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1306 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1307 }
1308 mavlink_msg_airspeeds_decode(last_msg, &packet2);
1309 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1310
1311 memset(&packet2, 0, sizeof(packet2));
1312 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 );
1313 mavlink_msg_airspeeds_decode(last_msg, &packet2);
1314 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1315}
1316
1317static void mavlink_test_serial_udb_extra_f17(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1318{
1319#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1320 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1321 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F17 >= 256) {
1322 return;
1323 }
1324#endif
1325 mavlink_message_t msg;
1326 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1327 uint16_t i;
1328 mavlink_serial_udb_extra_f17_t packet_in = {
1329 17.0,45.0,73.0
1330 };
1331 mavlink_serial_udb_extra_f17_t packet1, packet2;
1332 memset(&packet1, 0, sizeof(packet1));
1333 packet1.sue_feed_forward = packet_in.sue_feed_forward;
1334 packet1.sue_turn_rate_nav = packet_in.sue_turn_rate_nav;
1335 packet1.sue_turn_rate_fbw = packet_in.sue_turn_rate_fbw;
1336
1337
1338#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1339 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1340 // cope with extensions
1341 memset(MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F17_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F17_MIN_LEN);
1342 }
1343#endif
1344 memset(&packet2, 0, sizeof(packet2));
1345 mavlink_msg_serial_udb_extra_f17_encode(system_id, component_id, &msg, &packet1);
1346 mavlink_msg_serial_udb_extra_f17_decode(&msg, &packet2);
1347 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1348
1349 memset(&packet2, 0, sizeof(packet2));
1350 mavlink_msg_serial_udb_extra_f17_pack(system_id, component_id, &msg , packet1.sue_feed_forward , packet1.sue_turn_rate_nav , packet1.sue_turn_rate_fbw );
1351 mavlink_msg_serial_udb_extra_f17_decode(&msg, &packet2);
1352 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1353
1354 memset(&packet2, 0, sizeof(packet2));
1355 mavlink_msg_serial_udb_extra_f17_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.sue_feed_forward , packet1.sue_turn_rate_nav , packet1.sue_turn_rate_fbw );
1356 mavlink_msg_serial_udb_extra_f17_decode(&msg, &packet2);
1357 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1358
1359 memset(&packet2, 0, sizeof(packet2));
1360 mavlink_msg_to_send_buffer(buffer, &msg);
1361 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1362 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1363 }
1364 mavlink_msg_serial_udb_extra_f17_decode(last_msg, &packet2);
1365 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1366
1367 memset(&packet2, 0, sizeof(packet2));
1368 mavlink_msg_serial_udb_extra_f17_send(MAVLINK_COMM_1 , packet1.sue_feed_forward , packet1.sue_turn_rate_nav , packet1.sue_turn_rate_fbw );
1369 mavlink_msg_serial_udb_extra_f17_decode(last_msg, &packet2);
1370 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1371}
1372
1373static void mavlink_test_serial_udb_extra_f18(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1374{
1375#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1376 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1377 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F18 >= 256) {
1378 return;
1379 }
1380#endif
1381 mavlink_message_t msg;
1382 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1383 uint16_t i;
1384 mavlink_serial_udb_extra_f18_t packet_in = {
1385 17.0,45.0,73.0,101.0,129.0
1386 };
1387 mavlink_serial_udb_extra_f18_t packet1, packet2;
1388 memset(&packet1, 0, sizeof(packet1));
1389 packet1.angle_of_attack_normal = packet_in.angle_of_attack_normal;
1390 packet1.angle_of_attack_inverted = packet_in.angle_of_attack_inverted;
1391 packet1.elevator_trim_normal = packet_in.elevator_trim_normal;
1392 packet1.elevator_trim_inverted = packet_in.elevator_trim_inverted;
1393 packet1.reference_speed = packet_in.reference_speed;
1394
1395
1396#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1397 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1398 // cope with extensions
1399 memset(MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F18_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F18_MIN_LEN);
1400 }
1401#endif
1402 memset(&packet2, 0, sizeof(packet2));
1403 mavlink_msg_serial_udb_extra_f18_encode(system_id, component_id, &msg, &packet1);
1404 mavlink_msg_serial_udb_extra_f18_decode(&msg, &packet2);
1405 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1406
1407 memset(&packet2, 0, sizeof(packet2));
1408 mavlink_msg_serial_udb_extra_f18_pack(system_id, component_id, &msg , packet1.angle_of_attack_normal , packet1.angle_of_attack_inverted , packet1.elevator_trim_normal , packet1.elevator_trim_inverted , packet1.reference_speed );
1409 mavlink_msg_serial_udb_extra_f18_decode(&msg, &packet2);
1410 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1411
1412 memset(&packet2, 0, sizeof(packet2));
1413 mavlink_msg_serial_udb_extra_f18_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.angle_of_attack_normal , packet1.angle_of_attack_inverted , packet1.elevator_trim_normal , packet1.elevator_trim_inverted , packet1.reference_speed );
1414 mavlink_msg_serial_udb_extra_f18_decode(&msg, &packet2);
1415 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1416
1417 memset(&packet2, 0, sizeof(packet2));
1418 mavlink_msg_to_send_buffer(buffer, &msg);
1419 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1420 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1421 }
1422 mavlink_msg_serial_udb_extra_f18_decode(last_msg, &packet2);
1423 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1424
1425 memset(&packet2, 0, sizeof(packet2));
1426 mavlink_msg_serial_udb_extra_f18_send(MAVLINK_COMM_1 , packet1.angle_of_attack_normal , packet1.angle_of_attack_inverted , packet1.elevator_trim_normal , packet1.elevator_trim_inverted , packet1.reference_speed );
1427 mavlink_msg_serial_udb_extra_f18_decode(last_msg, &packet2);
1428 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1429}
1430
1431static void mavlink_test_serial_udb_extra_f19(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1432{
1433#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1434 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1435 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F19 >= 256) {
1436 return;
1437 }
1438#endif
1439 mavlink_message_t msg;
1440 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1441 uint16_t i;
1442 mavlink_serial_udb_extra_f19_t packet_in = {
1443 5,72,139,206,17,84,151,218
1444 };
1445 mavlink_serial_udb_extra_f19_t packet1, packet2;
1446 memset(&packet1, 0, sizeof(packet1));
1447 packet1.sue_aileron_output_channel = packet_in.sue_aileron_output_channel;
1448 packet1.sue_aileron_reversed = packet_in.sue_aileron_reversed;
1449 packet1.sue_elevator_output_channel = packet_in.sue_elevator_output_channel;
1450 packet1.sue_elevator_reversed = packet_in.sue_elevator_reversed;
1451 packet1.sue_throttle_output_channel = packet_in.sue_throttle_output_channel;
1452 packet1.sue_throttle_reversed = packet_in.sue_throttle_reversed;
1453 packet1.sue_rudder_output_channel = packet_in.sue_rudder_output_channel;
1454 packet1.sue_rudder_reversed = packet_in.sue_rudder_reversed;
1455
1456
1457#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1458 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1459 // cope with extensions
1460 memset(MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F19_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F19_MIN_LEN);
1461 }
1462#endif
1463 memset(&packet2, 0, sizeof(packet2));
1464 mavlink_msg_serial_udb_extra_f19_encode(system_id, component_id, &msg, &packet1);
1465 mavlink_msg_serial_udb_extra_f19_decode(&msg, &packet2);
1466 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1467
1468 memset(&packet2, 0, sizeof(packet2));
1469 mavlink_msg_serial_udb_extra_f19_pack(system_id, component_id, &msg , packet1.sue_aileron_output_channel , packet1.sue_aileron_reversed , packet1.sue_elevator_output_channel , packet1.sue_elevator_reversed , packet1.sue_throttle_output_channel , packet1.sue_throttle_reversed , packet1.sue_rudder_output_channel , packet1.sue_rudder_reversed );
1470 mavlink_msg_serial_udb_extra_f19_decode(&msg, &packet2);
1471 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1472
1473 memset(&packet2, 0, sizeof(packet2));
1474 mavlink_msg_serial_udb_extra_f19_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.sue_aileron_output_channel , packet1.sue_aileron_reversed , packet1.sue_elevator_output_channel , packet1.sue_elevator_reversed , packet1.sue_throttle_output_channel , packet1.sue_throttle_reversed , packet1.sue_rudder_output_channel , packet1.sue_rudder_reversed );
1475 mavlink_msg_serial_udb_extra_f19_decode(&msg, &packet2);
1476 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1477
1478 memset(&packet2, 0, sizeof(packet2));
1479 mavlink_msg_to_send_buffer(buffer, &msg);
1480 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1481 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1482 }
1483 mavlink_msg_serial_udb_extra_f19_decode(last_msg, &packet2);
1484 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1485
1486 memset(&packet2, 0, sizeof(packet2));
1487 mavlink_msg_serial_udb_extra_f19_send(MAVLINK_COMM_1 , packet1.sue_aileron_output_channel , packet1.sue_aileron_reversed , packet1.sue_elevator_output_channel , packet1.sue_elevator_reversed , packet1.sue_throttle_output_channel , packet1.sue_throttle_reversed , packet1.sue_rudder_output_channel , packet1.sue_rudder_reversed );
1488 mavlink_msg_serial_udb_extra_f19_decode(last_msg, &packet2);
1489 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1490}
1491
1492static void mavlink_test_serial_udb_extra_f20(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1493{
1494#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1495 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1496 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F20 >= 256) {
1497 return;
1498 }
1499#endif
1500 mavlink_message_t msg;
1501 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1502 uint16_t i;
1503 mavlink_serial_udb_extra_f20_t packet_in = {
1504 17235,17339,17443,17547,17651,17755,17859,17963,18067,18171,18275,18379,77
1505 };
1506 mavlink_serial_udb_extra_f20_t packet1, packet2;
1507 memset(&packet1, 0, sizeof(packet1));
1508 packet1.sue_trim_value_input_1 = packet_in.sue_trim_value_input_1;
1509 packet1.sue_trim_value_input_2 = packet_in.sue_trim_value_input_2;
1510 packet1.sue_trim_value_input_3 = packet_in.sue_trim_value_input_3;
1511 packet1.sue_trim_value_input_4 = packet_in.sue_trim_value_input_4;
1512 packet1.sue_trim_value_input_5 = packet_in.sue_trim_value_input_5;
1513 packet1.sue_trim_value_input_6 = packet_in.sue_trim_value_input_6;
1514 packet1.sue_trim_value_input_7 = packet_in.sue_trim_value_input_7;
1515 packet1.sue_trim_value_input_8 = packet_in.sue_trim_value_input_8;
1516 packet1.sue_trim_value_input_9 = packet_in.sue_trim_value_input_9;
1517 packet1.sue_trim_value_input_10 = packet_in.sue_trim_value_input_10;
1518 packet1.sue_trim_value_input_11 = packet_in.sue_trim_value_input_11;
1519 packet1.sue_trim_value_input_12 = packet_in.sue_trim_value_input_12;
1520 packet1.sue_number_of_inputs = packet_in.sue_number_of_inputs;
1521
1522
1523#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1524 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1525 // cope with extensions
1526 memset(MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F20_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F20_MIN_LEN);
1527 }
1528#endif
1529 memset(&packet2, 0, sizeof(packet2));
1530 mavlink_msg_serial_udb_extra_f20_encode(system_id, component_id, &msg, &packet1);
1531 mavlink_msg_serial_udb_extra_f20_decode(&msg, &packet2);
1532 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1533
1534 memset(&packet2, 0, sizeof(packet2));
1535 mavlink_msg_serial_udb_extra_f20_pack(system_id, component_id, &msg , packet1.sue_number_of_inputs , packet1.sue_trim_value_input_1 , packet1.sue_trim_value_input_2 , packet1.sue_trim_value_input_3 , packet1.sue_trim_value_input_4 , packet1.sue_trim_value_input_5 , packet1.sue_trim_value_input_6 , packet1.sue_trim_value_input_7 , packet1.sue_trim_value_input_8 , packet1.sue_trim_value_input_9 , packet1.sue_trim_value_input_10 , packet1.sue_trim_value_input_11 , packet1.sue_trim_value_input_12 );
1536 mavlink_msg_serial_udb_extra_f20_decode(&msg, &packet2);
1537 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1538
1539 memset(&packet2, 0, sizeof(packet2));
1540 mavlink_msg_serial_udb_extra_f20_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.sue_number_of_inputs , packet1.sue_trim_value_input_1 , packet1.sue_trim_value_input_2 , packet1.sue_trim_value_input_3 , packet1.sue_trim_value_input_4 , packet1.sue_trim_value_input_5 , packet1.sue_trim_value_input_6 , packet1.sue_trim_value_input_7 , packet1.sue_trim_value_input_8 , packet1.sue_trim_value_input_9 , packet1.sue_trim_value_input_10 , packet1.sue_trim_value_input_11 , packet1.sue_trim_value_input_12 );
1541 mavlink_msg_serial_udb_extra_f20_decode(&msg, &packet2);
1542 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1543
1544 memset(&packet2, 0, sizeof(packet2));
1545 mavlink_msg_to_send_buffer(buffer, &msg);
1546 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1547 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1548 }
1549 mavlink_msg_serial_udb_extra_f20_decode(last_msg, &packet2);
1550 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1551
1552 memset(&packet2, 0, sizeof(packet2));
1553 mavlink_msg_serial_udb_extra_f20_send(MAVLINK_COMM_1 , packet1.sue_number_of_inputs , packet1.sue_trim_value_input_1 , packet1.sue_trim_value_input_2 , packet1.sue_trim_value_input_3 , packet1.sue_trim_value_input_4 , packet1.sue_trim_value_input_5 , packet1.sue_trim_value_input_6 , packet1.sue_trim_value_input_7 , packet1.sue_trim_value_input_8 , packet1.sue_trim_value_input_9 , packet1.sue_trim_value_input_10 , packet1.sue_trim_value_input_11 , packet1.sue_trim_value_input_12 );
1554 mavlink_msg_serial_udb_extra_f20_decode(last_msg, &packet2);
1555 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1556}
1557
1558static void mavlink_test_serial_udb_extra_f21(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1559{
1560#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1561 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1562 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21 >= 256) {
1563 return;
1564 }
1565#endif
1566 mavlink_message_t msg;
1567 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1568 uint16_t i;
1569 mavlink_serial_udb_extra_f21_t packet_in = {
1570 17235,17339,17443,17547,17651,17755
1571 };
1572 mavlink_serial_udb_extra_f21_t packet1, packet2;
1573 memset(&packet1, 0, sizeof(packet1));
1574 packet1.sue_accel_x_offset = packet_in.sue_accel_x_offset;
1575 packet1.sue_accel_y_offset = packet_in.sue_accel_y_offset;
1576 packet1.sue_accel_z_offset = packet_in.sue_accel_z_offset;
1577 packet1.sue_gyro_x_offset = packet_in.sue_gyro_x_offset;
1578 packet1.sue_gyro_y_offset = packet_in.sue_gyro_y_offset;
1579 packet1.sue_gyro_z_offset = packet_in.sue_gyro_z_offset;
1580
1581
1582#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1583 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1584 // cope with extensions
1585 memset(MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F21_MIN_LEN);
1586 }
1587#endif
1588 memset(&packet2, 0, sizeof(packet2));
1589 mavlink_msg_serial_udb_extra_f21_encode(system_id, component_id, &msg, &packet1);
1590 mavlink_msg_serial_udb_extra_f21_decode(&msg, &packet2);
1591 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1592
1593 memset(&packet2, 0, sizeof(packet2));
1594 mavlink_msg_serial_udb_extra_f21_pack(system_id, component_id, &msg , packet1.sue_accel_x_offset , packet1.sue_accel_y_offset , packet1.sue_accel_z_offset , packet1.sue_gyro_x_offset , packet1.sue_gyro_y_offset , packet1.sue_gyro_z_offset );
1595 mavlink_msg_serial_udb_extra_f21_decode(&msg, &packet2);
1596 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1597
1598 memset(&packet2, 0, sizeof(packet2));
1599 mavlink_msg_serial_udb_extra_f21_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.sue_accel_x_offset , packet1.sue_accel_y_offset , packet1.sue_accel_z_offset , packet1.sue_gyro_x_offset , packet1.sue_gyro_y_offset , packet1.sue_gyro_z_offset );
1600 mavlink_msg_serial_udb_extra_f21_decode(&msg, &packet2);
1601 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1602
1603 memset(&packet2, 0, sizeof(packet2));
1604 mavlink_msg_to_send_buffer(buffer, &msg);
1605 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1606 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1607 }
1608 mavlink_msg_serial_udb_extra_f21_decode(last_msg, &packet2);
1609 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1610
1611 memset(&packet2, 0, sizeof(packet2));
1612 mavlink_msg_serial_udb_extra_f21_send(MAVLINK_COMM_1 , packet1.sue_accel_x_offset , packet1.sue_accel_y_offset , packet1.sue_accel_z_offset , packet1.sue_gyro_x_offset , packet1.sue_gyro_y_offset , packet1.sue_gyro_z_offset );
1613 mavlink_msg_serial_udb_extra_f21_decode(last_msg, &packet2);
1614 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1615}
1616
1617static void mavlink_test_serial_udb_extra_f22(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1618{
1619#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1620 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1621 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F22 >= 256) {
1622 return;
1623 }
1624#endif
1625 mavlink_message_t msg;
1626 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1627 uint16_t i;
1628 mavlink_serial_udb_extra_f22_t packet_in = {
1629 17235,17339,17443,17547,17651,17755
1630 };
1631 mavlink_serial_udb_extra_f22_t packet1, packet2;
1632 memset(&packet1, 0, sizeof(packet1));
1633 packet1.sue_accel_x_at_calibration = packet_in.sue_accel_x_at_calibration;
1634 packet1.sue_accel_y_at_calibration = packet_in.sue_accel_y_at_calibration;
1635 packet1.sue_accel_z_at_calibration = packet_in.sue_accel_z_at_calibration;
1636 packet1.sue_gyro_x_at_calibration = packet_in.sue_gyro_x_at_calibration;
1637 packet1.sue_gyro_y_at_calibration = packet_in.sue_gyro_y_at_calibration;
1638 packet1.sue_gyro_z_at_calibration = packet_in.sue_gyro_z_at_calibration;
1639
1640
1641#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1642 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1643 // cope with extensions
1644 memset(MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F22_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERIAL_UDB_EXTRA_F22_MIN_LEN);
1645 }
1646#endif
1647 memset(&packet2, 0, sizeof(packet2));
1648 mavlink_msg_serial_udb_extra_f22_encode(system_id, component_id, &msg, &packet1);
1649 mavlink_msg_serial_udb_extra_f22_decode(&msg, &packet2);
1650 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1651
1652 memset(&packet2, 0, sizeof(packet2));
1653 mavlink_msg_serial_udb_extra_f22_pack(system_id, component_id, &msg , packet1.sue_accel_x_at_calibration , packet1.sue_accel_y_at_calibration , packet1.sue_accel_z_at_calibration , packet1.sue_gyro_x_at_calibration , packet1.sue_gyro_y_at_calibration , packet1.sue_gyro_z_at_calibration );
1654 mavlink_msg_serial_udb_extra_f22_decode(&msg, &packet2);
1655 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1656
1657 memset(&packet2, 0, sizeof(packet2));
1658 mavlink_msg_serial_udb_extra_f22_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.sue_accel_x_at_calibration , packet1.sue_accel_y_at_calibration , packet1.sue_accel_z_at_calibration , packet1.sue_gyro_x_at_calibration , packet1.sue_gyro_y_at_calibration , packet1.sue_gyro_z_at_calibration );
1659 mavlink_msg_serial_udb_extra_f22_decode(&msg, &packet2);
1660 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1661
1662 memset(&packet2, 0, sizeof(packet2));
1663 mavlink_msg_to_send_buffer(buffer, &msg);
1664 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1665 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1666 }
1667 mavlink_msg_serial_udb_extra_f22_decode(last_msg, &packet2);
1668 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1669
1670 memset(&packet2, 0, sizeof(packet2));
1671 mavlink_msg_serial_udb_extra_f22_send(MAVLINK_COMM_1 , packet1.sue_accel_x_at_calibration , packet1.sue_accel_y_at_calibration , packet1.sue_accel_z_at_calibration , packet1.sue_gyro_x_at_calibration , packet1.sue_gyro_y_at_calibration , packet1.sue_gyro_z_at_calibration );
1672 mavlink_msg_serial_udb_extra_f22_decode(last_msg, &packet2);
1673 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1674}
1675
1676static void mavlink_test_matrixpilot(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1677{
1678 mavlink_test_flexifunction_set(system_id, component_id, last_msg);
1679 mavlink_test_flexifunction_read_req(system_id, component_id, last_msg);
1680 mavlink_test_flexifunction_buffer_function(system_id, component_id, last_msg);
1681 mavlink_test_flexifunction_buffer_function_ack(system_id, component_id, last_msg);
1682 mavlink_test_flexifunction_directory(system_id, component_id, last_msg);
1683 mavlink_test_flexifunction_directory_ack(system_id, component_id, last_msg);
1684 mavlink_test_flexifunction_command(system_id, component_id, last_msg);
1685 mavlink_test_flexifunction_command_ack(system_id, component_id, last_msg);
1686 mavlink_test_serial_udb_extra_f2_a(system_id, component_id, last_msg);
1687 mavlink_test_serial_udb_extra_f2_b(system_id, component_id, last_msg);
1688 mavlink_test_serial_udb_extra_f4(system_id, component_id, last_msg);
1689 mavlink_test_serial_udb_extra_f5(system_id, component_id, last_msg);
1690 mavlink_test_serial_udb_extra_f6(system_id, component_id, last_msg);
1691 mavlink_test_serial_udb_extra_f7(system_id, component_id, last_msg);
1692 mavlink_test_serial_udb_extra_f8(system_id, component_id, last_msg);
1693 mavlink_test_serial_udb_extra_f13(system_id, component_id, last_msg);
1694 mavlink_test_serial_udb_extra_f14(system_id, component_id, last_msg);
1695 mavlink_test_serial_udb_extra_f15(system_id, component_id, last_msg);
1696 mavlink_test_serial_udb_extra_f16(system_id, component_id, last_msg);
1697 mavlink_test_altitudes(system_id, component_id, last_msg);
1698 mavlink_test_airspeeds(system_id, component_id, last_msg);
1699 mavlink_test_serial_udb_extra_f17(system_id, component_id, last_msg);
1700 mavlink_test_serial_udb_extra_f18(system_id, component_id, last_msg);
1701 mavlink_test_serial_udb_extra_f19(system_id, component_id, last_msg);
1702 mavlink_test_serial_udb_extra_f20(system_id, component_id, last_msg);
1703 mavlink_test_serial_udb_extra_f21(system_id, component_id, last_msg);
1704 mavlink_test_serial_udb_extra_f22(system_id, component_id, last_msg);
1705}
1706
1707#ifdef __cplusplus
1708}
1709#endif // __cplusplus
1710#endif // MATRIXPILOT_TESTSUITE_H
MAVLink comm protocol testsuite generated from common.xml