RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
testsuite.h
浏览该文件的文档.
1
5#pragma once
6#ifndef ARDUPILOTMEGA_TESTSUITE_H
7#define ARDUPILOTMEGA_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_uAvionix(uint8_t, uint8_t, mavlink_message_t *last_msg);
17static void mavlink_test_ardupilotmega(uint8_t, uint8_t, mavlink_message_t *last_msg);
18
19static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
20{
21 mavlink_test_common(system_id, component_id, last_msg);
22 mavlink_test_uAvionix(system_id, component_id, last_msg);
23 mavlink_test_ardupilotmega(system_id, component_id, last_msg);
24}
25#endif
26
27#include "../common/testsuite.h"
29
30
31static void mavlink_test_sensor_offsets(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
32{
33#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
34 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
35 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SENSOR_OFFSETS >= 256) {
36 return;
37 }
38#endif
39 mavlink_message_t msg;
40 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
41 uint16_t i;
42 mavlink_sensor_offsets_t packet_in = {
43 17.0,963497672,963497880,101.0,129.0,157.0,185.0,213.0,241.0,19107,19211,19315
44 };
45 mavlink_sensor_offsets_t packet1, packet2;
46 memset(&packet1, 0, sizeof(packet1));
47 packet1.mag_declination = packet_in.mag_declination;
48 packet1.raw_press = packet_in.raw_press;
49 packet1.raw_temp = packet_in.raw_temp;
50 packet1.gyro_cal_x = packet_in.gyro_cal_x;
51 packet1.gyro_cal_y = packet_in.gyro_cal_y;
52 packet1.gyro_cal_z = packet_in.gyro_cal_z;
53 packet1.accel_cal_x = packet_in.accel_cal_x;
54 packet1.accel_cal_y = packet_in.accel_cal_y;
55 packet1.accel_cal_z = packet_in.accel_cal_z;
56 packet1.mag_ofs_x = packet_in.mag_ofs_x;
57 packet1.mag_ofs_y = packet_in.mag_ofs_y;
58 packet1.mag_ofs_z = packet_in.mag_ofs_z;
59
60
61#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
62 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
63 // cope with extensions
64 memset(MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN);
65 }
66#endif
67 memset(&packet2, 0, sizeof(packet2));
68 mavlink_msg_sensor_offsets_encode(system_id, component_id, &msg, &packet1);
69 mavlink_msg_sensor_offsets_decode(&msg, &packet2);
70 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
71
72 memset(&packet2, 0, sizeof(packet2));
73 mavlink_msg_sensor_offsets_pack(system_id, component_id, &msg , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z , packet1.mag_declination , packet1.raw_press , packet1.raw_temp , packet1.gyro_cal_x , packet1.gyro_cal_y , packet1.gyro_cal_z , packet1.accel_cal_x , packet1.accel_cal_y , packet1.accel_cal_z );
74 mavlink_msg_sensor_offsets_decode(&msg, &packet2);
75 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
76
77 memset(&packet2, 0, sizeof(packet2));
78 mavlink_msg_sensor_offsets_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z , packet1.mag_declination , packet1.raw_press , packet1.raw_temp , packet1.gyro_cal_x , packet1.gyro_cal_y , packet1.gyro_cal_z , packet1.accel_cal_x , packet1.accel_cal_y , packet1.accel_cal_z );
79 mavlink_msg_sensor_offsets_decode(&msg, &packet2);
80 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
81
82 memset(&packet2, 0, sizeof(packet2));
83 mavlink_msg_to_send_buffer(buffer, &msg);
84 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
85 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
86 }
87 mavlink_msg_sensor_offsets_decode(last_msg, &packet2);
88 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
89
90 memset(&packet2, 0, sizeof(packet2));
91 mavlink_msg_sensor_offsets_send(MAVLINK_COMM_1 , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z , packet1.mag_declination , packet1.raw_press , packet1.raw_temp , packet1.gyro_cal_x , packet1.gyro_cal_y , packet1.gyro_cal_z , packet1.accel_cal_x , packet1.accel_cal_y , packet1.accel_cal_z );
92 mavlink_msg_sensor_offsets_decode(last_msg, &packet2);
93 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
94}
95
96static void mavlink_test_set_mag_offsets(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
97{
98#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
99 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
100 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_MAG_OFFSETS >= 256) {
101 return;
102 }
103#endif
104 mavlink_message_t msg;
105 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
106 uint16_t i;
107 mavlink_set_mag_offsets_t packet_in = {
108 17235,17339,17443,151,218
109 };
110 mavlink_set_mag_offsets_t packet1, packet2;
111 memset(&packet1, 0, sizeof(packet1));
112 packet1.mag_ofs_x = packet_in.mag_ofs_x;
113 packet1.mag_ofs_y = packet_in.mag_ofs_y;
114 packet1.mag_ofs_z = packet_in.mag_ofs_z;
115 packet1.target_system = packet_in.target_system;
116 packet1.target_component = packet_in.target_component;
117
118
119#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
120 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
121 // cope with extensions
122 memset(MAVLINK_MSG_ID_SET_MAG_OFFSETS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_MAG_OFFSETS_MIN_LEN);
123 }
124#endif
125 memset(&packet2, 0, sizeof(packet2));
126 mavlink_msg_set_mag_offsets_encode(system_id, component_id, &msg, &packet1);
127 mavlink_msg_set_mag_offsets_decode(&msg, &packet2);
128 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
129
130 memset(&packet2, 0, sizeof(packet2));
131 mavlink_msg_set_mag_offsets_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z );
132 mavlink_msg_set_mag_offsets_decode(&msg, &packet2);
133 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
134
135 memset(&packet2, 0, sizeof(packet2));
136 mavlink_msg_set_mag_offsets_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z );
137 mavlink_msg_set_mag_offsets_decode(&msg, &packet2);
138 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
139
140 memset(&packet2, 0, sizeof(packet2));
141 mavlink_msg_to_send_buffer(buffer, &msg);
142 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
143 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
144 }
145 mavlink_msg_set_mag_offsets_decode(last_msg, &packet2);
146 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
147
148 memset(&packet2, 0, sizeof(packet2));
149 mavlink_msg_set_mag_offsets_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z );
150 mavlink_msg_set_mag_offsets_decode(last_msg, &packet2);
151 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
152}
153
154static void mavlink_test_meminfo(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
155{
156#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
157 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
158 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MEMINFO >= 256) {
159 return;
160 }
161#endif
162 mavlink_message_t msg;
163 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
164 uint16_t i;
165 mavlink_meminfo_t packet_in = {
166 17235,17339,963497672
167 };
168 mavlink_meminfo_t packet1, packet2;
169 memset(&packet1, 0, sizeof(packet1));
170 packet1.brkval = packet_in.brkval;
171 packet1.freemem = packet_in.freemem;
172 packet1.freemem32 = packet_in.freemem32;
173
174
175#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
176 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
177 // cope with extensions
178 memset(MAVLINK_MSG_ID_MEMINFO_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MEMINFO_MIN_LEN);
179 }
180#endif
181 memset(&packet2, 0, sizeof(packet2));
182 mavlink_msg_meminfo_encode(system_id, component_id, &msg, &packet1);
183 mavlink_msg_meminfo_decode(&msg, &packet2);
184 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
185
186 memset(&packet2, 0, sizeof(packet2));
187 mavlink_msg_meminfo_pack(system_id, component_id, &msg , packet1.brkval , packet1.freemem , packet1.freemem32 );
188 mavlink_msg_meminfo_decode(&msg, &packet2);
189 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
190
191 memset(&packet2, 0, sizeof(packet2));
192 mavlink_msg_meminfo_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.brkval , packet1.freemem , packet1.freemem32 );
193 mavlink_msg_meminfo_decode(&msg, &packet2);
194 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
195
196 memset(&packet2, 0, sizeof(packet2));
197 mavlink_msg_to_send_buffer(buffer, &msg);
198 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
199 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
200 }
201 mavlink_msg_meminfo_decode(last_msg, &packet2);
202 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
203
204 memset(&packet2, 0, sizeof(packet2));
205 mavlink_msg_meminfo_send(MAVLINK_COMM_1 , packet1.brkval , packet1.freemem , packet1.freemem32 );
206 mavlink_msg_meminfo_decode(last_msg, &packet2);
207 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
208}
209
210static void mavlink_test_ap_adc(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
211{
212#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
213 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
214 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AP_ADC >= 256) {
215 return;
216 }
217#endif
218 mavlink_message_t msg;
219 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
220 uint16_t i;
221 mavlink_ap_adc_t packet_in = {
222 17235,17339,17443,17547,17651,17755
223 };
224 mavlink_ap_adc_t packet1, packet2;
225 memset(&packet1, 0, sizeof(packet1));
226 packet1.adc1 = packet_in.adc1;
227 packet1.adc2 = packet_in.adc2;
228 packet1.adc3 = packet_in.adc3;
229 packet1.adc4 = packet_in.adc4;
230 packet1.adc5 = packet_in.adc5;
231 packet1.adc6 = packet_in.adc6;
232
233
234#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
235 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
236 // cope with extensions
237 memset(MAVLINK_MSG_ID_AP_ADC_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AP_ADC_MIN_LEN);
238 }
239#endif
240 memset(&packet2, 0, sizeof(packet2));
241 mavlink_msg_ap_adc_encode(system_id, component_id, &msg, &packet1);
242 mavlink_msg_ap_adc_decode(&msg, &packet2);
243 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
244
245 memset(&packet2, 0, sizeof(packet2));
246 mavlink_msg_ap_adc_pack(system_id, component_id, &msg , packet1.adc1 , packet1.adc2 , packet1.adc3 , packet1.adc4 , packet1.adc5 , packet1.adc6 );
247 mavlink_msg_ap_adc_decode(&msg, &packet2);
248 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
249
250 memset(&packet2, 0, sizeof(packet2));
251 mavlink_msg_ap_adc_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.adc1 , packet1.adc2 , packet1.adc3 , packet1.adc4 , packet1.adc5 , packet1.adc6 );
252 mavlink_msg_ap_adc_decode(&msg, &packet2);
253 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
254
255 memset(&packet2, 0, sizeof(packet2));
256 mavlink_msg_to_send_buffer(buffer, &msg);
257 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
258 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
259 }
260 mavlink_msg_ap_adc_decode(last_msg, &packet2);
261 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
262
263 memset(&packet2, 0, sizeof(packet2));
264 mavlink_msg_ap_adc_send(MAVLINK_COMM_1 , packet1.adc1 , packet1.adc2 , packet1.adc3 , packet1.adc4 , packet1.adc5 , packet1.adc6 );
265 mavlink_msg_ap_adc_decode(last_msg, &packet2);
266 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
267}
268
269static void mavlink_test_digicam_configure(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
270{
271#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
272 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
273 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DIGICAM_CONFIGURE >= 256) {
274 return;
275 }
276#endif
277 mavlink_message_t msg;
278 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
279 uint16_t i;
280 mavlink_digicam_configure_t packet_in = {
281 17.0,17443,151,218,29,96,163,230,41,108,175
282 };
283 mavlink_digicam_configure_t packet1, packet2;
284 memset(&packet1, 0, sizeof(packet1));
285 packet1.extra_value = packet_in.extra_value;
286 packet1.shutter_speed = packet_in.shutter_speed;
287 packet1.target_system = packet_in.target_system;
288 packet1.target_component = packet_in.target_component;
289 packet1.mode = packet_in.mode;
290 packet1.aperture = packet_in.aperture;
291 packet1.iso = packet_in.iso;
292 packet1.exposure_type = packet_in.exposure_type;
293 packet1.command_id = packet_in.command_id;
294 packet1.engine_cut_off = packet_in.engine_cut_off;
295 packet1.extra_param = packet_in.extra_param;
296
297
298#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
299 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
300 // cope with extensions
301 memset(MAVLINK_MSG_ID_DIGICAM_CONFIGURE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DIGICAM_CONFIGURE_MIN_LEN);
302 }
303#endif
304 memset(&packet2, 0, sizeof(packet2));
305 mavlink_msg_digicam_configure_encode(system_id, component_id, &msg, &packet1);
306 mavlink_msg_digicam_configure_decode(&msg, &packet2);
307 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
308
309 memset(&packet2, 0, sizeof(packet2));
310 mavlink_msg_digicam_configure_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.mode , packet1.shutter_speed , packet1.aperture , packet1.iso , packet1.exposure_type , packet1.command_id , packet1.engine_cut_off , packet1.extra_param , packet1.extra_value );
311 mavlink_msg_digicam_configure_decode(&msg, &packet2);
312 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
313
314 memset(&packet2, 0, sizeof(packet2));
315 mavlink_msg_digicam_configure_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.mode , packet1.shutter_speed , packet1.aperture , packet1.iso , packet1.exposure_type , packet1.command_id , packet1.engine_cut_off , packet1.extra_param , packet1.extra_value );
316 mavlink_msg_digicam_configure_decode(&msg, &packet2);
317 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
318
319 memset(&packet2, 0, sizeof(packet2));
320 mavlink_msg_to_send_buffer(buffer, &msg);
321 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
322 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
323 }
324 mavlink_msg_digicam_configure_decode(last_msg, &packet2);
325 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
326
327 memset(&packet2, 0, sizeof(packet2));
328 mavlink_msg_digicam_configure_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.mode , packet1.shutter_speed , packet1.aperture , packet1.iso , packet1.exposure_type , packet1.command_id , packet1.engine_cut_off , packet1.extra_param , packet1.extra_value );
329 mavlink_msg_digicam_configure_decode(last_msg, &packet2);
330 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
331}
332
333static void mavlink_test_digicam_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
334{
335#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
336 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
337 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DIGICAM_CONTROL >= 256) {
338 return;
339 }
340#endif
341 mavlink_message_t msg;
342 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
343 uint16_t i;
344 mavlink_digicam_control_t packet_in = {
345 17.0,17,84,151,218,29,96,163,230,41
346 };
347 mavlink_digicam_control_t packet1, packet2;
348 memset(&packet1, 0, sizeof(packet1));
349 packet1.extra_value = packet_in.extra_value;
350 packet1.target_system = packet_in.target_system;
351 packet1.target_component = packet_in.target_component;
352 packet1.session = packet_in.session;
353 packet1.zoom_pos = packet_in.zoom_pos;
354 packet1.zoom_step = packet_in.zoom_step;
355 packet1.focus_lock = packet_in.focus_lock;
356 packet1.shot = packet_in.shot;
357 packet1.command_id = packet_in.command_id;
358 packet1.extra_param = packet_in.extra_param;
359
360
361#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
362 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
363 // cope with extensions
364 memset(MAVLINK_MSG_ID_DIGICAM_CONTROL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DIGICAM_CONTROL_MIN_LEN);
365 }
366#endif
367 memset(&packet2, 0, sizeof(packet2));
368 mavlink_msg_digicam_control_encode(system_id, component_id, &msg, &packet1);
369 mavlink_msg_digicam_control_decode(&msg, &packet2);
370 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
371
372 memset(&packet2, 0, sizeof(packet2));
373 mavlink_msg_digicam_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.session , packet1.zoom_pos , packet1.zoom_step , packet1.focus_lock , packet1.shot , packet1.command_id , packet1.extra_param , packet1.extra_value );
374 mavlink_msg_digicam_control_decode(&msg, &packet2);
375 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
376
377 memset(&packet2, 0, sizeof(packet2));
378 mavlink_msg_digicam_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.session , packet1.zoom_pos , packet1.zoom_step , packet1.focus_lock , packet1.shot , packet1.command_id , packet1.extra_param , packet1.extra_value );
379 mavlink_msg_digicam_control_decode(&msg, &packet2);
380 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
381
382 memset(&packet2, 0, sizeof(packet2));
383 mavlink_msg_to_send_buffer(buffer, &msg);
384 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
385 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
386 }
387 mavlink_msg_digicam_control_decode(last_msg, &packet2);
388 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
389
390 memset(&packet2, 0, sizeof(packet2));
391 mavlink_msg_digicam_control_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.session , packet1.zoom_pos , packet1.zoom_step , packet1.focus_lock , packet1.shot , packet1.command_id , packet1.extra_param , packet1.extra_value );
392 mavlink_msg_digicam_control_decode(last_msg, &packet2);
393 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
394}
395
396static void mavlink_test_mount_configure(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
397{
398#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
399 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
400 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MOUNT_CONFIGURE >= 256) {
401 return;
402 }
403#endif
404 mavlink_message_t msg;
405 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
406 uint16_t i;
407 mavlink_mount_configure_t packet_in = {
408 5,72,139,206,17,84
409 };
410 mavlink_mount_configure_t packet1, packet2;
411 memset(&packet1, 0, sizeof(packet1));
412 packet1.target_system = packet_in.target_system;
413 packet1.target_component = packet_in.target_component;
414 packet1.mount_mode = packet_in.mount_mode;
415 packet1.stab_roll = packet_in.stab_roll;
416 packet1.stab_pitch = packet_in.stab_pitch;
417 packet1.stab_yaw = packet_in.stab_yaw;
418
419
420#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
421 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
422 // cope with extensions
423 memset(MAVLINK_MSG_ID_MOUNT_CONFIGURE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MOUNT_CONFIGURE_MIN_LEN);
424 }
425#endif
426 memset(&packet2, 0, sizeof(packet2));
427 mavlink_msg_mount_configure_encode(system_id, component_id, &msg, &packet1);
428 mavlink_msg_mount_configure_decode(&msg, &packet2);
429 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
430
431 memset(&packet2, 0, sizeof(packet2));
432 mavlink_msg_mount_configure_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.mount_mode , packet1.stab_roll , packet1.stab_pitch , packet1.stab_yaw );
433 mavlink_msg_mount_configure_decode(&msg, &packet2);
434 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
435
436 memset(&packet2, 0, sizeof(packet2));
437 mavlink_msg_mount_configure_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.mount_mode , packet1.stab_roll , packet1.stab_pitch , packet1.stab_yaw );
438 mavlink_msg_mount_configure_decode(&msg, &packet2);
439 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
440
441 memset(&packet2, 0, sizeof(packet2));
442 mavlink_msg_to_send_buffer(buffer, &msg);
443 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
444 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
445 }
446 mavlink_msg_mount_configure_decode(last_msg, &packet2);
447 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
448
449 memset(&packet2, 0, sizeof(packet2));
450 mavlink_msg_mount_configure_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.mount_mode , packet1.stab_roll , packet1.stab_pitch , packet1.stab_yaw );
451 mavlink_msg_mount_configure_decode(last_msg, &packet2);
452 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
453}
454
455static void mavlink_test_mount_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
456{
457#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
458 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
459 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MOUNT_CONTROL >= 256) {
460 return;
461 }
462#endif
463 mavlink_message_t msg;
464 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
465 uint16_t i;
466 mavlink_mount_control_t packet_in = {
467 963497464,963497672,963497880,41,108,175
468 };
469 mavlink_mount_control_t packet1, packet2;
470 memset(&packet1, 0, sizeof(packet1));
471 packet1.input_a = packet_in.input_a;
472 packet1.input_b = packet_in.input_b;
473 packet1.input_c = packet_in.input_c;
474 packet1.target_system = packet_in.target_system;
475 packet1.target_component = packet_in.target_component;
476 packet1.save_position = packet_in.save_position;
477
478
479#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
480 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
481 // cope with extensions
482 memset(MAVLINK_MSG_ID_MOUNT_CONTROL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MOUNT_CONTROL_MIN_LEN);
483 }
484#endif
485 memset(&packet2, 0, sizeof(packet2));
486 mavlink_msg_mount_control_encode(system_id, component_id, &msg, &packet1);
487 mavlink_msg_mount_control_decode(&msg, &packet2);
488 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
489
490 memset(&packet2, 0, sizeof(packet2));
491 mavlink_msg_mount_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.input_a , packet1.input_b , packet1.input_c , packet1.save_position );
492 mavlink_msg_mount_control_decode(&msg, &packet2);
493 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
494
495 memset(&packet2, 0, sizeof(packet2));
496 mavlink_msg_mount_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.input_a , packet1.input_b , packet1.input_c , packet1.save_position );
497 mavlink_msg_mount_control_decode(&msg, &packet2);
498 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
499
500 memset(&packet2, 0, sizeof(packet2));
501 mavlink_msg_to_send_buffer(buffer, &msg);
502 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
503 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
504 }
505 mavlink_msg_mount_control_decode(last_msg, &packet2);
506 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
507
508 memset(&packet2, 0, sizeof(packet2));
509 mavlink_msg_mount_control_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.input_a , packet1.input_b , packet1.input_c , packet1.save_position );
510 mavlink_msg_mount_control_decode(last_msg, &packet2);
511 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
512}
513
514static void mavlink_test_mount_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
515{
516#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
517 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
518 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MOUNT_STATUS >= 256) {
519 return;
520 }
521#endif
522 mavlink_message_t msg;
523 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
524 uint16_t i;
525 mavlink_mount_status_t packet_in = {
526 963497464,963497672,963497880,41,108
527 };
528 mavlink_mount_status_t packet1, packet2;
529 memset(&packet1, 0, sizeof(packet1));
530 packet1.pointing_a = packet_in.pointing_a;
531 packet1.pointing_b = packet_in.pointing_b;
532 packet1.pointing_c = packet_in.pointing_c;
533 packet1.target_system = packet_in.target_system;
534 packet1.target_component = packet_in.target_component;
535
536
537#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
538 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
539 // cope with extensions
540 memset(MAVLINK_MSG_ID_MOUNT_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MOUNT_STATUS_MIN_LEN);
541 }
542#endif
543 memset(&packet2, 0, sizeof(packet2));
544 mavlink_msg_mount_status_encode(system_id, component_id, &msg, &packet1);
545 mavlink_msg_mount_status_decode(&msg, &packet2);
546 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
547
548 memset(&packet2, 0, sizeof(packet2));
549 mavlink_msg_mount_status_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.pointing_a , packet1.pointing_b , packet1.pointing_c );
550 mavlink_msg_mount_status_decode(&msg, &packet2);
551 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
552
553 memset(&packet2, 0, sizeof(packet2));
554 mavlink_msg_mount_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.pointing_a , packet1.pointing_b , packet1.pointing_c );
555 mavlink_msg_mount_status_decode(&msg, &packet2);
556 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
557
558 memset(&packet2, 0, sizeof(packet2));
559 mavlink_msg_to_send_buffer(buffer, &msg);
560 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
561 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
562 }
563 mavlink_msg_mount_status_decode(last_msg, &packet2);
564 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
565
566 memset(&packet2, 0, sizeof(packet2));
567 mavlink_msg_mount_status_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.pointing_a , packet1.pointing_b , packet1.pointing_c );
568 mavlink_msg_mount_status_decode(last_msg, &packet2);
569 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
570}
571
572static void mavlink_test_fence_point(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
573{
574#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
575 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
576 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FENCE_POINT >= 256) {
577 return;
578 }
579#endif
580 mavlink_message_t msg;
581 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
582 uint16_t i;
583 mavlink_fence_point_t packet_in = {
584 17.0,45.0,29,96,163,230
585 };
586 mavlink_fence_point_t packet1, packet2;
587 memset(&packet1, 0, sizeof(packet1));
588 packet1.lat = packet_in.lat;
589 packet1.lng = packet_in.lng;
590 packet1.target_system = packet_in.target_system;
591 packet1.target_component = packet_in.target_component;
592 packet1.idx = packet_in.idx;
593 packet1.count = packet_in.count;
594
595
596#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
597 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
598 // cope with extensions
599 memset(MAVLINK_MSG_ID_FENCE_POINT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FENCE_POINT_MIN_LEN);
600 }
601#endif
602 memset(&packet2, 0, sizeof(packet2));
603 mavlink_msg_fence_point_encode(system_id, component_id, &msg, &packet1);
604 mavlink_msg_fence_point_decode(&msg, &packet2);
605 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
606
607 memset(&packet2, 0, sizeof(packet2));
608 mavlink_msg_fence_point_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng );
609 mavlink_msg_fence_point_decode(&msg, &packet2);
610 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
611
612 memset(&packet2, 0, sizeof(packet2));
613 mavlink_msg_fence_point_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng );
614 mavlink_msg_fence_point_decode(&msg, &packet2);
615 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
616
617 memset(&packet2, 0, sizeof(packet2));
618 mavlink_msg_to_send_buffer(buffer, &msg);
619 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
620 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
621 }
622 mavlink_msg_fence_point_decode(last_msg, &packet2);
623 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
624
625 memset(&packet2, 0, sizeof(packet2));
626 mavlink_msg_fence_point_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng );
627 mavlink_msg_fence_point_decode(last_msg, &packet2);
628 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
629}
630
631static void mavlink_test_fence_fetch_point(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
632{
633#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
634 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
635 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FENCE_FETCH_POINT >= 256) {
636 return;
637 }
638#endif
639 mavlink_message_t msg;
640 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
641 uint16_t i;
642 mavlink_fence_fetch_point_t packet_in = {
643 5,72,139
644 };
645 mavlink_fence_fetch_point_t packet1, packet2;
646 memset(&packet1, 0, sizeof(packet1));
647 packet1.target_system = packet_in.target_system;
648 packet1.target_component = packet_in.target_component;
649 packet1.idx = packet_in.idx;
650
651
652#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
653 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
654 // cope with extensions
655 memset(MAVLINK_MSG_ID_FENCE_FETCH_POINT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FENCE_FETCH_POINT_MIN_LEN);
656 }
657#endif
658 memset(&packet2, 0, sizeof(packet2));
659 mavlink_msg_fence_fetch_point_encode(system_id, component_id, &msg, &packet1);
660 mavlink_msg_fence_fetch_point_decode(&msg, &packet2);
661 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
662
663 memset(&packet2, 0, sizeof(packet2));
664 mavlink_msg_fence_fetch_point_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.idx );
665 mavlink_msg_fence_fetch_point_decode(&msg, &packet2);
666 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
667
668 memset(&packet2, 0, sizeof(packet2));
669 mavlink_msg_fence_fetch_point_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.idx );
670 mavlink_msg_fence_fetch_point_decode(&msg, &packet2);
671 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
672
673 memset(&packet2, 0, sizeof(packet2));
674 mavlink_msg_to_send_buffer(buffer, &msg);
675 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
676 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
677 }
678 mavlink_msg_fence_fetch_point_decode(last_msg, &packet2);
679 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
680
681 memset(&packet2, 0, sizeof(packet2));
682 mavlink_msg_fence_fetch_point_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.idx );
683 mavlink_msg_fence_fetch_point_decode(last_msg, &packet2);
684 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
685}
686
687static void mavlink_test_fence_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
688{
689#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
690 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
691 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FENCE_STATUS >= 256) {
692 return;
693 }
694#endif
695 mavlink_message_t msg;
696 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
697 uint16_t i;
698 mavlink_fence_status_t packet_in = {
699 963497464,17443,151,218
700 };
701 mavlink_fence_status_t packet1, packet2;
702 memset(&packet1, 0, sizeof(packet1));
703 packet1.breach_time = packet_in.breach_time;
704 packet1.breach_count = packet_in.breach_count;
705 packet1.breach_status = packet_in.breach_status;
706 packet1.breach_type = packet_in.breach_type;
707
708
709#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
710 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
711 // cope with extensions
712 memset(MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN);
713 }
714#endif
715 memset(&packet2, 0, sizeof(packet2));
716 mavlink_msg_fence_status_encode(system_id, component_id, &msg, &packet1);
717 mavlink_msg_fence_status_decode(&msg, &packet2);
718 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
719
720 memset(&packet2, 0, sizeof(packet2));
721 mavlink_msg_fence_status_pack(system_id, component_id, &msg , packet1.breach_status , packet1.breach_count , packet1.breach_type , packet1.breach_time );
722 mavlink_msg_fence_status_decode(&msg, &packet2);
723 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
724
725 memset(&packet2, 0, sizeof(packet2));
726 mavlink_msg_fence_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.breach_status , packet1.breach_count , packet1.breach_type , packet1.breach_time );
727 mavlink_msg_fence_status_decode(&msg, &packet2);
728 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
729
730 memset(&packet2, 0, sizeof(packet2));
731 mavlink_msg_to_send_buffer(buffer, &msg);
732 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
733 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
734 }
735 mavlink_msg_fence_status_decode(last_msg, &packet2);
736 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
737
738 memset(&packet2, 0, sizeof(packet2));
739 mavlink_msg_fence_status_send(MAVLINK_COMM_1 , packet1.breach_status , packet1.breach_count , packet1.breach_type , packet1.breach_time );
740 mavlink_msg_fence_status_decode(last_msg, &packet2);
741 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
742}
743
744static void mavlink_test_ahrs(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
745{
746#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
747 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
748 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AHRS >= 256) {
749 return;
750 }
751#endif
752 mavlink_message_t msg;
753 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
754 uint16_t i;
755 mavlink_ahrs_t packet_in = {
756 17.0,45.0,73.0,101.0,129.0,157.0,185.0
757 };
758 mavlink_ahrs_t packet1, packet2;
759 memset(&packet1, 0, sizeof(packet1));
760 packet1.omegaIx = packet_in.omegaIx;
761 packet1.omegaIy = packet_in.omegaIy;
762 packet1.omegaIz = packet_in.omegaIz;
763 packet1.accel_weight = packet_in.accel_weight;
764 packet1.renorm_val = packet_in.renorm_val;
765 packet1.error_rp = packet_in.error_rp;
766 packet1.error_yaw = packet_in.error_yaw;
767
768
769#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
770 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
771 // cope with extensions
772 memset(MAVLINK_MSG_ID_AHRS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AHRS_MIN_LEN);
773 }
774#endif
775 memset(&packet2, 0, sizeof(packet2));
776 mavlink_msg_ahrs_encode(system_id, component_id, &msg, &packet1);
777 mavlink_msg_ahrs_decode(&msg, &packet2);
778 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
779
780 memset(&packet2, 0, sizeof(packet2));
781 mavlink_msg_ahrs_pack(system_id, component_id, &msg , packet1.omegaIx , packet1.omegaIy , packet1.omegaIz , packet1.accel_weight , packet1.renorm_val , packet1.error_rp , packet1.error_yaw );
782 mavlink_msg_ahrs_decode(&msg, &packet2);
783 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
784
785 memset(&packet2, 0, sizeof(packet2));
786 mavlink_msg_ahrs_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.omegaIx , packet1.omegaIy , packet1.omegaIz , packet1.accel_weight , packet1.renorm_val , packet1.error_rp , packet1.error_yaw );
787 mavlink_msg_ahrs_decode(&msg, &packet2);
788 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
789
790 memset(&packet2, 0, sizeof(packet2));
791 mavlink_msg_to_send_buffer(buffer, &msg);
792 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
793 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
794 }
795 mavlink_msg_ahrs_decode(last_msg, &packet2);
796 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
797
798 memset(&packet2, 0, sizeof(packet2));
799 mavlink_msg_ahrs_send(MAVLINK_COMM_1 , packet1.omegaIx , packet1.omegaIy , packet1.omegaIz , packet1.accel_weight , packet1.renorm_val , packet1.error_rp , packet1.error_yaw );
800 mavlink_msg_ahrs_decode(last_msg, &packet2);
801 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
802}
803
804static void mavlink_test_simstate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
805{
806#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
807 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
808 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SIMSTATE >= 256) {
809 return;
810 }
811#endif
812 mavlink_message_t msg;
813 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
814 uint16_t i;
815 mavlink_simstate_t packet_in = {
816 17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,963499336,963499544
817 };
818 mavlink_simstate_t packet1, packet2;
819 memset(&packet1, 0, sizeof(packet1));
820 packet1.roll = packet_in.roll;
821 packet1.pitch = packet_in.pitch;
822 packet1.yaw = packet_in.yaw;
823 packet1.xacc = packet_in.xacc;
824 packet1.yacc = packet_in.yacc;
825 packet1.zacc = packet_in.zacc;
826 packet1.xgyro = packet_in.xgyro;
827 packet1.ygyro = packet_in.ygyro;
828 packet1.zgyro = packet_in.zgyro;
829 packet1.lat = packet_in.lat;
830 packet1.lng = packet_in.lng;
831
832
833#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
834 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
835 // cope with extensions
836 memset(MAVLINK_MSG_ID_SIMSTATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SIMSTATE_MIN_LEN);
837 }
838#endif
839 memset(&packet2, 0, sizeof(packet2));
840 mavlink_msg_simstate_encode(system_id, component_id, &msg, &packet1);
841 mavlink_msg_simstate_decode(&msg, &packet2);
842 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
843
844 memset(&packet2, 0, sizeof(packet2));
845 mavlink_msg_simstate_pack(system_id, component_id, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lng );
846 mavlink_msg_simstate_decode(&msg, &packet2);
847 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
848
849 memset(&packet2, 0, sizeof(packet2));
850 mavlink_msg_simstate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lng );
851 mavlink_msg_simstate_decode(&msg, &packet2);
852 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
853
854 memset(&packet2, 0, sizeof(packet2));
855 mavlink_msg_to_send_buffer(buffer, &msg);
856 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
857 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
858 }
859 mavlink_msg_simstate_decode(last_msg, &packet2);
860 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
861
862 memset(&packet2, 0, sizeof(packet2));
863 mavlink_msg_simstate_send(MAVLINK_COMM_1 , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lng );
864 mavlink_msg_simstate_decode(last_msg, &packet2);
865 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
866}
867
868static void mavlink_test_hwstatus(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
869{
870#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
871 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
872 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HWSTATUS >= 256) {
873 return;
874 }
875#endif
876 mavlink_message_t msg;
877 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
878 uint16_t i;
879 mavlink_hwstatus_t packet_in = {
880 17235,139
881 };
882 mavlink_hwstatus_t packet1, packet2;
883 memset(&packet1, 0, sizeof(packet1));
884 packet1.Vcc = packet_in.Vcc;
885 packet1.I2Cerr = packet_in.I2Cerr;
886
887
888#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
889 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
890 // cope with extensions
891 memset(MAVLINK_MSG_ID_HWSTATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HWSTATUS_MIN_LEN);
892 }
893#endif
894 memset(&packet2, 0, sizeof(packet2));
895 mavlink_msg_hwstatus_encode(system_id, component_id, &msg, &packet1);
896 mavlink_msg_hwstatus_decode(&msg, &packet2);
897 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
898
899 memset(&packet2, 0, sizeof(packet2));
900 mavlink_msg_hwstatus_pack(system_id, component_id, &msg , packet1.Vcc , packet1.I2Cerr );
901 mavlink_msg_hwstatus_decode(&msg, &packet2);
902 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
903
904 memset(&packet2, 0, sizeof(packet2));
905 mavlink_msg_hwstatus_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.Vcc , packet1.I2Cerr );
906 mavlink_msg_hwstatus_decode(&msg, &packet2);
907 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
908
909 memset(&packet2, 0, sizeof(packet2));
910 mavlink_msg_to_send_buffer(buffer, &msg);
911 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
912 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
913 }
914 mavlink_msg_hwstatus_decode(last_msg, &packet2);
915 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
916
917 memset(&packet2, 0, sizeof(packet2));
918 mavlink_msg_hwstatus_send(MAVLINK_COMM_1 , packet1.Vcc , packet1.I2Cerr );
919 mavlink_msg_hwstatus_decode(last_msg, &packet2);
920 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
921}
922
923static void mavlink_test_radio(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
924{
925#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
926 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
927 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RADIO >= 256) {
928 return;
929 }
930#endif
931 mavlink_message_t msg;
932 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
933 uint16_t i;
934 mavlink_radio_t packet_in = {
935 17235,17339,17,84,151,218,29
936 };
937 mavlink_radio_t packet1, packet2;
938 memset(&packet1, 0, sizeof(packet1));
939 packet1.rxerrors = packet_in.rxerrors;
940 packet1.fixed = packet_in.fixed;
941 packet1.rssi = packet_in.rssi;
942 packet1.remrssi = packet_in.remrssi;
943 packet1.txbuf = packet_in.txbuf;
944 packet1.noise = packet_in.noise;
945 packet1.remnoise = packet_in.remnoise;
946
947
948#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
949 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
950 // cope with extensions
951 memset(MAVLINK_MSG_ID_RADIO_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RADIO_MIN_LEN);
952 }
953#endif
954 memset(&packet2, 0, sizeof(packet2));
955 mavlink_msg_radio_encode(system_id, component_id, &msg, &packet1);
956 mavlink_msg_radio_decode(&msg, &packet2);
957 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
958
959 memset(&packet2, 0, sizeof(packet2));
960 mavlink_msg_radio_pack(system_id, component_id, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
961 mavlink_msg_radio_decode(&msg, &packet2);
962 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
963
964 memset(&packet2, 0, sizeof(packet2));
965 mavlink_msg_radio_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
966 mavlink_msg_radio_decode(&msg, &packet2);
967 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
968
969 memset(&packet2, 0, sizeof(packet2));
970 mavlink_msg_to_send_buffer(buffer, &msg);
971 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
972 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
973 }
974 mavlink_msg_radio_decode(last_msg, &packet2);
975 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
976
977 memset(&packet2, 0, sizeof(packet2));
978 mavlink_msg_radio_send(MAVLINK_COMM_1 , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
979 mavlink_msg_radio_decode(last_msg, &packet2);
980 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
981}
982
983static void mavlink_test_limits_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
984{
985#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
986 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
987 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LIMITS_STATUS >= 256) {
988 return;
989 }
990#endif
991 mavlink_message_t msg;
992 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
993 uint16_t i;
994 mavlink_limits_status_t packet_in = {
995 963497464,963497672,963497880,963498088,18067,187,254,65,132
996 };
997 mavlink_limits_status_t packet1, packet2;
998 memset(&packet1, 0, sizeof(packet1));
999 packet1.last_trigger = packet_in.last_trigger;
1000 packet1.last_action = packet_in.last_action;
1001 packet1.last_recovery = packet_in.last_recovery;
1002 packet1.last_clear = packet_in.last_clear;
1003 packet1.breach_count = packet_in.breach_count;
1004 packet1.limits_state = packet_in.limits_state;
1005 packet1.mods_enabled = packet_in.mods_enabled;
1006 packet1.mods_required = packet_in.mods_required;
1007 packet1.mods_triggered = packet_in.mods_triggered;
1008
1009
1010#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1011 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1012 // cope with extensions
1013 memset(MAVLINK_MSG_ID_LIMITS_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LIMITS_STATUS_MIN_LEN);
1014 }
1015#endif
1016 memset(&packet2, 0, sizeof(packet2));
1017 mavlink_msg_limits_status_encode(system_id, component_id, &msg, &packet1);
1018 mavlink_msg_limits_status_decode(&msg, &packet2);
1019 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1020
1021 memset(&packet2, 0, sizeof(packet2));
1022 mavlink_msg_limits_status_pack(system_id, component_id, &msg , packet1.limits_state , packet1.last_trigger , packet1.last_action , packet1.last_recovery , packet1.last_clear , packet1.breach_count , packet1.mods_enabled , packet1.mods_required , packet1.mods_triggered );
1023 mavlink_msg_limits_status_decode(&msg, &packet2);
1024 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1025
1026 memset(&packet2, 0, sizeof(packet2));
1027 mavlink_msg_limits_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.limits_state , packet1.last_trigger , packet1.last_action , packet1.last_recovery , packet1.last_clear , packet1.breach_count , packet1.mods_enabled , packet1.mods_required , packet1.mods_triggered );
1028 mavlink_msg_limits_status_decode(&msg, &packet2);
1029 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1030
1031 memset(&packet2, 0, sizeof(packet2));
1032 mavlink_msg_to_send_buffer(buffer, &msg);
1033 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1034 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1035 }
1036 mavlink_msg_limits_status_decode(last_msg, &packet2);
1037 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1038
1039 memset(&packet2, 0, sizeof(packet2));
1040 mavlink_msg_limits_status_send(MAVLINK_COMM_1 , packet1.limits_state , packet1.last_trigger , packet1.last_action , packet1.last_recovery , packet1.last_clear , packet1.breach_count , packet1.mods_enabled , packet1.mods_required , packet1.mods_triggered );
1041 mavlink_msg_limits_status_decode(last_msg, &packet2);
1042 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1043}
1044
1045static void mavlink_test_wind(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1046{
1047#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1048 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1049 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_WIND >= 256) {
1050 return;
1051 }
1052#endif
1053 mavlink_message_t msg;
1054 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1055 uint16_t i;
1056 mavlink_wind_t packet_in = {
1057 17.0,45.0,73.0
1058 };
1059 mavlink_wind_t packet1, packet2;
1060 memset(&packet1, 0, sizeof(packet1));
1061 packet1.direction = packet_in.direction;
1062 packet1.speed = packet_in.speed;
1063 packet1.speed_z = packet_in.speed_z;
1064
1065
1066#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1067 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1068 // cope with extensions
1069 memset(MAVLINK_MSG_ID_WIND_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_WIND_MIN_LEN);
1070 }
1071#endif
1072 memset(&packet2, 0, sizeof(packet2));
1073 mavlink_msg_wind_encode(system_id, component_id, &msg, &packet1);
1074 mavlink_msg_wind_decode(&msg, &packet2);
1075 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1076
1077 memset(&packet2, 0, sizeof(packet2));
1078 mavlink_msg_wind_pack(system_id, component_id, &msg , packet1.direction , packet1.speed , packet1.speed_z );
1079 mavlink_msg_wind_decode(&msg, &packet2);
1080 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1081
1082 memset(&packet2, 0, sizeof(packet2));
1083 mavlink_msg_wind_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.direction , packet1.speed , packet1.speed_z );
1084 mavlink_msg_wind_decode(&msg, &packet2);
1085 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1086
1087 memset(&packet2, 0, sizeof(packet2));
1088 mavlink_msg_to_send_buffer(buffer, &msg);
1089 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1090 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1091 }
1092 mavlink_msg_wind_decode(last_msg, &packet2);
1093 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1094
1095 memset(&packet2, 0, sizeof(packet2));
1096 mavlink_msg_wind_send(MAVLINK_COMM_1 , packet1.direction , packet1.speed , packet1.speed_z );
1097 mavlink_msg_wind_decode(last_msg, &packet2);
1098 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1099}
1100
1101static void mavlink_test_data16(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1102{
1103#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1104 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1105 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DATA16 >= 256) {
1106 return;
1107 }
1108#endif
1109 mavlink_message_t msg;
1110 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1111 uint16_t i;
1112 mavlink_data16_t packet_in = {
1113 5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154 }
1114 };
1115 mavlink_data16_t packet1, packet2;
1116 memset(&packet1, 0, sizeof(packet1));
1117 packet1.type = packet_in.type;
1118 packet1.len = packet_in.len;
1119
1120 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*16);
1121
1122#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1123 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1124 // cope with extensions
1125 memset(MAVLINK_MSG_ID_DATA16_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DATA16_MIN_LEN);
1126 }
1127#endif
1128 memset(&packet2, 0, sizeof(packet2));
1129 mavlink_msg_data16_encode(system_id, component_id, &msg, &packet1);
1130 mavlink_msg_data16_decode(&msg, &packet2);
1131 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1132
1133 memset(&packet2, 0, sizeof(packet2));
1134 mavlink_msg_data16_pack(system_id, component_id, &msg , packet1.type , packet1.len , packet1.data );
1135 mavlink_msg_data16_decode(&msg, &packet2);
1136 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1137
1138 memset(&packet2, 0, sizeof(packet2));
1139 mavlink_msg_data16_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.len , packet1.data );
1140 mavlink_msg_data16_decode(&msg, &packet2);
1141 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1142
1143 memset(&packet2, 0, sizeof(packet2));
1144 mavlink_msg_to_send_buffer(buffer, &msg);
1145 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1146 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1147 }
1148 mavlink_msg_data16_decode(last_msg, &packet2);
1149 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1150
1151 memset(&packet2, 0, sizeof(packet2));
1152 mavlink_msg_data16_send(MAVLINK_COMM_1 , packet1.type , packet1.len , packet1.data );
1153 mavlink_msg_data16_decode(last_msg, &packet2);
1154 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1155}
1156
1157static void mavlink_test_data32(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1158{
1159#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1160 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1161 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DATA32 >= 256) {
1162 return;
1163 }
1164#endif
1165 mavlink_message_t msg;
1166 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1167 uint16_t i;
1168 mavlink_data32_t packet_in = {
1169 5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170 }
1170 };
1171 mavlink_data32_t packet1, packet2;
1172 memset(&packet1, 0, sizeof(packet1));
1173 packet1.type = packet_in.type;
1174 packet1.len = packet_in.len;
1175
1176 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*32);
1177
1178#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1179 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1180 // cope with extensions
1181 memset(MAVLINK_MSG_ID_DATA32_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DATA32_MIN_LEN);
1182 }
1183#endif
1184 memset(&packet2, 0, sizeof(packet2));
1185 mavlink_msg_data32_encode(system_id, component_id, &msg, &packet1);
1186 mavlink_msg_data32_decode(&msg, &packet2);
1187 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1188
1189 memset(&packet2, 0, sizeof(packet2));
1190 mavlink_msg_data32_pack(system_id, component_id, &msg , packet1.type , packet1.len , packet1.data );
1191 mavlink_msg_data32_decode(&msg, &packet2);
1192 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1193
1194 memset(&packet2, 0, sizeof(packet2));
1195 mavlink_msg_data32_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.len , packet1.data );
1196 mavlink_msg_data32_decode(&msg, &packet2);
1197 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1198
1199 memset(&packet2, 0, sizeof(packet2));
1200 mavlink_msg_to_send_buffer(buffer, &msg);
1201 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1202 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1203 }
1204 mavlink_msg_data32_decode(last_msg, &packet2);
1205 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1206
1207 memset(&packet2, 0, sizeof(packet2));
1208 mavlink_msg_data32_send(MAVLINK_COMM_1 , packet1.type , packet1.len , packet1.data );
1209 mavlink_msg_data32_decode(last_msg, &packet2);
1210 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1211}
1212
1213static void mavlink_test_data64(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1214{
1215#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1216 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1217 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DATA64 >= 256) {
1218 return;
1219 }
1220#endif
1221 mavlink_message_t msg;
1222 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1223 uint16_t i;
1224 mavlink_data64_t packet_in = {
1225 5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202 }
1226 };
1227 mavlink_data64_t packet1, packet2;
1228 memset(&packet1, 0, sizeof(packet1));
1229 packet1.type = packet_in.type;
1230 packet1.len = packet_in.len;
1231
1232 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*64);
1233
1234#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1235 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1236 // cope with extensions
1237 memset(MAVLINK_MSG_ID_DATA64_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DATA64_MIN_LEN);
1238 }
1239#endif
1240 memset(&packet2, 0, sizeof(packet2));
1241 mavlink_msg_data64_encode(system_id, component_id, &msg, &packet1);
1242 mavlink_msg_data64_decode(&msg, &packet2);
1243 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1244
1245 memset(&packet2, 0, sizeof(packet2));
1246 mavlink_msg_data64_pack(system_id, component_id, &msg , packet1.type , packet1.len , packet1.data );
1247 mavlink_msg_data64_decode(&msg, &packet2);
1248 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1249
1250 memset(&packet2, 0, sizeof(packet2));
1251 mavlink_msg_data64_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.len , packet1.data );
1252 mavlink_msg_data64_decode(&msg, &packet2);
1253 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1254
1255 memset(&packet2, 0, sizeof(packet2));
1256 mavlink_msg_to_send_buffer(buffer, &msg);
1257 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1258 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1259 }
1260 mavlink_msg_data64_decode(last_msg, &packet2);
1261 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1262
1263 memset(&packet2, 0, sizeof(packet2));
1264 mavlink_msg_data64_send(MAVLINK_COMM_1 , packet1.type , packet1.len , packet1.data );
1265 mavlink_msg_data64_decode(last_msg, &packet2);
1266 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1267}
1268
1269static void mavlink_test_data96(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1270{
1271#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1272 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1273 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DATA96 >= 256) {
1274 return;
1275 }
1276#endif
1277 mavlink_message_t msg;
1278 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1279 uint16_t i;
1280 mavlink_data96_t packet_in = {
1281 5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234 }
1282 };
1283 mavlink_data96_t packet1, packet2;
1284 memset(&packet1, 0, sizeof(packet1));
1285 packet1.type = packet_in.type;
1286 packet1.len = packet_in.len;
1287
1288 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*96);
1289
1290#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1291 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1292 // cope with extensions
1293 memset(MAVLINK_MSG_ID_DATA96_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DATA96_MIN_LEN);
1294 }
1295#endif
1296 memset(&packet2, 0, sizeof(packet2));
1297 mavlink_msg_data96_encode(system_id, component_id, &msg, &packet1);
1298 mavlink_msg_data96_decode(&msg, &packet2);
1299 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1300
1301 memset(&packet2, 0, sizeof(packet2));
1302 mavlink_msg_data96_pack(system_id, component_id, &msg , packet1.type , packet1.len , packet1.data );
1303 mavlink_msg_data96_decode(&msg, &packet2);
1304 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1305
1306 memset(&packet2, 0, sizeof(packet2));
1307 mavlink_msg_data96_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.len , packet1.data );
1308 mavlink_msg_data96_decode(&msg, &packet2);
1309 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1310
1311 memset(&packet2, 0, sizeof(packet2));
1312 mavlink_msg_to_send_buffer(buffer, &msg);
1313 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1314 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1315 }
1316 mavlink_msg_data96_decode(last_msg, &packet2);
1317 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1318
1319 memset(&packet2, 0, sizeof(packet2));
1320 mavlink_msg_data96_send(MAVLINK_COMM_1 , packet1.type , packet1.len , packet1.data );
1321 mavlink_msg_data96_decode(last_msg, &packet2);
1322 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1323}
1324
1325static void mavlink_test_rangefinder(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1326{
1327#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1328 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1329 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RANGEFINDER >= 256) {
1330 return;
1331 }
1332#endif
1333 mavlink_message_t msg;
1334 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1335 uint16_t i;
1336 mavlink_rangefinder_t packet_in = {
1337 17.0,45.0
1338 };
1339 mavlink_rangefinder_t packet1, packet2;
1340 memset(&packet1, 0, sizeof(packet1));
1341 packet1.distance = packet_in.distance;
1342 packet1.voltage = packet_in.voltage;
1343
1344
1345#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1346 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1347 // cope with extensions
1348 memset(MAVLINK_MSG_ID_RANGEFINDER_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RANGEFINDER_MIN_LEN);
1349 }
1350#endif
1351 memset(&packet2, 0, sizeof(packet2));
1352 mavlink_msg_rangefinder_encode(system_id, component_id, &msg, &packet1);
1353 mavlink_msg_rangefinder_decode(&msg, &packet2);
1354 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1355
1356 memset(&packet2, 0, sizeof(packet2));
1357 mavlink_msg_rangefinder_pack(system_id, component_id, &msg , packet1.distance , packet1.voltage );
1358 mavlink_msg_rangefinder_decode(&msg, &packet2);
1359 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1360
1361 memset(&packet2, 0, sizeof(packet2));
1362 mavlink_msg_rangefinder_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.distance , packet1.voltage );
1363 mavlink_msg_rangefinder_decode(&msg, &packet2);
1364 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1365
1366 memset(&packet2, 0, sizeof(packet2));
1367 mavlink_msg_to_send_buffer(buffer, &msg);
1368 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1369 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1370 }
1371 mavlink_msg_rangefinder_decode(last_msg, &packet2);
1372 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1373
1374 memset(&packet2, 0, sizeof(packet2));
1375 mavlink_msg_rangefinder_send(MAVLINK_COMM_1 , packet1.distance , packet1.voltage );
1376 mavlink_msg_rangefinder_decode(last_msg, &packet2);
1377 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1378}
1379
1380static void mavlink_test_airspeed_autocal(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1381{
1382#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1383 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1384 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AIRSPEED_AUTOCAL >= 256) {
1385 return;
1386 }
1387#endif
1388 mavlink_message_t msg;
1389 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1390 uint16_t i;
1391 mavlink_airspeed_autocal_t packet_in = {
1392 17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0
1393 };
1394 mavlink_airspeed_autocal_t packet1, packet2;
1395 memset(&packet1, 0, sizeof(packet1));
1396 packet1.vx = packet_in.vx;
1397 packet1.vy = packet_in.vy;
1398 packet1.vz = packet_in.vz;
1399 packet1.diff_pressure = packet_in.diff_pressure;
1400 packet1.EAS2TAS = packet_in.EAS2TAS;
1401 packet1.ratio = packet_in.ratio;
1402 packet1.state_x = packet_in.state_x;
1403 packet1.state_y = packet_in.state_y;
1404 packet1.state_z = packet_in.state_z;
1405 packet1.Pax = packet_in.Pax;
1406 packet1.Pby = packet_in.Pby;
1407 packet1.Pcz = packet_in.Pcz;
1408
1409
1410#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1411 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1412 // cope with extensions
1413 memset(MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_MIN_LEN);
1414 }
1415#endif
1416 memset(&packet2, 0, sizeof(packet2));
1417 mavlink_msg_airspeed_autocal_encode(system_id, component_id, &msg, &packet1);
1418 mavlink_msg_airspeed_autocal_decode(&msg, &packet2);
1419 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1420
1421 memset(&packet2, 0, sizeof(packet2));
1422 mavlink_msg_airspeed_autocal_pack(system_id, component_id, &msg , packet1.vx , packet1.vy , packet1.vz , packet1.diff_pressure , packet1.EAS2TAS , packet1.ratio , packet1.state_x , packet1.state_y , packet1.state_z , packet1.Pax , packet1.Pby , packet1.Pcz );
1423 mavlink_msg_airspeed_autocal_decode(&msg, &packet2);
1424 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1425
1426 memset(&packet2, 0, sizeof(packet2));
1427 mavlink_msg_airspeed_autocal_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.vx , packet1.vy , packet1.vz , packet1.diff_pressure , packet1.EAS2TAS , packet1.ratio , packet1.state_x , packet1.state_y , packet1.state_z , packet1.Pax , packet1.Pby , packet1.Pcz );
1428 mavlink_msg_airspeed_autocal_decode(&msg, &packet2);
1429 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1430
1431 memset(&packet2, 0, sizeof(packet2));
1432 mavlink_msg_to_send_buffer(buffer, &msg);
1433 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1434 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1435 }
1436 mavlink_msg_airspeed_autocal_decode(last_msg, &packet2);
1437 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1438
1439 memset(&packet2, 0, sizeof(packet2));
1440 mavlink_msg_airspeed_autocal_send(MAVLINK_COMM_1 , packet1.vx , packet1.vy , packet1.vz , packet1.diff_pressure , packet1.EAS2TAS , packet1.ratio , packet1.state_x , packet1.state_y , packet1.state_z , packet1.Pax , packet1.Pby , packet1.Pcz );
1441 mavlink_msg_airspeed_autocal_decode(last_msg, &packet2);
1442 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1443}
1444
1445static void mavlink_test_rally_point(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1446{
1447#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1448 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1449 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RALLY_POINT >= 256) {
1450 return;
1451 }
1452#endif
1453 mavlink_message_t msg;
1454 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1455 uint16_t i;
1456 mavlink_rally_point_t packet_in = {
1457 963497464,963497672,17651,17755,17859,175,242,53,120,187
1458 };
1459 mavlink_rally_point_t packet1, packet2;
1460 memset(&packet1, 0, sizeof(packet1));
1461 packet1.lat = packet_in.lat;
1462 packet1.lng = packet_in.lng;
1463 packet1.alt = packet_in.alt;
1464 packet1.break_alt = packet_in.break_alt;
1465 packet1.land_dir = packet_in.land_dir;
1466 packet1.target_system = packet_in.target_system;
1467 packet1.target_component = packet_in.target_component;
1468 packet1.idx = packet_in.idx;
1469 packet1.count = packet_in.count;
1470 packet1.flags = packet_in.flags;
1471
1472
1473#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1474 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1475 // cope with extensions
1476 memset(MAVLINK_MSG_ID_RALLY_POINT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RALLY_POINT_MIN_LEN);
1477 }
1478#endif
1479 memset(&packet2, 0, sizeof(packet2));
1480 mavlink_msg_rally_point_encode(system_id, component_id, &msg, &packet1);
1481 mavlink_msg_rally_point_decode(&msg, &packet2);
1482 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1483
1484 memset(&packet2, 0, sizeof(packet2));
1485 mavlink_msg_rally_point_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng , packet1.alt , packet1.break_alt , packet1.land_dir , packet1.flags );
1486 mavlink_msg_rally_point_decode(&msg, &packet2);
1487 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1488
1489 memset(&packet2, 0, sizeof(packet2));
1490 mavlink_msg_rally_point_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng , packet1.alt , packet1.break_alt , packet1.land_dir , packet1.flags );
1491 mavlink_msg_rally_point_decode(&msg, &packet2);
1492 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1493
1494 memset(&packet2, 0, sizeof(packet2));
1495 mavlink_msg_to_send_buffer(buffer, &msg);
1496 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1497 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1498 }
1499 mavlink_msg_rally_point_decode(last_msg, &packet2);
1500 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1501
1502 memset(&packet2, 0, sizeof(packet2));
1503 mavlink_msg_rally_point_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng , packet1.alt , packet1.break_alt , packet1.land_dir , packet1.flags );
1504 mavlink_msg_rally_point_decode(last_msg, &packet2);
1505 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1506}
1507
1508static void mavlink_test_rally_fetch_point(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1509{
1510#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1511 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1512 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RALLY_FETCH_POINT >= 256) {
1513 return;
1514 }
1515#endif
1516 mavlink_message_t msg;
1517 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1518 uint16_t i;
1519 mavlink_rally_fetch_point_t packet_in = {
1520 5,72,139
1521 };
1522 mavlink_rally_fetch_point_t packet1, packet2;
1523 memset(&packet1, 0, sizeof(packet1));
1524 packet1.target_system = packet_in.target_system;
1525 packet1.target_component = packet_in.target_component;
1526 packet1.idx = packet_in.idx;
1527
1528
1529#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1530 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1531 // cope with extensions
1532 memset(MAVLINK_MSG_ID_RALLY_FETCH_POINT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RALLY_FETCH_POINT_MIN_LEN);
1533 }
1534#endif
1535 memset(&packet2, 0, sizeof(packet2));
1536 mavlink_msg_rally_fetch_point_encode(system_id, component_id, &msg, &packet1);
1537 mavlink_msg_rally_fetch_point_decode(&msg, &packet2);
1538 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1539
1540 memset(&packet2, 0, sizeof(packet2));
1541 mavlink_msg_rally_fetch_point_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.idx );
1542 mavlink_msg_rally_fetch_point_decode(&msg, &packet2);
1543 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1544
1545 memset(&packet2, 0, sizeof(packet2));
1546 mavlink_msg_rally_fetch_point_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.idx );
1547 mavlink_msg_rally_fetch_point_decode(&msg, &packet2);
1548 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1549
1550 memset(&packet2, 0, sizeof(packet2));
1551 mavlink_msg_to_send_buffer(buffer, &msg);
1552 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1553 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1554 }
1555 mavlink_msg_rally_fetch_point_decode(last_msg, &packet2);
1556 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1557
1558 memset(&packet2, 0, sizeof(packet2));
1559 mavlink_msg_rally_fetch_point_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.idx );
1560 mavlink_msg_rally_fetch_point_decode(last_msg, &packet2);
1561 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1562}
1563
1564static void mavlink_test_compassmot_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1565{
1566#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1567 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1568 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMPASSMOT_STATUS >= 256) {
1569 return;
1570 }
1571#endif
1572 mavlink_message_t msg;
1573 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1574 uint16_t i;
1575 mavlink_compassmot_status_t packet_in = {
1576 17.0,45.0,73.0,101.0,18067,18171
1577 };
1578 mavlink_compassmot_status_t packet1, packet2;
1579 memset(&packet1, 0, sizeof(packet1));
1580 packet1.current = packet_in.current;
1581 packet1.CompensationX = packet_in.CompensationX;
1582 packet1.CompensationY = packet_in.CompensationY;
1583 packet1.CompensationZ = packet_in.CompensationZ;
1584 packet1.throttle = packet_in.throttle;
1585 packet1.interference = packet_in.interference;
1586
1587
1588#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1589 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1590 // cope with extensions
1591 memset(MAVLINK_MSG_ID_COMPASSMOT_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COMPASSMOT_STATUS_MIN_LEN);
1592 }
1593#endif
1594 memset(&packet2, 0, sizeof(packet2));
1595 mavlink_msg_compassmot_status_encode(system_id, component_id, &msg, &packet1);
1596 mavlink_msg_compassmot_status_decode(&msg, &packet2);
1597 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1598
1599 memset(&packet2, 0, sizeof(packet2));
1600 mavlink_msg_compassmot_status_pack(system_id, component_id, &msg , packet1.throttle , packet1.current , packet1.interference , packet1.CompensationX , packet1.CompensationY , packet1.CompensationZ );
1601 mavlink_msg_compassmot_status_decode(&msg, &packet2);
1602 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1603
1604 memset(&packet2, 0, sizeof(packet2));
1605 mavlink_msg_compassmot_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.throttle , packet1.current , packet1.interference , packet1.CompensationX , packet1.CompensationY , packet1.CompensationZ );
1606 mavlink_msg_compassmot_status_decode(&msg, &packet2);
1607 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1608
1609 memset(&packet2, 0, sizeof(packet2));
1610 mavlink_msg_to_send_buffer(buffer, &msg);
1611 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1612 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1613 }
1614 mavlink_msg_compassmot_status_decode(last_msg, &packet2);
1615 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1616
1617 memset(&packet2, 0, sizeof(packet2));
1618 mavlink_msg_compassmot_status_send(MAVLINK_COMM_1 , packet1.throttle , packet1.current , packet1.interference , packet1.CompensationX , packet1.CompensationY , packet1.CompensationZ );
1619 mavlink_msg_compassmot_status_decode(last_msg, &packet2);
1620 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1621}
1622
1623static void mavlink_test_ahrs2(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1624{
1625#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1626 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1627 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AHRS2 >= 256) {
1628 return;
1629 }
1630#endif
1631 mavlink_message_t msg;
1632 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1633 uint16_t i;
1634 mavlink_ahrs2_t packet_in = {
1635 17.0,45.0,73.0,101.0,963498296,963498504
1636 };
1637 mavlink_ahrs2_t packet1, packet2;
1638 memset(&packet1, 0, sizeof(packet1));
1639 packet1.roll = packet_in.roll;
1640 packet1.pitch = packet_in.pitch;
1641 packet1.yaw = packet_in.yaw;
1642 packet1.altitude = packet_in.altitude;
1643 packet1.lat = packet_in.lat;
1644 packet1.lng = packet_in.lng;
1645
1646
1647#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1648 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1649 // cope with extensions
1650 memset(MAVLINK_MSG_ID_AHRS2_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AHRS2_MIN_LEN);
1651 }
1652#endif
1653 memset(&packet2, 0, sizeof(packet2));
1654 mavlink_msg_ahrs2_encode(system_id, component_id, &msg, &packet1);
1655 mavlink_msg_ahrs2_decode(&msg, &packet2);
1656 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1657
1658 memset(&packet2, 0, sizeof(packet2));
1659 mavlink_msg_ahrs2_pack(system_id, component_id, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.altitude , packet1.lat , packet1.lng );
1660 mavlink_msg_ahrs2_decode(&msg, &packet2);
1661 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1662
1663 memset(&packet2, 0, sizeof(packet2));
1664 mavlink_msg_ahrs2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.altitude , packet1.lat , packet1.lng );
1665 mavlink_msg_ahrs2_decode(&msg, &packet2);
1666 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1667
1668 memset(&packet2, 0, sizeof(packet2));
1669 mavlink_msg_to_send_buffer(buffer, &msg);
1670 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1671 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1672 }
1673 mavlink_msg_ahrs2_decode(last_msg, &packet2);
1674 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1675
1676 memset(&packet2, 0, sizeof(packet2));
1677 mavlink_msg_ahrs2_send(MAVLINK_COMM_1 , packet1.roll , packet1.pitch , packet1.yaw , packet1.altitude , packet1.lat , packet1.lng );
1678 mavlink_msg_ahrs2_decode(last_msg, &packet2);
1679 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1680}
1681
1682static void mavlink_test_camera_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1683{
1684#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1685 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1686 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_STATUS >= 256) {
1687 return;
1688 }
1689#endif
1690 mavlink_message_t msg;
1691 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1692 uint16_t i;
1693 mavlink_camera_status_t packet_in = {
1694 93372036854775807ULL,73.0,101.0,129.0,157.0,18483,211,22,89
1695 };
1696 mavlink_camera_status_t packet1, packet2;
1697 memset(&packet1, 0, sizeof(packet1));
1698 packet1.time_usec = packet_in.time_usec;
1699 packet1.p1 = packet_in.p1;
1700 packet1.p2 = packet_in.p2;
1701 packet1.p3 = packet_in.p3;
1702 packet1.p4 = packet_in.p4;
1703 packet1.img_idx = packet_in.img_idx;
1704 packet1.target_system = packet_in.target_system;
1705 packet1.cam_idx = packet_in.cam_idx;
1706 packet1.event_id = packet_in.event_id;
1707
1708
1709#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1710 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1711 // cope with extensions
1712 memset(MAVLINK_MSG_ID_CAMERA_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_STATUS_MIN_LEN);
1713 }
1714#endif
1715 memset(&packet2, 0, sizeof(packet2));
1716 mavlink_msg_camera_status_encode(system_id, component_id, &msg, &packet1);
1717 mavlink_msg_camera_status_decode(&msg, &packet2);
1718 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1719
1720 memset(&packet2, 0, sizeof(packet2));
1721 mavlink_msg_camera_status_pack(system_id, component_id, &msg , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.event_id , packet1.p1 , packet1.p2 , packet1.p3 , packet1.p4 );
1722 mavlink_msg_camera_status_decode(&msg, &packet2);
1723 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1724
1725 memset(&packet2, 0, sizeof(packet2));
1726 mavlink_msg_camera_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.event_id , packet1.p1 , packet1.p2 , packet1.p3 , packet1.p4 );
1727 mavlink_msg_camera_status_decode(&msg, &packet2);
1728 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1729
1730 memset(&packet2, 0, sizeof(packet2));
1731 mavlink_msg_to_send_buffer(buffer, &msg);
1732 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1733 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1734 }
1735 mavlink_msg_camera_status_decode(last_msg, &packet2);
1736 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1737
1738 memset(&packet2, 0, sizeof(packet2));
1739 mavlink_msg_camera_status_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.event_id , packet1.p1 , packet1.p2 , packet1.p3 , packet1.p4 );
1740 mavlink_msg_camera_status_decode(last_msg, &packet2);
1741 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1742}
1743
1744static void mavlink_test_camera_feedback(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1745{
1746#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1747 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1748 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_FEEDBACK >= 256) {
1749 return;
1750 }
1751#endif
1752 mavlink_message_t msg;
1753 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1754 uint16_t i;
1755 mavlink_camera_feedback_t packet_in = {
1756 93372036854775807ULL,963497880,963498088,129.0,157.0,185.0,213.0,241.0,269.0,19315,3,70,137
1757 };
1758 mavlink_camera_feedback_t packet1, packet2;
1759 memset(&packet1, 0, sizeof(packet1));
1760 packet1.time_usec = packet_in.time_usec;
1761 packet1.lat = packet_in.lat;
1762 packet1.lng = packet_in.lng;
1763 packet1.alt_msl = packet_in.alt_msl;
1764 packet1.alt_rel = packet_in.alt_rel;
1765 packet1.roll = packet_in.roll;
1766 packet1.pitch = packet_in.pitch;
1767 packet1.yaw = packet_in.yaw;
1768 packet1.foc_len = packet_in.foc_len;
1769 packet1.img_idx = packet_in.img_idx;
1770 packet1.target_system = packet_in.target_system;
1771 packet1.cam_idx = packet_in.cam_idx;
1772 packet1.flags = packet_in.flags;
1773
1774
1775#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1776 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1777 // cope with extensions
1778 memset(MAVLINK_MSG_ID_CAMERA_FEEDBACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_FEEDBACK_MIN_LEN);
1779 }
1780#endif
1781 memset(&packet2, 0, sizeof(packet2));
1782 mavlink_msg_camera_feedback_encode(system_id, component_id, &msg, &packet1);
1783 mavlink_msg_camera_feedback_decode(&msg, &packet2);
1784 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1785
1786 memset(&packet2, 0, sizeof(packet2));
1787 mavlink_msg_camera_feedback_pack(system_id, component_id, &msg , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.lat , packet1.lng , packet1.alt_msl , packet1.alt_rel , packet1.roll , packet1.pitch , packet1.yaw , packet1.foc_len , packet1.flags );
1788 mavlink_msg_camera_feedback_decode(&msg, &packet2);
1789 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1790
1791 memset(&packet2, 0, sizeof(packet2));
1792 mavlink_msg_camera_feedback_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.lat , packet1.lng , packet1.alt_msl , packet1.alt_rel , packet1.roll , packet1.pitch , packet1.yaw , packet1.foc_len , packet1.flags );
1793 mavlink_msg_camera_feedback_decode(&msg, &packet2);
1794 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1795
1796 memset(&packet2, 0, sizeof(packet2));
1797 mavlink_msg_to_send_buffer(buffer, &msg);
1798 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1799 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1800 }
1801 mavlink_msg_camera_feedback_decode(last_msg, &packet2);
1802 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1803
1804 memset(&packet2, 0, sizeof(packet2));
1805 mavlink_msg_camera_feedback_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.lat , packet1.lng , packet1.alt_msl , packet1.alt_rel , packet1.roll , packet1.pitch , packet1.yaw , packet1.foc_len , packet1.flags );
1806 mavlink_msg_camera_feedback_decode(last_msg, &packet2);
1807 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1808}
1809
1810static void mavlink_test_battery2(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1811{
1812#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1813 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1814 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_BATTERY2 >= 256) {
1815 return;
1816 }
1817#endif
1818 mavlink_message_t msg;
1819 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1820 uint16_t i;
1821 mavlink_battery2_t packet_in = {
1822 17235,17339
1823 };
1824 mavlink_battery2_t packet1, packet2;
1825 memset(&packet1, 0, sizeof(packet1));
1826 packet1.voltage = packet_in.voltage;
1827 packet1.current_battery = packet_in.current_battery;
1828
1829
1830#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1831 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1832 // cope with extensions
1833 memset(MAVLINK_MSG_ID_BATTERY2_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_BATTERY2_MIN_LEN);
1834 }
1835#endif
1836 memset(&packet2, 0, sizeof(packet2));
1837 mavlink_msg_battery2_encode(system_id, component_id, &msg, &packet1);
1838 mavlink_msg_battery2_decode(&msg, &packet2);
1839 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1840
1841 memset(&packet2, 0, sizeof(packet2));
1842 mavlink_msg_battery2_pack(system_id, component_id, &msg , packet1.voltage , packet1.current_battery );
1843 mavlink_msg_battery2_decode(&msg, &packet2);
1844 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1845
1846 memset(&packet2, 0, sizeof(packet2));
1847 mavlink_msg_battery2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.voltage , packet1.current_battery );
1848 mavlink_msg_battery2_decode(&msg, &packet2);
1849 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1850
1851 memset(&packet2, 0, sizeof(packet2));
1852 mavlink_msg_to_send_buffer(buffer, &msg);
1853 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1854 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1855 }
1856 mavlink_msg_battery2_decode(last_msg, &packet2);
1857 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1858
1859 memset(&packet2, 0, sizeof(packet2));
1860 mavlink_msg_battery2_send(MAVLINK_COMM_1 , packet1.voltage , packet1.current_battery );
1861 mavlink_msg_battery2_decode(last_msg, &packet2);
1862 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1863}
1864
1865static void mavlink_test_ahrs3(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1866{
1867#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1868 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1869 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AHRS3 >= 256) {
1870 return;
1871 }
1872#endif
1873 mavlink_message_t msg;
1874 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1875 uint16_t i;
1876 mavlink_ahrs3_t packet_in = {
1877 17.0,45.0,73.0,101.0,963498296,963498504,185.0,213.0,241.0,269.0
1878 };
1879 mavlink_ahrs3_t packet1, packet2;
1880 memset(&packet1, 0, sizeof(packet1));
1881 packet1.roll = packet_in.roll;
1882 packet1.pitch = packet_in.pitch;
1883 packet1.yaw = packet_in.yaw;
1884 packet1.altitude = packet_in.altitude;
1885 packet1.lat = packet_in.lat;
1886 packet1.lng = packet_in.lng;
1887 packet1.v1 = packet_in.v1;
1888 packet1.v2 = packet_in.v2;
1889 packet1.v3 = packet_in.v3;
1890 packet1.v4 = packet_in.v4;
1891
1892
1893#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1894 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1895 // cope with extensions
1896 memset(MAVLINK_MSG_ID_AHRS3_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AHRS3_MIN_LEN);
1897 }
1898#endif
1899 memset(&packet2, 0, sizeof(packet2));
1900 mavlink_msg_ahrs3_encode(system_id, component_id, &msg, &packet1);
1901 mavlink_msg_ahrs3_decode(&msg, &packet2);
1902 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1903
1904 memset(&packet2, 0, sizeof(packet2));
1905 mavlink_msg_ahrs3_pack(system_id, component_id, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.altitude , packet1.lat , packet1.lng , packet1.v1 , packet1.v2 , packet1.v3 , packet1.v4 );
1906 mavlink_msg_ahrs3_decode(&msg, &packet2);
1907 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1908
1909 memset(&packet2, 0, sizeof(packet2));
1910 mavlink_msg_ahrs3_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.altitude , packet1.lat , packet1.lng , packet1.v1 , packet1.v2 , packet1.v3 , packet1.v4 );
1911 mavlink_msg_ahrs3_decode(&msg, &packet2);
1912 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1913
1914 memset(&packet2, 0, sizeof(packet2));
1915 mavlink_msg_to_send_buffer(buffer, &msg);
1916 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1917 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1918 }
1919 mavlink_msg_ahrs3_decode(last_msg, &packet2);
1920 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1921
1922 memset(&packet2, 0, sizeof(packet2));
1923 mavlink_msg_ahrs3_send(MAVLINK_COMM_1 , packet1.roll , packet1.pitch , packet1.yaw , packet1.altitude , packet1.lat , packet1.lng , packet1.v1 , packet1.v2 , packet1.v3 , packet1.v4 );
1924 mavlink_msg_ahrs3_decode(last_msg, &packet2);
1925 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1926}
1927
1928static void mavlink_test_autopilot_version_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1929{
1930#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1931 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1932 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST >= 256) {
1933 return;
1934 }
1935#endif
1936 mavlink_message_t msg;
1937 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1938 uint16_t i;
1939 mavlink_autopilot_version_request_t packet_in = {
1940 5,72
1941 };
1942 mavlink_autopilot_version_request_t packet1, packet2;
1943 memset(&packet1, 0, sizeof(packet1));
1944 packet1.target_system = packet_in.target_system;
1945 packet1.target_component = packet_in.target_component;
1946
1947
1948#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1949 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1950 // cope with extensions
1951 memset(MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_MIN_LEN);
1952 }
1953#endif
1954 memset(&packet2, 0, sizeof(packet2));
1955 mavlink_msg_autopilot_version_request_encode(system_id, component_id, &msg, &packet1);
1956 mavlink_msg_autopilot_version_request_decode(&msg, &packet2);
1957 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1958
1959 memset(&packet2, 0, sizeof(packet2));
1960 mavlink_msg_autopilot_version_request_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
1961 mavlink_msg_autopilot_version_request_decode(&msg, &packet2);
1962 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1963
1964 memset(&packet2, 0, sizeof(packet2));
1965 mavlink_msg_autopilot_version_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
1966 mavlink_msg_autopilot_version_request_decode(&msg, &packet2);
1967 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1968
1969 memset(&packet2, 0, sizeof(packet2));
1970 mavlink_msg_to_send_buffer(buffer, &msg);
1971 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1972 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1973 }
1974 mavlink_msg_autopilot_version_request_decode(last_msg, &packet2);
1975 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1976
1977 memset(&packet2, 0, sizeof(packet2));
1978 mavlink_msg_autopilot_version_request_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
1979 mavlink_msg_autopilot_version_request_decode(last_msg, &packet2);
1980 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1981}
1982
1983static void mavlink_test_remote_log_data_block(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1984{
1985#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1986 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1987 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK >= 256) {
1988 return;
1989 }
1990#endif
1991 mavlink_message_t msg;
1992 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1993 uint16_t i;
1994 mavlink_remote_log_data_block_t packet_in = {
1995 963497464,17,84,{ 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94 }
1996 };
1997 mavlink_remote_log_data_block_t packet1, packet2;
1998 memset(&packet1, 0, sizeof(packet1));
1999 packet1.seqno = packet_in.seqno;
2000 packet1.target_system = packet_in.target_system;
2001 packet1.target_component = packet_in.target_component;
2002
2003 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*200);
2004
2005#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2006 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2007 // cope with extensions
2008 memset(MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_MIN_LEN);
2009 }
2010#endif
2011 memset(&packet2, 0, sizeof(packet2));
2012 mavlink_msg_remote_log_data_block_encode(system_id, component_id, &msg, &packet1);
2013 mavlink_msg_remote_log_data_block_decode(&msg, &packet2);
2014 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2015
2016 memset(&packet2, 0, sizeof(packet2));
2017 mavlink_msg_remote_log_data_block_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seqno , packet1.data );
2018 mavlink_msg_remote_log_data_block_decode(&msg, &packet2);
2019 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2020
2021 memset(&packet2, 0, sizeof(packet2));
2022 mavlink_msg_remote_log_data_block_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seqno , packet1.data );
2023 mavlink_msg_remote_log_data_block_decode(&msg, &packet2);
2024 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2025
2026 memset(&packet2, 0, sizeof(packet2));
2027 mavlink_msg_to_send_buffer(buffer, &msg);
2028 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2029 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2030 }
2031 mavlink_msg_remote_log_data_block_decode(last_msg, &packet2);
2032 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2033
2034 memset(&packet2, 0, sizeof(packet2));
2035 mavlink_msg_remote_log_data_block_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seqno , packet1.data );
2036 mavlink_msg_remote_log_data_block_decode(last_msg, &packet2);
2037 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2038}
2039
2040static void mavlink_test_remote_log_block_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2041{
2042#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2043 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2044 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS >= 256) {
2045 return;
2046 }
2047#endif
2048 mavlink_message_t msg;
2049 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2050 uint16_t i;
2051 mavlink_remote_log_block_status_t packet_in = {
2052 963497464,17,84,151
2053 };
2054 mavlink_remote_log_block_status_t packet1, packet2;
2055 memset(&packet1, 0, sizeof(packet1));
2056 packet1.seqno = packet_in.seqno;
2057 packet1.target_system = packet_in.target_system;
2058 packet1.target_component = packet_in.target_component;
2059 packet1.status = packet_in.status;
2060
2061
2062#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2063 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2064 // cope with extensions
2065 memset(MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_MIN_LEN);
2066 }
2067#endif
2068 memset(&packet2, 0, sizeof(packet2));
2069 mavlink_msg_remote_log_block_status_encode(system_id, component_id, &msg, &packet1);
2070 mavlink_msg_remote_log_block_status_decode(&msg, &packet2);
2071 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2072
2073 memset(&packet2, 0, sizeof(packet2));
2074 mavlink_msg_remote_log_block_status_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seqno , packet1.status );
2075 mavlink_msg_remote_log_block_status_decode(&msg, &packet2);
2076 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2077
2078 memset(&packet2, 0, sizeof(packet2));
2079 mavlink_msg_remote_log_block_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seqno , packet1.status );
2080 mavlink_msg_remote_log_block_status_decode(&msg, &packet2);
2081 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2082
2083 memset(&packet2, 0, sizeof(packet2));
2084 mavlink_msg_to_send_buffer(buffer, &msg);
2085 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2086 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2087 }
2088 mavlink_msg_remote_log_block_status_decode(last_msg, &packet2);
2089 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2090
2091 memset(&packet2, 0, sizeof(packet2));
2092 mavlink_msg_remote_log_block_status_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seqno , packet1.status );
2093 mavlink_msg_remote_log_block_status_decode(last_msg, &packet2);
2094 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2095}
2096
2097static void mavlink_test_led_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2098{
2099#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2100 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2101 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LED_CONTROL >= 256) {
2102 return;
2103 }
2104#endif
2105 mavlink_message_t msg;
2106 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2107 uint16_t i;
2108 mavlink_led_control_t packet_in = {
2109 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 }
2110 };
2111 mavlink_led_control_t packet1, packet2;
2112 memset(&packet1, 0, sizeof(packet1));
2113 packet1.target_system = packet_in.target_system;
2114 packet1.target_component = packet_in.target_component;
2115 packet1.instance = packet_in.instance;
2116 packet1.pattern = packet_in.pattern;
2117 packet1.custom_len = packet_in.custom_len;
2118
2119 mav_array_memcpy(packet1.custom_bytes, packet_in.custom_bytes, sizeof(uint8_t)*24);
2120
2121#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2122 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2123 // cope with extensions
2124 memset(MAVLINK_MSG_ID_LED_CONTROL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LED_CONTROL_MIN_LEN);
2125 }
2126#endif
2127 memset(&packet2, 0, sizeof(packet2));
2128 mavlink_msg_led_control_encode(system_id, component_id, &msg, &packet1);
2129 mavlink_msg_led_control_decode(&msg, &packet2);
2130 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2131
2132 memset(&packet2, 0, sizeof(packet2));
2133 mavlink_msg_led_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.instance , packet1.pattern , packet1.custom_len , packet1.custom_bytes );
2134 mavlink_msg_led_control_decode(&msg, &packet2);
2135 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2136
2137 memset(&packet2, 0, sizeof(packet2));
2138 mavlink_msg_led_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.instance , packet1.pattern , packet1.custom_len , packet1.custom_bytes );
2139 mavlink_msg_led_control_decode(&msg, &packet2);
2140 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2141
2142 memset(&packet2, 0, sizeof(packet2));
2143 mavlink_msg_to_send_buffer(buffer, &msg);
2144 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2145 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2146 }
2147 mavlink_msg_led_control_decode(last_msg, &packet2);
2148 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2149
2150 memset(&packet2, 0, sizeof(packet2));
2151 mavlink_msg_led_control_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.instance , packet1.pattern , packet1.custom_len , packet1.custom_bytes );
2152 mavlink_msg_led_control_decode(last_msg, &packet2);
2153 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2154}
2155
2156static void mavlink_test_mag_cal_progress(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2157{
2158#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2159 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2160 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MAG_CAL_PROGRESS >= 256) {
2161 return;
2162 }
2163#endif
2164 mavlink_message_t msg;
2165 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2166 uint16_t i;
2167 mavlink_mag_cal_progress_t packet_in = {
2168 17.0,45.0,73.0,41,108,175,242,53,{ 120, 121, 122, 123, 124, 125, 126, 127, 128, 129 }
2169 };
2170 mavlink_mag_cal_progress_t packet1, packet2;
2171 memset(&packet1, 0, sizeof(packet1));
2172 packet1.direction_x = packet_in.direction_x;
2173 packet1.direction_y = packet_in.direction_y;
2174 packet1.direction_z = packet_in.direction_z;
2175 packet1.compass_id = packet_in.compass_id;
2176 packet1.cal_mask = packet_in.cal_mask;
2177 packet1.cal_status = packet_in.cal_status;
2178 packet1.attempt = packet_in.attempt;
2179 packet1.completion_pct = packet_in.completion_pct;
2180
2181 mav_array_memcpy(packet1.completion_mask, packet_in.completion_mask, sizeof(uint8_t)*10);
2182
2183#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2184 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2185 // cope with extensions
2186 memset(MAVLINK_MSG_ID_MAG_CAL_PROGRESS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MAG_CAL_PROGRESS_MIN_LEN);
2187 }
2188#endif
2189 memset(&packet2, 0, sizeof(packet2));
2190 mavlink_msg_mag_cal_progress_encode(system_id, component_id, &msg, &packet1);
2191 mavlink_msg_mag_cal_progress_decode(&msg, &packet2);
2192 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2193
2194 memset(&packet2, 0, sizeof(packet2));
2195 mavlink_msg_mag_cal_progress_pack(system_id, component_id, &msg , packet1.compass_id , packet1.cal_mask , packet1.cal_status , packet1.attempt , packet1.completion_pct , packet1.completion_mask , packet1.direction_x , packet1.direction_y , packet1.direction_z );
2196 mavlink_msg_mag_cal_progress_decode(&msg, &packet2);
2197 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2198
2199 memset(&packet2, 0, sizeof(packet2));
2200 mavlink_msg_mag_cal_progress_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.compass_id , packet1.cal_mask , packet1.cal_status , packet1.attempt , packet1.completion_pct , packet1.completion_mask , packet1.direction_x , packet1.direction_y , packet1.direction_z );
2201 mavlink_msg_mag_cal_progress_decode(&msg, &packet2);
2202 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2203
2204 memset(&packet2, 0, sizeof(packet2));
2205 mavlink_msg_to_send_buffer(buffer, &msg);
2206 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2207 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2208 }
2209 mavlink_msg_mag_cal_progress_decode(last_msg, &packet2);
2210 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2211
2212 memset(&packet2, 0, sizeof(packet2));
2213 mavlink_msg_mag_cal_progress_send(MAVLINK_COMM_1 , packet1.compass_id , packet1.cal_mask , packet1.cal_status , packet1.attempt , packet1.completion_pct , packet1.completion_mask , packet1.direction_x , packet1.direction_y , packet1.direction_z );
2214 mavlink_msg_mag_cal_progress_decode(last_msg, &packet2);
2215 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2216}
2217
2218static void mavlink_test_mag_cal_report(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2219{
2220#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2221 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2222 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MAG_CAL_REPORT >= 256) {
2223 return;
2224 }
2225#endif
2226 mavlink_message_t msg;
2227 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2228 uint16_t i;
2229 mavlink_mag_cal_report_t packet_in = {
2230 17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,125,192,3,70
2231 };
2232 mavlink_mag_cal_report_t packet1, packet2;
2233 memset(&packet1, 0, sizeof(packet1));
2234 packet1.fitness = packet_in.fitness;
2235 packet1.ofs_x = packet_in.ofs_x;
2236 packet1.ofs_y = packet_in.ofs_y;
2237 packet1.ofs_z = packet_in.ofs_z;
2238 packet1.diag_x = packet_in.diag_x;
2239 packet1.diag_y = packet_in.diag_y;
2240 packet1.diag_z = packet_in.diag_z;
2241 packet1.offdiag_x = packet_in.offdiag_x;
2242 packet1.offdiag_y = packet_in.offdiag_y;
2243 packet1.offdiag_z = packet_in.offdiag_z;
2244 packet1.compass_id = packet_in.compass_id;
2245 packet1.cal_mask = packet_in.cal_mask;
2246 packet1.cal_status = packet_in.cal_status;
2247 packet1.autosaved = packet_in.autosaved;
2248
2249
2250#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2251 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2252 // cope with extensions
2253 memset(MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN);
2254 }
2255#endif
2256 memset(&packet2, 0, sizeof(packet2));
2257 mavlink_msg_mag_cal_report_encode(system_id, component_id, &msg, &packet1);
2258 mavlink_msg_mag_cal_report_decode(&msg, &packet2);
2259 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2260
2261 memset(&packet2, 0, sizeof(packet2));
2262 mavlink_msg_mag_cal_report_pack(system_id, component_id, &msg , packet1.compass_id , packet1.cal_mask , packet1.cal_status , packet1.autosaved , packet1.fitness , packet1.ofs_x , packet1.ofs_y , packet1.ofs_z , packet1.diag_x , packet1.diag_y , packet1.diag_z , packet1.offdiag_x , packet1.offdiag_y , packet1.offdiag_z );
2263 mavlink_msg_mag_cal_report_decode(&msg, &packet2);
2264 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2265
2266 memset(&packet2, 0, sizeof(packet2));
2267 mavlink_msg_mag_cal_report_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.compass_id , packet1.cal_mask , packet1.cal_status , packet1.autosaved , packet1.fitness , packet1.ofs_x , packet1.ofs_y , packet1.ofs_z , packet1.diag_x , packet1.diag_y , packet1.diag_z , packet1.offdiag_x , packet1.offdiag_y , packet1.offdiag_z );
2268 mavlink_msg_mag_cal_report_decode(&msg, &packet2);
2269 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2270
2271 memset(&packet2, 0, sizeof(packet2));
2272 mavlink_msg_to_send_buffer(buffer, &msg);
2273 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2274 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2275 }
2276 mavlink_msg_mag_cal_report_decode(last_msg, &packet2);
2277 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2278
2279 memset(&packet2, 0, sizeof(packet2));
2280 mavlink_msg_mag_cal_report_send(MAVLINK_COMM_1 , packet1.compass_id , packet1.cal_mask , packet1.cal_status , packet1.autosaved , packet1.fitness , packet1.ofs_x , packet1.ofs_y , packet1.ofs_z , packet1.diag_x , packet1.diag_y , packet1.diag_z , packet1.offdiag_x , packet1.offdiag_y , packet1.offdiag_z );
2281 mavlink_msg_mag_cal_report_decode(last_msg, &packet2);
2282 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2283}
2284
2285static void mavlink_test_ekf_status_report(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2286{
2287#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2288 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2289 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_EKF_STATUS_REPORT >= 256) {
2290 return;
2291 }
2292#endif
2293 mavlink_message_t msg;
2294 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2295 uint16_t i;
2296 mavlink_ekf_status_report_t packet_in = {
2297 17.0,45.0,73.0,101.0,129.0,18275
2298 };
2299 mavlink_ekf_status_report_t packet1, packet2;
2300 memset(&packet1, 0, sizeof(packet1));
2301 packet1.velocity_variance = packet_in.velocity_variance;
2302 packet1.pos_horiz_variance = packet_in.pos_horiz_variance;
2303 packet1.pos_vert_variance = packet_in.pos_vert_variance;
2304 packet1.compass_variance = packet_in.compass_variance;
2305 packet1.terrain_alt_variance = packet_in.terrain_alt_variance;
2306 packet1.flags = packet_in.flags;
2307
2308
2309#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2310 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2311 // cope with extensions
2312 memset(MAVLINK_MSG_ID_EKF_STATUS_REPORT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_EKF_STATUS_REPORT_MIN_LEN);
2313 }
2314#endif
2315 memset(&packet2, 0, sizeof(packet2));
2316 mavlink_msg_ekf_status_report_encode(system_id, component_id, &msg, &packet1);
2317 mavlink_msg_ekf_status_report_decode(&msg, &packet2);
2318 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2319
2320 memset(&packet2, 0, sizeof(packet2));
2321 mavlink_msg_ekf_status_report_pack(system_id, component_id, &msg , packet1.flags , packet1.velocity_variance , packet1.pos_horiz_variance , packet1.pos_vert_variance , packet1.compass_variance , packet1.terrain_alt_variance );
2322 mavlink_msg_ekf_status_report_decode(&msg, &packet2);
2323 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2324
2325 memset(&packet2, 0, sizeof(packet2));
2326 mavlink_msg_ekf_status_report_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.flags , packet1.velocity_variance , packet1.pos_horiz_variance , packet1.pos_vert_variance , packet1.compass_variance , packet1.terrain_alt_variance );
2327 mavlink_msg_ekf_status_report_decode(&msg, &packet2);
2328 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2329
2330 memset(&packet2, 0, sizeof(packet2));
2331 mavlink_msg_to_send_buffer(buffer, &msg);
2332 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2333 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2334 }
2335 mavlink_msg_ekf_status_report_decode(last_msg, &packet2);
2336 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2337
2338 memset(&packet2, 0, sizeof(packet2));
2339 mavlink_msg_ekf_status_report_send(MAVLINK_COMM_1 , packet1.flags , packet1.velocity_variance , packet1.pos_horiz_variance , packet1.pos_vert_variance , packet1.compass_variance , packet1.terrain_alt_variance );
2340 mavlink_msg_ekf_status_report_decode(last_msg, &packet2);
2341 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2342}
2343
2344static void mavlink_test_pid_tuning(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2345{
2346#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2347 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2348 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PID_TUNING >= 256) {
2349 return;
2350 }
2351#endif
2352 mavlink_message_t msg;
2353 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2354 uint16_t i;
2355 mavlink_pid_tuning_t packet_in = {
2356 17.0,45.0,73.0,101.0,129.0,157.0,77
2357 };
2358 mavlink_pid_tuning_t packet1, packet2;
2359 memset(&packet1, 0, sizeof(packet1));
2360 packet1.desired = packet_in.desired;
2361 packet1.achieved = packet_in.achieved;
2362 packet1.FF = packet_in.FF;
2363 packet1.P = packet_in.P;
2364 packet1.I = packet_in.I;
2365 packet1.D = packet_in.D;
2366 packet1.axis = packet_in.axis;
2367
2368
2369#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2370 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2371 // cope with extensions
2372 memset(MAVLINK_MSG_ID_PID_TUNING_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PID_TUNING_MIN_LEN);
2373 }
2374#endif
2375 memset(&packet2, 0, sizeof(packet2));
2376 mavlink_msg_pid_tuning_encode(system_id, component_id, &msg, &packet1);
2377 mavlink_msg_pid_tuning_decode(&msg, &packet2);
2378 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2379
2380 memset(&packet2, 0, sizeof(packet2));
2381 mavlink_msg_pid_tuning_pack(system_id, component_id, &msg , packet1.axis , packet1.desired , packet1.achieved , packet1.FF , packet1.P , packet1.I , packet1.D );
2382 mavlink_msg_pid_tuning_decode(&msg, &packet2);
2383 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2384
2385 memset(&packet2, 0, sizeof(packet2));
2386 mavlink_msg_pid_tuning_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.axis , packet1.desired , packet1.achieved , packet1.FF , packet1.P , packet1.I , packet1.D );
2387 mavlink_msg_pid_tuning_decode(&msg, &packet2);
2388 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2389
2390 memset(&packet2, 0, sizeof(packet2));
2391 mavlink_msg_to_send_buffer(buffer, &msg);
2392 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2393 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2394 }
2395 mavlink_msg_pid_tuning_decode(last_msg, &packet2);
2396 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2397
2398 memset(&packet2, 0, sizeof(packet2));
2399 mavlink_msg_pid_tuning_send(MAVLINK_COMM_1 , packet1.axis , packet1.desired , packet1.achieved , packet1.FF , packet1.P , packet1.I , packet1.D );
2400 mavlink_msg_pid_tuning_decode(last_msg, &packet2);
2401 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2402}
2403
2404static void mavlink_test_gimbal_report(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2405{
2406#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2407 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2408 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_REPORT >= 256) {
2409 return;
2410 }
2411#endif
2412 mavlink_message_t msg;
2413 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2414 uint16_t i;
2415 mavlink_gimbal_report_t packet_in = {
2416 17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,125,192
2417 };
2418 mavlink_gimbal_report_t packet1, packet2;
2419 memset(&packet1, 0, sizeof(packet1));
2420 packet1.delta_time = packet_in.delta_time;
2421 packet1.delta_angle_x = packet_in.delta_angle_x;
2422 packet1.delta_angle_y = packet_in.delta_angle_y;
2423 packet1.delta_angle_z = packet_in.delta_angle_z;
2424 packet1.delta_velocity_x = packet_in.delta_velocity_x;
2425 packet1.delta_velocity_y = packet_in.delta_velocity_y;
2426 packet1.delta_velocity_z = packet_in.delta_velocity_z;
2427 packet1.joint_roll = packet_in.joint_roll;
2428 packet1.joint_el = packet_in.joint_el;
2429 packet1.joint_az = packet_in.joint_az;
2430 packet1.target_system = packet_in.target_system;
2431 packet1.target_component = packet_in.target_component;
2432
2433
2434#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2435 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2436 // cope with extensions
2437 memset(MAVLINK_MSG_ID_GIMBAL_REPORT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_REPORT_MIN_LEN);
2438 }
2439#endif
2440 memset(&packet2, 0, sizeof(packet2));
2441 mavlink_msg_gimbal_report_encode(system_id, component_id, &msg, &packet1);
2442 mavlink_msg_gimbal_report_decode(&msg, &packet2);
2443 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2444
2445 memset(&packet2, 0, sizeof(packet2));
2446 mavlink_msg_gimbal_report_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.delta_time , packet1.delta_angle_x , packet1.delta_angle_y , packet1.delta_angle_z , packet1.delta_velocity_x , packet1.delta_velocity_y , packet1.delta_velocity_z , packet1.joint_roll , packet1.joint_el , packet1.joint_az );
2447 mavlink_msg_gimbal_report_decode(&msg, &packet2);
2448 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2449
2450 memset(&packet2, 0, sizeof(packet2));
2451 mavlink_msg_gimbal_report_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.delta_time , packet1.delta_angle_x , packet1.delta_angle_y , packet1.delta_angle_z , packet1.delta_velocity_x , packet1.delta_velocity_y , packet1.delta_velocity_z , packet1.joint_roll , packet1.joint_el , packet1.joint_az );
2452 mavlink_msg_gimbal_report_decode(&msg, &packet2);
2453 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2454
2455 memset(&packet2, 0, sizeof(packet2));
2456 mavlink_msg_to_send_buffer(buffer, &msg);
2457 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2458 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2459 }
2460 mavlink_msg_gimbal_report_decode(last_msg, &packet2);
2461 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2462
2463 memset(&packet2, 0, sizeof(packet2));
2464 mavlink_msg_gimbal_report_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.delta_time , packet1.delta_angle_x , packet1.delta_angle_y , packet1.delta_angle_z , packet1.delta_velocity_x , packet1.delta_velocity_y , packet1.delta_velocity_z , packet1.joint_roll , packet1.joint_el , packet1.joint_az );
2465 mavlink_msg_gimbal_report_decode(last_msg, &packet2);
2466 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2467}
2468
2469static void mavlink_test_gimbal_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2470{
2471#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2472 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2473 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_CONTROL >= 256) {
2474 return;
2475 }
2476#endif
2477 mavlink_message_t msg;
2478 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2479 uint16_t i;
2480 mavlink_gimbal_control_t packet_in = {
2481 17.0,45.0,73.0,41,108
2482 };
2483 mavlink_gimbal_control_t packet1, packet2;
2484 memset(&packet1, 0, sizeof(packet1));
2485 packet1.demanded_rate_x = packet_in.demanded_rate_x;
2486 packet1.demanded_rate_y = packet_in.demanded_rate_y;
2487 packet1.demanded_rate_z = packet_in.demanded_rate_z;
2488 packet1.target_system = packet_in.target_system;
2489 packet1.target_component = packet_in.target_component;
2490
2491
2492#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2493 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2494 // cope with extensions
2495 memset(MAVLINK_MSG_ID_GIMBAL_CONTROL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_CONTROL_MIN_LEN);
2496 }
2497#endif
2498 memset(&packet2, 0, sizeof(packet2));
2499 mavlink_msg_gimbal_control_encode(system_id, component_id, &msg, &packet1);
2500 mavlink_msg_gimbal_control_decode(&msg, &packet2);
2501 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2502
2503 memset(&packet2, 0, sizeof(packet2));
2504 mavlink_msg_gimbal_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.demanded_rate_x , packet1.demanded_rate_y , packet1.demanded_rate_z );
2505 mavlink_msg_gimbal_control_decode(&msg, &packet2);
2506 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2507
2508 memset(&packet2, 0, sizeof(packet2));
2509 mavlink_msg_gimbal_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.demanded_rate_x , packet1.demanded_rate_y , packet1.demanded_rate_z );
2510 mavlink_msg_gimbal_control_decode(&msg, &packet2);
2511 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2512
2513 memset(&packet2, 0, sizeof(packet2));
2514 mavlink_msg_to_send_buffer(buffer, &msg);
2515 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2516 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2517 }
2518 mavlink_msg_gimbal_control_decode(last_msg, &packet2);
2519 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2520
2521 memset(&packet2, 0, sizeof(packet2));
2522 mavlink_msg_gimbal_control_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.demanded_rate_x , packet1.demanded_rate_y , packet1.demanded_rate_z );
2523 mavlink_msg_gimbal_control_decode(last_msg, &packet2);
2524 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2525}
2526
2527static void mavlink_test_gimbal_torque_cmd_report(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2528{
2529#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2530 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2531 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT >= 256) {
2532 return;
2533 }
2534#endif
2535 mavlink_message_t msg;
2536 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2537 uint16_t i;
2538 mavlink_gimbal_torque_cmd_report_t packet_in = {
2539 17235,17339,17443,151,218
2540 };
2541 mavlink_gimbal_torque_cmd_report_t packet1, packet2;
2542 memset(&packet1, 0, sizeof(packet1));
2543 packet1.rl_torque_cmd = packet_in.rl_torque_cmd;
2544 packet1.el_torque_cmd = packet_in.el_torque_cmd;
2545 packet1.az_torque_cmd = packet_in.az_torque_cmd;
2546 packet1.target_system = packet_in.target_system;
2547 packet1.target_component = packet_in.target_component;
2548
2549
2550#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2551 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2552 // cope with extensions
2553 memset(MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_MIN_LEN);
2554 }
2555#endif
2556 memset(&packet2, 0, sizeof(packet2));
2557 mavlink_msg_gimbal_torque_cmd_report_encode(system_id, component_id, &msg, &packet1);
2558 mavlink_msg_gimbal_torque_cmd_report_decode(&msg, &packet2);
2559 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2560
2561 memset(&packet2, 0, sizeof(packet2));
2562 mavlink_msg_gimbal_torque_cmd_report_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.rl_torque_cmd , packet1.el_torque_cmd , packet1.az_torque_cmd );
2563 mavlink_msg_gimbal_torque_cmd_report_decode(&msg, &packet2);
2564 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2565
2566 memset(&packet2, 0, sizeof(packet2));
2567 mavlink_msg_gimbal_torque_cmd_report_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.rl_torque_cmd , packet1.el_torque_cmd , packet1.az_torque_cmd );
2568 mavlink_msg_gimbal_torque_cmd_report_decode(&msg, &packet2);
2569 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2570
2571 memset(&packet2, 0, sizeof(packet2));
2572 mavlink_msg_to_send_buffer(buffer, &msg);
2573 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2574 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2575 }
2576 mavlink_msg_gimbal_torque_cmd_report_decode(last_msg, &packet2);
2577 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2578
2579 memset(&packet2, 0, sizeof(packet2));
2580 mavlink_msg_gimbal_torque_cmd_report_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.rl_torque_cmd , packet1.el_torque_cmd , packet1.az_torque_cmd );
2581 mavlink_msg_gimbal_torque_cmd_report_decode(last_msg, &packet2);
2582 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2583}
2584
2585static void mavlink_test_gopro_heartbeat(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2586{
2587#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2588 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2589 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GOPRO_HEARTBEAT >= 256) {
2590 return;
2591 }
2592#endif
2593 mavlink_message_t msg;
2594 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2595 uint16_t i;
2596 mavlink_gopro_heartbeat_t packet_in = {
2597 5,72,139
2598 };
2599 mavlink_gopro_heartbeat_t packet1, packet2;
2600 memset(&packet1, 0, sizeof(packet1));
2601 packet1.status = packet_in.status;
2602 packet1.capture_mode = packet_in.capture_mode;
2603 packet1.flags = packet_in.flags;
2604
2605
2606#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2607 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2608 // cope with extensions
2609 memset(MAVLINK_MSG_ID_GOPRO_HEARTBEAT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GOPRO_HEARTBEAT_MIN_LEN);
2610 }
2611#endif
2612 memset(&packet2, 0, sizeof(packet2));
2613 mavlink_msg_gopro_heartbeat_encode(system_id, component_id, &msg, &packet1);
2614 mavlink_msg_gopro_heartbeat_decode(&msg, &packet2);
2615 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2616
2617 memset(&packet2, 0, sizeof(packet2));
2618 mavlink_msg_gopro_heartbeat_pack(system_id, component_id, &msg , packet1.status , packet1.capture_mode , packet1.flags );
2619 mavlink_msg_gopro_heartbeat_decode(&msg, &packet2);
2620 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2621
2622 memset(&packet2, 0, sizeof(packet2));
2623 mavlink_msg_gopro_heartbeat_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.status , packet1.capture_mode , packet1.flags );
2624 mavlink_msg_gopro_heartbeat_decode(&msg, &packet2);
2625 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2626
2627 memset(&packet2, 0, sizeof(packet2));
2628 mavlink_msg_to_send_buffer(buffer, &msg);
2629 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2630 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2631 }
2632 mavlink_msg_gopro_heartbeat_decode(last_msg, &packet2);
2633 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2634
2635 memset(&packet2, 0, sizeof(packet2));
2636 mavlink_msg_gopro_heartbeat_send(MAVLINK_COMM_1 , packet1.status , packet1.capture_mode , packet1.flags );
2637 mavlink_msg_gopro_heartbeat_decode(last_msg, &packet2);
2638 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2639}
2640
2641static void mavlink_test_gopro_get_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2642{
2643#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2644 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2645 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GOPRO_GET_REQUEST >= 256) {
2646 return;
2647 }
2648#endif
2649 mavlink_message_t msg;
2650 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2651 uint16_t i;
2652 mavlink_gopro_get_request_t packet_in = {
2653 5,72,139
2654 };
2655 mavlink_gopro_get_request_t packet1, packet2;
2656 memset(&packet1, 0, sizeof(packet1));
2657 packet1.target_system = packet_in.target_system;
2658 packet1.target_component = packet_in.target_component;
2659 packet1.cmd_id = packet_in.cmd_id;
2660
2661
2662#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2663 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2664 // cope with extensions
2665 memset(MAVLINK_MSG_ID_GOPRO_GET_REQUEST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GOPRO_GET_REQUEST_MIN_LEN);
2666 }
2667#endif
2668 memset(&packet2, 0, sizeof(packet2));
2669 mavlink_msg_gopro_get_request_encode(system_id, component_id, &msg, &packet1);
2670 mavlink_msg_gopro_get_request_decode(&msg, &packet2);
2671 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2672
2673 memset(&packet2, 0, sizeof(packet2));
2674 mavlink_msg_gopro_get_request_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.cmd_id );
2675 mavlink_msg_gopro_get_request_decode(&msg, &packet2);
2676 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2677
2678 memset(&packet2, 0, sizeof(packet2));
2679 mavlink_msg_gopro_get_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.cmd_id );
2680 mavlink_msg_gopro_get_request_decode(&msg, &packet2);
2681 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2682
2683 memset(&packet2, 0, sizeof(packet2));
2684 mavlink_msg_to_send_buffer(buffer, &msg);
2685 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2686 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2687 }
2688 mavlink_msg_gopro_get_request_decode(last_msg, &packet2);
2689 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2690
2691 memset(&packet2, 0, sizeof(packet2));
2692 mavlink_msg_gopro_get_request_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.cmd_id );
2693 mavlink_msg_gopro_get_request_decode(last_msg, &packet2);
2694 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2695}
2696
2697static void mavlink_test_gopro_get_response(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2698{
2699#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2700 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2701 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GOPRO_GET_RESPONSE >= 256) {
2702 return;
2703 }
2704#endif
2705 mavlink_message_t msg;
2706 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2707 uint16_t i;
2708 mavlink_gopro_get_response_t packet_in = {
2709 5,72,{ 139, 140, 141, 142 }
2710 };
2711 mavlink_gopro_get_response_t packet1, packet2;
2712 memset(&packet1, 0, sizeof(packet1));
2713 packet1.cmd_id = packet_in.cmd_id;
2714 packet1.status = packet_in.status;
2715
2716 mav_array_memcpy(packet1.value, packet_in.value, sizeof(uint8_t)*4);
2717
2718#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2719 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2720 // cope with extensions
2721 memset(MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_MIN_LEN);
2722 }
2723#endif
2724 memset(&packet2, 0, sizeof(packet2));
2725 mavlink_msg_gopro_get_response_encode(system_id, component_id, &msg, &packet1);
2726 mavlink_msg_gopro_get_response_decode(&msg, &packet2);
2727 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2728
2729 memset(&packet2, 0, sizeof(packet2));
2730 mavlink_msg_gopro_get_response_pack(system_id, component_id, &msg , packet1.cmd_id , packet1.status , packet1.value );
2731 mavlink_msg_gopro_get_response_decode(&msg, &packet2);
2732 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2733
2734 memset(&packet2, 0, sizeof(packet2));
2735 mavlink_msg_gopro_get_response_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.cmd_id , packet1.status , packet1.value );
2736 mavlink_msg_gopro_get_response_decode(&msg, &packet2);
2737 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2738
2739 memset(&packet2, 0, sizeof(packet2));
2740 mavlink_msg_to_send_buffer(buffer, &msg);
2741 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2742 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2743 }
2744 mavlink_msg_gopro_get_response_decode(last_msg, &packet2);
2745 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2746
2747 memset(&packet2, 0, sizeof(packet2));
2748 mavlink_msg_gopro_get_response_send(MAVLINK_COMM_1 , packet1.cmd_id , packet1.status , packet1.value );
2749 mavlink_msg_gopro_get_response_decode(last_msg, &packet2);
2750 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2751}
2752
2753static void mavlink_test_gopro_set_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2754{
2755#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2756 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2757 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GOPRO_SET_REQUEST >= 256) {
2758 return;
2759 }
2760#endif
2761 mavlink_message_t msg;
2762 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2763 uint16_t i;
2764 mavlink_gopro_set_request_t packet_in = {
2765 5,72,139,{ 206, 207, 208, 209 }
2766 };
2767 mavlink_gopro_set_request_t packet1, packet2;
2768 memset(&packet1, 0, sizeof(packet1));
2769 packet1.target_system = packet_in.target_system;
2770 packet1.target_component = packet_in.target_component;
2771 packet1.cmd_id = packet_in.cmd_id;
2772
2773 mav_array_memcpy(packet1.value, packet_in.value, sizeof(uint8_t)*4);
2774
2775#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2776 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2777 // cope with extensions
2778 memset(MAVLINK_MSG_ID_GOPRO_SET_REQUEST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GOPRO_SET_REQUEST_MIN_LEN);
2779 }
2780#endif
2781 memset(&packet2, 0, sizeof(packet2));
2782 mavlink_msg_gopro_set_request_encode(system_id, component_id, &msg, &packet1);
2783 mavlink_msg_gopro_set_request_decode(&msg, &packet2);
2784 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2785
2786 memset(&packet2, 0, sizeof(packet2));
2787 mavlink_msg_gopro_set_request_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.cmd_id , packet1.value );
2788 mavlink_msg_gopro_set_request_decode(&msg, &packet2);
2789 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2790
2791 memset(&packet2, 0, sizeof(packet2));
2792 mavlink_msg_gopro_set_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.cmd_id , packet1.value );
2793 mavlink_msg_gopro_set_request_decode(&msg, &packet2);
2794 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2795
2796 memset(&packet2, 0, sizeof(packet2));
2797 mavlink_msg_to_send_buffer(buffer, &msg);
2798 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2799 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2800 }
2801 mavlink_msg_gopro_set_request_decode(last_msg, &packet2);
2802 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2803
2804 memset(&packet2, 0, sizeof(packet2));
2805 mavlink_msg_gopro_set_request_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.cmd_id , packet1.value );
2806 mavlink_msg_gopro_set_request_decode(last_msg, &packet2);
2807 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2808}
2809
2810static void mavlink_test_gopro_set_response(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2811{
2812#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2813 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2814 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GOPRO_SET_RESPONSE >= 256) {
2815 return;
2816 }
2817#endif
2818 mavlink_message_t msg;
2819 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2820 uint16_t i;
2821 mavlink_gopro_set_response_t packet_in = {
2822 5,72
2823 };
2824 mavlink_gopro_set_response_t packet1, packet2;
2825 memset(&packet1, 0, sizeof(packet1));
2826 packet1.cmd_id = packet_in.cmd_id;
2827 packet1.status = packet_in.status;
2828
2829
2830#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2831 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2832 // cope with extensions
2833 memset(MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_MIN_LEN);
2834 }
2835#endif
2836 memset(&packet2, 0, sizeof(packet2));
2837 mavlink_msg_gopro_set_response_encode(system_id, component_id, &msg, &packet1);
2838 mavlink_msg_gopro_set_response_decode(&msg, &packet2);
2839 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2840
2841 memset(&packet2, 0, sizeof(packet2));
2842 mavlink_msg_gopro_set_response_pack(system_id, component_id, &msg , packet1.cmd_id , packet1.status );
2843 mavlink_msg_gopro_set_response_decode(&msg, &packet2);
2844 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2845
2846 memset(&packet2, 0, sizeof(packet2));
2847 mavlink_msg_gopro_set_response_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.cmd_id , packet1.status );
2848 mavlink_msg_gopro_set_response_decode(&msg, &packet2);
2849 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2850
2851 memset(&packet2, 0, sizeof(packet2));
2852 mavlink_msg_to_send_buffer(buffer, &msg);
2853 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2854 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2855 }
2856 mavlink_msg_gopro_set_response_decode(last_msg, &packet2);
2857 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2858
2859 memset(&packet2, 0, sizeof(packet2));
2860 mavlink_msg_gopro_set_response_send(MAVLINK_COMM_1 , packet1.cmd_id , packet1.status );
2861 mavlink_msg_gopro_set_response_decode(last_msg, &packet2);
2862 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2863}
2864
2865static void mavlink_test_rpm(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2866{
2867#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2868 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2869 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RPM >= 256) {
2870 return;
2871 }
2872#endif
2873 mavlink_message_t msg;
2874 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2875 uint16_t i;
2876 mavlink_rpm_t packet_in = {
2877 17.0,45.0
2878 };
2879 mavlink_rpm_t packet1, packet2;
2880 memset(&packet1, 0, sizeof(packet1));
2881 packet1.rpm1 = packet_in.rpm1;
2882 packet1.rpm2 = packet_in.rpm2;
2883
2884
2885#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2886 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2887 // cope with extensions
2888 memset(MAVLINK_MSG_ID_RPM_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RPM_MIN_LEN);
2889 }
2890#endif
2891 memset(&packet2, 0, sizeof(packet2));
2892 mavlink_msg_rpm_encode(system_id, component_id, &msg, &packet1);
2893 mavlink_msg_rpm_decode(&msg, &packet2);
2894 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2895
2896 memset(&packet2, 0, sizeof(packet2));
2897 mavlink_msg_rpm_pack(system_id, component_id, &msg , packet1.rpm1 , packet1.rpm2 );
2898 mavlink_msg_rpm_decode(&msg, &packet2);
2899 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2900
2901 memset(&packet2, 0, sizeof(packet2));
2902 mavlink_msg_rpm_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.rpm1 , packet1.rpm2 );
2903 mavlink_msg_rpm_decode(&msg, &packet2);
2904 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2905
2906 memset(&packet2, 0, sizeof(packet2));
2907 mavlink_msg_to_send_buffer(buffer, &msg);
2908 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2909 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2910 }
2911 mavlink_msg_rpm_decode(last_msg, &packet2);
2912 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2913
2914 memset(&packet2, 0, sizeof(packet2));
2915 mavlink_msg_rpm_send(MAVLINK_COMM_1 , packet1.rpm1 , packet1.rpm2 );
2916 mavlink_msg_rpm_decode(last_msg, &packet2);
2917 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2918}
2919
2920static void mavlink_test_device_op_read(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2921{
2922#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2923 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2924 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DEVICE_OP_READ >= 256) {
2925 return;
2926 }
2927#endif
2928 mavlink_message_t msg;
2929 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2930 uint16_t i;
2931 mavlink_device_op_read_t packet_in = {
2932 963497464,17,84,151,218,29,"JKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUV",216,27
2933 };
2934 mavlink_device_op_read_t packet1, packet2;
2935 memset(&packet1, 0, sizeof(packet1));
2936 packet1.request_id = packet_in.request_id;
2937 packet1.target_system = packet_in.target_system;
2938 packet1.target_component = packet_in.target_component;
2939 packet1.bustype = packet_in.bustype;
2940 packet1.bus = packet_in.bus;
2941 packet1.address = packet_in.address;
2942 packet1.regstart = packet_in.regstart;
2943 packet1.count = packet_in.count;
2944
2945 mav_array_memcpy(packet1.busname, packet_in.busname, sizeof(char)*40);
2946
2947#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2948 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2949 // cope with extensions
2950 memset(MAVLINK_MSG_ID_DEVICE_OP_READ_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DEVICE_OP_READ_MIN_LEN);
2951 }
2952#endif
2953 memset(&packet2, 0, sizeof(packet2));
2954 mavlink_msg_device_op_read_encode(system_id, component_id, &msg, &packet1);
2955 mavlink_msg_device_op_read_decode(&msg, &packet2);
2956 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2957
2958 memset(&packet2, 0, sizeof(packet2));
2959 mavlink_msg_device_op_read_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.request_id , packet1.bustype , packet1.bus , packet1.address , packet1.busname , packet1.regstart , packet1.count );
2960 mavlink_msg_device_op_read_decode(&msg, &packet2);
2961 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2962
2963 memset(&packet2, 0, sizeof(packet2));
2964 mavlink_msg_device_op_read_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.request_id , packet1.bustype , packet1.bus , packet1.address , packet1.busname , packet1.regstart , packet1.count );
2965 mavlink_msg_device_op_read_decode(&msg, &packet2);
2966 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2967
2968 memset(&packet2, 0, sizeof(packet2));
2969 mavlink_msg_to_send_buffer(buffer, &msg);
2970 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2971 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2972 }
2973 mavlink_msg_device_op_read_decode(last_msg, &packet2);
2974 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2975
2976 memset(&packet2, 0, sizeof(packet2));
2977 mavlink_msg_device_op_read_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.request_id , packet1.bustype , packet1.bus , packet1.address , packet1.busname , packet1.regstart , packet1.count );
2978 mavlink_msg_device_op_read_decode(last_msg, &packet2);
2979 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2980}
2981
2982static void mavlink_test_device_op_read_reply(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2983{
2984#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2985 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2986 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DEVICE_OP_READ_REPLY >= 256) {
2987 return;
2988 }
2989#endif
2990 mavlink_message_t msg;
2991 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2992 uint16_t i;
2993 mavlink_device_op_read_reply_t packet_in = {
2994 963497464,17,84,151,{ 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89 }
2995 };
2996 mavlink_device_op_read_reply_t packet1, packet2;
2997 memset(&packet1, 0, sizeof(packet1));
2998 packet1.request_id = packet_in.request_id;
2999 packet1.result = packet_in.result;
3000 packet1.regstart = packet_in.regstart;
3001 packet1.count = packet_in.count;
3002
3003 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*128);
3004
3005#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3006 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3007 // cope with extensions
3008 memset(MAVLINK_MSG_ID_DEVICE_OP_READ_REPLY_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DEVICE_OP_READ_REPLY_MIN_LEN);
3009 }
3010#endif
3011 memset(&packet2, 0, sizeof(packet2));
3012 mavlink_msg_device_op_read_reply_encode(system_id, component_id, &msg, &packet1);
3013 mavlink_msg_device_op_read_reply_decode(&msg, &packet2);
3014 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3015
3016 memset(&packet2, 0, sizeof(packet2));
3017 mavlink_msg_device_op_read_reply_pack(system_id, component_id, &msg , packet1.request_id , packet1.result , packet1.regstart , packet1.count , packet1.data );
3018 mavlink_msg_device_op_read_reply_decode(&msg, &packet2);
3019 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3020
3021 memset(&packet2, 0, sizeof(packet2));
3022 mavlink_msg_device_op_read_reply_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.request_id , packet1.result , packet1.regstart , packet1.count , packet1.data );
3023 mavlink_msg_device_op_read_reply_decode(&msg, &packet2);
3024 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3025
3026 memset(&packet2, 0, sizeof(packet2));
3027 mavlink_msg_to_send_buffer(buffer, &msg);
3028 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3029 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3030 }
3031 mavlink_msg_device_op_read_reply_decode(last_msg, &packet2);
3032 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3033
3034 memset(&packet2, 0, sizeof(packet2));
3035 mavlink_msg_device_op_read_reply_send(MAVLINK_COMM_1 , packet1.request_id , packet1.result , packet1.regstart , packet1.count , packet1.data );
3036 mavlink_msg_device_op_read_reply_decode(last_msg, &packet2);
3037 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3038}
3039
3040static void mavlink_test_device_op_write(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3041{
3042#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3043 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3044 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DEVICE_OP_WRITE >= 256) {
3045 return;
3046 }
3047#endif
3048 mavlink_message_t msg;
3049 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3050 uint16_t i;
3051 mavlink_device_op_write_t packet_in = {
3052 963497464,17,84,151,218,29,"JKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUV",216,27,{ 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221 }
3053 };
3054 mavlink_device_op_write_t packet1, packet2;
3055 memset(&packet1, 0, sizeof(packet1));
3056 packet1.request_id = packet_in.request_id;
3057 packet1.target_system = packet_in.target_system;
3058 packet1.target_component = packet_in.target_component;
3059 packet1.bustype = packet_in.bustype;
3060 packet1.bus = packet_in.bus;
3061 packet1.address = packet_in.address;
3062 packet1.regstart = packet_in.regstart;
3063 packet1.count = packet_in.count;
3064
3065 mav_array_memcpy(packet1.busname, packet_in.busname, sizeof(char)*40);
3066 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*128);
3067
3068#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3069 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3070 // cope with extensions
3071 memset(MAVLINK_MSG_ID_DEVICE_OP_WRITE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DEVICE_OP_WRITE_MIN_LEN);
3072 }
3073#endif
3074 memset(&packet2, 0, sizeof(packet2));
3075 mavlink_msg_device_op_write_encode(system_id, component_id, &msg, &packet1);
3076 mavlink_msg_device_op_write_decode(&msg, &packet2);
3077 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3078
3079 memset(&packet2, 0, sizeof(packet2));
3080 mavlink_msg_device_op_write_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.request_id , packet1.bustype , packet1.bus , packet1.address , packet1.busname , packet1.regstart , packet1.count , packet1.data );
3081 mavlink_msg_device_op_write_decode(&msg, &packet2);
3082 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3083
3084 memset(&packet2, 0, sizeof(packet2));
3085 mavlink_msg_device_op_write_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.request_id , packet1.bustype , packet1.bus , packet1.address , packet1.busname , packet1.regstart , packet1.count , packet1.data );
3086 mavlink_msg_device_op_write_decode(&msg, &packet2);
3087 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3088
3089 memset(&packet2, 0, sizeof(packet2));
3090 mavlink_msg_to_send_buffer(buffer, &msg);
3091 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3092 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3093 }
3094 mavlink_msg_device_op_write_decode(last_msg, &packet2);
3095 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3096
3097 memset(&packet2, 0, sizeof(packet2));
3098 mavlink_msg_device_op_write_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.request_id , packet1.bustype , packet1.bus , packet1.address , packet1.busname , packet1.regstart , packet1.count , packet1.data );
3099 mavlink_msg_device_op_write_decode(last_msg, &packet2);
3100 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3101}
3102
3103static void mavlink_test_device_op_write_reply(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3104{
3105#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3106 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3107 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DEVICE_OP_WRITE_REPLY >= 256) {
3108 return;
3109 }
3110#endif
3111 mavlink_message_t msg;
3112 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3113 uint16_t i;
3114 mavlink_device_op_write_reply_t packet_in = {
3115 963497464,17
3116 };
3117 mavlink_device_op_write_reply_t packet1, packet2;
3118 memset(&packet1, 0, sizeof(packet1));
3119 packet1.request_id = packet_in.request_id;
3120 packet1.result = packet_in.result;
3121
3122
3123#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3124 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3125 // cope with extensions
3126 memset(MAVLINK_MSG_ID_DEVICE_OP_WRITE_REPLY_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DEVICE_OP_WRITE_REPLY_MIN_LEN);
3127 }
3128#endif
3129 memset(&packet2, 0, sizeof(packet2));
3130 mavlink_msg_device_op_write_reply_encode(system_id, component_id, &msg, &packet1);
3131 mavlink_msg_device_op_write_reply_decode(&msg, &packet2);
3132 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3133
3134 memset(&packet2, 0, sizeof(packet2));
3135 mavlink_msg_device_op_write_reply_pack(system_id, component_id, &msg , packet1.request_id , packet1.result );
3136 mavlink_msg_device_op_write_reply_decode(&msg, &packet2);
3137 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3138
3139 memset(&packet2, 0, sizeof(packet2));
3140 mavlink_msg_device_op_write_reply_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.request_id , packet1.result );
3141 mavlink_msg_device_op_write_reply_decode(&msg, &packet2);
3142 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3143
3144 memset(&packet2, 0, sizeof(packet2));
3145 mavlink_msg_to_send_buffer(buffer, &msg);
3146 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3147 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3148 }
3149 mavlink_msg_device_op_write_reply_decode(last_msg, &packet2);
3150 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3151
3152 memset(&packet2, 0, sizeof(packet2));
3153 mavlink_msg_device_op_write_reply_send(MAVLINK_COMM_1 , packet1.request_id , packet1.result );
3154 mavlink_msg_device_op_write_reply_decode(last_msg, &packet2);
3155 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3156}
3157
3158static void mavlink_test_adap_tuning(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3159{
3160#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3161 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3162 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ADAP_TUNING >= 256) {
3163 return;
3164 }
3165#endif
3166 mavlink_message_t msg;
3167 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3168 uint16_t i;
3169 mavlink_adap_tuning_t packet_in = {
3170 17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,149
3171 };
3172 mavlink_adap_tuning_t packet1, packet2;
3173 memset(&packet1, 0, sizeof(packet1));
3174 packet1.desired = packet_in.desired;
3175 packet1.achieved = packet_in.achieved;
3176 packet1.error = packet_in.error;
3177 packet1.theta = packet_in.theta;
3178 packet1.omega = packet_in.omega;
3179 packet1.sigma = packet_in.sigma;
3180 packet1.theta_dot = packet_in.theta_dot;
3181 packet1.omega_dot = packet_in.omega_dot;
3182 packet1.sigma_dot = packet_in.sigma_dot;
3183 packet1.f = packet_in.f;
3184 packet1.f_dot = packet_in.f_dot;
3185 packet1.u = packet_in.u;
3186 packet1.axis = packet_in.axis;
3187
3188
3189#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3190 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3191 // cope with extensions
3192 memset(MAVLINK_MSG_ID_ADAP_TUNING_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ADAP_TUNING_MIN_LEN);
3193 }
3194#endif
3195 memset(&packet2, 0, sizeof(packet2));
3196 mavlink_msg_adap_tuning_encode(system_id, component_id, &msg, &packet1);
3197 mavlink_msg_adap_tuning_decode(&msg, &packet2);
3198 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3199
3200 memset(&packet2, 0, sizeof(packet2));
3201 mavlink_msg_adap_tuning_pack(system_id, component_id, &msg , packet1.axis , packet1.desired , packet1.achieved , packet1.error , packet1.theta , packet1.omega , packet1.sigma , packet1.theta_dot , packet1.omega_dot , packet1.sigma_dot , packet1.f , packet1.f_dot , packet1.u );
3202 mavlink_msg_adap_tuning_decode(&msg, &packet2);
3203 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3204
3205 memset(&packet2, 0, sizeof(packet2));
3206 mavlink_msg_adap_tuning_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.axis , packet1.desired , packet1.achieved , packet1.error , packet1.theta , packet1.omega , packet1.sigma , packet1.theta_dot , packet1.omega_dot , packet1.sigma_dot , packet1.f , packet1.f_dot , packet1.u );
3207 mavlink_msg_adap_tuning_decode(&msg, &packet2);
3208 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3209
3210 memset(&packet2, 0, sizeof(packet2));
3211 mavlink_msg_to_send_buffer(buffer, &msg);
3212 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3213 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3214 }
3215 mavlink_msg_adap_tuning_decode(last_msg, &packet2);
3216 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3217
3218 memset(&packet2, 0, sizeof(packet2));
3219 mavlink_msg_adap_tuning_send(MAVLINK_COMM_1 , packet1.axis , packet1.desired , packet1.achieved , packet1.error , packet1.theta , packet1.omega , packet1.sigma , packet1.theta_dot , packet1.omega_dot , packet1.sigma_dot , packet1.f , packet1.f_dot , packet1.u );
3220 mavlink_msg_adap_tuning_decode(last_msg, &packet2);
3221 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3222}
3223
3224static void mavlink_test_vision_position_delta(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3225{
3226#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3227 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3228 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VISION_POSITION_DELTA >= 256) {
3229 return;
3230 }
3231#endif
3232 mavlink_message_t msg;
3233 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3234 uint16_t i;
3235 mavlink_vision_position_delta_t packet_in = {
3236 93372036854775807ULL,93372036854776311ULL,{ 129.0, 130.0, 131.0 },{ 213.0, 214.0, 215.0 },297.0
3237 };
3238 mavlink_vision_position_delta_t packet1, packet2;
3239 memset(&packet1, 0, sizeof(packet1));
3240 packet1.time_usec = packet_in.time_usec;
3241 packet1.time_delta_usec = packet_in.time_delta_usec;
3242 packet1.confidence = packet_in.confidence;
3243
3244 mav_array_memcpy(packet1.angle_delta, packet_in.angle_delta, sizeof(float)*3);
3245 mav_array_memcpy(packet1.position_delta, packet_in.position_delta, sizeof(float)*3);
3246
3247#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3248 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3249 // cope with extensions
3250 memset(MAVLINK_MSG_ID_VISION_POSITION_DELTA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VISION_POSITION_DELTA_MIN_LEN);
3251 }
3252#endif
3253 memset(&packet2, 0, sizeof(packet2));
3254 mavlink_msg_vision_position_delta_encode(system_id, component_id, &msg, &packet1);
3255 mavlink_msg_vision_position_delta_decode(&msg, &packet2);
3256 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3257
3258 memset(&packet2, 0, sizeof(packet2));
3259 mavlink_msg_vision_position_delta_pack(system_id, component_id, &msg , packet1.time_usec , packet1.time_delta_usec , packet1.angle_delta , packet1.position_delta , packet1.confidence );
3260 mavlink_msg_vision_position_delta_decode(&msg, &packet2);
3261 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3262
3263 memset(&packet2, 0, sizeof(packet2));
3264 mavlink_msg_vision_position_delta_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.time_delta_usec , packet1.angle_delta , packet1.position_delta , packet1.confidence );
3265 mavlink_msg_vision_position_delta_decode(&msg, &packet2);
3266 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3267
3268 memset(&packet2, 0, sizeof(packet2));
3269 mavlink_msg_to_send_buffer(buffer, &msg);
3270 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3271 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3272 }
3273 mavlink_msg_vision_position_delta_decode(last_msg, &packet2);
3274 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3275
3276 memset(&packet2, 0, sizeof(packet2));
3277 mavlink_msg_vision_position_delta_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.time_delta_usec , packet1.angle_delta , packet1.position_delta , packet1.confidence );
3278 mavlink_msg_vision_position_delta_decode(last_msg, &packet2);
3279 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3280}
3281
3282static void mavlink_test_ardupilotmega(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3283{
3284 mavlink_test_sensor_offsets(system_id, component_id, last_msg);
3285 mavlink_test_set_mag_offsets(system_id, component_id, last_msg);
3286 mavlink_test_meminfo(system_id, component_id, last_msg);
3287 mavlink_test_ap_adc(system_id, component_id, last_msg);
3288 mavlink_test_digicam_configure(system_id, component_id, last_msg);
3289 mavlink_test_digicam_control(system_id, component_id, last_msg);
3290 mavlink_test_mount_configure(system_id, component_id, last_msg);
3291 mavlink_test_mount_control(system_id, component_id, last_msg);
3292 mavlink_test_mount_status(system_id, component_id, last_msg);
3293 mavlink_test_fence_point(system_id, component_id, last_msg);
3294 mavlink_test_fence_fetch_point(system_id, component_id, last_msg);
3295 mavlink_test_fence_status(system_id, component_id, last_msg);
3296 mavlink_test_ahrs(system_id, component_id, last_msg);
3297 mavlink_test_simstate(system_id, component_id, last_msg);
3298 mavlink_test_hwstatus(system_id, component_id, last_msg);
3299 mavlink_test_radio(system_id, component_id, last_msg);
3300 mavlink_test_limits_status(system_id, component_id, last_msg);
3301 mavlink_test_wind(system_id, component_id, last_msg);
3302 mavlink_test_data16(system_id, component_id, last_msg);
3303 mavlink_test_data32(system_id, component_id, last_msg);
3304 mavlink_test_data64(system_id, component_id, last_msg);
3305 mavlink_test_data96(system_id, component_id, last_msg);
3306 mavlink_test_rangefinder(system_id, component_id, last_msg);
3307 mavlink_test_airspeed_autocal(system_id, component_id, last_msg);
3308 mavlink_test_rally_point(system_id, component_id, last_msg);
3309 mavlink_test_rally_fetch_point(system_id, component_id, last_msg);
3310 mavlink_test_compassmot_status(system_id, component_id, last_msg);
3311 mavlink_test_ahrs2(system_id, component_id, last_msg);
3312 mavlink_test_camera_status(system_id, component_id, last_msg);
3313 mavlink_test_camera_feedback(system_id, component_id, last_msg);
3314 mavlink_test_battery2(system_id, component_id, last_msg);
3315 mavlink_test_ahrs3(system_id, component_id, last_msg);
3316 mavlink_test_autopilot_version_request(system_id, component_id, last_msg);
3317 mavlink_test_remote_log_data_block(system_id, component_id, last_msg);
3318 mavlink_test_remote_log_block_status(system_id, component_id, last_msg);
3319 mavlink_test_led_control(system_id, component_id, last_msg);
3320 mavlink_test_mag_cal_progress(system_id, component_id, last_msg);
3321 mavlink_test_mag_cal_report(system_id, component_id, last_msg);
3322 mavlink_test_ekf_status_report(system_id, component_id, last_msg);
3323 mavlink_test_pid_tuning(system_id, component_id, last_msg);
3324 mavlink_test_gimbal_report(system_id, component_id, last_msg);
3325 mavlink_test_gimbal_control(system_id, component_id, last_msg);
3326 mavlink_test_gimbal_torque_cmd_report(system_id, component_id, last_msg);
3327 mavlink_test_gopro_heartbeat(system_id, component_id, last_msg);
3328 mavlink_test_gopro_get_request(system_id, component_id, last_msg);
3329 mavlink_test_gopro_get_response(system_id, component_id, last_msg);
3330 mavlink_test_gopro_set_request(system_id, component_id, last_msg);
3331 mavlink_test_gopro_set_response(system_id, component_id, last_msg);
3332 mavlink_test_rpm(system_id, component_id, last_msg);
3333 mavlink_test_device_op_read(system_id, component_id, last_msg);
3334 mavlink_test_device_op_read_reply(system_id, component_id, last_msg);
3335 mavlink_test_device_op_write(system_id, component_id, last_msg);
3336 mavlink_test_device_op_write_reply(system_id, component_id, last_msg);
3337 mavlink_test_adap_tuning(system_id, component_id, last_msg);
3338 mavlink_test_vision_position_delta(system_id, component_id, last_msg);
3339}
3340
3341#ifdef __cplusplus
3342}
3343#endif // __cplusplus
3344#endif // ARDUPILOTMEGA_TESTSUITE_H
MAVLink comm protocol testsuite generated from common.xml
MAVLink comm protocol testsuite generated from uAvionix.xml