Arduino Mavlink
Loading...
Searching...
No Matches
testsuite.h
Go to the documentation of this file.
1/** @file
2 * @brief MAVLink comm protocol testsuite generated from common.xml
3 * @see https://mavlink.io/en/
4 */
5#pragma once
6#ifndef COMMON_TESTSUITE_H
7#define COMMON_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_standard(uint8_t, uint8_t, mavlink_message_t *last_msg);
16static void mavlink_test_common(uint8_t, uint8_t, mavlink_message_t *last_msg);
17
18static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
19{
20 mavlink_test_standard(system_id, component_id, last_msg);
21 mavlink_test_common(system_id, component_id, last_msg);
22}
23#endif
24
25#include "../standard/testsuite.h"
26
27
28static void mavlink_test_sys_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
29{
30#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
31 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
32 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SYS_STATUS >= 256) {
33 return;
34 }
35#endif
36 mavlink_message_t msg;
37 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
38 uint16_t i;
39 mavlink_sys_status_t packet_in = {
40 963497464,963497672,963497880,17859,17963,18067,18171,18275,18379,18483,18587,18691,223,963499076,963499284,963499492
41 };
42 mavlink_sys_status_t packet1, packet2;
43 memset(&packet1, 0, sizeof(packet1));
44 packet1.onboard_control_sensors_present = packet_in.onboard_control_sensors_present;
45 packet1.onboard_control_sensors_enabled = packet_in.onboard_control_sensors_enabled;
46 packet1.onboard_control_sensors_health = packet_in.onboard_control_sensors_health;
47 packet1.load = packet_in.load;
48 packet1.voltage_battery = packet_in.voltage_battery;
49 packet1.current_battery = packet_in.current_battery;
50 packet1.drop_rate_comm = packet_in.drop_rate_comm;
51 packet1.errors_comm = packet_in.errors_comm;
52 packet1.errors_count1 = packet_in.errors_count1;
53 packet1.errors_count2 = packet_in.errors_count2;
54 packet1.errors_count3 = packet_in.errors_count3;
55 packet1.errors_count4 = packet_in.errors_count4;
56 packet1.battery_remaining = packet_in.battery_remaining;
57 packet1.onboard_control_sensors_present_extended = packet_in.onboard_control_sensors_present_extended;
58 packet1.onboard_control_sensors_enabled_extended = packet_in.onboard_control_sensors_enabled_extended;
59 packet1.onboard_control_sensors_health_extended = packet_in.onboard_control_sensors_health_extended;
60
61
62#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
63 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
64 // cope with extensions
65 memset(MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN);
66 }
67#endif
68 memset(&packet2, 0, sizeof(packet2));
69 mavlink_msg_sys_status_encode(system_id, component_id, &msg, &packet1);
70 mavlink_msg_sys_status_decode(&msg, &packet2);
71 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
72
73 memset(&packet2, 0, sizeof(packet2));
74 mavlink_msg_sys_status_pack(system_id, component_id, &msg , packet1.onboard_control_sensors_present , packet1.onboard_control_sensors_enabled , packet1.onboard_control_sensors_health , packet1.load , packet1.voltage_battery , packet1.current_battery , packet1.battery_remaining , packet1.drop_rate_comm , packet1.errors_comm , packet1.errors_count1 , packet1.errors_count2 , packet1.errors_count3 , packet1.errors_count4 , packet1.onboard_control_sensors_present_extended , packet1.onboard_control_sensors_enabled_extended , packet1.onboard_control_sensors_health_extended );
75 mavlink_msg_sys_status_decode(&msg, &packet2);
76 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
77
78 memset(&packet2, 0, sizeof(packet2));
79 mavlink_msg_sys_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.onboard_control_sensors_present , packet1.onboard_control_sensors_enabled , packet1.onboard_control_sensors_health , packet1.load , packet1.voltage_battery , packet1.current_battery , packet1.battery_remaining , packet1.drop_rate_comm , packet1.errors_comm , packet1.errors_count1 , packet1.errors_count2 , packet1.errors_count3 , packet1.errors_count4 , packet1.onboard_control_sensors_present_extended , packet1.onboard_control_sensors_enabled_extended , packet1.onboard_control_sensors_health_extended );
80 mavlink_msg_sys_status_decode(&msg, &packet2);
81 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
82
83 memset(&packet2, 0, sizeof(packet2));
84 mavlink_msg_to_send_buffer(buffer, &msg);
85 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
86 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
87 }
88 mavlink_msg_sys_status_decode(last_msg, &packet2);
89 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
90
91 memset(&packet2, 0, sizeof(packet2));
92 mavlink_msg_sys_status_send(MAVLINK_COMM_1 , packet1.onboard_control_sensors_present , packet1.onboard_control_sensors_enabled , packet1.onboard_control_sensors_health , packet1.load , packet1.voltage_battery , packet1.current_battery , packet1.battery_remaining , packet1.drop_rate_comm , packet1.errors_comm , packet1.errors_count1 , packet1.errors_count2 , packet1.errors_count3 , packet1.errors_count4 , packet1.onboard_control_sensors_present_extended , packet1.onboard_control_sensors_enabled_extended , packet1.onboard_control_sensors_health_extended );
93 mavlink_msg_sys_status_decode(last_msg, &packet2);
94 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
95
96#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
97 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SYS_STATUS") != NULL);
98 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SYS_STATUS) != NULL);
99#endif
100}
101
102static void mavlink_test_system_time(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
103{
104#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
105 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
106 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SYSTEM_TIME >= 256) {
107 return;
108 }
109#endif
110 mavlink_message_t msg;
111 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
112 uint16_t i;
113 mavlink_system_time_t packet_in = {
114 93372036854775807ULL,963497880
115 };
116 mavlink_system_time_t packet1, packet2;
117 memset(&packet1, 0, sizeof(packet1));
118 packet1.time_unix_usec = packet_in.time_unix_usec;
119 packet1.time_boot_ms = packet_in.time_boot_ms;
120
121
122#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
123 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
124 // cope with extensions
125 memset(MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN);
126 }
127#endif
128 memset(&packet2, 0, sizeof(packet2));
129 mavlink_msg_system_time_encode(system_id, component_id, &msg, &packet1);
130 mavlink_msg_system_time_decode(&msg, &packet2);
131 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
132
133 memset(&packet2, 0, sizeof(packet2));
134 mavlink_msg_system_time_pack(system_id, component_id, &msg , packet1.time_unix_usec , packet1.time_boot_ms );
135 mavlink_msg_system_time_decode(&msg, &packet2);
136 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
137
138 memset(&packet2, 0, sizeof(packet2));
139 mavlink_msg_system_time_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_unix_usec , packet1.time_boot_ms );
140 mavlink_msg_system_time_decode(&msg, &packet2);
141 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
142
143 memset(&packet2, 0, sizeof(packet2));
144 mavlink_msg_to_send_buffer(buffer, &msg);
145 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
146 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
147 }
148 mavlink_msg_system_time_decode(last_msg, &packet2);
149 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
150
151 memset(&packet2, 0, sizeof(packet2));
152 mavlink_msg_system_time_send(MAVLINK_COMM_1 , packet1.time_unix_usec , packet1.time_boot_ms );
153 mavlink_msg_system_time_decode(last_msg, &packet2);
154 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
155
156#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
157 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SYSTEM_TIME") != NULL);
158 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SYSTEM_TIME) != NULL);
159#endif
160}
161
162static void mavlink_test_ping(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
163{
164#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
165 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
166 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PING >= 256) {
167 return;
168 }
169#endif
170 mavlink_message_t msg;
171 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
172 uint16_t i;
173 mavlink_ping_t packet_in = {
174 93372036854775807ULL,963497880,41,108
175 };
176 mavlink_ping_t packet1, packet2;
177 memset(&packet1, 0, sizeof(packet1));
178 packet1.time_usec = packet_in.time_usec;
179 packet1.seq = packet_in.seq;
180 packet1.target_system = packet_in.target_system;
181 packet1.target_component = packet_in.target_component;
182
183
184#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
185 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
186 // cope with extensions
187 memset(MAVLINK_MSG_ID_PING_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PING_MIN_LEN);
188 }
189#endif
190 memset(&packet2, 0, sizeof(packet2));
191 mavlink_msg_ping_encode(system_id, component_id, &msg, &packet1);
192 mavlink_msg_ping_decode(&msg, &packet2);
193 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
194
195 memset(&packet2, 0, sizeof(packet2));
196 mavlink_msg_ping_pack(system_id, component_id, &msg , packet1.time_usec , packet1.seq , packet1.target_system , packet1.target_component );
197 mavlink_msg_ping_decode(&msg, &packet2);
198 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
199
200 memset(&packet2, 0, sizeof(packet2));
201 mavlink_msg_ping_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.seq , packet1.target_system , packet1.target_component );
202 mavlink_msg_ping_decode(&msg, &packet2);
203 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
204
205 memset(&packet2, 0, sizeof(packet2));
206 mavlink_msg_to_send_buffer(buffer, &msg);
207 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
208 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
209 }
210 mavlink_msg_ping_decode(last_msg, &packet2);
211 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
212
213 memset(&packet2, 0, sizeof(packet2));
214 mavlink_msg_ping_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.seq , packet1.target_system , packet1.target_component );
215 mavlink_msg_ping_decode(last_msg, &packet2);
216 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
217
218#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
219 MAVLINK_ASSERT(mavlink_get_message_info_by_name("PING") != NULL);
220 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PING) != NULL);
221#endif
222}
223
224static void mavlink_test_change_operator_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
225{
226#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
227 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
228 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL >= 256) {
229 return;
230 }
231#endif
232 mavlink_message_t msg;
233 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
234 uint16_t i;
235 mavlink_change_operator_control_t packet_in = {
236 5,72,139,"DEFGHIJKLMNOPQRSTUVWXYZA"
237 };
238 mavlink_change_operator_control_t packet1, packet2;
239 memset(&packet1, 0, sizeof(packet1));
240 packet1.target_system = packet_in.target_system;
241 packet1.control_request = packet_in.control_request;
242 packet1.version = packet_in.version;
243
244 mav_array_memcpy(packet1.passkey, packet_in.passkey, sizeof(char)*25);
245
246#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
247 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
248 // cope with extensions
249 memset(MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN);
250 }
251#endif
252 memset(&packet2, 0, sizeof(packet2));
253 mavlink_msg_change_operator_control_encode(system_id, component_id, &msg, &packet1);
254 mavlink_msg_change_operator_control_decode(&msg, &packet2);
255 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
256
257 memset(&packet2, 0, sizeof(packet2));
258 mavlink_msg_change_operator_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.control_request , packet1.version , packet1.passkey );
259 mavlink_msg_change_operator_control_decode(&msg, &packet2);
260 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
261
262 memset(&packet2, 0, sizeof(packet2));
263 mavlink_msg_change_operator_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.control_request , packet1.version , packet1.passkey );
264 mavlink_msg_change_operator_control_decode(&msg, &packet2);
265 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
266
267 memset(&packet2, 0, sizeof(packet2));
268 mavlink_msg_to_send_buffer(buffer, &msg);
269 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
270 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
271 }
272 mavlink_msg_change_operator_control_decode(last_msg, &packet2);
273 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
274
275 memset(&packet2, 0, sizeof(packet2));
276 mavlink_msg_change_operator_control_send(MAVLINK_COMM_1 , packet1.target_system , packet1.control_request , packet1.version , packet1.passkey );
277 mavlink_msg_change_operator_control_decode(last_msg, &packet2);
278 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
279
280#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
281 MAVLINK_ASSERT(mavlink_get_message_info_by_name("CHANGE_OPERATOR_CONTROL") != NULL);
282 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL) != NULL);
283#endif
284}
285
286static void mavlink_test_change_operator_control_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
287{
288#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
289 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
290 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK >= 256) {
291 return;
292 }
293#endif
294 mavlink_message_t msg;
295 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
296 uint16_t i;
297 mavlink_change_operator_control_ack_t packet_in = {
298 5,72,139
299 };
300 mavlink_change_operator_control_ack_t packet1, packet2;
301 memset(&packet1, 0, sizeof(packet1));
302 packet1.gcs_system_id = packet_in.gcs_system_id;
303 packet1.control_request = packet_in.control_request;
304 packet1.ack = packet_in.ack;
305
306
307#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
308 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
309 // cope with extensions
310 memset(MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN);
311 }
312#endif
313 memset(&packet2, 0, sizeof(packet2));
314 mavlink_msg_change_operator_control_ack_encode(system_id, component_id, &msg, &packet1);
315 mavlink_msg_change_operator_control_ack_decode(&msg, &packet2);
316 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
317
318 memset(&packet2, 0, sizeof(packet2));
319 mavlink_msg_change_operator_control_ack_pack(system_id, component_id, &msg , packet1.gcs_system_id , packet1.control_request , packet1.ack );
320 mavlink_msg_change_operator_control_ack_decode(&msg, &packet2);
321 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
322
323 memset(&packet2, 0, sizeof(packet2));
324 mavlink_msg_change_operator_control_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.gcs_system_id , packet1.control_request , packet1.ack );
325 mavlink_msg_change_operator_control_ack_decode(&msg, &packet2);
326 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
327
328 memset(&packet2, 0, sizeof(packet2));
329 mavlink_msg_to_send_buffer(buffer, &msg);
330 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
331 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
332 }
333 mavlink_msg_change_operator_control_ack_decode(last_msg, &packet2);
334 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
335
336 memset(&packet2, 0, sizeof(packet2));
337 mavlink_msg_change_operator_control_ack_send(MAVLINK_COMM_1 , packet1.gcs_system_id , packet1.control_request , packet1.ack );
338 mavlink_msg_change_operator_control_ack_decode(last_msg, &packet2);
339 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
340
341#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
342 MAVLINK_ASSERT(mavlink_get_message_info_by_name("CHANGE_OPERATOR_CONTROL_ACK") != NULL);
343 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK) != NULL);
344#endif
345}
346
347static void mavlink_test_auth_key(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
348{
349#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
350 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
351 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AUTH_KEY >= 256) {
352 return;
353 }
354#endif
355 mavlink_message_t msg;
356 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
357 uint16_t i;
358 mavlink_auth_key_t packet_in = {
359 "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDE"
360 };
361 mavlink_auth_key_t packet1, packet2;
362 memset(&packet1, 0, sizeof(packet1));
363
364 mav_array_memcpy(packet1.key, packet_in.key, sizeof(char)*32);
365
366#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
367 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
368 // cope with extensions
369 memset(MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN);
370 }
371#endif
372 memset(&packet2, 0, sizeof(packet2));
373 mavlink_msg_auth_key_encode(system_id, component_id, &msg, &packet1);
374 mavlink_msg_auth_key_decode(&msg, &packet2);
375 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
376
377 memset(&packet2, 0, sizeof(packet2));
378 mavlink_msg_auth_key_pack(system_id, component_id, &msg , packet1.key );
379 mavlink_msg_auth_key_decode(&msg, &packet2);
380 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
381
382 memset(&packet2, 0, sizeof(packet2));
383 mavlink_msg_auth_key_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.key );
384 mavlink_msg_auth_key_decode(&msg, &packet2);
385 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
386
387 memset(&packet2, 0, sizeof(packet2));
388 mavlink_msg_to_send_buffer(buffer, &msg);
389 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
390 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
391 }
392 mavlink_msg_auth_key_decode(last_msg, &packet2);
393 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
394
395 memset(&packet2, 0, sizeof(packet2));
396 mavlink_msg_auth_key_send(MAVLINK_COMM_1 , packet1.key );
397 mavlink_msg_auth_key_decode(last_msg, &packet2);
398 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
399
400#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
401 MAVLINK_ASSERT(mavlink_get_message_info_by_name("AUTH_KEY") != NULL);
402 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_AUTH_KEY) != NULL);
403#endif
404}
405
406static void mavlink_test_link_node_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
407{
408#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
409 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
410 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LINK_NODE_STATUS >= 256) {
411 return;
412 }
413#endif
414 mavlink_message_t msg;
415 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
416 uint16_t i;
417 mavlink_link_node_status_t packet_in = {
418 93372036854775807ULL,963497880,963498088,963498296,963498504,963498712,18691,18795,18899,235,46
419 };
420 mavlink_link_node_status_t packet1, packet2;
421 memset(&packet1, 0, sizeof(packet1));
422 packet1.timestamp = packet_in.timestamp;
423 packet1.tx_rate = packet_in.tx_rate;
424 packet1.rx_rate = packet_in.rx_rate;
425 packet1.messages_sent = packet_in.messages_sent;
426 packet1.messages_received = packet_in.messages_received;
427 packet1.messages_lost = packet_in.messages_lost;
428 packet1.rx_parse_err = packet_in.rx_parse_err;
429 packet1.tx_overflows = packet_in.tx_overflows;
430 packet1.rx_overflows = packet_in.rx_overflows;
431 packet1.tx_buf = packet_in.tx_buf;
432 packet1.rx_buf = packet_in.rx_buf;
433
434
435#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
436 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
437 // cope with extensions
438 memset(MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN);
439 }
440#endif
441 memset(&packet2, 0, sizeof(packet2));
442 mavlink_msg_link_node_status_encode(system_id, component_id, &msg, &packet1);
443 mavlink_msg_link_node_status_decode(&msg, &packet2);
444 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
445
446 memset(&packet2, 0, sizeof(packet2));
447 mavlink_msg_link_node_status_pack(system_id, component_id, &msg , packet1.timestamp , packet1.tx_buf , packet1.rx_buf , packet1.tx_rate , packet1.rx_rate , packet1.rx_parse_err , packet1.tx_overflows , packet1.rx_overflows , packet1.messages_sent , packet1.messages_received , packet1.messages_lost );
448 mavlink_msg_link_node_status_decode(&msg, &packet2);
449 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
450
451 memset(&packet2, 0, sizeof(packet2));
452 mavlink_msg_link_node_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.tx_buf , packet1.rx_buf , packet1.tx_rate , packet1.rx_rate , packet1.rx_parse_err , packet1.tx_overflows , packet1.rx_overflows , packet1.messages_sent , packet1.messages_received , packet1.messages_lost );
453 mavlink_msg_link_node_status_decode(&msg, &packet2);
454 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
455
456 memset(&packet2, 0, sizeof(packet2));
457 mavlink_msg_to_send_buffer(buffer, &msg);
458 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
459 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
460 }
461 mavlink_msg_link_node_status_decode(last_msg, &packet2);
462 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
463
464 memset(&packet2, 0, sizeof(packet2));
465 mavlink_msg_link_node_status_send(MAVLINK_COMM_1 , packet1.timestamp , packet1.tx_buf , packet1.rx_buf , packet1.tx_rate , packet1.rx_rate , packet1.rx_parse_err , packet1.tx_overflows , packet1.rx_overflows , packet1.messages_sent , packet1.messages_received , packet1.messages_lost );
466 mavlink_msg_link_node_status_decode(last_msg, &packet2);
467 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
468
469#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
470 MAVLINK_ASSERT(mavlink_get_message_info_by_name("LINK_NODE_STATUS") != NULL);
471 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LINK_NODE_STATUS) != NULL);
472#endif
473}
474
475static void mavlink_test_set_mode(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
476{
477#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
478 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
479 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_MODE >= 256) {
480 return;
481 }
482#endif
483 mavlink_message_t msg;
484 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
485 uint16_t i;
486 mavlink_set_mode_t packet_in = {
487 963497464,17,84
488 };
489 mavlink_set_mode_t packet1, packet2;
490 memset(&packet1, 0, sizeof(packet1));
491 packet1.custom_mode = packet_in.custom_mode;
492 packet1.target_system = packet_in.target_system;
493 packet1.base_mode = packet_in.base_mode;
494
495
496#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
497 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
498 // cope with extensions
499 memset(MAVLINK_MSG_ID_SET_MODE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_MODE_MIN_LEN);
500 }
501#endif
502 memset(&packet2, 0, sizeof(packet2));
503 mavlink_msg_set_mode_encode(system_id, component_id, &msg, &packet1);
504 mavlink_msg_set_mode_decode(&msg, &packet2);
505 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
506
507 memset(&packet2, 0, sizeof(packet2));
508 mavlink_msg_set_mode_pack(system_id, component_id, &msg , packet1.target_system , packet1.base_mode , packet1.custom_mode );
509 mavlink_msg_set_mode_decode(&msg, &packet2);
510 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
511
512 memset(&packet2, 0, sizeof(packet2));
513 mavlink_msg_set_mode_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.base_mode , packet1.custom_mode );
514 mavlink_msg_set_mode_decode(&msg, &packet2);
515 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
516
517 memset(&packet2, 0, sizeof(packet2));
518 mavlink_msg_to_send_buffer(buffer, &msg);
519 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
520 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
521 }
522 mavlink_msg_set_mode_decode(last_msg, &packet2);
523 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
524
525 memset(&packet2, 0, sizeof(packet2));
526 mavlink_msg_set_mode_send(MAVLINK_COMM_1 , packet1.target_system , packet1.base_mode , packet1.custom_mode );
527 mavlink_msg_set_mode_decode(last_msg, &packet2);
528 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
529
530#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
531 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SET_MODE") != NULL);
532 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SET_MODE) != NULL);
533#endif
534}
535
536static void mavlink_test_param_request_read(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
537{
538#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
539 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
540 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_REQUEST_READ >= 256) {
541 return;
542 }
543#endif
544 mavlink_message_t msg;
545 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
546 uint16_t i;
547 mavlink_param_request_read_t packet_in = {
548 17235,139,206,"EFGHIJKLMNOPQRS"
549 };
550 mavlink_param_request_read_t packet1, packet2;
551 memset(&packet1, 0, sizeof(packet1));
552 packet1.param_index = packet_in.param_index;
553 packet1.target_system = packet_in.target_system;
554 packet1.target_component = packet_in.target_component;
555
556 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
557
558#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
559 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
560 // cope with extensions
561 memset(MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN);
562 }
563#endif
564 memset(&packet2, 0, sizeof(packet2));
565 mavlink_msg_param_request_read_encode(system_id, component_id, &msg, &packet1);
566 mavlink_msg_param_request_read_decode(&msg, &packet2);
567 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
568
569 memset(&packet2, 0, sizeof(packet2));
570 mavlink_msg_param_request_read_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index );
571 mavlink_msg_param_request_read_decode(&msg, &packet2);
572 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
573
574 memset(&packet2, 0, sizeof(packet2));
575 mavlink_msg_param_request_read_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index );
576 mavlink_msg_param_request_read_decode(&msg, &packet2);
577 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
578
579 memset(&packet2, 0, sizeof(packet2));
580 mavlink_msg_to_send_buffer(buffer, &msg);
581 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
582 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
583 }
584 mavlink_msg_param_request_read_decode(last_msg, &packet2);
585 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
586
587 memset(&packet2, 0, sizeof(packet2));
588 mavlink_msg_param_request_read_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index );
589 mavlink_msg_param_request_read_decode(last_msg, &packet2);
590 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
591
592#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
593 MAVLINK_ASSERT(mavlink_get_message_info_by_name("PARAM_REQUEST_READ") != NULL);
594 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PARAM_REQUEST_READ) != NULL);
595#endif
596}
597
598static void mavlink_test_param_request_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
599{
600#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
601 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
602 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_REQUEST_LIST >= 256) {
603 return;
604 }
605#endif
606 mavlink_message_t msg;
607 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
608 uint16_t i;
609 mavlink_param_request_list_t packet_in = {
610 5,72
611 };
612 mavlink_param_request_list_t packet1, packet2;
613 memset(&packet1, 0, sizeof(packet1));
614 packet1.target_system = packet_in.target_system;
615 packet1.target_component = packet_in.target_component;
616
617
618#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
619 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
620 // cope with extensions
621 memset(MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN);
622 }
623#endif
624 memset(&packet2, 0, sizeof(packet2));
625 mavlink_msg_param_request_list_encode(system_id, component_id, &msg, &packet1);
626 mavlink_msg_param_request_list_decode(&msg, &packet2);
627 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
628
629 memset(&packet2, 0, sizeof(packet2));
630 mavlink_msg_param_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
631 mavlink_msg_param_request_list_decode(&msg, &packet2);
632 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
633
634 memset(&packet2, 0, sizeof(packet2));
635 mavlink_msg_param_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
636 mavlink_msg_param_request_list_decode(&msg, &packet2);
637 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
638
639 memset(&packet2, 0, sizeof(packet2));
640 mavlink_msg_to_send_buffer(buffer, &msg);
641 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
642 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
643 }
644 mavlink_msg_param_request_list_decode(last_msg, &packet2);
645 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
646
647 memset(&packet2, 0, sizeof(packet2));
648 mavlink_msg_param_request_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
649 mavlink_msg_param_request_list_decode(last_msg, &packet2);
650 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
651
652#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
653 MAVLINK_ASSERT(mavlink_get_message_info_by_name("PARAM_REQUEST_LIST") != NULL);
654 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PARAM_REQUEST_LIST) != NULL);
655#endif
656}
657
658static void mavlink_test_param_value(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
659{
660#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
661 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
662 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_VALUE >= 256) {
663 return;
664 }
665#endif
666 mavlink_message_t msg;
667 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
668 uint16_t i;
669 mavlink_param_value_t packet_in = {
670 17.0,17443,17547,"IJKLMNOPQRSTUVW",77
671 };
672 mavlink_param_value_t packet1, packet2;
673 memset(&packet1, 0, sizeof(packet1));
674 packet1.param_value = packet_in.param_value;
675 packet1.param_count = packet_in.param_count;
676 packet1.param_index = packet_in.param_index;
677 packet1.param_type = packet_in.param_type;
678
679 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
680
681#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
682 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
683 // cope with extensions
684 memset(MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN);
685 }
686#endif
687 memset(&packet2, 0, sizeof(packet2));
688 mavlink_msg_param_value_encode(system_id, component_id, &msg, &packet1);
689 mavlink_msg_param_value_decode(&msg, &packet2);
690 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
691
692 memset(&packet2, 0, sizeof(packet2));
693 mavlink_msg_param_value_pack(system_id, component_id, &msg , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_count , packet1.param_index );
694 mavlink_msg_param_value_decode(&msg, &packet2);
695 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
696
697 memset(&packet2, 0, sizeof(packet2));
698 mavlink_msg_param_value_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_count , packet1.param_index );
699 mavlink_msg_param_value_decode(&msg, &packet2);
700 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
701
702 memset(&packet2, 0, sizeof(packet2));
703 mavlink_msg_to_send_buffer(buffer, &msg);
704 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
705 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
706 }
707 mavlink_msg_param_value_decode(last_msg, &packet2);
708 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
709
710 memset(&packet2, 0, sizeof(packet2));
711 mavlink_msg_param_value_send(MAVLINK_COMM_1 , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_count , packet1.param_index );
712 mavlink_msg_param_value_decode(last_msg, &packet2);
713 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
714
715#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
716 MAVLINK_ASSERT(mavlink_get_message_info_by_name("PARAM_VALUE") != NULL);
717 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PARAM_VALUE) != NULL);
718#endif
719}
720
721static void mavlink_test_param_set(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
722{
723#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
724 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
725 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_SET >= 256) {
726 return;
727 }
728#endif
729 mavlink_message_t msg;
730 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
731 uint16_t i;
732 mavlink_param_set_t packet_in = {
733 17.0,17,84,"GHIJKLMNOPQRSTU",199
734 };
735 mavlink_param_set_t packet1, packet2;
736 memset(&packet1, 0, sizeof(packet1));
737 packet1.param_value = packet_in.param_value;
738 packet1.target_system = packet_in.target_system;
739 packet1.target_component = packet_in.target_component;
740 packet1.param_type = packet_in.param_type;
741
742 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
743
744#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
745 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
746 // cope with extensions
747 memset(MAVLINK_MSG_ID_PARAM_SET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_SET_MIN_LEN);
748 }
749#endif
750 memset(&packet2, 0, sizeof(packet2));
751 mavlink_msg_param_set_encode(system_id, component_id, &msg, &packet1);
752 mavlink_msg_param_set_decode(&msg, &packet2);
753 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
754
755 memset(&packet2, 0, sizeof(packet2));
756 mavlink_msg_param_set_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type );
757 mavlink_msg_param_set_decode(&msg, &packet2);
758 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
759
760 memset(&packet2, 0, sizeof(packet2));
761 mavlink_msg_param_set_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type );
762 mavlink_msg_param_set_decode(&msg, &packet2);
763 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
764
765 memset(&packet2, 0, sizeof(packet2));
766 mavlink_msg_to_send_buffer(buffer, &msg);
767 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
768 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
769 }
770 mavlink_msg_param_set_decode(last_msg, &packet2);
771 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
772
773 memset(&packet2, 0, sizeof(packet2));
774 mavlink_msg_param_set_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type );
775 mavlink_msg_param_set_decode(last_msg, &packet2);
776 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
777
778#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
779 MAVLINK_ASSERT(mavlink_get_message_info_by_name("PARAM_SET") != NULL);
780 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PARAM_SET) != NULL);
781#endif
782}
783
784static void mavlink_test_gps_raw_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
785{
786#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
787 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
788 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_RAW_INT >= 256) {
789 return;
790 }
791#endif
792 mavlink_message_t msg;
793 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
794 uint16_t i;
795 mavlink_gps_raw_int_t packet_in = {
796 93372036854775807ULL,963497880,963498088,963498296,18275,18379,18483,18587,89,156,963499024,963499232,963499440,963499648,963499856,19835
797 };
798 mavlink_gps_raw_int_t packet1, packet2;
799 memset(&packet1, 0, sizeof(packet1));
800 packet1.time_usec = packet_in.time_usec;
801 packet1.lat = packet_in.lat;
802 packet1.lon = packet_in.lon;
803 packet1.alt = packet_in.alt;
804 packet1.eph = packet_in.eph;
805 packet1.epv = packet_in.epv;
806 packet1.vel = packet_in.vel;
807 packet1.cog = packet_in.cog;
808 packet1.fix_type = packet_in.fix_type;
809 packet1.satellites_visible = packet_in.satellites_visible;
810 packet1.alt_ellipsoid = packet_in.alt_ellipsoid;
811 packet1.h_acc = packet_in.h_acc;
812 packet1.v_acc = packet_in.v_acc;
813 packet1.vel_acc = packet_in.vel_acc;
814 packet1.hdg_acc = packet_in.hdg_acc;
815 packet1.yaw = packet_in.yaw;
816
817
818#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
819 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
820 // cope with extensions
821 memset(MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN);
822 }
823#endif
824 memset(&packet2, 0, sizeof(packet2));
825 mavlink_msg_gps_raw_int_encode(system_id, component_id, &msg, &packet1);
826 mavlink_msg_gps_raw_int_decode(&msg, &packet2);
827 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
828
829 memset(&packet2, 0, sizeof(packet2));
830 mavlink_msg_gps_raw_int_pack(system_id, component_id, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible , packet1.alt_ellipsoid , packet1.h_acc , packet1.v_acc , packet1.vel_acc , packet1.hdg_acc , packet1.yaw );
831 mavlink_msg_gps_raw_int_decode(&msg, &packet2);
832 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
833
834 memset(&packet2, 0, sizeof(packet2));
835 mavlink_msg_gps_raw_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible , packet1.alt_ellipsoid , packet1.h_acc , packet1.v_acc , packet1.vel_acc , packet1.hdg_acc , packet1.yaw );
836 mavlink_msg_gps_raw_int_decode(&msg, &packet2);
837 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
838
839 memset(&packet2, 0, sizeof(packet2));
840 mavlink_msg_to_send_buffer(buffer, &msg);
841 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
842 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
843 }
844 mavlink_msg_gps_raw_int_decode(last_msg, &packet2);
845 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
846
847 memset(&packet2, 0, sizeof(packet2));
848 mavlink_msg_gps_raw_int_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible , packet1.alt_ellipsoid , packet1.h_acc , packet1.v_acc , packet1.vel_acc , packet1.hdg_acc , packet1.yaw );
849 mavlink_msg_gps_raw_int_decode(last_msg, &packet2);
850 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
851
852#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
853 MAVLINK_ASSERT(mavlink_get_message_info_by_name("GPS_RAW_INT") != NULL);
854 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GPS_RAW_INT) != NULL);
855#endif
856}
857
858static void mavlink_test_gps_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
859{
860#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
861 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
862 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_STATUS >= 256) {
863 return;
864 }
865#endif
866 mavlink_message_t msg;
867 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
868 uint16_t i;
869 mavlink_gps_status_t packet_in = {
870 5,{ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91 },{ 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151 },{ 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211 },{ 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },{ 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75 }
871 };
872 mavlink_gps_status_t packet1, packet2;
873 memset(&packet1, 0, sizeof(packet1));
874 packet1.satellites_visible = packet_in.satellites_visible;
875
876 mav_array_memcpy(packet1.satellite_prn, packet_in.satellite_prn, sizeof(uint8_t)*20);
877 mav_array_memcpy(packet1.satellite_used, packet_in.satellite_used, sizeof(uint8_t)*20);
878 mav_array_memcpy(packet1.satellite_elevation, packet_in.satellite_elevation, sizeof(uint8_t)*20);
879 mav_array_memcpy(packet1.satellite_azimuth, packet_in.satellite_azimuth, sizeof(uint8_t)*20);
880 mav_array_memcpy(packet1.satellite_snr, packet_in.satellite_snr, sizeof(uint8_t)*20);
881
882#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
883 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
884 // cope with extensions
885 memset(MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN);
886 }
887#endif
888 memset(&packet2, 0, sizeof(packet2));
889 mavlink_msg_gps_status_encode(system_id, component_id, &msg, &packet1);
890 mavlink_msg_gps_status_decode(&msg, &packet2);
891 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
892
893 memset(&packet2, 0, sizeof(packet2));
894 mavlink_msg_gps_status_pack(system_id, component_id, &msg , packet1.satellites_visible , packet1.satellite_prn , packet1.satellite_used , packet1.satellite_elevation , packet1.satellite_azimuth , packet1.satellite_snr );
895 mavlink_msg_gps_status_decode(&msg, &packet2);
896 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
897
898 memset(&packet2, 0, sizeof(packet2));
899 mavlink_msg_gps_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.satellites_visible , packet1.satellite_prn , packet1.satellite_used , packet1.satellite_elevation , packet1.satellite_azimuth , packet1.satellite_snr );
900 mavlink_msg_gps_status_decode(&msg, &packet2);
901 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
902
903 memset(&packet2, 0, sizeof(packet2));
904 mavlink_msg_to_send_buffer(buffer, &msg);
905 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
906 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
907 }
908 mavlink_msg_gps_status_decode(last_msg, &packet2);
909 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
910
911 memset(&packet2, 0, sizeof(packet2));
912 mavlink_msg_gps_status_send(MAVLINK_COMM_1 , packet1.satellites_visible , packet1.satellite_prn , packet1.satellite_used , packet1.satellite_elevation , packet1.satellite_azimuth , packet1.satellite_snr );
913 mavlink_msg_gps_status_decode(last_msg, &packet2);
914 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
915
916#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
917 MAVLINK_ASSERT(mavlink_get_message_info_by_name("GPS_STATUS") != NULL);
918 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GPS_STATUS) != NULL);
919#endif
920}
921
922static void mavlink_test_scaled_imu(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
923{
924#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
925 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
926 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_IMU >= 256) {
927 return;
928 }
929#endif
930 mavlink_message_t msg;
931 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
932 uint16_t i;
933 mavlink_scaled_imu_t packet_in = {
934 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275,18379
935 };
936 mavlink_scaled_imu_t packet1, packet2;
937 memset(&packet1, 0, sizeof(packet1));
938 packet1.time_boot_ms = packet_in.time_boot_ms;
939 packet1.xacc = packet_in.xacc;
940 packet1.yacc = packet_in.yacc;
941 packet1.zacc = packet_in.zacc;
942 packet1.xgyro = packet_in.xgyro;
943 packet1.ygyro = packet_in.ygyro;
944 packet1.zgyro = packet_in.zgyro;
945 packet1.xmag = packet_in.xmag;
946 packet1.ymag = packet_in.ymag;
947 packet1.zmag = packet_in.zmag;
948 packet1.temperature = packet_in.temperature;
949
950
951#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
952 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
953 // cope with extensions
954 memset(MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN);
955 }
956#endif
957 memset(&packet2, 0, sizeof(packet2));
958 mavlink_msg_scaled_imu_encode(system_id, component_id, &msg, &packet1);
959 mavlink_msg_scaled_imu_decode(&msg, &packet2);
960 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
961
962 memset(&packet2, 0, sizeof(packet2));
963 mavlink_msg_scaled_imu_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.temperature );
964 mavlink_msg_scaled_imu_decode(&msg, &packet2);
965 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
966
967 memset(&packet2, 0, sizeof(packet2));
968 mavlink_msg_scaled_imu_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.temperature );
969 mavlink_msg_scaled_imu_decode(&msg, &packet2);
970 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
971
972 memset(&packet2, 0, sizeof(packet2));
973 mavlink_msg_to_send_buffer(buffer, &msg);
974 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
975 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
976 }
977 mavlink_msg_scaled_imu_decode(last_msg, &packet2);
978 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
979
980 memset(&packet2, 0, sizeof(packet2));
981 mavlink_msg_scaled_imu_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.temperature );
982 mavlink_msg_scaled_imu_decode(last_msg, &packet2);
983 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
984
985#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
986 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SCALED_IMU") != NULL);
987 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SCALED_IMU) != NULL);
988#endif
989}
990
991static void mavlink_test_raw_imu(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
992{
993#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
994 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
995 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RAW_IMU >= 256) {
996 return;
997 }
998#endif
999 mavlink_message_t msg;
1000 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1001 uint16_t i;
1002 mavlink_raw_imu_t packet_in = {
1003 93372036854775807ULL,17651,17755,17859,17963,18067,18171,18275,18379,18483,211,18639
1004 };
1005 mavlink_raw_imu_t packet1, packet2;
1006 memset(&packet1, 0, sizeof(packet1));
1007 packet1.time_usec = packet_in.time_usec;
1008 packet1.xacc = packet_in.xacc;
1009 packet1.yacc = packet_in.yacc;
1010 packet1.zacc = packet_in.zacc;
1011 packet1.xgyro = packet_in.xgyro;
1012 packet1.ygyro = packet_in.ygyro;
1013 packet1.zgyro = packet_in.zgyro;
1014 packet1.xmag = packet_in.xmag;
1015 packet1.ymag = packet_in.ymag;
1016 packet1.zmag = packet_in.zmag;
1017 packet1.id = packet_in.id;
1018 packet1.temperature = packet_in.temperature;
1019
1020
1021#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1022 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1023 // cope with extensions
1024 memset(MAVLINK_MSG_ID_RAW_IMU_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RAW_IMU_MIN_LEN);
1025 }
1026#endif
1027 memset(&packet2, 0, sizeof(packet2));
1028 mavlink_msg_raw_imu_encode(system_id, component_id, &msg, &packet1);
1029 mavlink_msg_raw_imu_decode(&msg, &packet2);
1030 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1031
1032 memset(&packet2, 0, sizeof(packet2));
1033 mavlink_msg_raw_imu_pack(system_id, component_id, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.id , packet1.temperature );
1034 mavlink_msg_raw_imu_decode(&msg, &packet2);
1035 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1036
1037 memset(&packet2, 0, sizeof(packet2));
1038 mavlink_msg_raw_imu_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.id , packet1.temperature );
1039 mavlink_msg_raw_imu_decode(&msg, &packet2);
1040 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1041
1042 memset(&packet2, 0, sizeof(packet2));
1043 mavlink_msg_to_send_buffer(buffer, &msg);
1044 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1045 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1046 }
1047 mavlink_msg_raw_imu_decode(last_msg, &packet2);
1048 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1049
1050 memset(&packet2, 0, sizeof(packet2));
1051 mavlink_msg_raw_imu_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.id , packet1.temperature );
1052 mavlink_msg_raw_imu_decode(last_msg, &packet2);
1053 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1054
1055#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1056 MAVLINK_ASSERT(mavlink_get_message_info_by_name("RAW_IMU") != NULL);
1057 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_RAW_IMU) != NULL);
1058#endif
1059}
1060
1061static void mavlink_test_raw_pressure(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1062{
1063#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1064 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1065 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RAW_PRESSURE >= 256) {
1066 return;
1067 }
1068#endif
1069 mavlink_message_t msg;
1070 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1071 uint16_t i;
1072 mavlink_raw_pressure_t packet_in = {
1073 93372036854775807ULL,17651,17755,17859,17963
1074 };
1075 mavlink_raw_pressure_t packet1, packet2;
1076 memset(&packet1, 0, sizeof(packet1));
1077 packet1.time_usec = packet_in.time_usec;
1078 packet1.press_abs = packet_in.press_abs;
1079 packet1.press_diff1 = packet_in.press_diff1;
1080 packet1.press_diff2 = packet_in.press_diff2;
1081 packet1.temperature = packet_in.temperature;
1082
1083
1084#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1085 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1086 // cope with extensions
1087 memset(MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN);
1088 }
1089#endif
1090 memset(&packet2, 0, sizeof(packet2));
1091 mavlink_msg_raw_pressure_encode(system_id, component_id, &msg, &packet1);
1092 mavlink_msg_raw_pressure_decode(&msg, &packet2);
1093 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1094
1095 memset(&packet2, 0, sizeof(packet2));
1096 mavlink_msg_raw_pressure_pack(system_id, component_id, &msg , packet1.time_usec , packet1.press_abs , packet1.press_diff1 , packet1.press_diff2 , packet1.temperature );
1097 mavlink_msg_raw_pressure_decode(&msg, &packet2);
1098 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1099
1100 memset(&packet2, 0, sizeof(packet2));
1101 mavlink_msg_raw_pressure_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.press_abs , packet1.press_diff1 , packet1.press_diff2 , packet1.temperature );
1102 mavlink_msg_raw_pressure_decode(&msg, &packet2);
1103 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1104
1105 memset(&packet2, 0, sizeof(packet2));
1106 mavlink_msg_to_send_buffer(buffer, &msg);
1107 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1108 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1109 }
1110 mavlink_msg_raw_pressure_decode(last_msg, &packet2);
1111 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1112
1113 memset(&packet2, 0, sizeof(packet2));
1114 mavlink_msg_raw_pressure_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.press_abs , packet1.press_diff1 , packet1.press_diff2 , packet1.temperature );
1115 mavlink_msg_raw_pressure_decode(last_msg, &packet2);
1116 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1117
1118#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1119 MAVLINK_ASSERT(mavlink_get_message_info_by_name("RAW_PRESSURE") != NULL);
1120 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_RAW_PRESSURE) != NULL);
1121#endif
1122}
1123
1124static void mavlink_test_scaled_pressure(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1125{
1126#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1127 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1128 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_PRESSURE >= 256) {
1129 return;
1130 }
1131#endif
1132 mavlink_message_t msg;
1133 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1134 uint16_t i;
1135 mavlink_scaled_pressure_t packet_in = {
1136 963497464,45.0,73.0,17859,17963
1137 };
1138 mavlink_scaled_pressure_t packet1, packet2;
1139 memset(&packet1, 0, sizeof(packet1));
1140 packet1.time_boot_ms = packet_in.time_boot_ms;
1141 packet1.press_abs = packet_in.press_abs;
1142 packet1.press_diff = packet_in.press_diff;
1143 packet1.temperature = packet_in.temperature;
1144 packet1.temperature_press_diff = packet_in.temperature_press_diff;
1145
1146
1147#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1148 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1149 // cope with extensions
1150 memset(MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN);
1151 }
1152#endif
1153 memset(&packet2, 0, sizeof(packet2));
1154 mavlink_msg_scaled_pressure_encode(system_id, component_id, &msg, &packet1);
1155 mavlink_msg_scaled_pressure_decode(&msg, &packet2);
1156 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1157
1158 memset(&packet2, 0, sizeof(packet2));
1159 mavlink_msg_scaled_pressure_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature , packet1.temperature_press_diff );
1160 mavlink_msg_scaled_pressure_decode(&msg, &packet2);
1161 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1162
1163 memset(&packet2, 0, sizeof(packet2));
1164 mavlink_msg_scaled_pressure_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature , packet1.temperature_press_diff );
1165 mavlink_msg_scaled_pressure_decode(&msg, &packet2);
1166 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1167
1168 memset(&packet2, 0, sizeof(packet2));
1169 mavlink_msg_to_send_buffer(buffer, &msg);
1170 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1171 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1172 }
1173 mavlink_msg_scaled_pressure_decode(last_msg, &packet2);
1174 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1175
1176 memset(&packet2, 0, sizeof(packet2));
1177 mavlink_msg_scaled_pressure_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature , packet1.temperature_press_diff );
1178 mavlink_msg_scaled_pressure_decode(last_msg, &packet2);
1179 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1180
1181#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1182 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SCALED_PRESSURE") != NULL);
1183 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SCALED_PRESSURE) != NULL);
1184#endif
1185}
1186
1187static void mavlink_test_attitude(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1188{
1189#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1190 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1191 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATTITUDE >= 256) {
1192 return;
1193 }
1194#endif
1195 mavlink_message_t msg;
1196 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1197 uint16_t i;
1198 mavlink_attitude_t packet_in = {
1199 963497464,45.0,73.0,101.0,129.0,157.0,185.0
1200 };
1201 mavlink_attitude_t packet1, packet2;
1202 memset(&packet1, 0, sizeof(packet1));
1203 packet1.time_boot_ms = packet_in.time_boot_ms;
1204 packet1.roll = packet_in.roll;
1205 packet1.pitch = packet_in.pitch;
1206 packet1.yaw = packet_in.yaw;
1207 packet1.rollspeed = packet_in.rollspeed;
1208 packet1.pitchspeed = packet_in.pitchspeed;
1209 packet1.yawspeed = packet_in.yawspeed;
1210
1211
1212#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1213 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1214 // cope with extensions
1215 memset(MAVLINK_MSG_ID_ATTITUDE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ATTITUDE_MIN_LEN);
1216 }
1217#endif
1218 memset(&packet2, 0, sizeof(packet2));
1219 mavlink_msg_attitude_encode(system_id, component_id, &msg, &packet1);
1220 mavlink_msg_attitude_decode(&msg, &packet2);
1221 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1222
1223 memset(&packet2, 0, sizeof(packet2));
1224 mavlink_msg_attitude_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed );
1225 mavlink_msg_attitude_decode(&msg, &packet2);
1226 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1227
1228 memset(&packet2, 0, sizeof(packet2));
1229 mavlink_msg_attitude_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed );
1230 mavlink_msg_attitude_decode(&msg, &packet2);
1231 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1232
1233 memset(&packet2, 0, sizeof(packet2));
1234 mavlink_msg_to_send_buffer(buffer, &msg);
1235 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1236 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1237 }
1238 mavlink_msg_attitude_decode(last_msg, &packet2);
1239 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1240
1241 memset(&packet2, 0, sizeof(packet2));
1242 mavlink_msg_attitude_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed );
1243 mavlink_msg_attitude_decode(last_msg, &packet2);
1244 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1245
1246#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1247 MAVLINK_ASSERT(mavlink_get_message_info_by_name("ATTITUDE") != NULL);
1248 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ATTITUDE) != NULL);
1249#endif
1250}
1251
1252static void mavlink_test_attitude_quaternion(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1253{
1254#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1255 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1256 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATTITUDE_QUATERNION >= 256) {
1257 return;
1258 }
1259#endif
1260 mavlink_message_t msg;
1261 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1262 uint16_t i;
1263 mavlink_attitude_quaternion_t packet_in = {
1264 963497464,45.0,73.0,101.0,129.0,157.0,185.0,213.0,{ 241.0, 242.0, 243.0, 244.0 }
1265 };
1266 mavlink_attitude_quaternion_t packet1, packet2;
1267 memset(&packet1, 0, sizeof(packet1));
1268 packet1.time_boot_ms = packet_in.time_boot_ms;
1269 packet1.q1 = packet_in.q1;
1270 packet1.q2 = packet_in.q2;
1271 packet1.q3 = packet_in.q3;
1272 packet1.q4 = packet_in.q4;
1273 packet1.rollspeed = packet_in.rollspeed;
1274 packet1.pitchspeed = packet_in.pitchspeed;
1275 packet1.yawspeed = packet_in.yawspeed;
1276
1277 mav_array_memcpy(packet1.repr_offset_q, packet_in.repr_offset_q, sizeof(float)*4);
1278
1279#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1280 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1281 // cope with extensions
1282 memset(MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN);
1283 }
1284#endif
1285 memset(&packet2, 0, sizeof(packet2));
1286 mavlink_msg_attitude_quaternion_encode(system_id, component_id, &msg, &packet1);
1287 mavlink_msg_attitude_quaternion_decode(&msg, &packet2);
1288 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1289
1290 memset(&packet2, 0, sizeof(packet2));
1291 mavlink_msg_attitude_quaternion_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.repr_offset_q );
1292 mavlink_msg_attitude_quaternion_decode(&msg, &packet2);
1293 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1294
1295 memset(&packet2, 0, sizeof(packet2));
1296 mavlink_msg_attitude_quaternion_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.repr_offset_q );
1297 mavlink_msg_attitude_quaternion_decode(&msg, &packet2);
1298 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1299
1300 memset(&packet2, 0, sizeof(packet2));
1301 mavlink_msg_to_send_buffer(buffer, &msg);
1302 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1303 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1304 }
1305 mavlink_msg_attitude_quaternion_decode(last_msg, &packet2);
1306 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1307
1308 memset(&packet2, 0, sizeof(packet2));
1309 mavlink_msg_attitude_quaternion_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.repr_offset_q );
1310 mavlink_msg_attitude_quaternion_decode(last_msg, &packet2);
1311 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1312
1313#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1314 MAVLINK_ASSERT(mavlink_get_message_info_by_name("ATTITUDE_QUATERNION") != NULL);
1315 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ATTITUDE_QUATERNION) != NULL);
1316#endif
1317}
1318
1319static void mavlink_test_local_position_ned(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1320{
1321#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1322 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1323 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOCAL_POSITION_NED >= 256) {
1324 return;
1325 }
1326#endif
1327 mavlink_message_t msg;
1328 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1329 uint16_t i;
1330 mavlink_local_position_ned_t packet_in = {
1331 963497464,45.0,73.0,101.0,129.0,157.0,185.0
1332 };
1333 mavlink_local_position_ned_t packet1, packet2;
1334 memset(&packet1, 0, sizeof(packet1));
1335 packet1.time_boot_ms = packet_in.time_boot_ms;
1336 packet1.x = packet_in.x;
1337 packet1.y = packet_in.y;
1338 packet1.z = packet_in.z;
1339 packet1.vx = packet_in.vx;
1340 packet1.vy = packet_in.vy;
1341 packet1.vz = packet_in.vz;
1342
1343
1344#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1345 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1346 // cope with extensions
1347 memset(MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN);
1348 }
1349#endif
1350 memset(&packet2, 0, sizeof(packet2));
1351 mavlink_msg_local_position_ned_encode(system_id, component_id, &msg, &packet1);
1352 mavlink_msg_local_position_ned_decode(&msg, &packet2);
1353 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1354
1355 memset(&packet2, 0, sizeof(packet2));
1356 mavlink_msg_local_position_ned_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz );
1357 mavlink_msg_local_position_ned_decode(&msg, &packet2);
1358 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1359
1360 memset(&packet2, 0, sizeof(packet2));
1361 mavlink_msg_local_position_ned_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz );
1362 mavlink_msg_local_position_ned_decode(&msg, &packet2);
1363 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1364
1365 memset(&packet2, 0, sizeof(packet2));
1366 mavlink_msg_to_send_buffer(buffer, &msg);
1367 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1368 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1369 }
1370 mavlink_msg_local_position_ned_decode(last_msg, &packet2);
1371 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1372
1373 memset(&packet2, 0, sizeof(packet2));
1374 mavlink_msg_local_position_ned_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz );
1375 mavlink_msg_local_position_ned_decode(last_msg, &packet2);
1376 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1377
1378#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1379 MAVLINK_ASSERT(mavlink_get_message_info_by_name("LOCAL_POSITION_NED") != NULL);
1380 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOCAL_POSITION_NED) != NULL);
1381#endif
1382}
1383
1384static void mavlink_test_rc_channels_scaled(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1385{
1386#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1387 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1388 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RC_CHANNELS_SCALED >= 256) {
1389 return;
1390 }
1391#endif
1392 mavlink_message_t msg;
1393 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1394 uint16_t i;
1395 mavlink_rc_channels_scaled_t packet_in = {
1396 963497464,17443,17547,17651,17755,17859,17963,18067,18171,65,132
1397 };
1398 mavlink_rc_channels_scaled_t packet1, packet2;
1399 memset(&packet1, 0, sizeof(packet1));
1400 packet1.time_boot_ms = packet_in.time_boot_ms;
1401 packet1.chan1_scaled = packet_in.chan1_scaled;
1402 packet1.chan2_scaled = packet_in.chan2_scaled;
1403 packet1.chan3_scaled = packet_in.chan3_scaled;
1404 packet1.chan4_scaled = packet_in.chan4_scaled;
1405 packet1.chan5_scaled = packet_in.chan5_scaled;
1406 packet1.chan6_scaled = packet_in.chan6_scaled;
1407 packet1.chan7_scaled = packet_in.chan7_scaled;
1408 packet1.chan8_scaled = packet_in.chan8_scaled;
1409 packet1.port = packet_in.port;
1410 packet1.rssi = packet_in.rssi;
1411
1412
1413#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1414 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1415 // cope with extensions
1416 memset(MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN);
1417 }
1418#endif
1419 memset(&packet2, 0, sizeof(packet2));
1420 mavlink_msg_rc_channels_scaled_encode(system_id, component_id, &msg, &packet1);
1421 mavlink_msg_rc_channels_scaled_decode(&msg, &packet2);
1422 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1423
1424 memset(&packet2, 0, sizeof(packet2));
1425 mavlink_msg_rc_channels_scaled_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.port , packet1.chan1_scaled , packet1.chan2_scaled , packet1.chan3_scaled , packet1.chan4_scaled , packet1.chan5_scaled , packet1.chan6_scaled , packet1.chan7_scaled , packet1.chan8_scaled , packet1.rssi );
1426 mavlink_msg_rc_channels_scaled_decode(&msg, &packet2);
1427 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1428
1429 memset(&packet2, 0, sizeof(packet2));
1430 mavlink_msg_rc_channels_scaled_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.port , packet1.chan1_scaled , packet1.chan2_scaled , packet1.chan3_scaled , packet1.chan4_scaled , packet1.chan5_scaled , packet1.chan6_scaled , packet1.chan7_scaled , packet1.chan8_scaled , packet1.rssi );
1431 mavlink_msg_rc_channels_scaled_decode(&msg, &packet2);
1432 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1433
1434 memset(&packet2, 0, sizeof(packet2));
1435 mavlink_msg_to_send_buffer(buffer, &msg);
1436 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1437 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1438 }
1439 mavlink_msg_rc_channels_scaled_decode(last_msg, &packet2);
1440 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1441
1442 memset(&packet2, 0, sizeof(packet2));
1443 mavlink_msg_rc_channels_scaled_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.port , packet1.chan1_scaled , packet1.chan2_scaled , packet1.chan3_scaled , packet1.chan4_scaled , packet1.chan5_scaled , packet1.chan6_scaled , packet1.chan7_scaled , packet1.chan8_scaled , packet1.rssi );
1444 mavlink_msg_rc_channels_scaled_decode(last_msg, &packet2);
1445 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1446
1447#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1448 MAVLINK_ASSERT(mavlink_get_message_info_by_name("RC_CHANNELS_SCALED") != NULL);
1449 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_RC_CHANNELS_SCALED) != NULL);
1450#endif
1451}
1452
1453static void mavlink_test_rc_channels_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1454{
1455#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1456 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1457 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RC_CHANNELS_RAW >= 256) {
1458 return;
1459 }
1460#endif
1461 mavlink_message_t msg;
1462 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1463 uint16_t i;
1464 mavlink_rc_channels_raw_t packet_in = {
1465 963497464,17443,17547,17651,17755,17859,17963,18067,18171,65,132
1466 };
1467 mavlink_rc_channels_raw_t packet1, packet2;
1468 memset(&packet1, 0, sizeof(packet1));
1469 packet1.time_boot_ms = packet_in.time_boot_ms;
1470 packet1.chan1_raw = packet_in.chan1_raw;
1471 packet1.chan2_raw = packet_in.chan2_raw;
1472 packet1.chan3_raw = packet_in.chan3_raw;
1473 packet1.chan4_raw = packet_in.chan4_raw;
1474 packet1.chan5_raw = packet_in.chan5_raw;
1475 packet1.chan6_raw = packet_in.chan6_raw;
1476 packet1.chan7_raw = packet_in.chan7_raw;
1477 packet1.chan8_raw = packet_in.chan8_raw;
1478 packet1.port = packet_in.port;
1479 packet1.rssi = packet_in.rssi;
1480
1481
1482#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1483 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1484 // cope with extensions
1485 memset(MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN);
1486 }
1487#endif
1488 memset(&packet2, 0, sizeof(packet2));
1489 mavlink_msg_rc_channels_raw_encode(system_id, component_id, &msg, &packet1);
1490 mavlink_msg_rc_channels_raw_decode(&msg, &packet2);
1491 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1492
1493 memset(&packet2, 0, sizeof(packet2));
1494 mavlink_msg_rc_channels_raw_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.port , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.rssi );
1495 mavlink_msg_rc_channels_raw_decode(&msg, &packet2);
1496 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1497
1498 memset(&packet2, 0, sizeof(packet2));
1499 mavlink_msg_rc_channels_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.port , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.rssi );
1500 mavlink_msg_rc_channels_raw_decode(&msg, &packet2);
1501 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1502
1503 memset(&packet2, 0, sizeof(packet2));
1504 mavlink_msg_to_send_buffer(buffer, &msg);
1505 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1506 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1507 }
1508 mavlink_msg_rc_channels_raw_decode(last_msg, &packet2);
1509 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1510
1511 memset(&packet2, 0, sizeof(packet2));
1512 mavlink_msg_rc_channels_raw_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.port , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.rssi );
1513 mavlink_msg_rc_channels_raw_decode(last_msg, &packet2);
1514 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1515
1516#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1517 MAVLINK_ASSERT(mavlink_get_message_info_by_name("RC_CHANNELS_RAW") != NULL);
1518 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_RC_CHANNELS_RAW) != NULL);
1519#endif
1520}
1521
1522static void mavlink_test_servo_output_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1523{
1524#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1525 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1526 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERVO_OUTPUT_RAW >= 256) {
1527 return;
1528 }
1529#endif
1530 mavlink_message_t msg;
1531 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1532 uint16_t i;
1533 mavlink_servo_output_raw_t packet_in = {
1534 963497464,17443,17547,17651,17755,17859,17963,18067,18171,65,18327,18431,18535,18639,18743,18847,18951,19055
1535 };
1536 mavlink_servo_output_raw_t packet1, packet2;
1537 memset(&packet1, 0, sizeof(packet1));
1538 packet1.time_usec = packet_in.time_usec;
1539 packet1.servo1_raw = packet_in.servo1_raw;
1540 packet1.servo2_raw = packet_in.servo2_raw;
1541 packet1.servo3_raw = packet_in.servo3_raw;
1542 packet1.servo4_raw = packet_in.servo4_raw;
1543 packet1.servo5_raw = packet_in.servo5_raw;
1544 packet1.servo6_raw = packet_in.servo6_raw;
1545 packet1.servo7_raw = packet_in.servo7_raw;
1546 packet1.servo8_raw = packet_in.servo8_raw;
1547 packet1.port = packet_in.port;
1548 packet1.servo9_raw = packet_in.servo9_raw;
1549 packet1.servo10_raw = packet_in.servo10_raw;
1550 packet1.servo11_raw = packet_in.servo11_raw;
1551 packet1.servo12_raw = packet_in.servo12_raw;
1552 packet1.servo13_raw = packet_in.servo13_raw;
1553 packet1.servo14_raw = packet_in.servo14_raw;
1554 packet1.servo15_raw = packet_in.servo15_raw;
1555 packet1.servo16_raw = packet_in.servo16_raw;
1556
1557
1558#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1559 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1560 // cope with extensions
1561 memset(MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN);
1562 }
1563#endif
1564 memset(&packet2, 0, sizeof(packet2));
1565 mavlink_msg_servo_output_raw_encode(system_id, component_id, &msg, &packet1);
1566 mavlink_msg_servo_output_raw_decode(&msg, &packet2);
1567 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1568
1569 memset(&packet2, 0, sizeof(packet2));
1570 mavlink_msg_servo_output_raw_pack(system_id, component_id, &msg , packet1.time_usec , packet1.port , packet1.servo1_raw , packet1.servo2_raw , packet1.servo3_raw , packet1.servo4_raw , packet1.servo5_raw , packet1.servo6_raw , packet1.servo7_raw , packet1.servo8_raw , packet1.servo9_raw , packet1.servo10_raw , packet1.servo11_raw , packet1.servo12_raw , packet1.servo13_raw , packet1.servo14_raw , packet1.servo15_raw , packet1.servo16_raw );
1571 mavlink_msg_servo_output_raw_decode(&msg, &packet2);
1572 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1573
1574 memset(&packet2, 0, sizeof(packet2));
1575 mavlink_msg_servo_output_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.port , packet1.servo1_raw , packet1.servo2_raw , packet1.servo3_raw , packet1.servo4_raw , packet1.servo5_raw , packet1.servo6_raw , packet1.servo7_raw , packet1.servo8_raw , packet1.servo9_raw , packet1.servo10_raw , packet1.servo11_raw , packet1.servo12_raw , packet1.servo13_raw , packet1.servo14_raw , packet1.servo15_raw , packet1.servo16_raw );
1576 mavlink_msg_servo_output_raw_decode(&msg, &packet2);
1577 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1578
1579 memset(&packet2, 0, sizeof(packet2));
1580 mavlink_msg_to_send_buffer(buffer, &msg);
1581 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1582 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1583 }
1584 mavlink_msg_servo_output_raw_decode(last_msg, &packet2);
1585 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1586
1587 memset(&packet2, 0, sizeof(packet2));
1588 mavlink_msg_servo_output_raw_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.port , packet1.servo1_raw , packet1.servo2_raw , packet1.servo3_raw , packet1.servo4_raw , packet1.servo5_raw , packet1.servo6_raw , packet1.servo7_raw , packet1.servo8_raw , packet1.servo9_raw , packet1.servo10_raw , packet1.servo11_raw , packet1.servo12_raw , packet1.servo13_raw , packet1.servo14_raw , packet1.servo15_raw , packet1.servo16_raw );
1589 mavlink_msg_servo_output_raw_decode(last_msg, &packet2);
1590 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1591
1592#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1593 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SERVO_OUTPUT_RAW") != NULL);
1594 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SERVO_OUTPUT_RAW) != NULL);
1595#endif
1596}
1597
1598static void mavlink_test_mission_request_partial_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1599{
1600#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1601 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1602 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST >= 256) {
1603 return;
1604 }
1605#endif
1606 mavlink_message_t msg;
1607 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1608 uint16_t i;
1609 mavlink_mission_request_partial_list_t packet_in = {
1610 17235,17339,17,84,151
1611 };
1612 mavlink_mission_request_partial_list_t packet1, packet2;
1613 memset(&packet1, 0, sizeof(packet1));
1614 packet1.start_index = packet_in.start_index;
1615 packet1.end_index = packet_in.end_index;
1616 packet1.target_system = packet_in.target_system;
1617 packet1.target_component = packet_in.target_component;
1618 packet1.mission_type = packet_in.mission_type;
1619
1620
1621#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1622 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1623 // cope with extensions
1624 memset(MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN);
1625 }
1626#endif
1627 memset(&packet2, 0, sizeof(packet2));
1628 mavlink_msg_mission_request_partial_list_encode(system_id, component_id, &msg, &packet1);
1629 mavlink_msg_mission_request_partial_list_decode(&msg, &packet2);
1630 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1631
1632 memset(&packet2, 0, sizeof(packet2));
1633 mavlink_msg_mission_request_partial_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index , packet1.mission_type );
1634 mavlink_msg_mission_request_partial_list_decode(&msg, &packet2);
1635 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1636
1637 memset(&packet2, 0, sizeof(packet2));
1638 mavlink_msg_mission_request_partial_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index , packet1.mission_type );
1639 mavlink_msg_mission_request_partial_list_decode(&msg, &packet2);
1640 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1641
1642 memset(&packet2, 0, sizeof(packet2));
1643 mavlink_msg_to_send_buffer(buffer, &msg);
1644 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1645 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1646 }
1647 mavlink_msg_mission_request_partial_list_decode(last_msg, &packet2);
1648 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1649
1650 memset(&packet2, 0, sizeof(packet2));
1651 mavlink_msg_mission_request_partial_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index , packet1.mission_type );
1652 mavlink_msg_mission_request_partial_list_decode(last_msg, &packet2);
1653 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1654
1655#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1656 MAVLINK_ASSERT(mavlink_get_message_info_by_name("MISSION_REQUEST_PARTIAL_LIST") != NULL);
1657 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST) != NULL);
1658#endif
1659}
1660
1661static void mavlink_test_mission_write_partial_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1662{
1663#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1664 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1665 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST >= 256) {
1666 return;
1667 }
1668#endif
1669 mavlink_message_t msg;
1670 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1671 uint16_t i;
1672 mavlink_mission_write_partial_list_t packet_in = {
1673 17235,17339,17,84,151
1674 };
1675 mavlink_mission_write_partial_list_t packet1, packet2;
1676 memset(&packet1, 0, sizeof(packet1));
1677 packet1.start_index = packet_in.start_index;
1678 packet1.end_index = packet_in.end_index;
1679 packet1.target_system = packet_in.target_system;
1680 packet1.target_component = packet_in.target_component;
1681 packet1.mission_type = packet_in.mission_type;
1682
1683
1684#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1685 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1686 // cope with extensions
1687 memset(MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN);
1688 }
1689#endif
1690 memset(&packet2, 0, sizeof(packet2));
1691 mavlink_msg_mission_write_partial_list_encode(system_id, component_id, &msg, &packet1);
1692 mavlink_msg_mission_write_partial_list_decode(&msg, &packet2);
1693 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1694
1695 memset(&packet2, 0, sizeof(packet2));
1696 mavlink_msg_mission_write_partial_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index , packet1.mission_type );
1697 mavlink_msg_mission_write_partial_list_decode(&msg, &packet2);
1698 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1699
1700 memset(&packet2, 0, sizeof(packet2));
1701 mavlink_msg_mission_write_partial_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index , packet1.mission_type );
1702 mavlink_msg_mission_write_partial_list_decode(&msg, &packet2);
1703 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1704
1705 memset(&packet2, 0, sizeof(packet2));
1706 mavlink_msg_to_send_buffer(buffer, &msg);
1707 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1708 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1709 }
1710 mavlink_msg_mission_write_partial_list_decode(last_msg, &packet2);
1711 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1712
1713 memset(&packet2, 0, sizeof(packet2));
1714 mavlink_msg_mission_write_partial_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index , packet1.mission_type );
1715 mavlink_msg_mission_write_partial_list_decode(last_msg, &packet2);
1716 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1717
1718#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1719 MAVLINK_ASSERT(mavlink_get_message_info_by_name("MISSION_WRITE_PARTIAL_LIST") != NULL);
1720 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST) != NULL);
1721#endif
1722}
1723
1724static void mavlink_test_mission_item(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1725{
1726#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1727 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1728 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_ITEM >= 256) {
1729 return;
1730 }
1731#endif
1732 mavlink_message_t msg;
1733 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1734 uint16_t i;
1735 mavlink_mission_item_t packet_in = {
1736 17.0,45.0,73.0,101.0,129.0,157.0,185.0,18691,18795,101,168,235,46,113,180
1737 };
1738 mavlink_mission_item_t packet1, packet2;
1739 memset(&packet1, 0, sizeof(packet1));
1740 packet1.param1 = packet_in.param1;
1741 packet1.param2 = packet_in.param2;
1742 packet1.param3 = packet_in.param3;
1743 packet1.param4 = packet_in.param4;
1744 packet1.x = packet_in.x;
1745 packet1.y = packet_in.y;
1746 packet1.z = packet_in.z;
1747 packet1.seq = packet_in.seq;
1748 packet1.command = packet_in.command;
1749 packet1.target_system = packet_in.target_system;
1750 packet1.target_component = packet_in.target_component;
1751 packet1.frame = packet_in.frame;
1752 packet1.current = packet_in.current;
1753 packet1.autocontinue = packet_in.autocontinue;
1754 packet1.mission_type = packet_in.mission_type;
1755
1756
1757#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1758 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1759 // cope with extensions
1760 memset(MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN);
1761 }
1762#endif
1763 memset(&packet2, 0, sizeof(packet2));
1764 mavlink_msg_mission_item_encode(system_id, component_id, &msg, &packet1);
1765 mavlink_msg_mission_item_decode(&msg, &packet2);
1766 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1767
1768 memset(&packet2, 0, sizeof(packet2));
1769 mavlink_msg_mission_item_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z , packet1.mission_type );
1770 mavlink_msg_mission_item_decode(&msg, &packet2);
1771 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1772
1773 memset(&packet2, 0, sizeof(packet2));
1774 mavlink_msg_mission_item_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z , packet1.mission_type );
1775 mavlink_msg_mission_item_decode(&msg, &packet2);
1776 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1777
1778 memset(&packet2, 0, sizeof(packet2));
1779 mavlink_msg_to_send_buffer(buffer, &msg);
1780 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1781 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1782 }
1783 mavlink_msg_mission_item_decode(last_msg, &packet2);
1784 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1785
1786 memset(&packet2, 0, sizeof(packet2));
1787 mavlink_msg_mission_item_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z , packet1.mission_type );
1788 mavlink_msg_mission_item_decode(last_msg, &packet2);
1789 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1790
1791#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1792 MAVLINK_ASSERT(mavlink_get_message_info_by_name("MISSION_ITEM") != NULL);
1793 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_ITEM) != NULL);
1794#endif
1795}
1796
1797static void mavlink_test_mission_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1798{
1799#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1800 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1801 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_REQUEST >= 256) {
1802 return;
1803 }
1804#endif
1805 mavlink_message_t msg;
1806 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1807 uint16_t i;
1808 mavlink_mission_request_t packet_in = {
1809 17235,139,206,17
1810 };
1811 mavlink_mission_request_t packet1, packet2;
1812 memset(&packet1, 0, sizeof(packet1));
1813 packet1.seq = packet_in.seq;
1814 packet1.target_system = packet_in.target_system;
1815 packet1.target_component = packet_in.target_component;
1816 packet1.mission_type = packet_in.mission_type;
1817
1818
1819#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1820 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1821 // cope with extensions
1822 memset(MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN);
1823 }
1824#endif
1825 memset(&packet2, 0, sizeof(packet2));
1826 mavlink_msg_mission_request_encode(system_id, component_id, &msg, &packet1);
1827 mavlink_msg_mission_request_decode(&msg, &packet2);
1828 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1829
1830 memset(&packet2, 0, sizeof(packet2));
1831 mavlink_msg_mission_request_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.mission_type );
1832 mavlink_msg_mission_request_decode(&msg, &packet2);
1833 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1834
1835 memset(&packet2, 0, sizeof(packet2));
1836 mavlink_msg_mission_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.mission_type );
1837 mavlink_msg_mission_request_decode(&msg, &packet2);
1838 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1839
1840 memset(&packet2, 0, sizeof(packet2));
1841 mavlink_msg_to_send_buffer(buffer, &msg);
1842 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1843 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1844 }
1845 mavlink_msg_mission_request_decode(last_msg, &packet2);
1846 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1847
1848 memset(&packet2, 0, sizeof(packet2));
1849 mavlink_msg_mission_request_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seq , packet1.mission_type );
1850 mavlink_msg_mission_request_decode(last_msg, &packet2);
1851 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1852
1853#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1854 MAVLINK_ASSERT(mavlink_get_message_info_by_name("MISSION_REQUEST") != NULL);
1855 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_REQUEST) != NULL);
1856#endif
1857}
1858
1859static void mavlink_test_mission_set_current(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1860{
1861#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1862 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1863 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_SET_CURRENT >= 256) {
1864 return;
1865 }
1866#endif
1867 mavlink_message_t msg;
1868 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1869 uint16_t i;
1870 mavlink_mission_set_current_t packet_in = {
1871 17235,139,206
1872 };
1873 mavlink_mission_set_current_t packet1, packet2;
1874 memset(&packet1, 0, sizeof(packet1));
1875 packet1.seq = packet_in.seq;
1876 packet1.target_system = packet_in.target_system;
1877 packet1.target_component = packet_in.target_component;
1878
1879
1880#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1881 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1882 // cope with extensions
1883 memset(MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN);
1884 }
1885#endif
1886 memset(&packet2, 0, sizeof(packet2));
1887 mavlink_msg_mission_set_current_encode(system_id, component_id, &msg, &packet1);
1888 mavlink_msg_mission_set_current_decode(&msg, &packet2);
1889 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1890
1891 memset(&packet2, 0, sizeof(packet2));
1892 mavlink_msg_mission_set_current_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq );
1893 mavlink_msg_mission_set_current_decode(&msg, &packet2);
1894 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1895
1896 memset(&packet2, 0, sizeof(packet2));
1897 mavlink_msg_mission_set_current_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq );
1898 mavlink_msg_mission_set_current_decode(&msg, &packet2);
1899 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1900
1901 memset(&packet2, 0, sizeof(packet2));
1902 mavlink_msg_to_send_buffer(buffer, &msg);
1903 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1904 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1905 }
1906 mavlink_msg_mission_set_current_decode(last_msg, &packet2);
1907 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1908
1909 memset(&packet2, 0, sizeof(packet2));
1910 mavlink_msg_mission_set_current_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seq );
1911 mavlink_msg_mission_set_current_decode(last_msg, &packet2);
1912 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1913
1914#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1915 MAVLINK_ASSERT(mavlink_get_message_info_by_name("MISSION_SET_CURRENT") != NULL);
1916 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_SET_CURRENT) != NULL);
1917#endif
1918}
1919
1920static void mavlink_test_mission_current(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1921{
1922#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1923 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1924 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_CURRENT >= 256) {
1925 return;
1926 }
1927#endif
1928 mavlink_message_t msg;
1929 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1930 uint16_t i;
1931 mavlink_mission_current_t packet_in = {
1932 17235,17339,17,84,963497776,963497984,963498192
1933 };
1934 mavlink_mission_current_t packet1, packet2;
1935 memset(&packet1, 0, sizeof(packet1));
1936 packet1.seq = packet_in.seq;
1937 packet1.total = packet_in.total;
1938 packet1.mission_state = packet_in.mission_state;
1939 packet1.mission_mode = packet_in.mission_mode;
1940 packet1.mission_id = packet_in.mission_id;
1941 packet1.fence_id = packet_in.fence_id;
1942 packet1.rally_points_id = packet_in.rally_points_id;
1943
1944
1945#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1946 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1947 // cope with extensions
1948 memset(MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN);
1949 }
1950#endif
1951 memset(&packet2, 0, sizeof(packet2));
1952 mavlink_msg_mission_current_encode(system_id, component_id, &msg, &packet1);
1953 mavlink_msg_mission_current_decode(&msg, &packet2);
1954 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1955
1956 memset(&packet2, 0, sizeof(packet2));
1957 mavlink_msg_mission_current_pack(system_id, component_id, &msg , packet1.seq , packet1.total , packet1.mission_state , packet1.mission_mode , packet1.mission_id , packet1.fence_id , packet1.rally_points_id );
1958 mavlink_msg_mission_current_decode(&msg, &packet2);
1959 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1960
1961 memset(&packet2, 0, sizeof(packet2));
1962 mavlink_msg_mission_current_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seq , packet1.total , packet1.mission_state , packet1.mission_mode , packet1.mission_id , packet1.fence_id , packet1.rally_points_id );
1963 mavlink_msg_mission_current_decode(&msg, &packet2);
1964 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1965
1966 memset(&packet2, 0, sizeof(packet2));
1967 mavlink_msg_to_send_buffer(buffer, &msg);
1968 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1969 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1970 }
1971 mavlink_msg_mission_current_decode(last_msg, &packet2);
1972 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1973
1974 memset(&packet2, 0, sizeof(packet2));
1975 mavlink_msg_mission_current_send(MAVLINK_COMM_1 , packet1.seq , packet1.total , packet1.mission_state , packet1.mission_mode , packet1.mission_id , packet1.fence_id , packet1.rally_points_id );
1976 mavlink_msg_mission_current_decode(last_msg, &packet2);
1977 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1978
1979#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1980 MAVLINK_ASSERT(mavlink_get_message_info_by_name("MISSION_CURRENT") != NULL);
1981 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_CURRENT) != NULL);
1982#endif
1983}
1984
1985static void mavlink_test_mission_request_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1986{
1987#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1988 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1989 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_REQUEST_LIST >= 256) {
1990 return;
1991 }
1992#endif
1993 mavlink_message_t msg;
1994 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1995 uint16_t i;
1996 mavlink_mission_request_list_t packet_in = {
1997 5,72,139
1998 };
1999 mavlink_mission_request_list_t packet1, packet2;
2000 memset(&packet1, 0, sizeof(packet1));
2001 packet1.target_system = packet_in.target_system;
2002 packet1.target_component = packet_in.target_component;
2003 packet1.mission_type = packet_in.mission_type;
2004
2005
2006#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2007 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2008 // cope with extensions
2009 memset(MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN);
2010 }
2011#endif
2012 memset(&packet2, 0, sizeof(packet2));
2013 mavlink_msg_mission_request_list_encode(system_id, component_id, &msg, &packet1);
2014 mavlink_msg_mission_request_list_decode(&msg, &packet2);
2015 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2016
2017 memset(&packet2, 0, sizeof(packet2));
2018 mavlink_msg_mission_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.mission_type );
2019 mavlink_msg_mission_request_list_decode(&msg, &packet2);
2020 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2021
2022 memset(&packet2, 0, sizeof(packet2));
2023 mavlink_msg_mission_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.mission_type );
2024 mavlink_msg_mission_request_list_decode(&msg, &packet2);
2025 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2026
2027 memset(&packet2, 0, sizeof(packet2));
2028 mavlink_msg_to_send_buffer(buffer, &msg);
2029 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2030 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2031 }
2032 mavlink_msg_mission_request_list_decode(last_msg, &packet2);
2033 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2034
2035 memset(&packet2, 0, sizeof(packet2));
2036 mavlink_msg_mission_request_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.mission_type );
2037 mavlink_msg_mission_request_list_decode(last_msg, &packet2);
2038 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2039
2040#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2041 MAVLINK_ASSERT(mavlink_get_message_info_by_name("MISSION_REQUEST_LIST") != NULL);
2042 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_REQUEST_LIST) != NULL);
2043#endif
2044}
2045
2046static void mavlink_test_mission_count(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2047{
2048#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2049 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2050 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_COUNT >= 256) {
2051 return;
2052 }
2053#endif
2054 mavlink_message_t msg;
2055 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2056 uint16_t i;
2057 mavlink_mission_count_t packet_in = {
2058 17235,139,206,17,963497724
2059 };
2060 mavlink_mission_count_t packet1, packet2;
2061 memset(&packet1, 0, sizeof(packet1));
2062 packet1.count = packet_in.count;
2063 packet1.target_system = packet_in.target_system;
2064 packet1.target_component = packet_in.target_component;
2065 packet1.mission_type = packet_in.mission_type;
2066 packet1.opaque_id = packet_in.opaque_id;
2067
2068
2069#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2070 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2071 // cope with extensions
2072 memset(MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN);
2073 }
2074#endif
2075 memset(&packet2, 0, sizeof(packet2));
2076 mavlink_msg_mission_count_encode(system_id, component_id, &msg, &packet1);
2077 mavlink_msg_mission_count_decode(&msg, &packet2);
2078 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2079
2080 memset(&packet2, 0, sizeof(packet2));
2081 mavlink_msg_mission_count_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.count , packet1.mission_type , packet1.opaque_id );
2082 mavlink_msg_mission_count_decode(&msg, &packet2);
2083 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2084
2085 memset(&packet2, 0, sizeof(packet2));
2086 mavlink_msg_mission_count_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.count , packet1.mission_type , packet1.opaque_id );
2087 mavlink_msg_mission_count_decode(&msg, &packet2);
2088 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2089
2090 memset(&packet2, 0, sizeof(packet2));
2091 mavlink_msg_to_send_buffer(buffer, &msg);
2092 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2093 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2094 }
2095 mavlink_msg_mission_count_decode(last_msg, &packet2);
2096 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2097
2098 memset(&packet2, 0, sizeof(packet2));
2099 mavlink_msg_mission_count_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.count , packet1.mission_type , packet1.opaque_id );
2100 mavlink_msg_mission_count_decode(last_msg, &packet2);
2101 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2102
2103#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2104 MAVLINK_ASSERT(mavlink_get_message_info_by_name("MISSION_COUNT") != NULL);
2105 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_COUNT) != NULL);
2106#endif
2107}
2108
2109static void mavlink_test_mission_clear_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2110{
2111#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2112 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2113 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_CLEAR_ALL >= 256) {
2114 return;
2115 }
2116#endif
2117 mavlink_message_t msg;
2118 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2119 uint16_t i;
2120 mavlink_mission_clear_all_t packet_in = {
2121 5,72,139
2122 };
2123 mavlink_mission_clear_all_t packet1, packet2;
2124 memset(&packet1, 0, sizeof(packet1));
2125 packet1.target_system = packet_in.target_system;
2126 packet1.target_component = packet_in.target_component;
2127 packet1.mission_type = packet_in.mission_type;
2128
2129
2130#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2131 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2132 // cope with extensions
2133 memset(MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN);
2134 }
2135#endif
2136 memset(&packet2, 0, sizeof(packet2));
2137 mavlink_msg_mission_clear_all_encode(system_id, component_id, &msg, &packet1);
2138 mavlink_msg_mission_clear_all_decode(&msg, &packet2);
2139 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2140
2141 memset(&packet2, 0, sizeof(packet2));
2142 mavlink_msg_mission_clear_all_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.mission_type );
2143 mavlink_msg_mission_clear_all_decode(&msg, &packet2);
2144 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2145
2146 memset(&packet2, 0, sizeof(packet2));
2147 mavlink_msg_mission_clear_all_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.mission_type );
2148 mavlink_msg_mission_clear_all_decode(&msg, &packet2);
2149 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2150
2151 memset(&packet2, 0, sizeof(packet2));
2152 mavlink_msg_to_send_buffer(buffer, &msg);
2153 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2154 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2155 }
2156 mavlink_msg_mission_clear_all_decode(last_msg, &packet2);
2157 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2158
2159 memset(&packet2, 0, sizeof(packet2));
2160 mavlink_msg_mission_clear_all_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.mission_type );
2161 mavlink_msg_mission_clear_all_decode(last_msg, &packet2);
2162 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2163
2164#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2165 MAVLINK_ASSERT(mavlink_get_message_info_by_name("MISSION_CLEAR_ALL") != NULL);
2166 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_CLEAR_ALL) != NULL);
2167#endif
2168}
2169
2170static void mavlink_test_mission_item_reached(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2171{
2172#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2173 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2174 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_ITEM_REACHED >= 256) {
2175 return;
2176 }
2177#endif
2178 mavlink_message_t msg;
2179 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2180 uint16_t i;
2181 mavlink_mission_item_reached_t packet_in = {
2182 17235
2183 };
2184 mavlink_mission_item_reached_t packet1, packet2;
2185 memset(&packet1, 0, sizeof(packet1));
2186 packet1.seq = packet_in.seq;
2187
2188
2189#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2190 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2191 // cope with extensions
2192 memset(MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN);
2193 }
2194#endif
2195 memset(&packet2, 0, sizeof(packet2));
2196 mavlink_msg_mission_item_reached_encode(system_id, component_id, &msg, &packet1);
2197 mavlink_msg_mission_item_reached_decode(&msg, &packet2);
2198 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2199
2200 memset(&packet2, 0, sizeof(packet2));
2201 mavlink_msg_mission_item_reached_pack(system_id, component_id, &msg , packet1.seq );
2202 mavlink_msg_mission_item_reached_decode(&msg, &packet2);
2203 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2204
2205 memset(&packet2, 0, sizeof(packet2));
2206 mavlink_msg_mission_item_reached_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seq );
2207 mavlink_msg_mission_item_reached_decode(&msg, &packet2);
2208 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2209
2210 memset(&packet2, 0, sizeof(packet2));
2211 mavlink_msg_to_send_buffer(buffer, &msg);
2212 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2213 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2214 }
2215 mavlink_msg_mission_item_reached_decode(last_msg, &packet2);
2216 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2217
2218 memset(&packet2, 0, sizeof(packet2));
2219 mavlink_msg_mission_item_reached_send(MAVLINK_COMM_1 , packet1.seq );
2220 mavlink_msg_mission_item_reached_decode(last_msg, &packet2);
2221 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2222
2223#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2224 MAVLINK_ASSERT(mavlink_get_message_info_by_name("MISSION_ITEM_REACHED") != NULL);
2225 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_ITEM_REACHED) != NULL);
2226#endif
2227}
2228
2229static void mavlink_test_mission_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2230{
2231#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2232 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2233 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_ACK >= 256) {
2234 return;
2235 }
2236#endif
2237 mavlink_message_t msg;
2238 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2239 uint16_t i;
2240 mavlink_mission_ack_t packet_in = {
2241 5,72,139,206,963497672
2242 };
2243 mavlink_mission_ack_t packet1, packet2;
2244 memset(&packet1, 0, sizeof(packet1));
2245 packet1.target_system = packet_in.target_system;
2246 packet1.target_component = packet_in.target_component;
2247 packet1.type = packet_in.type;
2248 packet1.mission_type = packet_in.mission_type;
2249 packet1.opaque_id = packet_in.opaque_id;
2250
2251
2252#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2253 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2254 // cope with extensions
2255 memset(MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN);
2256 }
2257#endif
2258 memset(&packet2, 0, sizeof(packet2));
2259 mavlink_msg_mission_ack_encode(system_id, component_id, &msg, &packet1);
2260 mavlink_msg_mission_ack_decode(&msg, &packet2);
2261 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2262
2263 memset(&packet2, 0, sizeof(packet2));
2264 mavlink_msg_mission_ack_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.type , packet1.mission_type , packet1.opaque_id );
2265 mavlink_msg_mission_ack_decode(&msg, &packet2);
2266 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2267
2268 memset(&packet2, 0, sizeof(packet2));
2269 mavlink_msg_mission_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.type , packet1.mission_type , packet1.opaque_id );
2270 mavlink_msg_mission_ack_decode(&msg, &packet2);
2271 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2272
2273 memset(&packet2, 0, sizeof(packet2));
2274 mavlink_msg_to_send_buffer(buffer, &msg);
2275 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2276 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2277 }
2278 mavlink_msg_mission_ack_decode(last_msg, &packet2);
2279 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2280
2281 memset(&packet2, 0, sizeof(packet2));
2282 mavlink_msg_mission_ack_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.type , packet1.mission_type , packet1.opaque_id );
2283 mavlink_msg_mission_ack_decode(last_msg, &packet2);
2284 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2285
2286#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2287 MAVLINK_ASSERT(mavlink_get_message_info_by_name("MISSION_ACK") != NULL);
2288 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_ACK) != NULL);
2289#endif
2290}
2291
2292static void mavlink_test_set_gps_global_origin(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2293{
2294#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2295 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2296 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN >= 256) {
2297 return;
2298 }
2299#endif
2300 mavlink_message_t msg;
2301 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2302 uint16_t i;
2303 mavlink_set_gps_global_origin_t packet_in = {
2304 963497464,963497672,963497880,41,93372036854776626ULL
2305 };
2306 mavlink_set_gps_global_origin_t packet1, packet2;
2307 memset(&packet1, 0, sizeof(packet1));
2308 packet1.latitude = packet_in.latitude;
2309 packet1.longitude = packet_in.longitude;
2310 packet1.altitude = packet_in.altitude;
2311 packet1.target_system = packet_in.target_system;
2312 packet1.time_usec = packet_in.time_usec;
2313
2314
2315#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2316 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2317 // cope with extensions
2318 memset(MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN);
2319 }
2320#endif
2321 memset(&packet2, 0, sizeof(packet2));
2322 mavlink_msg_set_gps_global_origin_encode(system_id, component_id, &msg, &packet1);
2323 mavlink_msg_set_gps_global_origin_decode(&msg, &packet2);
2324 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2325
2326 memset(&packet2, 0, sizeof(packet2));
2327 mavlink_msg_set_gps_global_origin_pack(system_id, component_id, &msg , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude , packet1.time_usec );
2328 mavlink_msg_set_gps_global_origin_decode(&msg, &packet2);
2329 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2330
2331 memset(&packet2, 0, sizeof(packet2));
2332 mavlink_msg_set_gps_global_origin_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude , packet1.time_usec );
2333 mavlink_msg_set_gps_global_origin_decode(&msg, &packet2);
2334 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2335
2336 memset(&packet2, 0, sizeof(packet2));
2337 mavlink_msg_to_send_buffer(buffer, &msg);
2338 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2339 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2340 }
2341 mavlink_msg_set_gps_global_origin_decode(last_msg, &packet2);
2342 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2343
2344 memset(&packet2, 0, sizeof(packet2));
2345 mavlink_msg_set_gps_global_origin_send(MAVLINK_COMM_1 , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude , packet1.time_usec );
2346 mavlink_msg_set_gps_global_origin_decode(last_msg, &packet2);
2347 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2348
2349#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2350 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SET_GPS_GLOBAL_ORIGIN") != NULL);
2351 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN) != NULL);
2352#endif
2353}
2354
2355static void mavlink_test_gps_global_origin(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2356{
2357#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2358 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2359 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN >= 256) {
2360 return;
2361 }
2362#endif
2363 mavlink_message_t msg;
2364 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2365 uint16_t i;
2366 mavlink_gps_global_origin_t packet_in = {
2367 963497464,963497672,963497880,93372036854776563ULL
2368 };
2369 mavlink_gps_global_origin_t packet1, packet2;
2370 memset(&packet1, 0, sizeof(packet1));
2371 packet1.latitude = packet_in.latitude;
2372 packet1.longitude = packet_in.longitude;
2373 packet1.altitude = packet_in.altitude;
2374 packet1.time_usec = packet_in.time_usec;
2375
2376
2377#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2378 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2379 // cope with extensions
2380 memset(MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN);
2381 }
2382#endif
2383 memset(&packet2, 0, sizeof(packet2));
2384 mavlink_msg_gps_global_origin_encode(system_id, component_id, &msg, &packet1);
2385 mavlink_msg_gps_global_origin_decode(&msg, &packet2);
2386 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2387
2388 memset(&packet2, 0, sizeof(packet2));
2389 mavlink_msg_gps_global_origin_pack(system_id, component_id, &msg , packet1.latitude , packet1.longitude , packet1.altitude , packet1.time_usec );
2390 mavlink_msg_gps_global_origin_decode(&msg, &packet2);
2391 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2392
2393 memset(&packet2, 0, sizeof(packet2));
2394 mavlink_msg_gps_global_origin_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.latitude , packet1.longitude , packet1.altitude , packet1.time_usec );
2395 mavlink_msg_gps_global_origin_decode(&msg, &packet2);
2396 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2397
2398 memset(&packet2, 0, sizeof(packet2));
2399 mavlink_msg_to_send_buffer(buffer, &msg);
2400 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2401 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2402 }
2403 mavlink_msg_gps_global_origin_decode(last_msg, &packet2);
2404 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2405
2406 memset(&packet2, 0, sizeof(packet2));
2407 mavlink_msg_gps_global_origin_send(MAVLINK_COMM_1 , packet1.latitude , packet1.longitude , packet1.altitude , packet1.time_usec );
2408 mavlink_msg_gps_global_origin_decode(last_msg, &packet2);
2409 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2410
2411#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2412 MAVLINK_ASSERT(mavlink_get_message_info_by_name("GPS_GLOBAL_ORIGIN") != NULL);
2413 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN) != NULL);
2414#endif
2415}
2416
2417static void mavlink_test_param_map_rc(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2418{
2419#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2420 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2421 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_MAP_RC >= 256) {
2422 return;
2423 }
2424#endif
2425 mavlink_message_t msg;
2426 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2427 uint16_t i;
2428 mavlink_param_map_rc_t packet_in = {
2429 17.0,45.0,73.0,101.0,18067,187,254,"UVWXYZABCDEFGHI",113
2430 };
2431 mavlink_param_map_rc_t packet1, packet2;
2432 memset(&packet1, 0, sizeof(packet1));
2433 packet1.param_value0 = packet_in.param_value0;
2434 packet1.scale = packet_in.scale;
2435 packet1.param_value_min = packet_in.param_value_min;
2436 packet1.param_value_max = packet_in.param_value_max;
2437 packet1.param_index = packet_in.param_index;
2438 packet1.target_system = packet_in.target_system;
2439 packet1.target_component = packet_in.target_component;
2440 packet1.parameter_rc_channel_index = packet_in.parameter_rc_channel_index;
2441
2442 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
2443
2444#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2445 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2446 // cope with extensions
2447 memset(MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN);
2448 }
2449#endif
2450 memset(&packet2, 0, sizeof(packet2));
2451 mavlink_msg_param_map_rc_encode(system_id, component_id, &msg, &packet1);
2452 mavlink_msg_param_map_rc_decode(&msg, &packet2);
2453 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2454
2455 memset(&packet2, 0, sizeof(packet2));
2456 mavlink_msg_param_map_rc_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.parameter_rc_channel_index , packet1.param_value0 , packet1.scale , packet1.param_value_min , packet1.param_value_max );
2457 mavlink_msg_param_map_rc_decode(&msg, &packet2);
2458 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2459
2460 memset(&packet2, 0, sizeof(packet2));
2461 mavlink_msg_param_map_rc_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.parameter_rc_channel_index , packet1.param_value0 , packet1.scale , packet1.param_value_min , packet1.param_value_max );
2462 mavlink_msg_param_map_rc_decode(&msg, &packet2);
2463 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2464
2465 memset(&packet2, 0, sizeof(packet2));
2466 mavlink_msg_to_send_buffer(buffer, &msg);
2467 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2468 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2469 }
2470 mavlink_msg_param_map_rc_decode(last_msg, &packet2);
2471 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2472
2473 memset(&packet2, 0, sizeof(packet2));
2474 mavlink_msg_param_map_rc_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.parameter_rc_channel_index , packet1.param_value0 , packet1.scale , packet1.param_value_min , packet1.param_value_max );
2475 mavlink_msg_param_map_rc_decode(last_msg, &packet2);
2476 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2477
2478#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2479 MAVLINK_ASSERT(mavlink_get_message_info_by_name("PARAM_MAP_RC") != NULL);
2480 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PARAM_MAP_RC) != NULL);
2481#endif
2482}
2483
2484static void mavlink_test_mission_request_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2485{
2486#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2487 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2488 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_REQUEST_INT >= 256) {
2489 return;
2490 }
2491#endif
2492 mavlink_message_t msg;
2493 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2494 uint16_t i;
2495 mavlink_mission_request_int_t packet_in = {
2496 17235,139,206,17
2497 };
2498 mavlink_mission_request_int_t packet1, packet2;
2499 memset(&packet1, 0, sizeof(packet1));
2500 packet1.seq = packet_in.seq;
2501 packet1.target_system = packet_in.target_system;
2502 packet1.target_component = packet_in.target_component;
2503 packet1.mission_type = packet_in.mission_type;
2504
2505
2506#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2507 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2508 // cope with extensions
2509 memset(MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN);
2510 }
2511#endif
2512 memset(&packet2, 0, sizeof(packet2));
2513 mavlink_msg_mission_request_int_encode(system_id, component_id, &msg, &packet1);
2514 mavlink_msg_mission_request_int_decode(&msg, &packet2);
2515 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2516
2517 memset(&packet2, 0, sizeof(packet2));
2518 mavlink_msg_mission_request_int_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.mission_type );
2519 mavlink_msg_mission_request_int_decode(&msg, &packet2);
2520 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2521
2522 memset(&packet2, 0, sizeof(packet2));
2523 mavlink_msg_mission_request_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.mission_type );
2524 mavlink_msg_mission_request_int_decode(&msg, &packet2);
2525 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2526
2527 memset(&packet2, 0, sizeof(packet2));
2528 mavlink_msg_to_send_buffer(buffer, &msg);
2529 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2530 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2531 }
2532 mavlink_msg_mission_request_int_decode(last_msg, &packet2);
2533 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2534
2535 memset(&packet2, 0, sizeof(packet2));
2536 mavlink_msg_mission_request_int_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seq , packet1.mission_type );
2537 mavlink_msg_mission_request_int_decode(last_msg, &packet2);
2538 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2539
2540#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2541 MAVLINK_ASSERT(mavlink_get_message_info_by_name("MISSION_REQUEST_INT") != NULL);
2542 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_REQUEST_INT) != NULL);
2543#endif
2544}
2545
2546static void mavlink_test_safety_set_allowed_area(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2547{
2548#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2549 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2550 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA >= 256) {
2551 return;
2552 }
2553#endif
2554 mavlink_message_t msg;
2555 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2556 uint16_t i;
2557 mavlink_safety_set_allowed_area_t packet_in = {
2558 17.0,45.0,73.0,101.0,129.0,157.0,77,144,211
2559 };
2560 mavlink_safety_set_allowed_area_t packet1, packet2;
2561 memset(&packet1, 0, sizeof(packet1));
2562 packet1.p1x = packet_in.p1x;
2563 packet1.p1y = packet_in.p1y;
2564 packet1.p1z = packet_in.p1z;
2565 packet1.p2x = packet_in.p2x;
2566 packet1.p2y = packet_in.p2y;
2567 packet1.p2z = packet_in.p2z;
2568 packet1.target_system = packet_in.target_system;
2569 packet1.target_component = packet_in.target_component;
2570 packet1.frame = packet_in.frame;
2571
2572
2573#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2574 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2575 // cope with extensions
2576 memset(MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN);
2577 }
2578#endif
2579 memset(&packet2, 0, sizeof(packet2));
2580 mavlink_msg_safety_set_allowed_area_encode(system_id, component_id, &msg, &packet1);
2581 mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2);
2582 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2583
2584 memset(&packet2, 0, sizeof(packet2));
2585 mavlink_msg_safety_set_allowed_area_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z );
2586 mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2);
2587 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2588
2589 memset(&packet2, 0, sizeof(packet2));
2590 mavlink_msg_safety_set_allowed_area_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z );
2591 mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2);
2592 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2593
2594 memset(&packet2, 0, sizeof(packet2));
2595 mavlink_msg_to_send_buffer(buffer, &msg);
2596 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2597 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2598 }
2599 mavlink_msg_safety_set_allowed_area_decode(last_msg, &packet2);
2600 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2601
2602 memset(&packet2, 0, sizeof(packet2));
2603 mavlink_msg_safety_set_allowed_area_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z );
2604 mavlink_msg_safety_set_allowed_area_decode(last_msg, &packet2);
2605 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2606
2607#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2608 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SAFETY_SET_ALLOWED_AREA") != NULL);
2609 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA) != NULL);
2610#endif
2611}
2612
2613static void mavlink_test_safety_allowed_area(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2614{
2615#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2616 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2617 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA >= 256) {
2618 return;
2619 }
2620#endif
2621 mavlink_message_t msg;
2622 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2623 uint16_t i;
2624 mavlink_safety_allowed_area_t packet_in = {
2625 17.0,45.0,73.0,101.0,129.0,157.0,77
2626 };
2627 mavlink_safety_allowed_area_t packet1, packet2;
2628 memset(&packet1, 0, sizeof(packet1));
2629 packet1.p1x = packet_in.p1x;
2630 packet1.p1y = packet_in.p1y;
2631 packet1.p1z = packet_in.p1z;
2632 packet1.p2x = packet_in.p2x;
2633 packet1.p2y = packet_in.p2y;
2634 packet1.p2z = packet_in.p2z;
2635 packet1.frame = packet_in.frame;
2636
2637
2638#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2639 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2640 // cope with extensions
2641 memset(MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN);
2642 }
2643#endif
2644 memset(&packet2, 0, sizeof(packet2));
2645 mavlink_msg_safety_allowed_area_encode(system_id, component_id, &msg, &packet1);
2646 mavlink_msg_safety_allowed_area_decode(&msg, &packet2);
2647 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2648
2649 memset(&packet2, 0, sizeof(packet2));
2650 mavlink_msg_safety_allowed_area_pack(system_id, component_id, &msg , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z );
2651 mavlink_msg_safety_allowed_area_decode(&msg, &packet2);
2652 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2653
2654 memset(&packet2, 0, sizeof(packet2));
2655 mavlink_msg_safety_allowed_area_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z );
2656 mavlink_msg_safety_allowed_area_decode(&msg, &packet2);
2657 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2658
2659 memset(&packet2, 0, sizeof(packet2));
2660 mavlink_msg_to_send_buffer(buffer, &msg);
2661 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2662 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2663 }
2664 mavlink_msg_safety_allowed_area_decode(last_msg, &packet2);
2665 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2666
2667 memset(&packet2, 0, sizeof(packet2));
2668 mavlink_msg_safety_allowed_area_send(MAVLINK_COMM_1 , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z );
2669 mavlink_msg_safety_allowed_area_decode(last_msg, &packet2);
2670 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2671
2672#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2673 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SAFETY_ALLOWED_AREA") != NULL);
2674 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA) != NULL);
2675#endif
2676}
2677
2678static void mavlink_test_attitude_quaternion_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2679{
2680#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2681 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2682 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV >= 256) {
2683 return;
2684 }
2685#endif
2686 mavlink_message_t msg;
2687 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2688 uint16_t i;
2689 mavlink_attitude_quaternion_cov_t packet_in = {
2690 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0 },185.0,213.0,241.0,{ 269.0, 270.0, 271.0, 272.0, 273.0, 274.0, 275.0, 276.0, 277.0 }
2691 };
2692 mavlink_attitude_quaternion_cov_t packet1, packet2;
2693 memset(&packet1, 0, sizeof(packet1));
2694 packet1.time_usec = packet_in.time_usec;
2695 packet1.rollspeed = packet_in.rollspeed;
2696 packet1.pitchspeed = packet_in.pitchspeed;
2697 packet1.yawspeed = packet_in.yawspeed;
2698
2699 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
2700 mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*9);
2701
2702#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2703 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2704 // cope with extensions
2705 memset(MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN);
2706 }
2707#endif
2708 memset(&packet2, 0, sizeof(packet2));
2709 mavlink_msg_attitude_quaternion_cov_encode(system_id, component_id, &msg, &packet1);
2710 mavlink_msg_attitude_quaternion_cov_decode(&msg, &packet2);
2711 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2712
2713 memset(&packet2, 0, sizeof(packet2));
2714 mavlink_msg_attitude_quaternion_cov_pack(system_id, component_id, &msg , packet1.time_usec , packet1.q , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.covariance );
2715 mavlink_msg_attitude_quaternion_cov_decode(&msg, &packet2);
2716 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2717
2718 memset(&packet2, 0, sizeof(packet2));
2719 mavlink_msg_attitude_quaternion_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.q , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.covariance );
2720 mavlink_msg_attitude_quaternion_cov_decode(&msg, &packet2);
2721 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2722
2723 memset(&packet2, 0, sizeof(packet2));
2724 mavlink_msg_to_send_buffer(buffer, &msg);
2725 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2726 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2727 }
2728 mavlink_msg_attitude_quaternion_cov_decode(last_msg, &packet2);
2729 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2730
2731 memset(&packet2, 0, sizeof(packet2));
2732 mavlink_msg_attitude_quaternion_cov_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.q , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.covariance );
2733 mavlink_msg_attitude_quaternion_cov_decode(last_msg, &packet2);
2734 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2735
2736#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2737 MAVLINK_ASSERT(mavlink_get_message_info_by_name("ATTITUDE_QUATERNION_COV") != NULL);
2738 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV) != NULL);
2739#endif
2740}
2741
2742static void mavlink_test_nav_controller_output(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2743{
2744#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2745 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2746 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT >= 256) {
2747 return;
2748 }
2749#endif
2750 mavlink_message_t msg;
2751 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2752 uint16_t i;
2753 mavlink_nav_controller_output_t packet_in = {
2754 17.0,45.0,73.0,101.0,129.0,18275,18379,18483
2755 };
2756 mavlink_nav_controller_output_t packet1, packet2;
2757 memset(&packet1, 0, sizeof(packet1));
2758 packet1.nav_roll = packet_in.nav_roll;
2759 packet1.nav_pitch = packet_in.nav_pitch;
2760 packet1.alt_error = packet_in.alt_error;
2761 packet1.aspd_error = packet_in.aspd_error;
2762 packet1.xtrack_error = packet_in.xtrack_error;
2763 packet1.nav_bearing = packet_in.nav_bearing;
2764 packet1.target_bearing = packet_in.target_bearing;
2765 packet1.wp_dist = packet_in.wp_dist;
2766
2767
2768#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2769 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2770 // cope with extensions
2771 memset(MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN);
2772 }
2773#endif
2774 memset(&packet2, 0, sizeof(packet2));
2775 mavlink_msg_nav_controller_output_encode(system_id, component_id, &msg, &packet1);
2776 mavlink_msg_nav_controller_output_decode(&msg, &packet2);
2777 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2778
2779 memset(&packet2, 0, sizeof(packet2));
2780 mavlink_msg_nav_controller_output_pack(system_id, component_id, &msg , packet1.nav_roll , packet1.nav_pitch , packet1.nav_bearing , packet1.target_bearing , packet1.wp_dist , packet1.alt_error , packet1.aspd_error , packet1.xtrack_error );
2781 mavlink_msg_nav_controller_output_decode(&msg, &packet2);
2782 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2783
2784 memset(&packet2, 0, sizeof(packet2));
2785 mavlink_msg_nav_controller_output_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.nav_roll , packet1.nav_pitch , packet1.nav_bearing , packet1.target_bearing , packet1.wp_dist , packet1.alt_error , packet1.aspd_error , packet1.xtrack_error );
2786 mavlink_msg_nav_controller_output_decode(&msg, &packet2);
2787 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2788
2789 memset(&packet2, 0, sizeof(packet2));
2790 mavlink_msg_to_send_buffer(buffer, &msg);
2791 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2792 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2793 }
2794 mavlink_msg_nav_controller_output_decode(last_msg, &packet2);
2795 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2796
2797 memset(&packet2, 0, sizeof(packet2));
2798 mavlink_msg_nav_controller_output_send(MAVLINK_COMM_1 , packet1.nav_roll , packet1.nav_pitch , packet1.nav_bearing , packet1.target_bearing , packet1.wp_dist , packet1.alt_error , packet1.aspd_error , packet1.xtrack_error );
2799 mavlink_msg_nav_controller_output_decode(last_msg, &packet2);
2800 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2801
2802#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2803 MAVLINK_ASSERT(mavlink_get_message_info_by_name("NAV_CONTROLLER_OUTPUT") != NULL);
2804 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT) != NULL);
2805#endif
2806}
2807
2808static void mavlink_test_global_position_int_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2809{
2810#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2811 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2812 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV >= 256) {
2813 return;
2814 }
2815#endif
2816 mavlink_message_t msg;
2817 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2818 uint16_t i;
2819 mavlink_global_position_int_cov_t packet_in = {
2820 93372036854775807ULL,963497880,963498088,963498296,963498504,185.0,213.0,241.0,{ 269.0, 270.0, 271.0, 272.0, 273.0, 274.0, 275.0, 276.0, 277.0, 278.0, 279.0, 280.0, 281.0, 282.0, 283.0, 284.0, 285.0, 286.0, 287.0, 288.0, 289.0, 290.0, 291.0, 292.0, 293.0, 294.0, 295.0, 296.0, 297.0, 298.0, 299.0, 300.0, 301.0, 302.0, 303.0, 304.0 },33
2821 };
2822 mavlink_global_position_int_cov_t packet1, packet2;
2823 memset(&packet1, 0, sizeof(packet1));
2824 packet1.time_usec = packet_in.time_usec;
2825 packet1.lat = packet_in.lat;
2826 packet1.lon = packet_in.lon;
2827 packet1.alt = packet_in.alt;
2828 packet1.relative_alt = packet_in.relative_alt;
2829 packet1.vx = packet_in.vx;
2830 packet1.vy = packet_in.vy;
2831 packet1.vz = packet_in.vz;
2832 packet1.estimator_type = packet_in.estimator_type;
2833
2834 mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*36);
2835
2836#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2837 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2838 // cope with extensions
2839 memset(MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN);
2840 }
2841#endif
2842 memset(&packet2, 0, sizeof(packet2));
2843 mavlink_msg_global_position_int_cov_encode(system_id, component_id, &msg, &packet1);
2844 mavlink_msg_global_position_int_cov_decode(&msg, &packet2);
2845 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2846
2847 memset(&packet2, 0, sizeof(packet2));
2848 mavlink_msg_global_position_int_cov_pack(system_id, component_id, &msg , packet1.time_usec , packet1.estimator_type , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.covariance );
2849 mavlink_msg_global_position_int_cov_decode(&msg, &packet2);
2850 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2851
2852 memset(&packet2, 0, sizeof(packet2));
2853 mavlink_msg_global_position_int_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.estimator_type , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.covariance );
2854 mavlink_msg_global_position_int_cov_decode(&msg, &packet2);
2855 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2856
2857 memset(&packet2, 0, sizeof(packet2));
2858 mavlink_msg_to_send_buffer(buffer, &msg);
2859 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2860 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2861 }
2862 mavlink_msg_global_position_int_cov_decode(last_msg, &packet2);
2863 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2864
2865 memset(&packet2, 0, sizeof(packet2));
2866 mavlink_msg_global_position_int_cov_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.estimator_type , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.covariance );
2867 mavlink_msg_global_position_int_cov_decode(last_msg, &packet2);
2868 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2869
2870#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2871 MAVLINK_ASSERT(mavlink_get_message_info_by_name("GLOBAL_POSITION_INT_COV") != NULL);
2872 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV) != NULL);
2873#endif
2874}
2875
2876static void mavlink_test_local_position_ned_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2877{
2878#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2879 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2880 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV >= 256) {
2881 return;
2882 }
2883#endif
2884 mavlink_message_t msg;
2885 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2886 uint16_t i;
2887 mavlink_local_position_ned_cov_t packet_in = {
2888 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,{ 325.0, 326.0, 327.0, 328.0, 329.0, 330.0, 331.0, 332.0, 333.0, 334.0, 335.0, 336.0, 337.0, 338.0, 339.0, 340.0, 341.0, 342.0, 343.0, 344.0, 345.0, 346.0, 347.0, 348.0, 349.0, 350.0, 351.0, 352.0, 353.0, 354.0, 355.0, 356.0, 357.0, 358.0, 359.0, 360.0, 361.0, 362.0, 363.0, 364.0, 365.0, 366.0, 367.0, 368.0, 369.0 },165
2889 };
2890 mavlink_local_position_ned_cov_t packet1, packet2;
2891 memset(&packet1, 0, sizeof(packet1));
2892 packet1.time_usec = packet_in.time_usec;
2893 packet1.x = packet_in.x;
2894 packet1.y = packet_in.y;
2895 packet1.z = packet_in.z;
2896 packet1.vx = packet_in.vx;
2897 packet1.vy = packet_in.vy;
2898 packet1.vz = packet_in.vz;
2899 packet1.ax = packet_in.ax;
2900 packet1.ay = packet_in.ay;
2901 packet1.az = packet_in.az;
2902 packet1.estimator_type = packet_in.estimator_type;
2903
2904 mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*45);
2905
2906#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2907 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2908 // cope with extensions
2909 memset(MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN);
2910 }
2911#endif
2912 memset(&packet2, 0, sizeof(packet2));
2913 mavlink_msg_local_position_ned_cov_encode(system_id, component_id, &msg, &packet1);
2914 mavlink_msg_local_position_ned_cov_decode(&msg, &packet2);
2915 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2916
2917 memset(&packet2, 0, sizeof(packet2));
2918 mavlink_msg_local_position_ned_cov_pack(system_id, component_id, &msg , packet1.time_usec , packet1.estimator_type , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.ax , packet1.ay , packet1.az , packet1.covariance );
2919 mavlink_msg_local_position_ned_cov_decode(&msg, &packet2);
2920 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2921
2922 memset(&packet2, 0, sizeof(packet2));
2923 mavlink_msg_local_position_ned_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.estimator_type , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.ax , packet1.ay , packet1.az , packet1.covariance );
2924 mavlink_msg_local_position_ned_cov_decode(&msg, &packet2);
2925 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2926
2927 memset(&packet2, 0, sizeof(packet2));
2928 mavlink_msg_to_send_buffer(buffer, &msg);
2929 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2930 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2931 }
2932 mavlink_msg_local_position_ned_cov_decode(last_msg, &packet2);
2933 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2934
2935 memset(&packet2, 0, sizeof(packet2));
2936 mavlink_msg_local_position_ned_cov_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.estimator_type , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.ax , packet1.ay , packet1.az , packet1.covariance );
2937 mavlink_msg_local_position_ned_cov_decode(last_msg, &packet2);
2938 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2939
2940#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2941 MAVLINK_ASSERT(mavlink_get_message_info_by_name("LOCAL_POSITION_NED_COV") != NULL);
2942 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV) != NULL);
2943#endif
2944}
2945
2946static void mavlink_test_rc_channels(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2947{
2948#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2949 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2950 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RC_CHANNELS >= 256) {
2951 return;
2952 }
2953#endif
2954 mavlink_message_t msg;
2955 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2956 uint16_t i;
2957 mavlink_rc_channels_t packet_in = {
2958 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275,18379,18483,18587,18691,18795,18899,19003,19107,19211,125,192
2959 };
2960 mavlink_rc_channels_t packet1, packet2;
2961 memset(&packet1, 0, sizeof(packet1));
2962 packet1.time_boot_ms = packet_in.time_boot_ms;
2963 packet1.chan1_raw = packet_in.chan1_raw;
2964 packet1.chan2_raw = packet_in.chan2_raw;
2965 packet1.chan3_raw = packet_in.chan3_raw;
2966 packet1.chan4_raw = packet_in.chan4_raw;
2967 packet1.chan5_raw = packet_in.chan5_raw;
2968 packet1.chan6_raw = packet_in.chan6_raw;
2969 packet1.chan7_raw = packet_in.chan7_raw;
2970 packet1.chan8_raw = packet_in.chan8_raw;
2971 packet1.chan9_raw = packet_in.chan9_raw;
2972 packet1.chan10_raw = packet_in.chan10_raw;
2973 packet1.chan11_raw = packet_in.chan11_raw;
2974 packet1.chan12_raw = packet_in.chan12_raw;
2975 packet1.chan13_raw = packet_in.chan13_raw;
2976 packet1.chan14_raw = packet_in.chan14_raw;
2977 packet1.chan15_raw = packet_in.chan15_raw;
2978 packet1.chan16_raw = packet_in.chan16_raw;
2979 packet1.chan17_raw = packet_in.chan17_raw;
2980 packet1.chan18_raw = packet_in.chan18_raw;
2981 packet1.chancount = packet_in.chancount;
2982 packet1.rssi = packet_in.rssi;
2983
2984
2985#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2986 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2987 // cope with extensions
2988 memset(MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN);
2989 }
2990#endif
2991 memset(&packet2, 0, sizeof(packet2));
2992 mavlink_msg_rc_channels_encode(system_id, component_id, &msg, &packet1);
2993 mavlink_msg_rc_channels_decode(&msg, &packet2);
2994 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2995
2996 memset(&packet2, 0, sizeof(packet2));
2997 mavlink_msg_rc_channels_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.chancount , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.chan13_raw , packet1.chan14_raw , packet1.chan15_raw , packet1.chan16_raw , packet1.chan17_raw , packet1.chan18_raw , packet1.rssi );
2998 mavlink_msg_rc_channels_decode(&msg, &packet2);
2999 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3000
3001 memset(&packet2, 0, sizeof(packet2));
3002 mavlink_msg_rc_channels_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.chancount , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.chan13_raw , packet1.chan14_raw , packet1.chan15_raw , packet1.chan16_raw , packet1.chan17_raw , packet1.chan18_raw , packet1.rssi );
3003 mavlink_msg_rc_channels_decode(&msg, &packet2);
3004 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3005
3006 memset(&packet2, 0, sizeof(packet2));
3007 mavlink_msg_to_send_buffer(buffer, &msg);
3008 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3009 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3010 }
3011 mavlink_msg_rc_channels_decode(last_msg, &packet2);
3012 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3013
3014 memset(&packet2, 0, sizeof(packet2));
3015 mavlink_msg_rc_channels_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.chancount , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.chan13_raw , packet1.chan14_raw , packet1.chan15_raw , packet1.chan16_raw , packet1.chan17_raw , packet1.chan18_raw , packet1.rssi );
3016 mavlink_msg_rc_channels_decode(last_msg, &packet2);
3017 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3018
3019#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3020 MAVLINK_ASSERT(mavlink_get_message_info_by_name("RC_CHANNELS") != NULL);
3021 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_RC_CHANNELS) != NULL);
3022#endif
3023}
3024
3025static void mavlink_test_request_data_stream(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3026{
3027#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3028 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3029 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_REQUEST_DATA_STREAM >= 256) {
3030 return;
3031 }
3032#endif
3033 mavlink_message_t msg;
3034 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3035 uint16_t i;
3036 mavlink_request_data_stream_t packet_in = {
3037 17235,139,206,17,84
3038 };
3039 mavlink_request_data_stream_t packet1, packet2;
3040 memset(&packet1, 0, sizeof(packet1));
3041 packet1.req_message_rate = packet_in.req_message_rate;
3042 packet1.target_system = packet_in.target_system;
3043 packet1.target_component = packet_in.target_component;
3044 packet1.req_stream_id = packet_in.req_stream_id;
3045 packet1.start_stop = packet_in.start_stop;
3046
3047
3048#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3049 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3050 // cope with extensions
3051 memset(MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN);
3052 }
3053#endif
3054 memset(&packet2, 0, sizeof(packet2));
3055 mavlink_msg_request_data_stream_encode(system_id, component_id, &msg, &packet1);
3056 mavlink_msg_request_data_stream_decode(&msg, &packet2);
3057 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3058
3059 memset(&packet2, 0, sizeof(packet2));
3060 mavlink_msg_request_data_stream_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.req_stream_id , packet1.req_message_rate , packet1.start_stop );
3061 mavlink_msg_request_data_stream_decode(&msg, &packet2);
3062 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3063
3064 memset(&packet2, 0, sizeof(packet2));
3065 mavlink_msg_request_data_stream_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.req_stream_id , packet1.req_message_rate , packet1.start_stop );
3066 mavlink_msg_request_data_stream_decode(&msg, &packet2);
3067 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3068
3069 memset(&packet2, 0, sizeof(packet2));
3070 mavlink_msg_to_send_buffer(buffer, &msg);
3071 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3072 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3073 }
3074 mavlink_msg_request_data_stream_decode(last_msg, &packet2);
3075 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3076
3077 memset(&packet2, 0, sizeof(packet2));
3078 mavlink_msg_request_data_stream_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.req_stream_id , packet1.req_message_rate , packet1.start_stop );
3079 mavlink_msg_request_data_stream_decode(last_msg, &packet2);
3080 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3081
3082#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3083 MAVLINK_ASSERT(mavlink_get_message_info_by_name("REQUEST_DATA_STREAM") != NULL);
3084 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_REQUEST_DATA_STREAM) != NULL);
3085#endif
3086}
3087
3088static void mavlink_test_data_stream(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3089{
3090#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3091 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3092 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DATA_STREAM >= 256) {
3093 return;
3094 }
3095#endif
3096 mavlink_message_t msg;
3097 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3098 uint16_t i;
3099 mavlink_data_stream_t packet_in = {
3100 17235,139,206
3101 };
3102 mavlink_data_stream_t packet1, packet2;
3103 memset(&packet1, 0, sizeof(packet1));
3104 packet1.message_rate = packet_in.message_rate;
3105 packet1.stream_id = packet_in.stream_id;
3106 packet1.on_off = packet_in.on_off;
3107
3108
3109#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3110 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3111 // cope with extensions
3112 memset(MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN);
3113 }
3114#endif
3115 memset(&packet2, 0, sizeof(packet2));
3116 mavlink_msg_data_stream_encode(system_id, component_id, &msg, &packet1);
3117 mavlink_msg_data_stream_decode(&msg, &packet2);
3118 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3119
3120 memset(&packet2, 0, sizeof(packet2));
3121 mavlink_msg_data_stream_pack(system_id, component_id, &msg , packet1.stream_id , packet1.message_rate , packet1.on_off );
3122 mavlink_msg_data_stream_decode(&msg, &packet2);
3123 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3124
3125 memset(&packet2, 0, sizeof(packet2));
3126 mavlink_msg_data_stream_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.stream_id , packet1.message_rate , packet1.on_off );
3127 mavlink_msg_data_stream_decode(&msg, &packet2);
3128 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3129
3130 memset(&packet2, 0, sizeof(packet2));
3131 mavlink_msg_to_send_buffer(buffer, &msg);
3132 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3133 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3134 }
3135 mavlink_msg_data_stream_decode(last_msg, &packet2);
3136 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3137
3138 memset(&packet2, 0, sizeof(packet2));
3139 mavlink_msg_data_stream_send(MAVLINK_COMM_1 , packet1.stream_id , packet1.message_rate , packet1.on_off );
3140 mavlink_msg_data_stream_decode(last_msg, &packet2);
3141 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3142
3143#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3144 MAVLINK_ASSERT(mavlink_get_message_info_by_name("DATA_STREAM") != NULL);
3145 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_DATA_STREAM) != NULL);
3146#endif
3147}
3148
3149static void mavlink_test_manual_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3150{
3151#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3152 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3153 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MANUAL_CONTROL >= 256) {
3154 return;
3155 }
3156#endif
3157 mavlink_message_t msg;
3158 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3159 uint16_t i;
3160 mavlink_manual_control_t packet_in = {
3161 17235,17339,17443,17547,17651,163,17807,108,17963,18067,18171,18275,18379,18483,18587,18691
3162 };
3163 mavlink_manual_control_t packet1, packet2;
3164 memset(&packet1, 0, sizeof(packet1));
3165 packet1.x = packet_in.x;
3166 packet1.y = packet_in.y;
3167 packet1.z = packet_in.z;
3168 packet1.r = packet_in.r;
3169 packet1.buttons = packet_in.buttons;
3170 packet1.target = packet_in.target;
3171 packet1.buttons2 = packet_in.buttons2;
3172 packet1.enabled_extensions = packet_in.enabled_extensions;
3173 packet1.s = packet_in.s;
3174 packet1.t = packet_in.t;
3175 packet1.aux1 = packet_in.aux1;
3176 packet1.aux2 = packet_in.aux2;
3177 packet1.aux3 = packet_in.aux3;
3178 packet1.aux4 = packet_in.aux4;
3179 packet1.aux5 = packet_in.aux5;
3180 packet1.aux6 = packet_in.aux6;
3181
3182
3183#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3184 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3185 // cope with extensions
3186 memset(MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN);
3187 }
3188#endif
3189 memset(&packet2, 0, sizeof(packet2));
3190 mavlink_msg_manual_control_encode(system_id, component_id, &msg, &packet1);
3191 mavlink_msg_manual_control_decode(&msg, &packet2);
3192 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3193
3194 memset(&packet2, 0, sizeof(packet2));
3195 mavlink_msg_manual_control_pack(system_id, component_id, &msg , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons , packet1.buttons2 , packet1.enabled_extensions , packet1.s , packet1.t , packet1.aux1 , packet1.aux2 , packet1.aux3 , packet1.aux4 , packet1.aux5 , packet1.aux6 );
3196 mavlink_msg_manual_control_decode(&msg, &packet2);
3197 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3198
3199 memset(&packet2, 0, sizeof(packet2));
3200 mavlink_msg_manual_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons , packet1.buttons2 , packet1.enabled_extensions , packet1.s , packet1.t , packet1.aux1 , packet1.aux2 , packet1.aux3 , packet1.aux4 , packet1.aux5 , packet1.aux6 );
3201 mavlink_msg_manual_control_decode(&msg, &packet2);
3202 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3203
3204 memset(&packet2, 0, sizeof(packet2));
3205 mavlink_msg_to_send_buffer(buffer, &msg);
3206 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3207 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3208 }
3209 mavlink_msg_manual_control_decode(last_msg, &packet2);
3210 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3211
3212 memset(&packet2, 0, sizeof(packet2));
3213 mavlink_msg_manual_control_send(MAVLINK_COMM_1 , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons , packet1.buttons2 , packet1.enabled_extensions , packet1.s , packet1.t , packet1.aux1 , packet1.aux2 , packet1.aux3 , packet1.aux4 , packet1.aux5 , packet1.aux6 );
3214 mavlink_msg_manual_control_decode(last_msg, &packet2);
3215 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3216
3217#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3218 MAVLINK_ASSERT(mavlink_get_message_info_by_name("MANUAL_CONTROL") != NULL);
3219 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MANUAL_CONTROL) != NULL);
3220#endif
3221}
3222
3223static void mavlink_test_rc_channels_override(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3224{
3225#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3226 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3227 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE >= 256) {
3228 return;
3229 }
3230#endif
3231 mavlink_message_t msg;
3232 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3233 uint16_t i;
3234 mavlink_rc_channels_override_t packet_in = {
3235 17235,17339,17443,17547,17651,17755,17859,17963,53,120,18171,18275,18379,18483,18587,18691,18795,18899,19003,19107
3236 };
3237 mavlink_rc_channels_override_t packet1, packet2;
3238 memset(&packet1, 0, sizeof(packet1));
3239 packet1.chan1_raw = packet_in.chan1_raw;
3240 packet1.chan2_raw = packet_in.chan2_raw;
3241 packet1.chan3_raw = packet_in.chan3_raw;
3242 packet1.chan4_raw = packet_in.chan4_raw;
3243 packet1.chan5_raw = packet_in.chan5_raw;
3244 packet1.chan6_raw = packet_in.chan6_raw;
3245 packet1.chan7_raw = packet_in.chan7_raw;
3246 packet1.chan8_raw = packet_in.chan8_raw;
3247 packet1.target_system = packet_in.target_system;
3248 packet1.target_component = packet_in.target_component;
3249 packet1.chan9_raw = packet_in.chan9_raw;
3250 packet1.chan10_raw = packet_in.chan10_raw;
3251 packet1.chan11_raw = packet_in.chan11_raw;
3252 packet1.chan12_raw = packet_in.chan12_raw;
3253 packet1.chan13_raw = packet_in.chan13_raw;
3254 packet1.chan14_raw = packet_in.chan14_raw;
3255 packet1.chan15_raw = packet_in.chan15_raw;
3256 packet1.chan16_raw = packet_in.chan16_raw;
3257 packet1.chan17_raw = packet_in.chan17_raw;
3258 packet1.chan18_raw = packet_in.chan18_raw;
3259
3260
3261#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3262 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3263 // cope with extensions
3264 memset(MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN);
3265 }
3266#endif
3267 memset(&packet2, 0, sizeof(packet2));
3268 mavlink_msg_rc_channels_override_encode(system_id, component_id, &msg, &packet1);
3269 mavlink_msg_rc_channels_override_decode(&msg, &packet2);
3270 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3271
3272 memset(&packet2, 0, sizeof(packet2));
3273 mavlink_msg_rc_channels_override_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.chan13_raw , packet1.chan14_raw , packet1.chan15_raw , packet1.chan16_raw , packet1.chan17_raw , packet1.chan18_raw );
3274 mavlink_msg_rc_channels_override_decode(&msg, &packet2);
3275 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3276
3277 memset(&packet2, 0, sizeof(packet2));
3278 mavlink_msg_rc_channels_override_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.chan13_raw , packet1.chan14_raw , packet1.chan15_raw , packet1.chan16_raw , packet1.chan17_raw , packet1.chan18_raw );
3279 mavlink_msg_rc_channels_override_decode(&msg, &packet2);
3280 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3281
3282 memset(&packet2, 0, sizeof(packet2));
3283 mavlink_msg_to_send_buffer(buffer, &msg);
3284 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3285 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3286 }
3287 mavlink_msg_rc_channels_override_decode(last_msg, &packet2);
3288 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3289
3290 memset(&packet2, 0, sizeof(packet2));
3291 mavlink_msg_rc_channels_override_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.chan13_raw , packet1.chan14_raw , packet1.chan15_raw , packet1.chan16_raw , packet1.chan17_raw , packet1.chan18_raw );
3292 mavlink_msg_rc_channels_override_decode(last_msg, &packet2);
3293 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3294
3295#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3296 MAVLINK_ASSERT(mavlink_get_message_info_by_name("RC_CHANNELS_OVERRIDE") != NULL);
3297 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE) != NULL);
3298#endif
3299}
3300
3301static void mavlink_test_mission_item_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3302{
3303#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3304 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3305 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_ITEM_INT >= 256) {
3306 return;
3307 }
3308#endif
3309 mavlink_message_t msg;
3310 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3311 uint16_t i;
3312 mavlink_mission_item_int_t packet_in = {
3313 17.0,45.0,73.0,101.0,963498296,963498504,185.0,18691,18795,101,168,235,46,113,180
3314 };
3315 mavlink_mission_item_int_t packet1, packet2;
3316 memset(&packet1, 0, sizeof(packet1));
3317 packet1.param1 = packet_in.param1;
3318 packet1.param2 = packet_in.param2;
3319 packet1.param3 = packet_in.param3;
3320 packet1.param4 = packet_in.param4;
3321 packet1.x = packet_in.x;
3322 packet1.y = packet_in.y;
3323 packet1.z = packet_in.z;
3324 packet1.seq = packet_in.seq;
3325 packet1.command = packet_in.command;
3326 packet1.target_system = packet_in.target_system;
3327 packet1.target_component = packet_in.target_component;
3328 packet1.frame = packet_in.frame;
3329 packet1.current = packet_in.current;
3330 packet1.autocontinue = packet_in.autocontinue;
3331 packet1.mission_type = packet_in.mission_type;
3332
3333
3334#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3335 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3336 // cope with extensions
3337 memset(MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN);
3338 }
3339#endif
3340 memset(&packet2, 0, sizeof(packet2));
3341 mavlink_msg_mission_item_int_encode(system_id, component_id, &msg, &packet1);
3342 mavlink_msg_mission_item_int_decode(&msg, &packet2);
3343 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3344
3345 memset(&packet2, 0, sizeof(packet2));
3346 mavlink_msg_mission_item_int_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z , packet1.mission_type );
3347 mavlink_msg_mission_item_int_decode(&msg, &packet2);
3348 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3349
3350 memset(&packet2, 0, sizeof(packet2));
3351 mavlink_msg_mission_item_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z , packet1.mission_type );
3352 mavlink_msg_mission_item_int_decode(&msg, &packet2);
3353 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3354
3355 memset(&packet2, 0, sizeof(packet2));
3356 mavlink_msg_to_send_buffer(buffer, &msg);
3357 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3358 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3359 }
3360 mavlink_msg_mission_item_int_decode(last_msg, &packet2);
3361 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3362
3363 memset(&packet2, 0, sizeof(packet2));
3364 mavlink_msg_mission_item_int_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z , packet1.mission_type );
3365 mavlink_msg_mission_item_int_decode(last_msg, &packet2);
3366 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3367
3368#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3369 MAVLINK_ASSERT(mavlink_get_message_info_by_name("MISSION_ITEM_INT") != NULL);
3370 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_ITEM_INT) != NULL);
3371#endif
3372}
3373
3374static void mavlink_test_vfr_hud(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3375{
3376#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3377 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3378 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VFR_HUD >= 256) {
3379 return;
3380 }
3381#endif
3382 mavlink_message_t msg;
3383 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3384 uint16_t i;
3385 mavlink_vfr_hud_t packet_in = {
3386 17.0,45.0,73.0,101.0,18067,18171
3387 };
3388 mavlink_vfr_hud_t packet1, packet2;
3389 memset(&packet1, 0, sizeof(packet1));
3390 packet1.airspeed = packet_in.airspeed;
3391 packet1.groundspeed = packet_in.groundspeed;
3392 packet1.alt = packet_in.alt;
3393 packet1.climb = packet_in.climb;
3394 packet1.heading = packet_in.heading;
3395 packet1.throttle = packet_in.throttle;
3396
3397
3398#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3399 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3400 // cope with extensions
3401 memset(MAVLINK_MSG_ID_VFR_HUD_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VFR_HUD_MIN_LEN);
3402 }
3403#endif
3404 memset(&packet2, 0, sizeof(packet2));
3405 mavlink_msg_vfr_hud_encode(system_id, component_id, &msg, &packet1);
3406 mavlink_msg_vfr_hud_decode(&msg, &packet2);
3407 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3408
3409 memset(&packet2, 0, sizeof(packet2));
3410 mavlink_msg_vfr_hud_pack(system_id, component_id, &msg , packet1.airspeed , packet1.groundspeed , packet1.heading , packet1.throttle , packet1.alt , packet1.climb );
3411 mavlink_msg_vfr_hud_decode(&msg, &packet2);
3412 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3413
3414 memset(&packet2, 0, sizeof(packet2));
3415 mavlink_msg_vfr_hud_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.airspeed , packet1.groundspeed , packet1.heading , packet1.throttle , packet1.alt , packet1.climb );
3416 mavlink_msg_vfr_hud_decode(&msg, &packet2);
3417 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3418
3419 memset(&packet2, 0, sizeof(packet2));
3420 mavlink_msg_to_send_buffer(buffer, &msg);
3421 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3422 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3423 }
3424 mavlink_msg_vfr_hud_decode(last_msg, &packet2);
3425 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3426
3427 memset(&packet2, 0, sizeof(packet2));
3428 mavlink_msg_vfr_hud_send(MAVLINK_COMM_1 , packet1.airspeed , packet1.groundspeed , packet1.heading , packet1.throttle , packet1.alt , packet1.climb );
3429 mavlink_msg_vfr_hud_decode(last_msg, &packet2);
3430 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3431
3432#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3433 MAVLINK_ASSERT(mavlink_get_message_info_by_name("VFR_HUD") != NULL);
3434 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_VFR_HUD) != NULL);
3435#endif
3436}
3437
3438static void mavlink_test_command_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3439{
3440#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3441 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3442 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMMAND_INT >= 256) {
3443 return;
3444 }
3445#endif
3446 mavlink_message_t msg;
3447 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3448 uint16_t i;
3449 mavlink_command_int_t packet_in = {
3450 17.0,45.0,73.0,101.0,963498296,963498504,185.0,18691,223,34,101,168,235
3451 };
3452 mavlink_command_int_t packet1, packet2;
3453 memset(&packet1, 0, sizeof(packet1));
3454 packet1.param1 = packet_in.param1;
3455 packet1.param2 = packet_in.param2;
3456 packet1.param3 = packet_in.param3;
3457 packet1.param4 = packet_in.param4;
3458 packet1.x = packet_in.x;
3459 packet1.y = packet_in.y;
3460 packet1.z = packet_in.z;
3461 packet1.command = packet_in.command;
3462 packet1.target_system = packet_in.target_system;
3463 packet1.target_component = packet_in.target_component;
3464 packet1.frame = packet_in.frame;
3465 packet1.current = packet_in.current;
3466 packet1.autocontinue = packet_in.autocontinue;
3467
3468
3469#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3470 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3471 // cope with extensions
3472 memset(MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN);
3473 }
3474#endif
3475 memset(&packet2, 0, sizeof(packet2));
3476 mavlink_msg_command_int_encode(system_id, component_id, &msg, &packet1);
3477 mavlink_msg_command_int_decode(&msg, &packet2);
3478 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3479
3480 memset(&packet2, 0, sizeof(packet2));
3481 mavlink_msg_command_int_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z );
3482 mavlink_msg_command_int_decode(&msg, &packet2);
3483 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3484
3485 memset(&packet2, 0, sizeof(packet2));
3486 mavlink_msg_command_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z );
3487 mavlink_msg_command_int_decode(&msg, &packet2);
3488 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3489
3490 memset(&packet2, 0, sizeof(packet2));
3491 mavlink_msg_to_send_buffer(buffer, &msg);
3492 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3493 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3494 }
3495 mavlink_msg_command_int_decode(last_msg, &packet2);
3496 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3497
3498 memset(&packet2, 0, sizeof(packet2));
3499 mavlink_msg_command_int_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z );
3500 mavlink_msg_command_int_decode(last_msg, &packet2);
3501 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3502
3503#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3504 MAVLINK_ASSERT(mavlink_get_message_info_by_name("COMMAND_INT") != NULL);
3505 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_COMMAND_INT) != NULL);
3506#endif
3507}
3508
3509static void mavlink_test_command_long(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3510{
3511#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3512 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3513 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMMAND_LONG >= 256) {
3514 return;
3515 }
3516#endif
3517 mavlink_message_t msg;
3518 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3519 uint16_t i;
3520 mavlink_command_long_t packet_in = {
3521 17.0,45.0,73.0,101.0,129.0,157.0,185.0,18691,223,34,101
3522 };
3523 mavlink_command_long_t packet1, packet2;
3524 memset(&packet1, 0, sizeof(packet1));
3525 packet1.param1 = packet_in.param1;
3526 packet1.param2 = packet_in.param2;
3527 packet1.param3 = packet_in.param3;
3528 packet1.param4 = packet_in.param4;
3529 packet1.param5 = packet_in.param5;
3530 packet1.param6 = packet_in.param6;
3531 packet1.param7 = packet_in.param7;
3532 packet1.command = packet_in.command;
3533 packet1.target_system = packet_in.target_system;
3534 packet1.target_component = packet_in.target_component;
3535 packet1.confirmation = packet_in.confirmation;
3536
3537
3538#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3539 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3540 // cope with extensions
3541 memset(MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN);
3542 }
3543#endif
3544 memset(&packet2, 0, sizeof(packet2));
3545 mavlink_msg_command_long_encode(system_id, component_id, &msg, &packet1);
3546 mavlink_msg_command_long_decode(&msg, &packet2);
3547 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3548
3549 memset(&packet2, 0, sizeof(packet2));
3550 mavlink_msg_command_long_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.command , packet1.confirmation , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.param5 , packet1.param6 , packet1.param7 );
3551 mavlink_msg_command_long_decode(&msg, &packet2);
3552 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3553
3554 memset(&packet2, 0, sizeof(packet2));
3555 mavlink_msg_command_long_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.command , packet1.confirmation , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.param5 , packet1.param6 , packet1.param7 );
3556 mavlink_msg_command_long_decode(&msg, &packet2);
3557 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3558
3559 memset(&packet2, 0, sizeof(packet2));
3560 mavlink_msg_to_send_buffer(buffer, &msg);
3561 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3562 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3563 }
3564 mavlink_msg_command_long_decode(last_msg, &packet2);
3565 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3566
3567 memset(&packet2, 0, sizeof(packet2));
3568 mavlink_msg_command_long_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.command , packet1.confirmation , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.param5 , packet1.param6 , packet1.param7 );
3569 mavlink_msg_command_long_decode(last_msg, &packet2);
3570 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3571
3572#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3573 MAVLINK_ASSERT(mavlink_get_message_info_by_name("COMMAND_LONG") != NULL);
3574 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_COMMAND_LONG) != NULL);
3575#endif
3576}
3577
3578static void mavlink_test_command_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3579{
3580#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3581 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3582 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMMAND_ACK >= 256) {
3583 return;
3584 }
3585#endif
3586 mavlink_message_t msg;
3587 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3588 uint16_t i;
3589 mavlink_command_ack_t packet_in = {
3590 17235,139,206,963497672,29,96
3591 };
3592 mavlink_command_ack_t packet1, packet2;
3593 memset(&packet1, 0, sizeof(packet1));
3594 packet1.command = packet_in.command;
3595 packet1.result = packet_in.result;
3596 packet1.progress = packet_in.progress;
3597 packet1.result_param2 = packet_in.result_param2;
3598 packet1.target_system = packet_in.target_system;
3599 packet1.target_component = packet_in.target_component;
3600
3601
3602#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3603 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3604 // cope with extensions
3605 memset(MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN);
3606 }
3607#endif
3608 memset(&packet2, 0, sizeof(packet2));
3609 mavlink_msg_command_ack_encode(system_id, component_id, &msg, &packet1);
3610 mavlink_msg_command_ack_decode(&msg, &packet2);
3611 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3612
3613 memset(&packet2, 0, sizeof(packet2));
3614 mavlink_msg_command_ack_pack(system_id, component_id, &msg , packet1.command , packet1.result , packet1.progress , packet1.result_param2 , packet1.target_system , packet1.target_component );
3615 mavlink_msg_command_ack_decode(&msg, &packet2);
3616 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3617
3618 memset(&packet2, 0, sizeof(packet2));
3619 mavlink_msg_command_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.command , packet1.result , packet1.progress , packet1.result_param2 , packet1.target_system , packet1.target_component );
3620 mavlink_msg_command_ack_decode(&msg, &packet2);
3621 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3622
3623 memset(&packet2, 0, sizeof(packet2));
3624 mavlink_msg_to_send_buffer(buffer, &msg);
3625 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3626 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3627 }
3628 mavlink_msg_command_ack_decode(last_msg, &packet2);
3629 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3630
3631 memset(&packet2, 0, sizeof(packet2));
3632 mavlink_msg_command_ack_send(MAVLINK_COMM_1 , packet1.command , packet1.result , packet1.progress , packet1.result_param2 , packet1.target_system , packet1.target_component );
3633 mavlink_msg_command_ack_decode(last_msg, &packet2);
3634 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3635
3636#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3637 MAVLINK_ASSERT(mavlink_get_message_info_by_name("COMMAND_ACK") != NULL);
3638 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_COMMAND_ACK) != NULL);
3639#endif
3640}
3641
3642static void mavlink_test_command_cancel(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3643{
3644#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3645 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3646 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMMAND_CANCEL >= 256) {
3647 return;
3648 }
3649#endif
3650 mavlink_message_t msg;
3651 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3652 uint16_t i;
3653 mavlink_command_cancel_t packet_in = {
3654 17235,139,206
3655 };
3656 mavlink_command_cancel_t packet1, packet2;
3657 memset(&packet1, 0, sizeof(packet1));
3658 packet1.command = packet_in.command;
3659 packet1.target_system = packet_in.target_system;
3660 packet1.target_component = packet_in.target_component;
3661
3662
3663#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3664 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3665 // cope with extensions
3666 memset(MAVLINK_MSG_ID_COMMAND_CANCEL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COMMAND_CANCEL_MIN_LEN);
3667 }
3668#endif
3669 memset(&packet2, 0, sizeof(packet2));
3670 mavlink_msg_command_cancel_encode(system_id, component_id, &msg, &packet1);
3671 mavlink_msg_command_cancel_decode(&msg, &packet2);
3672 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3673
3674 memset(&packet2, 0, sizeof(packet2));
3675 mavlink_msg_command_cancel_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.command );
3676 mavlink_msg_command_cancel_decode(&msg, &packet2);
3677 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3678
3679 memset(&packet2, 0, sizeof(packet2));
3680 mavlink_msg_command_cancel_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.command );
3681 mavlink_msg_command_cancel_decode(&msg, &packet2);
3682 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3683
3684 memset(&packet2, 0, sizeof(packet2));
3685 mavlink_msg_to_send_buffer(buffer, &msg);
3686 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3687 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3688 }
3689 mavlink_msg_command_cancel_decode(last_msg, &packet2);
3690 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3691
3692 memset(&packet2, 0, sizeof(packet2));
3693 mavlink_msg_command_cancel_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.command );
3694 mavlink_msg_command_cancel_decode(last_msg, &packet2);
3695 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3696
3697#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3698 MAVLINK_ASSERT(mavlink_get_message_info_by_name("COMMAND_CANCEL") != NULL);
3699 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_COMMAND_CANCEL) != NULL);
3700#endif
3701}
3702
3703static void mavlink_test_manual_setpoint(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3704{
3705#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3706 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3707 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MANUAL_SETPOINT >= 256) {
3708 return;
3709 }
3710#endif
3711 mavlink_message_t msg;
3712 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3713 uint16_t i;
3714 mavlink_manual_setpoint_t packet_in = {
3715 963497464,45.0,73.0,101.0,129.0,65,132
3716 };
3717 mavlink_manual_setpoint_t packet1, packet2;
3718 memset(&packet1, 0, sizeof(packet1));
3719 packet1.time_boot_ms = packet_in.time_boot_ms;
3720 packet1.roll = packet_in.roll;
3721 packet1.pitch = packet_in.pitch;
3722 packet1.yaw = packet_in.yaw;
3723 packet1.thrust = packet_in.thrust;
3724 packet1.mode_switch = packet_in.mode_switch;
3725 packet1.manual_override_switch = packet_in.manual_override_switch;
3726
3727
3728#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3729 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3730 // cope with extensions
3731 memset(MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN);
3732 }
3733#endif
3734 memset(&packet2, 0, sizeof(packet2));
3735 mavlink_msg_manual_setpoint_encode(system_id, component_id, &msg, &packet1);
3736 mavlink_msg_manual_setpoint_decode(&msg, &packet2);
3737 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3738
3739 memset(&packet2, 0, sizeof(packet2));
3740 mavlink_msg_manual_setpoint_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.mode_switch , packet1.manual_override_switch );
3741 mavlink_msg_manual_setpoint_decode(&msg, &packet2);
3742 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3743
3744 memset(&packet2, 0, sizeof(packet2));
3745 mavlink_msg_manual_setpoint_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.mode_switch , packet1.manual_override_switch );
3746 mavlink_msg_manual_setpoint_decode(&msg, &packet2);
3747 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3748
3749 memset(&packet2, 0, sizeof(packet2));
3750 mavlink_msg_to_send_buffer(buffer, &msg);
3751 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3752 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3753 }
3754 mavlink_msg_manual_setpoint_decode(last_msg, &packet2);
3755 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3756
3757 memset(&packet2, 0, sizeof(packet2));
3758 mavlink_msg_manual_setpoint_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.mode_switch , packet1.manual_override_switch );
3759 mavlink_msg_manual_setpoint_decode(last_msg, &packet2);
3760 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3761
3762#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3763 MAVLINK_ASSERT(mavlink_get_message_info_by_name("MANUAL_SETPOINT") != NULL);
3764 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MANUAL_SETPOINT) != NULL);
3765#endif
3766}
3767
3768static void mavlink_test_set_attitude_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3769{
3770#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3771 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3772 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_ATTITUDE_TARGET >= 256) {
3773 return;
3774 }
3775#endif
3776 mavlink_message_t msg;
3777 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3778 uint16_t i;
3779 mavlink_set_attitude_target_t packet_in = {
3780 963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,241.0,113,180,247,{ 290.0, 291.0, 292.0 }
3781 };
3782 mavlink_set_attitude_target_t packet1, packet2;
3783 memset(&packet1, 0, sizeof(packet1));
3784 packet1.time_boot_ms = packet_in.time_boot_ms;
3785 packet1.body_roll_rate = packet_in.body_roll_rate;
3786 packet1.body_pitch_rate = packet_in.body_pitch_rate;
3787 packet1.body_yaw_rate = packet_in.body_yaw_rate;
3788 packet1.thrust = packet_in.thrust;
3789 packet1.target_system = packet_in.target_system;
3790 packet1.target_component = packet_in.target_component;
3791 packet1.type_mask = packet_in.type_mask;
3792
3793 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
3794 mav_array_memcpy(packet1.thrust_body, packet_in.thrust_body, sizeof(float)*3);
3795
3796#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3797 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3798 // cope with extensions
3799 memset(MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN);
3800 }
3801#endif
3802 memset(&packet2, 0, sizeof(packet2));
3803 mavlink_msg_set_attitude_target_encode(system_id, component_id, &msg, &packet1);
3804 mavlink_msg_set_attitude_target_decode(&msg, &packet2);
3805 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3806
3807 memset(&packet2, 0, sizeof(packet2));
3808 mavlink_msg_set_attitude_target_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust , packet1.thrust_body );
3809 mavlink_msg_set_attitude_target_decode(&msg, &packet2);
3810 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3811
3812 memset(&packet2, 0, sizeof(packet2));
3813 mavlink_msg_set_attitude_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust , packet1.thrust_body );
3814 mavlink_msg_set_attitude_target_decode(&msg, &packet2);
3815 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3816
3817 memset(&packet2, 0, sizeof(packet2));
3818 mavlink_msg_to_send_buffer(buffer, &msg);
3819 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3820 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3821 }
3822 mavlink_msg_set_attitude_target_decode(last_msg, &packet2);
3823 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3824
3825 memset(&packet2, 0, sizeof(packet2));
3826 mavlink_msg_set_attitude_target_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust , packet1.thrust_body );
3827 mavlink_msg_set_attitude_target_decode(last_msg, &packet2);
3828 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3829
3830#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3831 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SET_ATTITUDE_TARGET") != NULL);
3832 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SET_ATTITUDE_TARGET) != NULL);
3833#endif
3834}
3835
3836static void mavlink_test_attitude_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3837{
3838#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3839 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3840 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATTITUDE_TARGET >= 256) {
3841 return;
3842 }
3843#endif
3844 mavlink_message_t msg;
3845 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3846 uint16_t i;
3847 mavlink_attitude_target_t packet_in = {
3848 963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,241.0,113
3849 };
3850 mavlink_attitude_target_t packet1, packet2;
3851 memset(&packet1, 0, sizeof(packet1));
3852 packet1.time_boot_ms = packet_in.time_boot_ms;
3853 packet1.body_roll_rate = packet_in.body_roll_rate;
3854 packet1.body_pitch_rate = packet_in.body_pitch_rate;
3855 packet1.body_yaw_rate = packet_in.body_yaw_rate;
3856 packet1.thrust = packet_in.thrust;
3857 packet1.type_mask = packet_in.type_mask;
3858
3859 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
3860
3861#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3862 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3863 // cope with extensions
3864 memset(MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN);
3865 }
3866#endif
3867 memset(&packet2, 0, sizeof(packet2));
3868 mavlink_msg_attitude_target_encode(system_id, component_id, &msg, &packet1);
3869 mavlink_msg_attitude_target_decode(&msg, &packet2);
3870 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3871
3872 memset(&packet2, 0, sizeof(packet2));
3873 mavlink_msg_attitude_target_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust );
3874 mavlink_msg_attitude_target_decode(&msg, &packet2);
3875 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3876
3877 memset(&packet2, 0, sizeof(packet2));
3878 mavlink_msg_attitude_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust );
3879 mavlink_msg_attitude_target_decode(&msg, &packet2);
3880 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3881
3882 memset(&packet2, 0, sizeof(packet2));
3883 mavlink_msg_to_send_buffer(buffer, &msg);
3884 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3885 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3886 }
3887 mavlink_msg_attitude_target_decode(last_msg, &packet2);
3888 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3889
3890 memset(&packet2, 0, sizeof(packet2));
3891 mavlink_msg_attitude_target_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust );
3892 mavlink_msg_attitude_target_decode(last_msg, &packet2);
3893 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3894
3895#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3896 MAVLINK_ASSERT(mavlink_get_message_info_by_name("ATTITUDE_TARGET") != NULL);
3897 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ATTITUDE_TARGET) != NULL);
3898#endif
3899}
3900
3901static void mavlink_test_set_position_target_local_ned(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3902{
3903#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3904 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3905 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED >= 256) {
3906 return;
3907 }
3908#endif
3909 mavlink_message_t msg;
3910 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3911 uint16_t i;
3912 mavlink_set_position_target_local_ned_t packet_in = {
3913 963497464,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27,94,161
3914 };
3915 mavlink_set_position_target_local_ned_t packet1, packet2;
3916 memset(&packet1, 0, sizeof(packet1));
3917 packet1.time_boot_ms = packet_in.time_boot_ms;
3918 packet1.x = packet_in.x;
3919 packet1.y = packet_in.y;
3920 packet1.z = packet_in.z;
3921 packet1.vx = packet_in.vx;
3922 packet1.vy = packet_in.vy;
3923 packet1.vz = packet_in.vz;
3924 packet1.afx = packet_in.afx;
3925 packet1.afy = packet_in.afy;
3926 packet1.afz = packet_in.afz;
3927 packet1.yaw = packet_in.yaw;
3928 packet1.yaw_rate = packet_in.yaw_rate;
3929 packet1.type_mask = packet_in.type_mask;
3930 packet1.target_system = packet_in.target_system;
3931 packet1.target_component = packet_in.target_component;
3932 packet1.coordinate_frame = packet_in.coordinate_frame;
3933
3934
3935#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3936 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3937 // cope with extensions
3938 memset(MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN);
3939 }
3940#endif
3941 memset(&packet2, 0, sizeof(packet2));
3942 mavlink_msg_set_position_target_local_ned_encode(system_id, component_id, &msg, &packet1);
3943 mavlink_msg_set_position_target_local_ned_decode(&msg, &packet2);
3944 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3945
3946 memset(&packet2, 0, sizeof(packet2));
3947 mavlink_msg_set_position_target_local_ned_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
3948 mavlink_msg_set_position_target_local_ned_decode(&msg, &packet2);
3949 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3950
3951 memset(&packet2, 0, sizeof(packet2));
3952 mavlink_msg_set_position_target_local_ned_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
3953 mavlink_msg_set_position_target_local_ned_decode(&msg, &packet2);
3954 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3955
3956 memset(&packet2, 0, sizeof(packet2));
3957 mavlink_msg_to_send_buffer(buffer, &msg);
3958 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3959 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3960 }
3961 mavlink_msg_set_position_target_local_ned_decode(last_msg, &packet2);
3962 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3963
3964 memset(&packet2, 0, sizeof(packet2));
3965 mavlink_msg_set_position_target_local_ned_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
3966 mavlink_msg_set_position_target_local_ned_decode(last_msg, &packet2);
3967 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3968
3969#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3970 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SET_POSITION_TARGET_LOCAL_NED") != NULL);
3971 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED) != NULL);
3972#endif
3973}
3974
3975static void mavlink_test_position_target_local_ned(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3976{
3977#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3978 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3979 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED >= 256) {
3980 return;
3981 }
3982#endif
3983 mavlink_message_t msg;
3984 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3985 uint16_t i;
3986 mavlink_position_target_local_ned_t packet_in = {
3987 963497464,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27
3988 };
3989 mavlink_position_target_local_ned_t packet1, packet2;
3990 memset(&packet1, 0, sizeof(packet1));
3991 packet1.time_boot_ms = packet_in.time_boot_ms;
3992 packet1.x = packet_in.x;
3993 packet1.y = packet_in.y;
3994 packet1.z = packet_in.z;
3995 packet1.vx = packet_in.vx;
3996 packet1.vy = packet_in.vy;
3997 packet1.vz = packet_in.vz;
3998 packet1.afx = packet_in.afx;
3999 packet1.afy = packet_in.afy;
4000 packet1.afz = packet_in.afz;
4001 packet1.yaw = packet_in.yaw;
4002 packet1.yaw_rate = packet_in.yaw_rate;
4003 packet1.type_mask = packet_in.type_mask;
4004 packet1.coordinate_frame = packet_in.coordinate_frame;
4005
4006
4007#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4008 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4009 // cope with extensions
4010 memset(MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN);
4011 }
4012#endif
4013 memset(&packet2, 0, sizeof(packet2));
4014 mavlink_msg_position_target_local_ned_encode(system_id, component_id, &msg, &packet1);
4015 mavlink_msg_position_target_local_ned_decode(&msg, &packet2);
4016 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4017
4018 memset(&packet2, 0, sizeof(packet2));
4019 mavlink_msg_position_target_local_ned_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
4020 mavlink_msg_position_target_local_ned_decode(&msg, &packet2);
4021 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4022
4023 memset(&packet2, 0, sizeof(packet2));
4024 mavlink_msg_position_target_local_ned_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
4025 mavlink_msg_position_target_local_ned_decode(&msg, &packet2);
4026 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4027
4028 memset(&packet2, 0, sizeof(packet2));
4029 mavlink_msg_to_send_buffer(buffer, &msg);
4030 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4031 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4032 }
4033 mavlink_msg_position_target_local_ned_decode(last_msg, &packet2);
4034 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4035
4036 memset(&packet2, 0, sizeof(packet2));
4037 mavlink_msg_position_target_local_ned_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
4038 mavlink_msg_position_target_local_ned_decode(last_msg, &packet2);
4039 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4040
4041#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4042 MAVLINK_ASSERT(mavlink_get_message_info_by_name("POSITION_TARGET_LOCAL_NED") != NULL);
4043 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED) != NULL);
4044#endif
4045}
4046
4047static void mavlink_test_set_position_target_global_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4048{
4049#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4050 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4051 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT >= 256) {
4052 return;
4053 }
4054#endif
4055 mavlink_message_t msg;
4056 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4057 uint16_t i;
4058 mavlink_set_position_target_global_int_t packet_in = {
4059 963497464,963497672,963497880,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27,94,161
4060 };
4061 mavlink_set_position_target_global_int_t packet1, packet2;
4062 memset(&packet1, 0, sizeof(packet1));
4063 packet1.time_boot_ms = packet_in.time_boot_ms;
4064 packet1.lat_int = packet_in.lat_int;
4065 packet1.lon_int = packet_in.lon_int;
4066 packet1.alt = packet_in.alt;
4067 packet1.vx = packet_in.vx;
4068 packet1.vy = packet_in.vy;
4069 packet1.vz = packet_in.vz;
4070 packet1.afx = packet_in.afx;
4071 packet1.afy = packet_in.afy;
4072 packet1.afz = packet_in.afz;
4073 packet1.yaw = packet_in.yaw;
4074 packet1.yaw_rate = packet_in.yaw_rate;
4075 packet1.type_mask = packet_in.type_mask;
4076 packet1.target_system = packet_in.target_system;
4077 packet1.target_component = packet_in.target_component;
4078 packet1.coordinate_frame = packet_in.coordinate_frame;
4079
4080
4081#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4082 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4083 // cope with extensions
4084 memset(MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN);
4085 }
4086#endif
4087 memset(&packet2, 0, sizeof(packet2));
4088 mavlink_msg_set_position_target_global_int_encode(system_id, component_id, &msg, &packet1);
4089 mavlink_msg_set_position_target_global_int_decode(&msg, &packet2);
4090 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4091
4092 memset(&packet2, 0, sizeof(packet2));
4093 mavlink_msg_set_position_target_global_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
4094 mavlink_msg_set_position_target_global_int_decode(&msg, &packet2);
4095 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4096
4097 memset(&packet2, 0, sizeof(packet2));
4098 mavlink_msg_set_position_target_global_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
4099 mavlink_msg_set_position_target_global_int_decode(&msg, &packet2);
4100 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4101
4102 memset(&packet2, 0, sizeof(packet2));
4103 mavlink_msg_to_send_buffer(buffer, &msg);
4104 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4105 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4106 }
4107 mavlink_msg_set_position_target_global_int_decode(last_msg, &packet2);
4108 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4109
4110 memset(&packet2, 0, sizeof(packet2));
4111 mavlink_msg_set_position_target_global_int_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
4112 mavlink_msg_set_position_target_global_int_decode(last_msg, &packet2);
4113 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4114
4115#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4116 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SET_POSITION_TARGET_GLOBAL_INT") != NULL);
4117 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT) != NULL);
4118#endif
4119}
4120
4121static void mavlink_test_position_target_global_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4122{
4123#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4124 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4125 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT >= 256) {
4126 return;
4127 }
4128#endif
4129 mavlink_message_t msg;
4130 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4131 uint16_t i;
4132 mavlink_position_target_global_int_t packet_in = {
4133 963497464,963497672,963497880,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27
4134 };
4135 mavlink_position_target_global_int_t packet1, packet2;
4136 memset(&packet1, 0, sizeof(packet1));
4137 packet1.time_boot_ms = packet_in.time_boot_ms;
4138 packet1.lat_int = packet_in.lat_int;
4139 packet1.lon_int = packet_in.lon_int;
4140 packet1.alt = packet_in.alt;
4141 packet1.vx = packet_in.vx;
4142 packet1.vy = packet_in.vy;
4143 packet1.vz = packet_in.vz;
4144 packet1.afx = packet_in.afx;
4145 packet1.afy = packet_in.afy;
4146 packet1.afz = packet_in.afz;
4147 packet1.yaw = packet_in.yaw;
4148 packet1.yaw_rate = packet_in.yaw_rate;
4149 packet1.type_mask = packet_in.type_mask;
4150 packet1.coordinate_frame = packet_in.coordinate_frame;
4151
4152
4153#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4154 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4155 // cope with extensions
4156 memset(MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN);
4157 }
4158#endif
4159 memset(&packet2, 0, sizeof(packet2));
4160 mavlink_msg_position_target_global_int_encode(system_id, component_id, &msg, &packet1);
4161 mavlink_msg_position_target_global_int_decode(&msg, &packet2);
4162 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4163
4164 memset(&packet2, 0, sizeof(packet2));
4165 mavlink_msg_position_target_global_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
4166 mavlink_msg_position_target_global_int_decode(&msg, &packet2);
4167 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4168
4169 memset(&packet2, 0, sizeof(packet2));
4170 mavlink_msg_position_target_global_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
4171 mavlink_msg_position_target_global_int_decode(&msg, &packet2);
4172 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4173
4174 memset(&packet2, 0, sizeof(packet2));
4175 mavlink_msg_to_send_buffer(buffer, &msg);
4176 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4177 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4178 }
4179 mavlink_msg_position_target_global_int_decode(last_msg, &packet2);
4180 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4181
4182 memset(&packet2, 0, sizeof(packet2));
4183 mavlink_msg_position_target_global_int_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
4184 mavlink_msg_position_target_global_int_decode(last_msg, &packet2);
4185 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4186
4187#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4188 MAVLINK_ASSERT(mavlink_get_message_info_by_name("POSITION_TARGET_GLOBAL_INT") != NULL);
4189 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT) != NULL);
4190#endif
4191}
4192
4193static void mavlink_test_local_position_ned_system_global_offset(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4194{
4195#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4196 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4197 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET >= 256) {
4198 return;
4199 }
4200#endif
4201 mavlink_message_t msg;
4202 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4203 uint16_t i;
4204 mavlink_local_position_ned_system_global_offset_t packet_in = {
4205 963497464,45.0,73.0,101.0,129.0,157.0,185.0
4206 };
4207 mavlink_local_position_ned_system_global_offset_t packet1, packet2;
4208 memset(&packet1, 0, sizeof(packet1));
4209 packet1.time_boot_ms = packet_in.time_boot_ms;
4210 packet1.x = packet_in.x;
4211 packet1.y = packet_in.y;
4212 packet1.z = packet_in.z;
4213 packet1.roll = packet_in.roll;
4214 packet1.pitch = packet_in.pitch;
4215 packet1.yaw = packet_in.yaw;
4216
4217
4218#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4219 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4220 // cope with extensions
4221 memset(MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN);
4222 }
4223#endif
4224 memset(&packet2, 0, sizeof(packet2));
4225 mavlink_msg_local_position_ned_system_global_offset_encode(system_id, component_id, &msg, &packet1);
4226 mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2);
4227 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4228
4229 memset(&packet2, 0, sizeof(packet2));
4230 mavlink_msg_local_position_ned_system_global_offset_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
4231 mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2);
4232 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4233
4234 memset(&packet2, 0, sizeof(packet2));
4235 mavlink_msg_local_position_ned_system_global_offset_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
4236 mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2);
4237 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4238
4239 memset(&packet2, 0, sizeof(packet2));
4240 mavlink_msg_to_send_buffer(buffer, &msg);
4241 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4242 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4243 }
4244 mavlink_msg_local_position_ned_system_global_offset_decode(last_msg, &packet2);
4245 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4246
4247 memset(&packet2, 0, sizeof(packet2));
4248 mavlink_msg_local_position_ned_system_global_offset_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
4249 mavlink_msg_local_position_ned_system_global_offset_decode(last_msg, &packet2);
4250 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4251
4252#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4253 MAVLINK_ASSERT(mavlink_get_message_info_by_name("LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET") != NULL);
4254 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET) != NULL);
4255#endif
4256}
4257
4258static void mavlink_test_hil_state(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4259{
4260#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4261 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4262 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_STATE >= 256) {
4263 return;
4264 }
4265#endif
4266 mavlink_message_t msg;
4267 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4268 uint16_t i;
4269 mavlink_hil_state_t packet_in = {
4270 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,963499128,963499336,963499544,19523,19627,19731,19835,19939,20043
4271 };
4272 mavlink_hil_state_t packet1, packet2;
4273 memset(&packet1, 0, sizeof(packet1));
4274 packet1.time_usec = packet_in.time_usec;
4275 packet1.roll = packet_in.roll;
4276 packet1.pitch = packet_in.pitch;
4277 packet1.yaw = packet_in.yaw;
4278 packet1.rollspeed = packet_in.rollspeed;
4279 packet1.pitchspeed = packet_in.pitchspeed;
4280 packet1.yawspeed = packet_in.yawspeed;
4281 packet1.lat = packet_in.lat;
4282 packet1.lon = packet_in.lon;
4283 packet1.alt = packet_in.alt;
4284 packet1.vx = packet_in.vx;
4285 packet1.vy = packet_in.vy;
4286 packet1.vz = packet_in.vz;
4287 packet1.xacc = packet_in.xacc;
4288 packet1.yacc = packet_in.yacc;
4289 packet1.zacc = packet_in.zacc;
4290
4291
4292#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4293 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4294 // cope with extensions
4295 memset(MAVLINK_MSG_ID_HIL_STATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_STATE_MIN_LEN);
4296 }
4297#endif
4298 memset(&packet2, 0, sizeof(packet2));
4299 mavlink_msg_hil_state_encode(system_id, component_id, &msg, &packet1);
4300 mavlink_msg_hil_state_decode(&msg, &packet2);
4301 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4302
4303 memset(&packet2, 0, sizeof(packet2));
4304 mavlink_msg_hil_state_pack(system_id, component_id, &msg , packet1.time_usec , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.xacc , packet1.yacc , packet1.zacc );
4305 mavlink_msg_hil_state_decode(&msg, &packet2);
4306 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4307
4308 memset(&packet2, 0, sizeof(packet2));
4309 mavlink_msg_hil_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.xacc , packet1.yacc , packet1.zacc );
4310 mavlink_msg_hil_state_decode(&msg, &packet2);
4311 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4312
4313 memset(&packet2, 0, sizeof(packet2));
4314 mavlink_msg_to_send_buffer(buffer, &msg);
4315 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4316 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4317 }
4318 mavlink_msg_hil_state_decode(last_msg, &packet2);
4319 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4320
4321 memset(&packet2, 0, sizeof(packet2));
4322 mavlink_msg_hil_state_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.xacc , packet1.yacc , packet1.zacc );
4323 mavlink_msg_hil_state_decode(last_msg, &packet2);
4324 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4325
4326#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4327 MAVLINK_ASSERT(mavlink_get_message_info_by_name("HIL_STATE") != NULL);
4328 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HIL_STATE) != NULL);
4329#endif
4330}
4331
4332static void mavlink_test_hil_controls(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4333{
4334#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4335 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4336 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_CONTROLS >= 256) {
4337 return;
4338 }
4339#endif
4340 mavlink_message_t msg;
4341 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4342 uint16_t i;
4343 mavlink_hil_controls_t packet_in = {
4344 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,125,192
4345 };
4346 mavlink_hil_controls_t packet1, packet2;
4347 memset(&packet1, 0, sizeof(packet1));
4348 packet1.time_usec = packet_in.time_usec;
4349 packet1.roll_ailerons = packet_in.roll_ailerons;
4350 packet1.pitch_elevator = packet_in.pitch_elevator;
4351 packet1.yaw_rudder = packet_in.yaw_rudder;
4352 packet1.throttle = packet_in.throttle;
4353 packet1.aux1 = packet_in.aux1;
4354 packet1.aux2 = packet_in.aux2;
4355 packet1.aux3 = packet_in.aux3;
4356 packet1.aux4 = packet_in.aux4;
4357 packet1.mode = packet_in.mode;
4358 packet1.nav_mode = packet_in.nav_mode;
4359
4360
4361#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4362 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4363 // cope with extensions
4364 memset(MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN);
4365 }
4366#endif
4367 memset(&packet2, 0, sizeof(packet2));
4368 mavlink_msg_hil_controls_encode(system_id, component_id, &msg, &packet1);
4369 mavlink_msg_hil_controls_decode(&msg, &packet2);
4370 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4371
4372 memset(&packet2, 0, sizeof(packet2));
4373 mavlink_msg_hil_controls_pack(system_id, component_id, &msg , packet1.time_usec , packet1.roll_ailerons , packet1.pitch_elevator , packet1.yaw_rudder , packet1.throttle , packet1.aux1 , packet1.aux2 , packet1.aux3 , packet1.aux4 , packet1.mode , packet1.nav_mode );
4374 mavlink_msg_hil_controls_decode(&msg, &packet2);
4375 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4376
4377 memset(&packet2, 0, sizeof(packet2));
4378 mavlink_msg_hil_controls_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.roll_ailerons , packet1.pitch_elevator , packet1.yaw_rudder , packet1.throttle , packet1.aux1 , packet1.aux2 , packet1.aux3 , packet1.aux4 , packet1.mode , packet1.nav_mode );
4379 mavlink_msg_hil_controls_decode(&msg, &packet2);
4380 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4381
4382 memset(&packet2, 0, sizeof(packet2));
4383 mavlink_msg_to_send_buffer(buffer, &msg);
4384 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4385 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4386 }
4387 mavlink_msg_hil_controls_decode(last_msg, &packet2);
4388 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4389
4390 memset(&packet2, 0, sizeof(packet2));
4391 mavlink_msg_hil_controls_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.roll_ailerons , packet1.pitch_elevator , packet1.yaw_rudder , packet1.throttle , packet1.aux1 , packet1.aux2 , packet1.aux3 , packet1.aux4 , packet1.mode , packet1.nav_mode );
4392 mavlink_msg_hil_controls_decode(last_msg, &packet2);
4393 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4394
4395#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4396 MAVLINK_ASSERT(mavlink_get_message_info_by_name("HIL_CONTROLS") != NULL);
4397 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HIL_CONTROLS) != NULL);
4398#endif
4399}
4400
4401static void mavlink_test_hil_rc_inputs_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4402{
4403#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4404 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4405 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW >= 256) {
4406 return;
4407 }
4408#endif
4409 mavlink_message_t msg;
4410 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4411 uint16_t i;
4412 mavlink_hil_rc_inputs_raw_t packet_in = {
4413 93372036854775807ULL,17651,17755,17859,17963,18067,18171,18275,18379,18483,18587,18691,18795,101
4414 };
4415 mavlink_hil_rc_inputs_raw_t packet1, packet2;
4416 memset(&packet1, 0, sizeof(packet1));
4417 packet1.time_usec = packet_in.time_usec;
4418 packet1.chan1_raw = packet_in.chan1_raw;
4419 packet1.chan2_raw = packet_in.chan2_raw;
4420 packet1.chan3_raw = packet_in.chan3_raw;
4421 packet1.chan4_raw = packet_in.chan4_raw;
4422 packet1.chan5_raw = packet_in.chan5_raw;
4423 packet1.chan6_raw = packet_in.chan6_raw;
4424 packet1.chan7_raw = packet_in.chan7_raw;
4425 packet1.chan8_raw = packet_in.chan8_raw;
4426 packet1.chan9_raw = packet_in.chan9_raw;
4427 packet1.chan10_raw = packet_in.chan10_raw;
4428 packet1.chan11_raw = packet_in.chan11_raw;
4429 packet1.chan12_raw = packet_in.chan12_raw;
4430 packet1.rssi = packet_in.rssi;
4431
4432
4433#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4434 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4435 // cope with extensions
4436 memset(MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN);
4437 }
4438#endif
4439 memset(&packet2, 0, sizeof(packet2));
4440 mavlink_msg_hil_rc_inputs_raw_encode(system_id, component_id, &msg, &packet1);
4441 mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2);
4442 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4443
4444 memset(&packet2, 0, sizeof(packet2));
4445 mavlink_msg_hil_rc_inputs_raw_pack(system_id, component_id, &msg , packet1.time_usec , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.rssi );
4446 mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2);
4447 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4448
4449 memset(&packet2, 0, sizeof(packet2));
4450 mavlink_msg_hil_rc_inputs_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.rssi );
4451 mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2);
4452 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4453
4454 memset(&packet2, 0, sizeof(packet2));
4455 mavlink_msg_to_send_buffer(buffer, &msg);
4456 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4457 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4458 }
4459 mavlink_msg_hil_rc_inputs_raw_decode(last_msg, &packet2);
4460 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4461
4462 memset(&packet2, 0, sizeof(packet2));
4463 mavlink_msg_hil_rc_inputs_raw_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.rssi );
4464 mavlink_msg_hil_rc_inputs_raw_decode(last_msg, &packet2);
4465 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4466
4467#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4468 MAVLINK_ASSERT(mavlink_get_message_info_by_name("HIL_RC_INPUTS_RAW") != NULL);
4469 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW) != NULL);
4470#endif
4471}
4472
4473static void mavlink_test_hil_actuator_controls(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4474{
4475#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4476 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4477 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS >= 256) {
4478 return;
4479 }
4480#endif
4481 mavlink_message_t msg;
4482 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4483 uint16_t i;
4484 mavlink_hil_actuator_controls_t packet_in = {
4485 93372036854775807ULL,93372036854776311ULL,{ 129.0, 130.0, 131.0, 132.0, 133.0, 134.0, 135.0, 136.0, 137.0, 138.0, 139.0, 140.0, 141.0, 142.0, 143.0, 144.0 },245
4486 };
4487 mavlink_hil_actuator_controls_t packet1, packet2;
4488 memset(&packet1, 0, sizeof(packet1));
4489 packet1.time_usec = packet_in.time_usec;
4490 packet1.flags = packet_in.flags;
4491 packet1.mode = packet_in.mode;
4492
4493 mav_array_memcpy(packet1.controls, packet_in.controls, sizeof(float)*16);
4494
4495#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4496 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4497 // cope with extensions
4498 memset(MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_MIN_LEN);
4499 }
4500#endif
4501 memset(&packet2, 0, sizeof(packet2));
4502 mavlink_msg_hil_actuator_controls_encode(system_id, component_id, &msg, &packet1);
4503 mavlink_msg_hil_actuator_controls_decode(&msg, &packet2);
4504 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4505
4506 memset(&packet2, 0, sizeof(packet2));
4507 mavlink_msg_hil_actuator_controls_pack(system_id, component_id, &msg , packet1.time_usec , packet1.controls , packet1.mode , packet1.flags );
4508 mavlink_msg_hil_actuator_controls_decode(&msg, &packet2);
4509 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4510
4511 memset(&packet2, 0, sizeof(packet2));
4512 mavlink_msg_hil_actuator_controls_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.controls , packet1.mode , packet1.flags );
4513 mavlink_msg_hil_actuator_controls_decode(&msg, &packet2);
4514 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4515
4516 memset(&packet2, 0, sizeof(packet2));
4517 mavlink_msg_to_send_buffer(buffer, &msg);
4518 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4519 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4520 }
4521 mavlink_msg_hil_actuator_controls_decode(last_msg, &packet2);
4522 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4523
4524 memset(&packet2, 0, sizeof(packet2));
4525 mavlink_msg_hil_actuator_controls_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.controls , packet1.mode , packet1.flags );
4526 mavlink_msg_hil_actuator_controls_decode(last_msg, &packet2);
4527 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4528
4529#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4530 MAVLINK_ASSERT(mavlink_get_message_info_by_name("HIL_ACTUATOR_CONTROLS") != NULL);
4531 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS) != NULL);
4532#endif
4533}
4534
4535static void mavlink_test_optical_flow(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4536{
4537#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4538 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4539 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPTICAL_FLOW >= 256) {
4540 return;
4541 }
4542#endif
4543 mavlink_message_t msg;
4544 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4545 uint16_t i;
4546 mavlink_optical_flow_t packet_in = {
4547 93372036854775807ULL,73.0,101.0,129.0,18275,18379,77,144,199.0,227.0
4548 };
4549 mavlink_optical_flow_t packet1, packet2;
4550 memset(&packet1, 0, sizeof(packet1));
4551 packet1.time_usec = packet_in.time_usec;
4552 packet1.flow_comp_m_x = packet_in.flow_comp_m_x;
4553 packet1.flow_comp_m_y = packet_in.flow_comp_m_y;
4554 packet1.ground_distance = packet_in.ground_distance;
4555 packet1.flow_x = packet_in.flow_x;
4556 packet1.flow_y = packet_in.flow_y;
4557 packet1.sensor_id = packet_in.sensor_id;
4558 packet1.quality = packet_in.quality;
4559 packet1.flow_rate_x = packet_in.flow_rate_x;
4560 packet1.flow_rate_y = packet_in.flow_rate_y;
4561
4562
4563#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4564 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4565 // cope with extensions
4566 memset(MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN);
4567 }
4568#endif
4569 memset(&packet2, 0, sizeof(packet2));
4570 mavlink_msg_optical_flow_encode(system_id, component_id, &msg, &packet1);
4571 mavlink_msg_optical_flow_decode(&msg, &packet2);
4572 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4573
4574 memset(&packet2, 0, sizeof(packet2));
4575 mavlink_msg_optical_flow_pack(system_id, component_id, &msg , packet1.time_usec , packet1.sensor_id , packet1.flow_x , packet1.flow_y , packet1.flow_comp_m_x , packet1.flow_comp_m_y , packet1.quality , packet1.ground_distance , packet1.flow_rate_x , packet1.flow_rate_y );
4576 mavlink_msg_optical_flow_decode(&msg, &packet2);
4577 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4578
4579 memset(&packet2, 0, sizeof(packet2));
4580 mavlink_msg_optical_flow_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.sensor_id , packet1.flow_x , packet1.flow_y , packet1.flow_comp_m_x , packet1.flow_comp_m_y , packet1.quality , packet1.ground_distance , packet1.flow_rate_x , packet1.flow_rate_y );
4581 mavlink_msg_optical_flow_decode(&msg, &packet2);
4582 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4583
4584 memset(&packet2, 0, sizeof(packet2));
4585 mavlink_msg_to_send_buffer(buffer, &msg);
4586 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4587 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4588 }
4589 mavlink_msg_optical_flow_decode(last_msg, &packet2);
4590 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4591
4592 memset(&packet2, 0, sizeof(packet2));
4593 mavlink_msg_optical_flow_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.sensor_id , packet1.flow_x , packet1.flow_y , packet1.flow_comp_m_x , packet1.flow_comp_m_y , packet1.quality , packet1.ground_distance , packet1.flow_rate_x , packet1.flow_rate_y );
4594 mavlink_msg_optical_flow_decode(last_msg, &packet2);
4595 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4596
4597#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4598 MAVLINK_ASSERT(mavlink_get_message_info_by_name("OPTICAL_FLOW") != NULL);
4599 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OPTICAL_FLOW) != NULL);
4600#endif
4601}
4602
4603static void mavlink_test_global_vision_position_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4604{
4605#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4606 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4607 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE >= 256) {
4608 return;
4609 }
4610#endif
4611 mavlink_message_t msg;
4612 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4613 uint16_t i;
4614 mavlink_global_vision_position_estimate_t packet_in = {
4615 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,{ 241.0, 242.0, 243.0, 244.0, 245.0, 246.0, 247.0, 248.0, 249.0, 250.0, 251.0, 252.0, 253.0, 254.0, 255.0, 256.0, 257.0, 258.0, 259.0, 260.0, 261.0 },97
4616 };
4617 mavlink_global_vision_position_estimate_t packet1, packet2;
4618 memset(&packet1, 0, sizeof(packet1));
4619 packet1.usec = packet_in.usec;
4620 packet1.x = packet_in.x;
4621 packet1.y = packet_in.y;
4622 packet1.z = packet_in.z;
4623 packet1.roll = packet_in.roll;
4624 packet1.pitch = packet_in.pitch;
4625 packet1.yaw = packet_in.yaw;
4626 packet1.reset_counter = packet_in.reset_counter;
4627
4628 mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*21);
4629
4630#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4631 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4632 // cope with extensions
4633 memset(MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN);
4634 }
4635#endif
4636 memset(&packet2, 0, sizeof(packet2));
4637 mavlink_msg_global_vision_position_estimate_encode(system_id, component_id, &msg, &packet1);
4638 mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2);
4639 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4640
4641 memset(&packet2, 0, sizeof(packet2));
4642 mavlink_msg_global_vision_position_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw , packet1.covariance , packet1.reset_counter );
4643 mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2);
4644 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4645
4646 memset(&packet2, 0, sizeof(packet2));
4647 mavlink_msg_global_vision_position_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw , packet1.covariance , packet1.reset_counter );
4648 mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2);
4649 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4650
4651 memset(&packet2, 0, sizeof(packet2));
4652 mavlink_msg_to_send_buffer(buffer, &msg);
4653 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4654 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4655 }
4656 mavlink_msg_global_vision_position_estimate_decode(last_msg, &packet2);
4657 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4658
4659 memset(&packet2, 0, sizeof(packet2));
4660 mavlink_msg_global_vision_position_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw , packet1.covariance , packet1.reset_counter );
4661 mavlink_msg_global_vision_position_estimate_decode(last_msg, &packet2);
4662 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4663
4664#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4665 MAVLINK_ASSERT(mavlink_get_message_info_by_name("GLOBAL_VISION_POSITION_ESTIMATE") != NULL);
4666 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE) != NULL);
4667#endif
4668}
4669
4670static void mavlink_test_vision_position_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4671{
4672#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4673 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4674 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE >= 256) {
4675 return;
4676 }
4677#endif
4678 mavlink_message_t msg;
4679 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4680 uint16_t i;
4681 mavlink_vision_position_estimate_t packet_in = {
4682 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,{ 241.0, 242.0, 243.0, 244.0, 245.0, 246.0, 247.0, 248.0, 249.0, 250.0, 251.0, 252.0, 253.0, 254.0, 255.0, 256.0, 257.0, 258.0, 259.0, 260.0, 261.0 },97
4683 };
4684 mavlink_vision_position_estimate_t packet1, packet2;
4685 memset(&packet1, 0, sizeof(packet1));
4686 packet1.usec = packet_in.usec;
4687 packet1.x = packet_in.x;
4688 packet1.y = packet_in.y;
4689 packet1.z = packet_in.z;
4690 packet1.roll = packet_in.roll;
4691 packet1.pitch = packet_in.pitch;
4692 packet1.yaw = packet_in.yaw;
4693 packet1.reset_counter = packet_in.reset_counter;
4694
4695 mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*21);
4696
4697#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4698 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4699 // cope with extensions
4700 memset(MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN);
4701 }
4702#endif
4703 memset(&packet2, 0, sizeof(packet2));
4704 mavlink_msg_vision_position_estimate_encode(system_id, component_id, &msg, &packet1);
4705 mavlink_msg_vision_position_estimate_decode(&msg, &packet2);
4706 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4707
4708 memset(&packet2, 0, sizeof(packet2));
4709 mavlink_msg_vision_position_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw , packet1.covariance , packet1.reset_counter );
4710 mavlink_msg_vision_position_estimate_decode(&msg, &packet2);
4711 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4712
4713 memset(&packet2, 0, sizeof(packet2));
4714 mavlink_msg_vision_position_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw , packet1.covariance , packet1.reset_counter );
4715 mavlink_msg_vision_position_estimate_decode(&msg, &packet2);
4716 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4717
4718 memset(&packet2, 0, sizeof(packet2));
4719 mavlink_msg_to_send_buffer(buffer, &msg);
4720 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4721 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4722 }
4723 mavlink_msg_vision_position_estimate_decode(last_msg, &packet2);
4724 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4725
4726 memset(&packet2, 0, sizeof(packet2));
4727 mavlink_msg_vision_position_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw , packet1.covariance , packet1.reset_counter );
4728 mavlink_msg_vision_position_estimate_decode(last_msg, &packet2);
4729 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4730
4731#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4732 MAVLINK_ASSERT(mavlink_get_message_info_by_name("VISION_POSITION_ESTIMATE") != NULL);
4733 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE) != NULL);
4734#endif
4735}
4736
4737static void mavlink_test_vision_speed_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4738{
4739#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4740 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4741 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE >= 256) {
4742 return;
4743 }
4744#endif
4745 mavlink_message_t msg;
4746 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4747 uint16_t i;
4748 mavlink_vision_speed_estimate_t packet_in = {
4749 93372036854775807ULL,73.0,101.0,129.0,{ 157.0, 158.0, 159.0, 160.0, 161.0, 162.0, 163.0, 164.0, 165.0 },173
4750 };
4751 mavlink_vision_speed_estimate_t packet1, packet2;
4752 memset(&packet1, 0, sizeof(packet1));
4753 packet1.usec = packet_in.usec;
4754 packet1.x = packet_in.x;
4755 packet1.y = packet_in.y;
4756 packet1.z = packet_in.z;
4757 packet1.reset_counter = packet_in.reset_counter;
4758
4759 mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*9);
4760
4761#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4762 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4763 // cope with extensions
4764 memset(MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN);
4765 }
4766#endif
4767 memset(&packet2, 0, sizeof(packet2));
4768 mavlink_msg_vision_speed_estimate_encode(system_id, component_id, &msg, &packet1);
4769 mavlink_msg_vision_speed_estimate_decode(&msg, &packet2);
4770 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4771
4772 memset(&packet2, 0, sizeof(packet2));
4773 mavlink_msg_vision_speed_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.covariance , packet1.reset_counter );
4774 mavlink_msg_vision_speed_estimate_decode(&msg, &packet2);
4775 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4776
4777 memset(&packet2, 0, sizeof(packet2));
4778 mavlink_msg_vision_speed_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.covariance , packet1.reset_counter );
4779 mavlink_msg_vision_speed_estimate_decode(&msg, &packet2);
4780 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4781
4782 memset(&packet2, 0, sizeof(packet2));
4783 mavlink_msg_to_send_buffer(buffer, &msg);
4784 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4785 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4786 }
4787 mavlink_msg_vision_speed_estimate_decode(last_msg, &packet2);
4788 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4789
4790 memset(&packet2, 0, sizeof(packet2));
4791 mavlink_msg_vision_speed_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.covariance , packet1.reset_counter );
4792 mavlink_msg_vision_speed_estimate_decode(last_msg, &packet2);
4793 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4794
4795#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4796 MAVLINK_ASSERT(mavlink_get_message_info_by_name("VISION_SPEED_ESTIMATE") != NULL);
4797 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE) != NULL);
4798#endif
4799}
4800
4801static void mavlink_test_vicon_position_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4802{
4803#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4804 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4805 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE >= 256) {
4806 return;
4807 }
4808#endif
4809 mavlink_message_t msg;
4810 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4811 uint16_t i;
4812 mavlink_vicon_position_estimate_t packet_in = {
4813 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,{ 241.0, 242.0, 243.0, 244.0, 245.0, 246.0, 247.0, 248.0, 249.0, 250.0, 251.0, 252.0, 253.0, 254.0, 255.0, 256.0, 257.0, 258.0, 259.0, 260.0, 261.0 }
4814 };
4815 mavlink_vicon_position_estimate_t packet1, packet2;
4816 memset(&packet1, 0, sizeof(packet1));
4817 packet1.usec = packet_in.usec;
4818 packet1.x = packet_in.x;
4819 packet1.y = packet_in.y;
4820 packet1.z = packet_in.z;
4821 packet1.roll = packet_in.roll;
4822 packet1.pitch = packet_in.pitch;
4823 packet1.yaw = packet_in.yaw;
4824
4825 mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*21);
4826
4827#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4828 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4829 // cope with extensions
4830 memset(MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN);
4831 }
4832#endif
4833 memset(&packet2, 0, sizeof(packet2));
4834 mavlink_msg_vicon_position_estimate_encode(system_id, component_id, &msg, &packet1);
4835 mavlink_msg_vicon_position_estimate_decode(&msg, &packet2);
4836 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4837
4838 memset(&packet2, 0, sizeof(packet2));
4839 mavlink_msg_vicon_position_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw , packet1.covariance );
4840 mavlink_msg_vicon_position_estimate_decode(&msg, &packet2);
4841 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4842
4843 memset(&packet2, 0, sizeof(packet2));
4844 mavlink_msg_vicon_position_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw , packet1.covariance );
4845 mavlink_msg_vicon_position_estimate_decode(&msg, &packet2);
4846 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4847
4848 memset(&packet2, 0, sizeof(packet2));
4849 mavlink_msg_to_send_buffer(buffer, &msg);
4850 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4851 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4852 }
4853 mavlink_msg_vicon_position_estimate_decode(last_msg, &packet2);
4854 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4855
4856 memset(&packet2, 0, sizeof(packet2));
4857 mavlink_msg_vicon_position_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw , packet1.covariance );
4858 mavlink_msg_vicon_position_estimate_decode(last_msg, &packet2);
4859 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4860
4861#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4862 MAVLINK_ASSERT(mavlink_get_message_info_by_name("VICON_POSITION_ESTIMATE") != NULL);
4863 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE) != NULL);
4864#endif
4865}
4866
4867static void mavlink_test_highres_imu(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4868{
4869#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4870 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4871 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIGHRES_IMU >= 256) {
4872 return;
4873 }
4874#endif
4875 mavlink_message_t msg;
4876 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4877 uint16_t i;
4878 mavlink_highres_imu_t packet_in = {
4879 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,409.0,20355,63
4880 };
4881 mavlink_highres_imu_t packet1, packet2;
4882 memset(&packet1, 0, sizeof(packet1));
4883 packet1.time_usec = packet_in.time_usec;
4884 packet1.xacc = packet_in.xacc;
4885 packet1.yacc = packet_in.yacc;
4886 packet1.zacc = packet_in.zacc;
4887 packet1.xgyro = packet_in.xgyro;
4888 packet1.ygyro = packet_in.ygyro;
4889 packet1.zgyro = packet_in.zgyro;
4890 packet1.xmag = packet_in.xmag;
4891 packet1.ymag = packet_in.ymag;
4892 packet1.zmag = packet_in.zmag;
4893 packet1.abs_pressure = packet_in.abs_pressure;
4894 packet1.diff_pressure = packet_in.diff_pressure;
4895 packet1.pressure_alt = packet_in.pressure_alt;
4896 packet1.temperature = packet_in.temperature;
4897 packet1.fields_updated = packet_in.fields_updated;
4898 packet1.id = packet_in.id;
4899
4900
4901#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4902 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4903 // cope with extensions
4904 memset(MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN);
4905 }
4906#endif
4907 memset(&packet2, 0, sizeof(packet2));
4908 mavlink_msg_highres_imu_encode(system_id, component_id, &msg, &packet1);
4909 mavlink_msg_highres_imu_decode(&msg, &packet2);
4910 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4911
4912 memset(&packet2, 0, sizeof(packet2));
4913 mavlink_msg_highres_imu_pack(system_id, component_id, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated , packet1.id );
4914 mavlink_msg_highres_imu_decode(&msg, &packet2);
4915 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4916
4917 memset(&packet2, 0, sizeof(packet2));
4918 mavlink_msg_highres_imu_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated , packet1.id );
4919 mavlink_msg_highres_imu_decode(&msg, &packet2);
4920 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4921
4922 memset(&packet2, 0, sizeof(packet2));
4923 mavlink_msg_to_send_buffer(buffer, &msg);
4924 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4925 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4926 }
4927 mavlink_msg_highres_imu_decode(last_msg, &packet2);
4928 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4929
4930 memset(&packet2, 0, sizeof(packet2));
4931 mavlink_msg_highres_imu_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated , packet1.id );
4932 mavlink_msg_highres_imu_decode(last_msg, &packet2);
4933 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4934
4935#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4936 MAVLINK_ASSERT(mavlink_get_message_info_by_name("HIGHRES_IMU") != NULL);
4937 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HIGHRES_IMU) != NULL);
4938#endif
4939}
4940
4941static void mavlink_test_optical_flow_rad(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4942{
4943#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4944 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4945 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPTICAL_FLOW_RAD >= 256) {
4946 return;
4947 }
4948#endif
4949 mavlink_message_t msg;
4950 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4951 uint16_t i;
4952 mavlink_optical_flow_rad_t packet_in = {
4953 93372036854775807ULL,963497880,101.0,129.0,157.0,185.0,213.0,963499128,269.0,19315,3,70
4954 };
4955 mavlink_optical_flow_rad_t packet1, packet2;
4956 memset(&packet1, 0, sizeof(packet1));
4957 packet1.time_usec = packet_in.time_usec;
4958 packet1.integration_time_us = packet_in.integration_time_us;
4959 packet1.integrated_x = packet_in.integrated_x;
4960 packet1.integrated_y = packet_in.integrated_y;
4961 packet1.integrated_xgyro = packet_in.integrated_xgyro;
4962 packet1.integrated_ygyro = packet_in.integrated_ygyro;
4963 packet1.integrated_zgyro = packet_in.integrated_zgyro;
4964 packet1.time_delta_distance_us = packet_in.time_delta_distance_us;
4965 packet1.distance = packet_in.distance;
4966 packet1.temperature = packet_in.temperature;
4967 packet1.sensor_id = packet_in.sensor_id;
4968 packet1.quality = packet_in.quality;
4969
4970
4971#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4972 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4973 // cope with extensions
4974 memset(MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN);
4975 }
4976#endif
4977 memset(&packet2, 0, sizeof(packet2));
4978 mavlink_msg_optical_flow_rad_encode(system_id, component_id, &msg, &packet1);
4979 mavlink_msg_optical_flow_rad_decode(&msg, &packet2);
4980 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4981
4982 memset(&packet2, 0, sizeof(packet2));
4983 mavlink_msg_optical_flow_rad_pack(system_id, component_id, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
4984 mavlink_msg_optical_flow_rad_decode(&msg, &packet2);
4985 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4986
4987 memset(&packet2, 0, sizeof(packet2));
4988 mavlink_msg_optical_flow_rad_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
4989 mavlink_msg_optical_flow_rad_decode(&msg, &packet2);
4990 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4991
4992 memset(&packet2, 0, sizeof(packet2));
4993 mavlink_msg_to_send_buffer(buffer, &msg);
4994 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4995 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4996 }
4997 mavlink_msg_optical_flow_rad_decode(last_msg, &packet2);
4998 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4999
5000 memset(&packet2, 0, sizeof(packet2));
5001 mavlink_msg_optical_flow_rad_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
5002 mavlink_msg_optical_flow_rad_decode(last_msg, &packet2);
5003 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5004
5005#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5006 MAVLINK_ASSERT(mavlink_get_message_info_by_name("OPTICAL_FLOW_RAD") != NULL);
5007 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OPTICAL_FLOW_RAD) != NULL);
5008#endif
5009}
5010
5011static void mavlink_test_hil_sensor(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5012{
5013#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5014 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5015 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_SENSOR >= 256) {
5016 return;
5017 }
5018#endif
5019 mavlink_message_t msg;
5020 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5021 uint16_t i;
5022 mavlink_hil_sensor_t packet_in = {
5023 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,409.0,963500584,197
5024 };
5025 mavlink_hil_sensor_t packet1, packet2;
5026 memset(&packet1, 0, sizeof(packet1));
5027 packet1.time_usec = packet_in.time_usec;
5028 packet1.xacc = packet_in.xacc;
5029 packet1.yacc = packet_in.yacc;
5030 packet1.zacc = packet_in.zacc;
5031 packet1.xgyro = packet_in.xgyro;
5032 packet1.ygyro = packet_in.ygyro;
5033 packet1.zgyro = packet_in.zgyro;
5034 packet1.xmag = packet_in.xmag;
5035 packet1.ymag = packet_in.ymag;
5036 packet1.zmag = packet_in.zmag;
5037 packet1.abs_pressure = packet_in.abs_pressure;
5038 packet1.diff_pressure = packet_in.diff_pressure;
5039 packet1.pressure_alt = packet_in.pressure_alt;
5040 packet1.temperature = packet_in.temperature;
5041 packet1.fields_updated = packet_in.fields_updated;
5042 packet1.id = packet_in.id;
5043
5044
5045#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5046 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5047 // cope with extensions
5048 memset(MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN);
5049 }
5050#endif
5051 memset(&packet2, 0, sizeof(packet2));
5052 mavlink_msg_hil_sensor_encode(system_id, component_id, &msg, &packet1);
5053 mavlink_msg_hil_sensor_decode(&msg, &packet2);
5054 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5055
5056 memset(&packet2, 0, sizeof(packet2));
5057 mavlink_msg_hil_sensor_pack(system_id, component_id, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated , packet1.id );
5058 mavlink_msg_hil_sensor_decode(&msg, &packet2);
5059 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5060
5061 memset(&packet2, 0, sizeof(packet2));
5062 mavlink_msg_hil_sensor_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated , packet1.id );
5063 mavlink_msg_hil_sensor_decode(&msg, &packet2);
5064 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5065
5066 memset(&packet2, 0, sizeof(packet2));
5067 mavlink_msg_to_send_buffer(buffer, &msg);
5068 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5069 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5070 }
5071 mavlink_msg_hil_sensor_decode(last_msg, &packet2);
5072 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5073
5074 memset(&packet2, 0, sizeof(packet2));
5075 mavlink_msg_hil_sensor_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated , packet1.id );
5076 mavlink_msg_hil_sensor_decode(last_msg, &packet2);
5077 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5078
5079#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5080 MAVLINK_ASSERT(mavlink_get_message_info_by_name("HIL_SENSOR") != NULL);
5081 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HIL_SENSOR) != NULL);
5082#endif
5083}
5084
5085static void mavlink_test_sim_state(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5086{
5087#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5088 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5089 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SIM_STATE >= 256) {
5090 return;
5091 }
5092#endif
5093 mavlink_message_t msg;
5094 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5095 uint16_t i;
5096 mavlink_sim_state_t packet_in = {
5097 17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,409.0,437.0,465.0,493.0,521.0,549.0,577.0,963501832,963502040
5098 };
5099 mavlink_sim_state_t packet1, packet2;
5100 memset(&packet1, 0, sizeof(packet1));
5101 packet1.q1 = packet_in.q1;
5102 packet1.q2 = packet_in.q2;
5103 packet1.q3 = packet_in.q3;
5104 packet1.q4 = packet_in.q4;
5105 packet1.roll = packet_in.roll;
5106 packet1.pitch = packet_in.pitch;
5107 packet1.yaw = packet_in.yaw;
5108 packet1.xacc = packet_in.xacc;
5109 packet1.yacc = packet_in.yacc;
5110 packet1.zacc = packet_in.zacc;
5111 packet1.xgyro = packet_in.xgyro;
5112 packet1.ygyro = packet_in.ygyro;
5113 packet1.zgyro = packet_in.zgyro;
5114 packet1.lat = packet_in.lat;
5115 packet1.lon = packet_in.lon;
5116 packet1.alt = packet_in.alt;
5117 packet1.std_dev_horz = packet_in.std_dev_horz;
5118 packet1.std_dev_vert = packet_in.std_dev_vert;
5119 packet1.vn = packet_in.vn;
5120 packet1.ve = packet_in.ve;
5121 packet1.vd = packet_in.vd;
5122 packet1.lat_int = packet_in.lat_int;
5123 packet1.lon_int = packet_in.lon_int;
5124
5125
5126#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5127 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5128 // cope with extensions
5129 memset(MAVLINK_MSG_ID_SIM_STATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SIM_STATE_MIN_LEN);
5130 }
5131#endif
5132 memset(&packet2, 0, sizeof(packet2));
5133 mavlink_msg_sim_state_encode(system_id, component_id, &msg, &packet1);
5134 mavlink_msg_sim_state_decode(&msg, &packet2);
5135 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5136
5137 memset(&packet2, 0, sizeof(packet2));
5138 mavlink_msg_sim_state_pack(system_id, component_id, &msg , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lon , packet1.alt , packet1.std_dev_horz , packet1.std_dev_vert , packet1.vn , packet1.ve , packet1.vd , packet1.lat_int , packet1.lon_int );
5139 mavlink_msg_sim_state_decode(&msg, &packet2);
5140 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5141
5142 memset(&packet2, 0, sizeof(packet2));
5143 mavlink_msg_sim_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lon , packet1.alt , packet1.std_dev_horz , packet1.std_dev_vert , packet1.vn , packet1.ve , packet1.vd , packet1.lat_int , packet1.lon_int );
5144 mavlink_msg_sim_state_decode(&msg, &packet2);
5145 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5146
5147 memset(&packet2, 0, sizeof(packet2));
5148 mavlink_msg_to_send_buffer(buffer, &msg);
5149 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5150 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5151 }
5152 mavlink_msg_sim_state_decode(last_msg, &packet2);
5153 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5154
5155 memset(&packet2, 0, sizeof(packet2));
5156 mavlink_msg_sim_state_send(MAVLINK_COMM_1 , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lon , packet1.alt , packet1.std_dev_horz , packet1.std_dev_vert , packet1.vn , packet1.ve , packet1.vd , packet1.lat_int , packet1.lon_int );
5157 mavlink_msg_sim_state_decode(last_msg, &packet2);
5158 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5159
5160#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5161 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SIM_STATE") != NULL);
5162 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SIM_STATE) != NULL);
5163#endif
5164}
5165
5166static void mavlink_test_radio_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5167{
5168#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5169 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5170 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RADIO_STATUS >= 256) {
5171 return;
5172 }
5173#endif
5174 mavlink_message_t msg;
5175 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5176 uint16_t i;
5177 mavlink_radio_status_t packet_in = {
5178 17235,17339,17,84,151,218,29
5179 };
5180 mavlink_radio_status_t packet1, packet2;
5181 memset(&packet1, 0, sizeof(packet1));
5182 packet1.rxerrors = packet_in.rxerrors;
5183 packet1.fixed = packet_in.fixed;
5184 packet1.rssi = packet_in.rssi;
5185 packet1.remrssi = packet_in.remrssi;
5186 packet1.txbuf = packet_in.txbuf;
5187 packet1.noise = packet_in.noise;
5188 packet1.remnoise = packet_in.remnoise;
5189
5190
5191#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5192 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5193 // cope with extensions
5194 memset(MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN);
5195 }
5196#endif
5197 memset(&packet2, 0, sizeof(packet2));
5198 mavlink_msg_radio_status_encode(system_id, component_id, &msg, &packet1);
5199 mavlink_msg_radio_status_decode(&msg, &packet2);
5200 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5201
5202 memset(&packet2, 0, sizeof(packet2));
5203 mavlink_msg_radio_status_pack(system_id, component_id, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
5204 mavlink_msg_radio_status_decode(&msg, &packet2);
5205 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5206
5207 memset(&packet2, 0, sizeof(packet2));
5208 mavlink_msg_radio_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
5209 mavlink_msg_radio_status_decode(&msg, &packet2);
5210 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5211
5212 memset(&packet2, 0, sizeof(packet2));
5213 mavlink_msg_to_send_buffer(buffer, &msg);
5214 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5215 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5216 }
5217 mavlink_msg_radio_status_decode(last_msg, &packet2);
5218 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5219
5220 memset(&packet2, 0, sizeof(packet2));
5221 mavlink_msg_radio_status_send(MAVLINK_COMM_1 , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
5222 mavlink_msg_radio_status_decode(last_msg, &packet2);
5223 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5224
5225#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5226 MAVLINK_ASSERT(mavlink_get_message_info_by_name("RADIO_STATUS") != NULL);
5227 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_RADIO_STATUS) != NULL);
5228#endif
5229}
5230
5231static void mavlink_test_file_transfer_protocol(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5232{
5233#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5234 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5235 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL >= 256) {
5236 return;
5237 }
5238#endif
5239 mavlink_message_t msg;
5240 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5241 uint16_t i;
5242 mavlink_file_transfer_protocol_t packet_in = {
5243 5,72,139,{ 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, 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 }
5244 };
5245 mavlink_file_transfer_protocol_t packet1, packet2;
5246 memset(&packet1, 0, sizeof(packet1));
5247 packet1.target_network = packet_in.target_network;
5248 packet1.target_system = packet_in.target_system;
5249 packet1.target_component = packet_in.target_component;
5250
5251 mav_array_memcpy(packet1.payload, packet_in.payload, sizeof(uint8_t)*251);
5252
5253#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5254 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5255 // cope with extensions
5256 memset(MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN);
5257 }
5258#endif
5259 memset(&packet2, 0, sizeof(packet2));
5260 mavlink_msg_file_transfer_protocol_encode(system_id, component_id, &msg, &packet1);
5261 mavlink_msg_file_transfer_protocol_decode(&msg, &packet2);
5262 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5263
5264 memset(&packet2, 0, sizeof(packet2));
5265 mavlink_msg_file_transfer_protocol_pack(system_id, component_id, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.payload );
5266 mavlink_msg_file_transfer_protocol_decode(&msg, &packet2);
5267 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5268
5269 memset(&packet2, 0, sizeof(packet2));
5270 mavlink_msg_file_transfer_protocol_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.payload );
5271 mavlink_msg_file_transfer_protocol_decode(&msg, &packet2);
5272 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5273
5274 memset(&packet2, 0, sizeof(packet2));
5275 mavlink_msg_to_send_buffer(buffer, &msg);
5276 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5277 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5278 }
5279 mavlink_msg_file_transfer_protocol_decode(last_msg, &packet2);
5280 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5281
5282 memset(&packet2, 0, sizeof(packet2));
5283 mavlink_msg_file_transfer_protocol_send(MAVLINK_COMM_1 , packet1.target_network , packet1.target_system , packet1.target_component , packet1.payload );
5284 mavlink_msg_file_transfer_protocol_decode(last_msg, &packet2);
5285 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5286
5287#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5288 MAVLINK_ASSERT(mavlink_get_message_info_by_name("FILE_TRANSFER_PROTOCOL") != NULL);
5289 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL) != NULL);
5290#endif
5291}
5292
5293static void mavlink_test_timesync(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5294{
5295#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5296 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5297 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TIMESYNC >= 256) {
5298 return;
5299 }
5300#endif
5301 mavlink_message_t msg;
5302 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5303 uint16_t i;
5304 mavlink_timesync_t packet_in = {
5305 93372036854775807LL,93372036854776311LL,53,120
5306 };
5307 mavlink_timesync_t packet1, packet2;
5308 memset(&packet1, 0, sizeof(packet1));
5309 packet1.tc1 = packet_in.tc1;
5310 packet1.ts1 = packet_in.ts1;
5311 packet1.target_system = packet_in.target_system;
5312 packet1.target_component = packet_in.target_component;
5313
5314
5315#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5316 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5317 // cope with extensions
5318 memset(MAVLINK_MSG_ID_TIMESYNC_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TIMESYNC_MIN_LEN);
5319 }
5320#endif
5321 memset(&packet2, 0, sizeof(packet2));
5322 mavlink_msg_timesync_encode(system_id, component_id, &msg, &packet1);
5323 mavlink_msg_timesync_decode(&msg, &packet2);
5324 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5325
5326 memset(&packet2, 0, sizeof(packet2));
5327 mavlink_msg_timesync_pack(system_id, component_id, &msg , packet1.tc1 , packet1.ts1 , packet1.target_system , packet1.target_component );
5328 mavlink_msg_timesync_decode(&msg, &packet2);
5329 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5330
5331 memset(&packet2, 0, sizeof(packet2));
5332 mavlink_msg_timesync_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.tc1 , packet1.ts1 , packet1.target_system , packet1.target_component );
5333 mavlink_msg_timesync_decode(&msg, &packet2);
5334 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5335
5336 memset(&packet2, 0, sizeof(packet2));
5337 mavlink_msg_to_send_buffer(buffer, &msg);
5338 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5339 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5340 }
5341 mavlink_msg_timesync_decode(last_msg, &packet2);
5342 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5343
5344 memset(&packet2, 0, sizeof(packet2));
5345 mavlink_msg_timesync_send(MAVLINK_COMM_1 , packet1.tc1 , packet1.ts1 , packet1.target_system , packet1.target_component );
5346 mavlink_msg_timesync_decode(last_msg, &packet2);
5347 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5348
5349#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5350 MAVLINK_ASSERT(mavlink_get_message_info_by_name("TIMESYNC") != NULL);
5351 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_TIMESYNC) != NULL);
5352#endif
5353}
5354
5355static void mavlink_test_camera_trigger(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5356{
5357#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5358 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5359 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_TRIGGER >= 256) {
5360 return;
5361 }
5362#endif
5363 mavlink_message_t msg;
5364 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5365 uint16_t i;
5366 mavlink_camera_trigger_t packet_in = {
5367 93372036854775807ULL,963497880
5368 };
5369 mavlink_camera_trigger_t packet1, packet2;
5370 memset(&packet1, 0, sizeof(packet1));
5371 packet1.time_usec = packet_in.time_usec;
5372 packet1.seq = packet_in.seq;
5373
5374
5375#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5376 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5377 // cope with extensions
5378 memset(MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN);
5379 }
5380#endif
5381 memset(&packet2, 0, sizeof(packet2));
5382 mavlink_msg_camera_trigger_encode(system_id, component_id, &msg, &packet1);
5383 mavlink_msg_camera_trigger_decode(&msg, &packet2);
5384 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5385
5386 memset(&packet2, 0, sizeof(packet2));
5387 mavlink_msg_camera_trigger_pack(system_id, component_id, &msg , packet1.time_usec , packet1.seq );
5388 mavlink_msg_camera_trigger_decode(&msg, &packet2);
5389 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5390
5391 memset(&packet2, 0, sizeof(packet2));
5392 mavlink_msg_camera_trigger_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.seq );
5393 mavlink_msg_camera_trigger_decode(&msg, &packet2);
5394 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5395
5396 memset(&packet2, 0, sizeof(packet2));
5397 mavlink_msg_to_send_buffer(buffer, &msg);
5398 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5399 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5400 }
5401 mavlink_msg_camera_trigger_decode(last_msg, &packet2);
5402 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5403
5404 memset(&packet2, 0, sizeof(packet2));
5405 mavlink_msg_camera_trigger_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.seq );
5406 mavlink_msg_camera_trigger_decode(last_msg, &packet2);
5407 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5408
5409#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5410 MAVLINK_ASSERT(mavlink_get_message_info_by_name("CAMERA_TRIGGER") != NULL);
5411 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CAMERA_TRIGGER) != NULL);
5412#endif
5413}
5414
5415static void mavlink_test_hil_gps(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5416{
5417#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5418 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5419 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_GPS >= 256) {
5420 return;
5421 }
5422#endif
5423 mavlink_message_t msg;
5424 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5425 uint16_t i;
5426 mavlink_hil_gps_t packet_in = {
5427 93372036854775807ULL,963497880,963498088,963498296,18275,18379,18483,18587,18691,18795,18899,235,46,113,19159
5428 };
5429 mavlink_hil_gps_t packet1, packet2;
5430 memset(&packet1, 0, sizeof(packet1));
5431 packet1.time_usec = packet_in.time_usec;
5432 packet1.lat = packet_in.lat;
5433 packet1.lon = packet_in.lon;
5434 packet1.alt = packet_in.alt;
5435 packet1.eph = packet_in.eph;
5436 packet1.epv = packet_in.epv;
5437 packet1.vel = packet_in.vel;
5438 packet1.vn = packet_in.vn;
5439 packet1.ve = packet_in.ve;
5440 packet1.vd = packet_in.vd;
5441 packet1.cog = packet_in.cog;
5442 packet1.fix_type = packet_in.fix_type;
5443 packet1.satellites_visible = packet_in.satellites_visible;
5444 packet1.id = packet_in.id;
5445 packet1.yaw = packet_in.yaw;
5446
5447
5448#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5449 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5450 // cope with extensions
5451 memset(MAVLINK_MSG_ID_HIL_GPS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_GPS_MIN_LEN);
5452 }
5453#endif
5454 memset(&packet2, 0, sizeof(packet2));
5455 mavlink_msg_hil_gps_encode(system_id, component_id, &msg, &packet1);
5456 mavlink_msg_hil_gps_decode(&msg, &packet2);
5457 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5458
5459 memset(&packet2, 0, sizeof(packet2));
5460 mavlink_msg_hil_gps_pack(system_id, component_id, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.vn , packet1.ve , packet1.vd , packet1.cog , packet1.satellites_visible , packet1.id , packet1.yaw );
5461 mavlink_msg_hil_gps_decode(&msg, &packet2);
5462 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5463
5464 memset(&packet2, 0, sizeof(packet2));
5465 mavlink_msg_hil_gps_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.vn , packet1.ve , packet1.vd , packet1.cog , packet1.satellites_visible , packet1.id , packet1.yaw );
5466 mavlink_msg_hil_gps_decode(&msg, &packet2);
5467 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5468
5469 memset(&packet2, 0, sizeof(packet2));
5470 mavlink_msg_to_send_buffer(buffer, &msg);
5471 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5472 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5473 }
5474 mavlink_msg_hil_gps_decode(last_msg, &packet2);
5475 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5476
5477 memset(&packet2, 0, sizeof(packet2));
5478 mavlink_msg_hil_gps_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.vn , packet1.ve , packet1.vd , packet1.cog , packet1.satellites_visible , packet1.id , packet1.yaw );
5479 mavlink_msg_hil_gps_decode(last_msg, &packet2);
5480 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5481
5482#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5483 MAVLINK_ASSERT(mavlink_get_message_info_by_name("HIL_GPS") != NULL);
5484 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HIL_GPS) != NULL);
5485#endif
5486}
5487
5488static void mavlink_test_hil_optical_flow(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5489{
5490#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5491 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5492 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_OPTICAL_FLOW >= 256) {
5493 return;
5494 }
5495#endif
5496 mavlink_message_t msg;
5497 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5498 uint16_t i;
5499 mavlink_hil_optical_flow_t packet_in = {
5500 93372036854775807ULL,963497880,101.0,129.0,157.0,185.0,213.0,963499128,269.0,19315,3,70
5501 };
5502 mavlink_hil_optical_flow_t packet1, packet2;
5503 memset(&packet1, 0, sizeof(packet1));
5504 packet1.time_usec = packet_in.time_usec;
5505 packet1.integration_time_us = packet_in.integration_time_us;
5506 packet1.integrated_x = packet_in.integrated_x;
5507 packet1.integrated_y = packet_in.integrated_y;
5508 packet1.integrated_xgyro = packet_in.integrated_xgyro;
5509 packet1.integrated_ygyro = packet_in.integrated_ygyro;
5510 packet1.integrated_zgyro = packet_in.integrated_zgyro;
5511 packet1.time_delta_distance_us = packet_in.time_delta_distance_us;
5512 packet1.distance = packet_in.distance;
5513 packet1.temperature = packet_in.temperature;
5514 packet1.sensor_id = packet_in.sensor_id;
5515 packet1.quality = packet_in.quality;
5516
5517
5518#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5519 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5520 // cope with extensions
5521 memset(MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN);
5522 }
5523#endif
5524 memset(&packet2, 0, sizeof(packet2));
5525 mavlink_msg_hil_optical_flow_encode(system_id, component_id, &msg, &packet1);
5526 mavlink_msg_hil_optical_flow_decode(&msg, &packet2);
5527 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5528
5529 memset(&packet2, 0, sizeof(packet2));
5530 mavlink_msg_hil_optical_flow_pack(system_id, component_id, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
5531 mavlink_msg_hil_optical_flow_decode(&msg, &packet2);
5532 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5533
5534 memset(&packet2, 0, sizeof(packet2));
5535 mavlink_msg_hil_optical_flow_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
5536 mavlink_msg_hil_optical_flow_decode(&msg, &packet2);
5537 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5538
5539 memset(&packet2, 0, sizeof(packet2));
5540 mavlink_msg_to_send_buffer(buffer, &msg);
5541 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5542 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5543 }
5544 mavlink_msg_hil_optical_flow_decode(last_msg, &packet2);
5545 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5546
5547 memset(&packet2, 0, sizeof(packet2));
5548 mavlink_msg_hil_optical_flow_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
5549 mavlink_msg_hil_optical_flow_decode(last_msg, &packet2);
5550 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5551
5552#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5553 MAVLINK_ASSERT(mavlink_get_message_info_by_name("HIL_OPTICAL_FLOW") != NULL);
5554 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HIL_OPTICAL_FLOW) != NULL);
5555#endif
5556}
5557
5558static void mavlink_test_hil_state_quaternion(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5559{
5560#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5561 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5562 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_STATE_QUATERNION >= 256) {
5563 return;
5564 }
5565#endif
5566 mavlink_message_t msg;
5567 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5568 uint16_t i;
5569 mavlink_hil_state_quaternion_t packet_in = {
5570 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0 },185.0,213.0,241.0,963499336,963499544,963499752,19731,19835,19939,20043,20147,20251,20355,20459
5571 };
5572 mavlink_hil_state_quaternion_t packet1, packet2;
5573 memset(&packet1, 0, sizeof(packet1));
5574 packet1.time_usec = packet_in.time_usec;
5575 packet1.rollspeed = packet_in.rollspeed;
5576 packet1.pitchspeed = packet_in.pitchspeed;
5577 packet1.yawspeed = packet_in.yawspeed;
5578 packet1.lat = packet_in.lat;
5579 packet1.lon = packet_in.lon;
5580 packet1.alt = packet_in.alt;
5581 packet1.vx = packet_in.vx;
5582 packet1.vy = packet_in.vy;
5583 packet1.vz = packet_in.vz;
5584 packet1.ind_airspeed = packet_in.ind_airspeed;
5585 packet1.true_airspeed = packet_in.true_airspeed;
5586 packet1.xacc = packet_in.xacc;
5587 packet1.yacc = packet_in.yacc;
5588 packet1.zacc = packet_in.zacc;
5589
5590 mav_array_memcpy(packet1.attitude_quaternion, packet_in.attitude_quaternion, sizeof(float)*4);
5591
5592#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5593 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5594 // cope with extensions
5595 memset(MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN);
5596 }
5597#endif
5598 memset(&packet2, 0, sizeof(packet2));
5599 mavlink_msg_hil_state_quaternion_encode(system_id, component_id, &msg, &packet1);
5600 mavlink_msg_hil_state_quaternion_decode(&msg, &packet2);
5601 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5602
5603 memset(&packet2, 0, sizeof(packet2));
5604 mavlink_msg_hil_state_quaternion_pack(system_id, component_id, &msg , packet1.time_usec , packet1.attitude_quaternion , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.ind_airspeed , packet1.true_airspeed , packet1.xacc , packet1.yacc , packet1.zacc );
5605 mavlink_msg_hil_state_quaternion_decode(&msg, &packet2);
5606 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5607
5608 memset(&packet2, 0, sizeof(packet2));
5609 mavlink_msg_hil_state_quaternion_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.attitude_quaternion , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.ind_airspeed , packet1.true_airspeed , packet1.xacc , packet1.yacc , packet1.zacc );
5610 mavlink_msg_hil_state_quaternion_decode(&msg, &packet2);
5611 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5612
5613 memset(&packet2, 0, sizeof(packet2));
5614 mavlink_msg_to_send_buffer(buffer, &msg);
5615 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5616 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5617 }
5618 mavlink_msg_hil_state_quaternion_decode(last_msg, &packet2);
5619 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5620
5621 memset(&packet2, 0, sizeof(packet2));
5622 mavlink_msg_hil_state_quaternion_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.attitude_quaternion , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.ind_airspeed , packet1.true_airspeed , packet1.xacc , packet1.yacc , packet1.zacc );
5623 mavlink_msg_hil_state_quaternion_decode(last_msg, &packet2);
5624 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5625
5626#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5627 MAVLINK_ASSERT(mavlink_get_message_info_by_name("HIL_STATE_QUATERNION") != NULL);
5628 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HIL_STATE_QUATERNION) != NULL);
5629#endif
5630}
5631
5632static void mavlink_test_scaled_imu2(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5633{
5634#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5635 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5636 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_IMU2 >= 256) {
5637 return;
5638 }
5639#endif
5640 mavlink_message_t msg;
5641 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5642 uint16_t i;
5643 mavlink_scaled_imu2_t packet_in = {
5644 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275,18379
5645 };
5646 mavlink_scaled_imu2_t packet1, packet2;
5647 memset(&packet1, 0, sizeof(packet1));
5648 packet1.time_boot_ms = packet_in.time_boot_ms;
5649 packet1.xacc = packet_in.xacc;
5650 packet1.yacc = packet_in.yacc;
5651 packet1.zacc = packet_in.zacc;
5652 packet1.xgyro = packet_in.xgyro;
5653 packet1.ygyro = packet_in.ygyro;
5654 packet1.zgyro = packet_in.zgyro;
5655 packet1.xmag = packet_in.xmag;
5656 packet1.ymag = packet_in.ymag;
5657 packet1.zmag = packet_in.zmag;
5658 packet1.temperature = packet_in.temperature;
5659
5660
5661#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5662 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5663 // cope with extensions
5664 memset(MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN);
5665 }
5666#endif
5667 memset(&packet2, 0, sizeof(packet2));
5668 mavlink_msg_scaled_imu2_encode(system_id, component_id, &msg, &packet1);
5669 mavlink_msg_scaled_imu2_decode(&msg, &packet2);
5670 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5671
5672 memset(&packet2, 0, sizeof(packet2));
5673 mavlink_msg_scaled_imu2_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.temperature );
5674 mavlink_msg_scaled_imu2_decode(&msg, &packet2);
5675 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5676
5677 memset(&packet2, 0, sizeof(packet2));
5678 mavlink_msg_scaled_imu2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.temperature );
5679 mavlink_msg_scaled_imu2_decode(&msg, &packet2);
5680 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5681
5682 memset(&packet2, 0, sizeof(packet2));
5683 mavlink_msg_to_send_buffer(buffer, &msg);
5684 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5685 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5686 }
5687 mavlink_msg_scaled_imu2_decode(last_msg, &packet2);
5688 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5689
5690 memset(&packet2, 0, sizeof(packet2));
5691 mavlink_msg_scaled_imu2_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.temperature );
5692 mavlink_msg_scaled_imu2_decode(last_msg, &packet2);
5693 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5694
5695#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5696 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SCALED_IMU2") != NULL);
5697 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SCALED_IMU2) != NULL);
5698#endif
5699}
5700
5701static void mavlink_test_log_request_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5702{
5703#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5704 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5705 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_REQUEST_LIST >= 256) {
5706 return;
5707 }
5708#endif
5709 mavlink_message_t msg;
5710 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5711 uint16_t i;
5712 mavlink_log_request_list_t packet_in = {
5713 17235,17339,17,84
5714 };
5715 mavlink_log_request_list_t packet1, packet2;
5716 memset(&packet1, 0, sizeof(packet1));
5717 packet1.start = packet_in.start;
5718 packet1.end = packet_in.end;
5719 packet1.target_system = packet_in.target_system;
5720 packet1.target_component = packet_in.target_component;
5721
5722
5723#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5724 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5725 // cope with extensions
5726 memset(MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN);
5727 }
5728#endif
5729 memset(&packet2, 0, sizeof(packet2));
5730 mavlink_msg_log_request_list_encode(system_id, component_id, &msg, &packet1);
5731 mavlink_msg_log_request_list_decode(&msg, &packet2);
5732 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5733
5734 memset(&packet2, 0, sizeof(packet2));
5735 mavlink_msg_log_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.start , packet1.end );
5736 mavlink_msg_log_request_list_decode(&msg, &packet2);
5737 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5738
5739 memset(&packet2, 0, sizeof(packet2));
5740 mavlink_msg_log_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.start , packet1.end );
5741 mavlink_msg_log_request_list_decode(&msg, &packet2);
5742 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5743
5744 memset(&packet2, 0, sizeof(packet2));
5745 mavlink_msg_to_send_buffer(buffer, &msg);
5746 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5747 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5748 }
5749 mavlink_msg_log_request_list_decode(last_msg, &packet2);
5750 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5751
5752 memset(&packet2, 0, sizeof(packet2));
5753 mavlink_msg_log_request_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.start , packet1.end );
5754 mavlink_msg_log_request_list_decode(last_msg, &packet2);
5755 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5756
5757#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5758 MAVLINK_ASSERT(mavlink_get_message_info_by_name("LOG_REQUEST_LIST") != NULL);
5759 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOG_REQUEST_LIST) != NULL);
5760#endif
5761}
5762
5763static void mavlink_test_log_entry(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5764{
5765#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5766 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5767 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_ENTRY >= 256) {
5768 return;
5769 }
5770#endif
5771 mavlink_message_t msg;
5772 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5773 uint16_t i;
5774 mavlink_log_entry_t packet_in = {
5775 963497464,963497672,17651,17755,17859
5776 };
5777 mavlink_log_entry_t packet1, packet2;
5778 memset(&packet1, 0, sizeof(packet1));
5779 packet1.time_utc = packet_in.time_utc;
5780 packet1.size = packet_in.size;
5781 packet1.id = packet_in.id;
5782 packet1.num_logs = packet_in.num_logs;
5783 packet1.last_log_num = packet_in.last_log_num;
5784
5785
5786#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5787 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5788 // cope with extensions
5789 memset(MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN);
5790 }
5791#endif
5792 memset(&packet2, 0, sizeof(packet2));
5793 mavlink_msg_log_entry_encode(system_id, component_id, &msg, &packet1);
5794 mavlink_msg_log_entry_decode(&msg, &packet2);
5795 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5796
5797 memset(&packet2, 0, sizeof(packet2));
5798 mavlink_msg_log_entry_pack(system_id, component_id, &msg , packet1.id , packet1.num_logs , packet1.last_log_num , packet1.time_utc , packet1.size );
5799 mavlink_msg_log_entry_decode(&msg, &packet2);
5800 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5801
5802 memset(&packet2, 0, sizeof(packet2));
5803 mavlink_msg_log_entry_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.num_logs , packet1.last_log_num , packet1.time_utc , packet1.size );
5804 mavlink_msg_log_entry_decode(&msg, &packet2);
5805 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5806
5807 memset(&packet2, 0, sizeof(packet2));
5808 mavlink_msg_to_send_buffer(buffer, &msg);
5809 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5810 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5811 }
5812 mavlink_msg_log_entry_decode(last_msg, &packet2);
5813 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5814
5815 memset(&packet2, 0, sizeof(packet2));
5816 mavlink_msg_log_entry_send(MAVLINK_COMM_1 , packet1.id , packet1.num_logs , packet1.last_log_num , packet1.time_utc , packet1.size );
5817 mavlink_msg_log_entry_decode(last_msg, &packet2);
5818 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5819
5820#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5821 MAVLINK_ASSERT(mavlink_get_message_info_by_name("LOG_ENTRY") != NULL);
5822 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOG_ENTRY) != NULL);
5823#endif
5824}
5825
5826static void mavlink_test_log_request_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5827{
5828#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5829 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5830 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_REQUEST_DATA >= 256) {
5831 return;
5832 }
5833#endif
5834 mavlink_message_t msg;
5835 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5836 uint16_t i;
5837 mavlink_log_request_data_t packet_in = {
5838 963497464,963497672,17651,163,230
5839 };
5840 mavlink_log_request_data_t packet1, packet2;
5841 memset(&packet1, 0, sizeof(packet1));
5842 packet1.ofs = packet_in.ofs;
5843 packet1.count = packet_in.count;
5844 packet1.id = packet_in.id;
5845 packet1.target_system = packet_in.target_system;
5846 packet1.target_component = packet_in.target_component;
5847
5848
5849#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5850 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5851 // cope with extensions
5852 memset(MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN);
5853 }
5854#endif
5855 memset(&packet2, 0, sizeof(packet2));
5856 mavlink_msg_log_request_data_encode(system_id, component_id, &msg, &packet1);
5857 mavlink_msg_log_request_data_decode(&msg, &packet2);
5858 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5859
5860 memset(&packet2, 0, sizeof(packet2));
5861 mavlink_msg_log_request_data_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id , packet1.ofs , packet1.count );
5862 mavlink_msg_log_request_data_decode(&msg, &packet2);
5863 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5864
5865 memset(&packet2, 0, sizeof(packet2));
5866 mavlink_msg_log_request_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.id , packet1.ofs , packet1.count );
5867 mavlink_msg_log_request_data_decode(&msg, &packet2);
5868 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5869
5870 memset(&packet2, 0, sizeof(packet2));
5871 mavlink_msg_to_send_buffer(buffer, &msg);
5872 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5873 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5874 }
5875 mavlink_msg_log_request_data_decode(last_msg, &packet2);
5876 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5877
5878 memset(&packet2, 0, sizeof(packet2));
5879 mavlink_msg_log_request_data_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.id , packet1.ofs , packet1.count );
5880 mavlink_msg_log_request_data_decode(last_msg, &packet2);
5881 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5882
5883#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5884 MAVLINK_ASSERT(mavlink_get_message_info_by_name("LOG_REQUEST_DATA") != NULL);
5885 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOG_REQUEST_DATA) != NULL);
5886#endif
5887}
5888
5889static void mavlink_test_log_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5890{
5891#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5892 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5893 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_DATA >= 256) {
5894 return;
5895 }
5896#endif
5897 mavlink_message_t msg;
5898 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5899 uint16_t i;
5900 mavlink_log_data_t packet_in = {
5901 963497464,17443,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 }
5902 };
5903 mavlink_log_data_t packet1, packet2;
5904 memset(&packet1, 0, sizeof(packet1));
5905 packet1.ofs = packet_in.ofs;
5906 packet1.id = packet_in.id;
5907 packet1.count = packet_in.count;
5908
5909 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*90);
5910
5911#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5912 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5913 // cope with extensions
5914 memset(MAVLINK_MSG_ID_LOG_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_DATA_MIN_LEN);
5915 }
5916#endif
5917 memset(&packet2, 0, sizeof(packet2));
5918 mavlink_msg_log_data_encode(system_id, component_id, &msg, &packet1);
5919 mavlink_msg_log_data_decode(&msg, &packet2);
5920 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5921
5922 memset(&packet2, 0, sizeof(packet2));
5923 mavlink_msg_log_data_pack(system_id, component_id, &msg , packet1.id , packet1.ofs , packet1.count , packet1.data );
5924 mavlink_msg_log_data_decode(&msg, &packet2);
5925 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5926
5927 memset(&packet2, 0, sizeof(packet2));
5928 mavlink_msg_log_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.ofs , packet1.count , packet1.data );
5929 mavlink_msg_log_data_decode(&msg, &packet2);
5930 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5931
5932 memset(&packet2, 0, sizeof(packet2));
5933 mavlink_msg_to_send_buffer(buffer, &msg);
5934 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5935 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5936 }
5937 mavlink_msg_log_data_decode(last_msg, &packet2);
5938 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5939
5940 memset(&packet2, 0, sizeof(packet2));
5941 mavlink_msg_log_data_send(MAVLINK_COMM_1 , packet1.id , packet1.ofs , packet1.count , packet1.data );
5942 mavlink_msg_log_data_decode(last_msg, &packet2);
5943 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5944
5945#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5946 MAVLINK_ASSERT(mavlink_get_message_info_by_name("LOG_DATA") != NULL);
5947 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOG_DATA) != NULL);
5948#endif
5949}
5950
5951static void mavlink_test_log_erase(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5952{
5953#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5954 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5955 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_ERASE >= 256) {
5956 return;
5957 }
5958#endif
5959 mavlink_message_t msg;
5960 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5961 uint16_t i;
5962 mavlink_log_erase_t packet_in = {
5963 5,72
5964 };
5965 mavlink_log_erase_t packet1, packet2;
5966 memset(&packet1, 0, sizeof(packet1));
5967 packet1.target_system = packet_in.target_system;
5968 packet1.target_component = packet_in.target_component;
5969
5970
5971#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5972 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5973 // cope with extensions
5974 memset(MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN);
5975 }
5976#endif
5977 memset(&packet2, 0, sizeof(packet2));
5978 mavlink_msg_log_erase_encode(system_id, component_id, &msg, &packet1);
5979 mavlink_msg_log_erase_decode(&msg, &packet2);
5980 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5981
5982 memset(&packet2, 0, sizeof(packet2));
5983 mavlink_msg_log_erase_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
5984 mavlink_msg_log_erase_decode(&msg, &packet2);
5985 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5986
5987 memset(&packet2, 0, sizeof(packet2));
5988 mavlink_msg_log_erase_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
5989 mavlink_msg_log_erase_decode(&msg, &packet2);
5990 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5991
5992 memset(&packet2, 0, sizeof(packet2));
5993 mavlink_msg_to_send_buffer(buffer, &msg);
5994 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5995 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5996 }
5997 mavlink_msg_log_erase_decode(last_msg, &packet2);
5998 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5999
6000 memset(&packet2, 0, sizeof(packet2));
6001 mavlink_msg_log_erase_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
6002 mavlink_msg_log_erase_decode(last_msg, &packet2);
6003 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6004
6005#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6006 MAVLINK_ASSERT(mavlink_get_message_info_by_name("LOG_ERASE") != NULL);
6007 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOG_ERASE) != NULL);
6008#endif
6009}
6010
6011static void mavlink_test_log_request_end(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6012{
6013#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6014 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6015 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_REQUEST_END >= 256) {
6016 return;
6017 }
6018#endif
6019 mavlink_message_t msg;
6020 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6021 uint16_t i;
6022 mavlink_log_request_end_t packet_in = {
6023 5,72
6024 };
6025 mavlink_log_request_end_t packet1, packet2;
6026 memset(&packet1, 0, sizeof(packet1));
6027 packet1.target_system = packet_in.target_system;
6028 packet1.target_component = packet_in.target_component;
6029
6030
6031#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6032 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6033 // cope with extensions
6034 memset(MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN);
6035 }
6036#endif
6037 memset(&packet2, 0, sizeof(packet2));
6038 mavlink_msg_log_request_end_encode(system_id, component_id, &msg, &packet1);
6039 mavlink_msg_log_request_end_decode(&msg, &packet2);
6040 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6041
6042 memset(&packet2, 0, sizeof(packet2));
6043 mavlink_msg_log_request_end_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
6044 mavlink_msg_log_request_end_decode(&msg, &packet2);
6045 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6046
6047 memset(&packet2, 0, sizeof(packet2));
6048 mavlink_msg_log_request_end_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
6049 mavlink_msg_log_request_end_decode(&msg, &packet2);
6050 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6051
6052 memset(&packet2, 0, sizeof(packet2));
6053 mavlink_msg_to_send_buffer(buffer, &msg);
6054 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6055 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6056 }
6057 mavlink_msg_log_request_end_decode(last_msg, &packet2);
6058 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6059
6060 memset(&packet2, 0, sizeof(packet2));
6061 mavlink_msg_log_request_end_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
6062 mavlink_msg_log_request_end_decode(last_msg, &packet2);
6063 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6064
6065#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6066 MAVLINK_ASSERT(mavlink_get_message_info_by_name("LOG_REQUEST_END") != NULL);
6067 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOG_REQUEST_END) != NULL);
6068#endif
6069}
6070
6071static void mavlink_test_gps_inject_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6072{
6073#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6074 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6075 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_INJECT_DATA >= 256) {
6076 return;
6077 }
6078#endif
6079 mavlink_message_t msg;
6080 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6081 uint16_t i;
6082 mavlink_gps_inject_data_t packet_in = {
6083 5,72,139,{ 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 }
6084 };
6085 mavlink_gps_inject_data_t packet1, packet2;
6086 memset(&packet1, 0, sizeof(packet1));
6087 packet1.target_system = packet_in.target_system;
6088 packet1.target_component = packet_in.target_component;
6089 packet1.len = packet_in.len;
6090
6091 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*110);
6092
6093#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6094 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6095 // cope with extensions
6096 memset(MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN);
6097 }
6098#endif
6099 memset(&packet2, 0, sizeof(packet2));
6100 mavlink_msg_gps_inject_data_encode(system_id, component_id, &msg, &packet1);
6101 mavlink_msg_gps_inject_data_decode(&msg, &packet2);
6102 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6103
6104 memset(&packet2, 0, sizeof(packet2));
6105 mavlink_msg_gps_inject_data_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.len , packet1.data );
6106 mavlink_msg_gps_inject_data_decode(&msg, &packet2);
6107 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6108
6109 memset(&packet2, 0, sizeof(packet2));
6110 mavlink_msg_gps_inject_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.len , packet1.data );
6111 mavlink_msg_gps_inject_data_decode(&msg, &packet2);
6112 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6113
6114 memset(&packet2, 0, sizeof(packet2));
6115 mavlink_msg_to_send_buffer(buffer, &msg);
6116 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6117 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6118 }
6119 mavlink_msg_gps_inject_data_decode(last_msg, &packet2);
6120 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6121
6122 memset(&packet2, 0, sizeof(packet2));
6123 mavlink_msg_gps_inject_data_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.len , packet1.data );
6124 mavlink_msg_gps_inject_data_decode(last_msg, &packet2);
6125 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6126
6127#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6128 MAVLINK_ASSERT(mavlink_get_message_info_by_name("GPS_INJECT_DATA") != NULL);
6129 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GPS_INJECT_DATA) != NULL);
6130#endif
6131}
6132
6133static void mavlink_test_gps2_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6134{
6135#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6136 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6137 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS2_RAW >= 256) {
6138 return;
6139 }
6140#endif
6141 mavlink_message_t msg;
6142 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6143 uint16_t i;
6144 mavlink_gps2_raw_t packet_in = {
6145 93372036854775807ULL,963497880,963498088,963498296,963498504,18483,18587,18691,18795,101,168,235,19055,963499388,963499596,963499804,963500012,963500220
6146 };
6147 mavlink_gps2_raw_t packet1, packet2;
6148 memset(&packet1, 0, sizeof(packet1));
6149 packet1.time_usec = packet_in.time_usec;
6150 packet1.lat = packet_in.lat;
6151 packet1.lon = packet_in.lon;
6152 packet1.alt = packet_in.alt;
6153 packet1.dgps_age = packet_in.dgps_age;
6154 packet1.eph = packet_in.eph;
6155 packet1.epv = packet_in.epv;
6156 packet1.vel = packet_in.vel;
6157 packet1.cog = packet_in.cog;
6158 packet1.fix_type = packet_in.fix_type;
6159 packet1.satellites_visible = packet_in.satellites_visible;
6160 packet1.dgps_numch = packet_in.dgps_numch;
6161 packet1.yaw = packet_in.yaw;
6162 packet1.alt_ellipsoid = packet_in.alt_ellipsoid;
6163 packet1.h_acc = packet_in.h_acc;
6164 packet1.v_acc = packet_in.v_acc;
6165 packet1.vel_acc = packet_in.vel_acc;
6166 packet1.hdg_acc = packet_in.hdg_acc;
6167
6168
6169#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6170 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6171 // cope with extensions
6172 memset(MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN);
6173 }
6174#endif
6175 memset(&packet2, 0, sizeof(packet2));
6176 mavlink_msg_gps2_raw_encode(system_id, component_id, &msg, &packet1);
6177 mavlink_msg_gps2_raw_decode(&msg, &packet2);
6178 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6179
6180 memset(&packet2, 0, sizeof(packet2));
6181 mavlink_msg_gps2_raw_pack(system_id, component_id, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible , packet1.dgps_numch , packet1.dgps_age , packet1.yaw , packet1.alt_ellipsoid , packet1.h_acc , packet1.v_acc , packet1.vel_acc , packet1.hdg_acc );
6182 mavlink_msg_gps2_raw_decode(&msg, &packet2);
6183 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6184
6185 memset(&packet2, 0, sizeof(packet2));
6186 mavlink_msg_gps2_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible , packet1.dgps_numch , packet1.dgps_age , packet1.yaw , packet1.alt_ellipsoid , packet1.h_acc , packet1.v_acc , packet1.vel_acc , packet1.hdg_acc );
6187 mavlink_msg_gps2_raw_decode(&msg, &packet2);
6188 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6189
6190 memset(&packet2, 0, sizeof(packet2));
6191 mavlink_msg_to_send_buffer(buffer, &msg);
6192 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6193 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6194 }
6195 mavlink_msg_gps2_raw_decode(last_msg, &packet2);
6196 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6197
6198 memset(&packet2, 0, sizeof(packet2));
6199 mavlink_msg_gps2_raw_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible , packet1.dgps_numch , packet1.dgps_age , packet1.yaw , packet1.alt_ellipsoid , packet1.h_acc , packet1.v_acc , packet1.vel_acc , packet1.hdg_acc );
6200 mavlink_msg_gps2_raw_decode(last_msg, &packet2);
6201 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6202
6203#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6204 MAVLINK_ASSERT(mavlink_get_message_info_by_name("GPS2_RAW") != NULL);
6205 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GPS2_RAW) != NULL);
6206#endif
6207}
6208
6209static void mavlink_test_power_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6210{
6211#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6212 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6213 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_POWER_STATUS >= 256) {
6214 return;
6215 }
6216#endif
6217 mavlink_message_t msg;
6218 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6219 uint16_t i;
6220 mavlink_power_status_t packet_in = {
6221 17235,17339,17443
6222 };
6223 mavlink_power_status_t packet1, packet2;
6224 memset(&packet1, 0, sizeof(packet1));
6225 packet1.Vcc = packet_in.Vcc;
6226 packet1.Vservo = packet_in.Vservo;
6227 packet1.flags = packet_in.flags;
6228
6229
6230#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6231 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6232 // cope with extensions
6233 memset(MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN);
6234 }
6235#endif
6236 memset(&packet2, 0, sizeof(packet2));
6237 mavlink_msg_power_status_encode(system_id, component_id, &msg, &packet1);
6238 mavlink_msg_power_status_decode(&msg, &packet2);
6239 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6240
6241 memset(&packet2, 0, sizeof(packet2));
6242 mavlink_msg_power_status_pack(system_id, component_id, &msg , packet1.Vcc , packet1.Vservo , packet1.flags );
6243 mavlink_msg_power_status_decode(&msg, &packet2);
6244 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6245
6246 memset(&packet2, 0, sizeof(packet2));
6247 mavlink_msg_power_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.Vcc , packet1.Vservo , packet1.flags );
6248 mavlink_msg_power_status_decode(&msg, &packet2);
6249 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6250
6251 memset(&packet2, 0, sizeof(packet2));
6252 mavlink_msg_to_send_buffer(buffer, &msg);
6253 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6254 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6255 }
6256 mavlink_msg_power_status_decode(last_msg, &packet2);
6257 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6258
6259 memset(&packet2, 0, sizeof(packet2));
6260 mavlink_msg_power_status_send(MAVLINK_COMM_1 , packet1.Vcc , packet1.Vservo , packet1.flags );
6261 mavlink_msg_power_status_decode(last_msg, &packet2);
6262 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6263
6264#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6265 MAVLINK_ASSERT(mavlink_get_message_info_by_name("POWER_STATUS") != NULL);
6266 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_POWER_STATUS) != NULL);
6267#endif
6268}
6269
6270static void mavlink_test_serial_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6271{
6272#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6273 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6274 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERIAL_CONTROL >= 256) {
6275 return;
6276 }
6277#endif
6278 mavlink_message_t msg;
6279 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6280 uint16_t i;
6281 mavlink_serial_control_t packet_in = {
6282 963497464,17443,151,218,29,{ 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 },178,245
6283 };
6284 mavlink_serial_control_t packet1, packet2;
6285 memset(&packet1, 0, sizeof(packet1));
6286 packet1.baudrate = packet_in.baudrate;
6287 packet1.timeout = packet_in.timeout;
6288 packet1.device = packet_in.device;
6289 packet1.flags = packet_in.flags;
6290 packet1.count = packet_in.count;
6291 packet1.target_system = packet_in.target_system;
6292 packet1.target_component = packet_in.target_component;
6293
6294 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*70);
6295
6296#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6297 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6298 // cope with extensions
6299 memset(MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN);
6300 }
6301#endif
6302 memset(&packet2, 0, sizeof(packet2));
6303 mavlink_msg_serial_control_encode(system_id, component_id, &msg, &packet1);
6304 mavlink_msg_serial_control_decode(&msg, &packet2);
6305 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6306
6307 memset(&packet2, 0, sizeof(packet2));
6308 mavlink_msg_serial_control_pack(system_id, component_id, &msg , packet1.device , packet1.flags , packet1.timeout , packet1.baudrate , packet1.count , packet1.data , packet1.target_system , packet1.target_component );
6309 mavlink_msg_serial_control_decode(&msg, &packet2);
6310 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6311
6312 memset(&packet2, 0, sizeof(packet2));
6313 mavlink_msg_serial_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.device , packet1.flags , packet1.timeout , packet1.baudrate , packet1.count , packet1.data , packet1.target_system , packet1.target_component );
6314 mavlink_msg_serial_control_decode(&msg, &packet2);
6315 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6316
6317 memset(&packet2, 0, sizeof(packet2));
6318 mavlink_msg_to_send_buffer(buffer, &msg);
6319 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6320 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6321 }
6322 mavlink_msg_serial_control_decode(last_msg, &packet2);
6323 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6324
6325 memset(&packet2, 0, sizeof(packet2));
6326 mavlink_msg_serial_control_send(MAVLINK_COMM_1 , packet1.device , packet1.flags , packet1.timeout , packet1.baudrate , packet1.count , packet1.data , packet1.target_system , packet1.target_component );
6327 mavlink_msg_serial_control_decode(last_msg, &packet2);
6328 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6329
6330#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6331 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SERIAL_CONTROL") != NULL);
6332 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SERIAL_CONTROL) != NULL);
6333#endif
6334}
6335
6336static void mavlink_test_gps_rtk(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6337{
6338#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6339 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6340 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_RTK >= 256) {
6341 return;
6342 }
6343#endif
6344 mavlink_message_t msg;
6345 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6346 uint16_t i;
6347 mavlink_gps_rtk_t packet_in = {
6348 963497464,963497672,963497880,963498088,963498296,963498504,963498712,18691,223,34,101,168,235
6349 };
6350 mavlink_gps_rtk_t packet1, packet2;
6351 memset(&packet1, 0, sizeof(packet1));
6352 packet1.time_last_baseline_ms = packet_in.time_last_baseline_ms;
6353 packet1.tow = packet_in.tow;
6354 packet1.baseline_a_mm = packet_in.baseline_a_mm;
6355 packet1.baseline_b_mm = packet_in.baseline_b_mm;
6356 packet1.baseline_c_mm = packet_in.baseline_c_mm;
6357 packet1.accuracy = packet_in.accuracy;
6358 packet1.iar_num_hypotheses = packet_in.iar_num_hypotheses;
6359 packet1.wn = packet_in.wn;
6360 packet1.rtk_receiver_id = packet_in.rtk_receiver_id;
6361 packet1.rtk_health = packet_in.rtk_health;
6362 packet1.rtk_rate = packet_in.rtk_rate;
6363 packet1.nsats = packet_in.nsats;
6364 packet1.baseline_coords_type = packet_in.baseline_coords_type;
6365
6366
6367#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6368 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6369 // cope with extensions
6370 memset(MAVLINK_MSG_ID_GPS_RTK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_RTK_MIN_LEN);
6371 }
6372#endif
6373 memset(&packet2, 0, sizeof(packet2));
6374 mavlink_msg_gps_rtk_encode(system_id, component_id, &msg, &packet1);
6375 mavlink_msg_gps_rtk_decode(&msg, &packet2);
6376 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6377
6378 memset(&packet2, 0, sizeof(packet2));
6379 mavlink_msg_gps_rtk_pack(system_id, component_id, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
6380 mavlink_msg_gps_rtk_decode(&msg, &packet2);
6381 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6382
6383 memset(&packet2, 0, sizeof(packet2));
6384 mavlink_msg_gps_rtk_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
6385 mavlink_msg_gps_rtk_decode(&msg, &packet2);
6386 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6387
6388 memset(&packet2, 0, sizeof(packet2));
6389 mavlink_msg_to_send_buffer(buffer, &msg);
6390 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6391 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6392 }
6393 mavlink_msg_gps_rtk_decode(last_msg, &packet2);
6394 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6395
6396 memset(&packet2, 0, sizeof(packet2));
6397 mavlink_msg_gps_rtk_send(MAVLINK_COMM_1 , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
6398 mavlink_msg_gps_rtk_decode(last_msg, &packet2);
6399 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6400
6401#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6402 MAVLINK_ASSERT(mavlink_get_message_info_by_name("GPS_RTK") != NULL);
6403 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GPS_RTK) != NULL);
6404#endif
6405}
6406
6407static void mavlink_test_gps2_rtk(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6408{
6409#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6410 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6411 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS2_RTK >= 256) {
6412 return;
6413 }
6414#endif
6415 mavlink_message_t msg;
6416 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6417 uint16_t i;
6418 mavlink_gps2_rtk_t packet_in = {
6419 963497464,963497672,963497880,963498088,963498296,963498504,963498712,18691,223,34,101,168,235
6420 };
6421 mavlink_gps2_rtk_t packet1, packet2;
6422 memset(&packet1, 0, sizeof(packet1));
6423 packet1.time_last_baseline_ms = packet_in.time_last_baseline_ms;
6424 packet1.tow = packet_in.tow;
6425 packet1.baseline_a_mm = packet_in.baseline_a_mm;
6426 packet1.baseline_b_mm = packet_in.baseline_b_mm;
6427 packet1.baseline_c_mm = packet_in.baseline_c_mm;
6428 packet1.accuracy = packet_in.accuracy;
6429 packet1.iar_num_hypotheses = packet_in.iar_num_hypotheses;
6430 packet1.wn = packet_in.wn;
6431 packet1.rtk_receiver_id = packet_in.rtk_receiver_id;
6432 packet1.rtk_health = packet_in.rtk_health;
6433 packet1.rtk_rate = packet_in.rtk_rate;
6434 packet1.nsats = packet_in.nsats;
6435 packet1.baseline_coords_type = packet_in.baseline_coords_type;
6436
6437
6438#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6439 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6440 // cope with extensions
6441 memset(MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN);
6442 }
6443#endif
6444 memset(&packet2, 0, sizeof(packet2));
6445 mavlink_msg_gps2_rtk_encode(system_id, component_id, &msg, &packet1);
6446 mavlink_msg_gps2_rtk_decode(&msg, &packet2);
6447 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6448
6449 memset(&packet2, 0, sizeof(packet2));
6450 mavlink_msg_gps2_rtk_pack(system_id, component_id, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
6451 mavlink_msg_gps2_rtk_decode(&msg, &packet2);
6452 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6453
6454 memset(&packet2, 0, sizeof(packet2));
6455 mavlink_msg_gps2_rtk_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
6456 mavlink_msg_gps2_rtk_decode(&msg, &packet2);
6457 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6458
6459 memset(&packet2, 0, sizeof(packet2));
6460 mavlink_msg_to_send_buffer(buffer, &msg);
6461 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6462 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6463 }
6464 mavlink_msg_gps2_rtk_decode(last_msg, &packet2);
6465 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6466
6467 memset(&packet2, 0, sizeof(packet2));
6468 mavlink_msg_gps2_rtk_send(MAVLINK_COMM_1 , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
6469 mavlink_msg_gps2_rtk_decode(last_msg, &packet2);
6470 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6471
6472#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6473 MAVLINK_ASSERT(mavlink_get_message_info_by_name("GPS2_RTK") != NULL);
6474 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GPS2_RTK) != NULL);
6475#endif
6476}
6477
6478static void mavlink_test_scaled_imu3(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6479{
6480#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6481 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6482 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_IMU3 >= 256) {
6483 return;
6484 }
6485#endif
6486 mavlink_message_t msg;
6487 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6488 uint16_t i;
6489 mavlink_scaled_imu3_t packet_in = {
6490 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275,18379
6491 };
6492 mavlink_scaled_imu3_t packet1, packet2;
6493 memset(&packet1, 0, sizeof(packet1));
6494 packet1.time_boot_ms = packet_in.time_boot_ms;
6495 packet1.xacc = packet_in.xacc;
6496 packet1.yacc = packet_in.yacc;
6497 packet1.zacc = packet_in.zacc;
6498 packet1.xgyro = packet_in.xgyro;
6499 packet1.ygyro = packet_in.ygyro;
6500 packet1.zgyro = packet_in.zgyro;
6501 packet1.xmag = packet_in.xmag;
6502 packet1.ymag = packet_in.ymag;
6503 packet1.zmag = packet_in.zmag;
6504 packet1.temperature = packet_in.temperature;
6505
6506
6507#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6508 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6509 // cope with extensions
6510 memset(MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN);
6511 }
6512#endif
6513 memset(&packet2, 0, sizeof(packet2));
6514 mavlink_msg_scaled_imu3_encode(system_id, component_id, &msg, &packet1);
6515 mavlink_msg_scaled_imu3_decode(&msg, &packet2);
6516 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6517
6518 memset(&packet2, 0, sizeof(packet2));
6519 mavlink_msg_scaled_imu3_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.temperature );
6520 mavlink_msg_scaled_imu3_decode(&msg, &packet2);
6521 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6522
6523 memset(&packet2, 0, sizeof(packet2));
6524 mavlink_msg_scaled_imu3_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.temperature );
6525 mavlink_msg_scaled_imu3_decode(&msg, &packet2);
6526 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6527
6528 memset(&packet2, 0, sizeof(packet2));
6529 mavlink_msg_to_send_buffer(buffer, &msg);
6530 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6531 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6532 }
6533 mavlink_msg_scaled_imu3_decode(last_msg, &packet2);
6534 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6535
6536 memset(&packet2, 0, sizeof(packet2));
6537 mavlink_msg_scaled_imu3_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.temperature );
6538 mavlink_msg_scaled_imu3_decode(last_msg, &packet2);
6539 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6540
6541#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6542 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SCALED_IMU3") != NULL);
6543 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SCALED_IMU3) != NULL);
6544#endif
6545}
6546
6547static void mavlink_test_data_transmission_handshake(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6548{
6549#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6550 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6551 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE >= 256) {
6552 return;
6553 }
6554#endif
6555 mavlink_message_t msg;
6556 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6557 uint16_t i;
6558 mavlink_data_transmission_handshake_t packet_in = {
6559 963497464,17443,17547,17651,163,230,41
6560 };
6561 mavlink_data_transmission_handshake_t packet1, packet2;
6562 memset(&packet1, 0, sizeof(packet1));
6563 packet1.size = packet_in.size;
6564 packet1.width = packet_in.width;
6565 packet1.height = packet_in.height;
6566 packet1.packets = packet_in.packets;
6567 packet1.type = packet_in.type;
6568 packet1.payload = packet_in.payload;
6569 packet1.jpg_quality = packet_in.jpg_quality;
6570
6571
6572#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6573 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6574 // cope with extensions
6575 memset(MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN);
6576 }
6577#endif
6578 memset(&packet2, 0, sizeof(packet2));
6579 mavlink_msg_data_transmission_handshake_encode(system_id, component_id, &msg, &packet1);
6580 mavlink_msg_data_transmission_handshake_decode(&msg, &packet2);
6581 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6582
6583 memset(&packet2, 0, sizeof(packet2));
6584 mavlink_msg_data_transmission_handshake_pack(system_id, component_id, &msg , packet1.type , packet1.size , packet1.width , packet1.height , packet1.packets , packet1.payload , packet1.jpg_quality );
6585 mavlink_msg_data_transmission_handshake_decode(&msg, &packet2);
6586 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6587
6588 memset(&packet2, 0, sizeof(packet2));
6589 mavlink_msg_data_transmission_handshake_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.size , packet1.width , packet1.height , packet1.packets , packet1.payload , packet1.jpg_quality );
6590 mavlink_msg_data_transmission_handshake_decode(&msg, &packet2);
6591 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6592
6593 memset(&packet2, 0, sizeof(packet2));
6594 mavlink_msg_to_send_buffer(buffer, &msg);
6595 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6596 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6597 }
6598 mavlink_msg_data_transmission_handshake_decode(last_msg, &packet2);
6599 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6600
6601 memset(&packet2, 0, sizeof(packet2));
6602 mavlink_msg_data_transmission_handshake_send(MAVLINK_COMM_1 , packet1.type , packet1.size , packet1.width , packet1.height , packet1.packets , packet1.payload , packet1.jpg_quality );
6603 mavlink_msg_data_transmission_handshake_decode(last_msg, &packet2);
6604 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6605
6606#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6607 MAVLINK_ASSERT(mavlink_get_message_info_by_name("DATA_TRANSMISSION_HANDSHAKE") != NULL);
6608 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE) != NULL);
6609#endif
6610}
6611
6612static void mavlink_test_encapsulated_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6613{
6614#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6615 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6616 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ENCAPSULATED_DATA >= 256) {
6617 return;
6618 }
6619#endif
6620 mavlink_message_t msg;
6621 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6622 uint16_t i;
6623 mavlink_encapsulated_data_t packet_in = {
6624 17235,{ 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, 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, 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 }
6625 };
6626 mavlink_encapsulated_data_t packet1, packet2;
6627 memset(&packet1, 0, sizeof(packet1));
6628 packet1.seqnr = packet_in.seqnr;
6629
6630 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*253);
6631
6632#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6633 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6634 // cope with extensions
6635 memset(MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN);
6636 }
6637#endif
6638 memset(&packet2, 0, sizeof(packet2));
6639 mavlink_msg_encapsulated_data_encode(system_id, component_id, &msg, &packet1);
6640 mavlink_msg_encapsulated_data_decode(&msg, &packet2);
6641 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6642
6643 memset(&packet2, 0, sizeof(packet2));
6644 mavlink_msg_encapsulated_data_pack(system_id, component_id, &msg , packet1.seqnr , packet1.data );
6645 mavlink_msg_encapsulated_data_decode(&msg, &packet2);
6646 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6647
6648 memset(&packet2, 0, sizeof(packet2));
6649 mavlink_msg_encapsulated_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seqnr , packet1.data );
6650 mavlink_msg_encapsulated_data_decode(&msg, &packet2);
6651 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6652
6653 memset(&packet2, 0, sizeof(packet2));
6654 mavlink_msg_to_send_buffer(buffer, &msg);
6655 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6656 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6657 }
6658 mavlink_msg_encapsulated_data_decode(last_msg, &packet2);
6659 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6660
6661 memset(&packet2, 0, sizeof(packet2));
6662 mavlink_msg_encapsulated_data_send(MAVLINK_COMM_1 , packet1.seqnr , packet1.data );
6663 mavlink_msg_encapsulated_data_decode(last_msg, &packet2);
6664 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6665
6666#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6667 MAVLINK_ASSERT(mavlink_get_message_info_by_name("ENCAPSULATED_DATA") != NULL);
6668 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ENCAPSULATED_DATA) != NULL);
6669#endif
6670}
6671
6672static void mavlink_test_distance_sensor(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6673{
6674#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6675 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6676 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DISTANCE_SENSOR >= 256) {
6677 return;
6678 }
6679#endif
6680 mavlink_message_t msg;
6681 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6682 uint16_t i;
6683 mavlink_distance_sensor_t packet_in = {
6684 963497464,17443,17547,17651,163,230,41,108,115.0,143.0,{ 171.0, 172.0, 173.0, 174.0 },247
6685 };
6686 mavlink_distance_sensor_t packet1, packet2;
6687 memset(&packet1, 0, sizeof(packet1));
6688 packet1.time_boot_ms = packet_in.time_boot_ms;
6689 packet1.min_distance = packet_in.min_distance;
6690 packet1.max_distance = packet_in.max_distance;
6691 packet1.current_distance = packet_in.current_distance;
6692 packet1.type = packet_in.type;
6693 packet1.id = packet_in.id;
6694 packet1.orientation = packet_in.orientation;
6695 packet1.covariance = packet_in.covariance;
6696 packet1.horizontal_fov = packet_in.horizontal_fov;
6697 packet1.vertical_fov = packet_in.vertical_fov;
6698 packet1.signal_quality = packet_in.signal_quality;
6699
6700 mav_array_memcpy(packet1.quaternion, packet_in.quaternion, sizeof(float)*4);
6701
6702#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6703 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6704 // cope with extensions
6705 memset(MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN);
6706 }
6707#endif
6708 memset(&packet2, 0, sizeof(packet2));
6709 mavlink_msg_distance_sensor_encode(system_id, component_id, &msg, &packet1);
6710 mavlink_msg_distance_sensor_decode(&msg, &packet2);
6711 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6712
6713 memset(&packet2, 0, sizeof(packet2));
6714 mavlink_msg_distance_sensor_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance , packet1.horizontal_fov , packet1.vertical_fov , packet1.quaternion , packet1.signal_quality );
6715 mavlink_msg_distance_sensor_decode(&msg, &packet2);
6716 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6717
6718 memset(&packet2, 0, sizeof(packet2));
6719 mavlink_msg_distance_sensor_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance , packet1.horizontal_fov , packet1.vertical_fov , packet1.quaternion , packet1.signal_quality );
6720 mavlink_msg_distance_sensor_decode(&msg, &packet2);
6721 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6722
6723 memset(&packet2, 0, sizeof(packet2));
6724 mavlink_msg_to_send_buffer(buffer, &msg);
6725 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6726 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6727 }
6728 mavlink_msg_distance_sensor_decode(last_msg, &packet2);
6729 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6730
6731 memset(&packet2, 0, sizeof(packet2));
6732 mavlink_msg_distance_sensor_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance , packet1.horizontal_fov , packet1.vertical_fov , packet1.quaternion , packet1.signal_quality );
6733 mavlink_msg_distance_sensor_decode(last_msg, &packet2);
6734 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6735
6736#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6737 MAVLINK_ASSERT(mavlink_get_message_info_by_name("DISTANCE_SENSOR") != NULL);
6738 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_DISTANCE_SENSOR) != NULL);
6739#endif
6740}
6741
6742static void mavlink_test_terrain_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6743{
6744#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6745 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6746 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TERRAIN_REQUEST >= 256) {
6747 return;
6748 }
6749#endif
6750 mavlink_message_t msg;
6751 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6752 uint16_t i;
6753 mavlink_terrain_request_t packet_in = {
6754 93372036854775807ULL,963497880,963498088,18067
6755 };
6756 mavlink_terrain_request_t packet1, packet2;
6757 memset(&packet1, 0, sizeof(packet1));
6758 packet1.mask = packet_in.mask;
6759 packet1.lat = packet_in.lat;
6760 packet1.lon = packet_in.lon;
6761 packet1.grid_spacing = packet_in.grid_spacing;
6762
6763
6764#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6765 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6766 // cope with extensions
6767 memset(MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN);
6768 }
6769#endif
6770 memset(&packet2, 0, sizeof(packet2));
6771 mavlink_msg_terrain_request_encode(system_id, component_id, &msg, &packet1);
6772 mavlink_msg_terrain_request_decode(&msg, &packet2);
6773 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6774
6775 memset(&packet2, 0, sizeof(packet2));
6776 mavlink_msg_terrain_request_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.mask );
6777 mavlink_msg_terrain_request_decode(&msg, &packet2);
6778 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6779
6780 memset(&packet2, 0, sizeof(packet2));
6781 mavlink_msg_terrain_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.mask );
6782 mavlink_msg_terrain_request_decode(&msg, &packet2);
6783 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6784
6785 memset(&packet2, 0, sizeof(packet2));
6786 mavlink_msg_to_send_buffer(buffer, &msg);
6787 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6788 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6789 }
6790 mavlink_msg_terrain_request_decode(last_msg, &packet2);
6791 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6792
6793 memset(&packet2, 0, sizeof(packet2));
6794 mavlink_msg_terrain_request_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.mask );
6795 mavlink_msg_terrain_request_decode(last_msg, &packet2);
6796 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6797
6798#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6799 MAVLINK_ASSERT(mavlink_get_message_info_by_name("TERRAIN_REQUEST") != NULL);
6800 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_TERRAIN_REQUEST) != NULL);
6801#endif
6802}
6803
6804static void mavlink_test_terrain_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6805{
6806#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6807 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6808 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TERRAIN_DATA >= 256) {
6809 return;
6810 }
6811#endif
6812 mavlink_message_t msg;
6813 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6814 uint16_t i;
6815 mavlink_terrain_data_t packet_in = {
6816 963497464,963497672,17651,{ 17755, 17756, 17757, 17758, 17759, 17760, 17761, 17762, 17763, 17764, 17765, 17766, 17767, 17768, 17769, 17770 },3
6817 };
6818 mavlink_terrain_data_t packet1, packet2;
6819 memset(&packet1, 0, sizeof(packet1));
6820 packet1.lat = packet_in.lat;
6821 packet1.lon = packet_in.lon;
6822 packet1.grid_spacing = packet_in.grid_spacing;
6823 packet1.gridbit = packet_in.gridbit;
6824
6825 mav_array_memcpy(packet1.data, packet_in.data, sizeof(int16_t)*16);
6826
6827#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6828 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6829 // cope with extensions
6830 memset(MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN);
6831 }
6832#endif
6833 memset(&packet2, 0, sizeof(packet2));
6834 mavlink_msg_terrain_data_encode(system_id, component_id, &msg, &packet1);
6835 mavlink_msg_terrain_data_decode(&msg, &packet2);
6836 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6837
6838 memset(&packet2, 0, sizeof(packet2));
6839 mavlink_msg_terrain_data_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.gridbit , packet1.data );
6840 mavlink_msg_terrain_data_decode(&msg, &packet2);
6841 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6842
6843 memset(&packet2, 0, sizeof(packet2));
6844 mavlink_msg_terrain_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.gridbit , packet1.data );
6845 mavlink_msg_terrain_data_decode(&msg, &packet2);
6846 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6847
6848 memset(&packet2, 0, sizeof(packet2));
6849 mavlink_msg_to_send_buffer(buffer, &msg);
6850 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6851 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6852 }
6853 mavlink_msg_terrain_data_decode(last_msg, &packet2);
6854 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6855
6856 memset(&packet2, 0, sizeof(packet2));
6857 mavlink_msg_terrain_data_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.gridbit , packet1.data );
6858 mavlink_msg_terrain_data_decode(last_msg, &packet2);
6859 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6860
6861#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6862 MAVLINK_ASSERT(mavlink_get_message_info_by_name("TERRAIN_DATA") != NULL);
6863 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_TERRAIN_DATA) != NULL);
6864#endif
6865}
6866
6867static void mavlink_test_terrain_check(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6868{
6869#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6870 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6871 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TERRAIN_CHECK >= 256) {
6872 return;
6873 }
6874#endif
6875 mavlink_message_t msg;
6876 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6877 uint16_t i;
6878 mavlink_terrain_check_t packet_in = {
6879 963497464,963497672
6880 };
6881 mavlink_terrain_check_t packet1, packet2;
6882 memset(&packet1, 0, sizeof(packet1));
6883 packet1.lat = packet_in.lat;
6884 packet1.lon = packet_in.lon;
6885
6886
6887#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6888 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6889 // cope with extensions
6890 memset(MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN);
6891 }
6892#endif
6893 memset(&packet2, 0, sizeof(packet2));
6894 mavlink_msg_terrain_check_encode(system_id, component_id, &msg, &packet1);
6895 mavlink_msg_terrain_check_decode(&msg, &packet2);
6896 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6897
6898 memset(&packet2, 0, sizeof(packet2));
6899 mavlink_msg_terrain_check_pack(system_id, component_id, &msg , packet1.lat , packet1.lon );
6900 mavlink_msg_terrain_check_decode(&msg, &packet2);
6901 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6902
6903 memset(&packet2, 0, sizeof(packet2));
6904 mavlink_msg_terrain_check_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon );
6905 mavlink_msg_terrain_check_decode(&msg, &packet2);
6906 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6907
6908 memset(&packet2, 0, sizeof(packet2));
6909 mavlink_msg_to_send_buffer(buffer, &msg);
6910 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6911 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6912 }
6913 mavlink_msg_terrain_check_decode(last_msg, &packet2);
6914 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6915
6916 memset(&packet2, 0, sizeof(packet2));
6917 mavlink_msg_terrain_check_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon );
6918 mavlink_msg_terrain_check_decode(last_msg, &packet2);
6919 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6920
6921#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6922 MAVLINK_ASSERT(mavlink_get_message_info_by_name("TERRAIN_CHECK") != NULL);
6923 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_TERRAIN_CHECK) != NULL);
6924#endif
6925}
6926
6927static void mavlink_test_terrain_report(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6928{
6929#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6930 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6931 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TERRAIN_REPORT >= 256) {
6932 return;
6933 }
6934#endif
6935 mavlink_message_t msg;
6936 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6937 uint16_t i;
6938 mavlink_terrain_report_t packet_in = {
6939 963497464,963497672,73.0,101.0,18067,18171,18275
6940 };
6941 mavlink_terrain_report_t packet1, packet2;
6942 memset(&packet1, 0, sizeof(packet1));
6943 packet1.lat = packet_in.lat;
6944 packet1.lon = packet_in.lon;
6945 packet1.terrain_height = packet_in.terrain_height;
6946 packet1.current_height = packet_in.current_height;
6947 packet1.spacing = packet_in.spacing;
6948 packet1.pending = packet_in.pending;
6949 packet1.loaded = packet_in.loaded;
6950
6951
6952#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6953 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6954 // cope with extensions
6955 memset(MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN);
6956 }
6957#endif
6958 memset(&packet2, 0, sizeof(packet2));
6959 mavlink_msg_terrain_report_encode(system_id, component_id, &msg, &packet1);
6960 mavlink_msg_terrain_report_decode(&msg, &packet2);
6961 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6962
6963 memset(&packet2, 0, sizeof(packet2));
6964 mavlink_msg_terrain_report_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.spacing , packet1.terrain_height , packet1.current_height , packet1.pending , packet1.loaded );
6965 mavlink_msg_terrain_report_decode(&msg, &packet2);
6966 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6967
6968 memset(&packet2, 0, sizeof(packet2));
6969 mavlink_msg_terrain_report_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon , packet1.spacing , packet1.terrain_height , packet1.current_height , packet1.pending , packet1.loaded );
6970 mavlink_msg_terrain_report_decode(&msg, &packet2);
6971 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6972
6973 memset(&packet2, 0, sizeof(packet2));
6974 mavlink_msg_to_send_buffer(buffer, &msg);
6975 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6976 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6977 }
6978 mavlink_msg_terrain_report_decode(last_msg, &packet2);
6979 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6980
6981 memset(&packet2, 0, sizeof(packet2));
6982 mavlink_msg_terrain_report_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon , packet1.spacing , packet1.terrain_height , packet1.current_height , packet1.pending , packet1.loaded );
6983 mavlink_msg_terrain_report_decode(last_msg, &packet2);
6984 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6985
6986#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6987 MAVLINK_ASSERT(mavlink_get_message_info_by_name("TERRAIN_REPORT") != NULL);
6988 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_TERRAIN_REPORT) != NULL);
6989#endif
6990}
6991
6992static void mavlink_test_scaled_pressure2(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6993{
6994#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6995 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6996 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_PRESSURE2 >= 256) {
6997 return;
6998 }
6999#endif
7000 mavlink_message_t msg;
7001 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7002 uint16_t i;
7003 mavlink_scaled_pressure2_t packet_in = {
7004 963497464,45.0,73.0,17859,17963
7005 };
7006 mavlink_scaled_pressure2_t packet1, packet2;
7007 memset(&packet1, 0, sizeof(packet1));
7008 packet1.time_boot_ms = packet_in.time_boot_ms;
7009 packet1.press_abs = packet_in.press_abs;
7010 packet1.press_diff = packet_in.press_diff;
7011 packet1.temperature = packet_in.temperature;
7012 packet1.temperature_press_diff = packet_in.temperature_press_diff;
7013
7014
7015#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7016 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7017 // cope with extensions
7018 memset(MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN);
7019 }
7020#endif
7021 memset(&packet2, 0, sizeof(packet2));
7022 mavlink_msg_scaled_pressure2_encode(system_id, component_id, &msg, &packet1);
7023 mavlink_msg_scaled_pressure2_decode(&msg, &packet2);
7024 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7025
7026 memset(&packet2, 0, sizeof(packet2));
7027 mavlink_msg_scaled_pressure2_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature , packet1.temperature_press_diff );
7028 mavlink_msg_scaled_pressure2_decode(&msg, &packet2);
7029 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7030
7031 memset(&packet2, 0, sizeof(packet2));
7032 mavlink_msg_scaled_pressure2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature , packet1.temperature_press_diff );
7033 mavlink_msg_scaled_pressure2_decode(&msg, &packet2);
7034 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7035
7036 memset(&packet2, 0, sizeof(packet2));
7037 mavlink_msg_to_send_buffer(buffer, &msg);
7038 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7039 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7040 }
7041 mavlink_msg_scaled_pressure2_decode(last_msg, &packet2);
7042 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7043
7044 memset(&packet2, 0, sizeof(packet2));
7045 mavlink_msg_scaled_pressure2_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature , packet1.temperature_press_diff );
7046 mavlink_msg_scaled_pressure2_decode(last_msg, &packet2);
7047 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7048
7049#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7050 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SCALED_PRESSURE2") != NULL);
7051 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SCALED_PRESSURE2) != NULL);
7052#endif
7053}
7054
7055static void mavlink_test_att_pos_mocap(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7056{
7057#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7058 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7059 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATT_POS_MOCAP >= 256) {
7060 return;
7061 }
7062#endif
7063 mavlink_message_t msg;
7064 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7065 uint16_t i;
7066 mavlink_att_pos_mocap_t packet_in = {
7067 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0 },185.0,213.0,241.0,{ 269.0, 270.0, 271.0, 272.0, 273.0, 274.0, 275.0, 276.0, 277.0, 278.0, 279.0, 280.0, 281.0, 282.0, 283.0, 284.0, 285.0, 286.0, 287.0, 288.0, 289.0 }
7068 };
7069 mavlink_att_pos_mocap_t packet1, packet2;
7070 memset(&packet1, 0, sizeof(packet1));
7071 packet1.time_usec = packet_in.time_usec;
7072 packet1.x = packet_in.x;
7073 packet1.y = packet_in.y;
7074 packet1.z = packet_in.z;
7075
7076 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
7077 mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*21);
7078
7079#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7080 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7081 // cope with extensions
7082 memset(MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN);
7083 }
7084#endif
7085 memset(&packet2, 0, sizeof(packet2));
7086 mavlink_msg_att_pos_mocap_encode(system_id, component_id, &msg, &packet1);
7087 mavlink_msg_att_pos_mocap_decode(&msg, &packet2);
7088 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7089
7090 memset(&packet2, 0, sizeof(packet2));
7091 mavlink_msg_att_pos_mocap_pack(system_id, component_id, &msg , packet1.time_usec , packet1.q , packet1.x , packet1.y , packet1.z , packet1.covariance );
7092 mavlink_msg_att_pos_mocap_decode(&msg, &packet2);
7093 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7094
7095 memset(&packet2, 0, sizeof(packet2));
7096 mavlink_msg_att_pos_mocap_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.q , packet1.x , packet1.y , packet1.z , packet1.covariance );
7097 mavlink_msg_att_pos_mocap_decode(&msg, &packet2);
7098 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7099
7100 memset(&packet2, 0, sizeof(packet2));
7101 mavlink_msg_to_send_buffer(buffer, &msg);
7102 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7103 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7104 }
7105 mavlink_msg_att_pos_mocap_decode(last_msg, &packet2);
7106 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7107
7108 memset(&packet2, 0, sizeof(packet2));
7109 mavlink_msg_att_pos_mocap_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.q , packet1.x , packet1.y , packet1.z , packet1.covariance );
7110 mavlink_msg_att_pos_mocap_decode(last_msg, &packet2);
7111 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7112
7113#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7114 MAVLINK_ASSERT(mavlink_get_message_info_by_name("ATT_POS_MOCAP") != NULL);
7115 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ATT_POS_MOCAP) != NULL);
7116#endif
7117}
7118
7119static void mavlink_test_set_actuator_control_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7120{
7121#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7122 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7123 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET >= 256) {
7124 return;
7125 }
7126#endif
7127 mavlink_message_t msg;
7128 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7129 uint16_t i;
7130 mavlink_set_actuator_control_target_t packet_in = {
7131 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0, 77.0, 78.0, 79.0, 80.0 },125,192,3
7132 };
7133 mavlink_set_actuator_control_target_t packet1, packet2;
7134 memset(&packet1, 0, sizeof(packet1));
7135 packet1.time_usec = packet_in.time_usec;
7136 packet1.group_mlx = packet_in.group_mlx;
7137 packet1.target_system = packet_in.target_system;
7138 packet1.target_component = packet_in.target_component;
7139
7140 mav_array_memcpy(packet1.controls, packet_in.controls, sizeof(float)*8);
7141
7142#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7143 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7144 // cope with extensions
7145 memset(MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN);
7146 }
7147#endif
7148 memset(&packet2, 0, sizeof(packet2));
7149 mavlink_msg_set_actuator_control_target_encode(system_id, component_id, &msg, &packet1);
7150 mavlink_msg_set_actuator_control_target_decode(&msg, &packet2);
7151 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7152
7153 memset(&packet2, 0, sizeof(packet2));
7154 mavlink_msg_set_actuator_control_target_pack(system_id, component_id, &msg , packet1.time_usec , packet1.group_mlx , packet1.target_system , packet1.target_component , packet1.controls );
7155 mavlink_msg_set_actuator_control_target_decode(&msg, &packet2);
7156 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7157
7158 memset(&packet2, 0, sizeof(packet2));
7159 mavlink_msg_set_actuator_control_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.group_mlx , packet1.target_system , packet1.target_component , packet1.controls );
7160 mavlink_msg_set_actuator_control_target_decode(&msg, &packet2);
7161 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7162
7163 memset(&packet2, 0, sizeof(packet2));
7164 mavlink_msg_to_send_buffer(buffer, &msg);
7165 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7166 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7167 }
7168 mavlink_msg_set_actuator_control_target_decode(last_msg, &packet2);
7169 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7170
7171 memset(&packet2, 0, sizeof(packet2));
7172 mavlink_msg_set_actuator_control_target_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.group_mlx , packet1.target_system , packet1.target_component , packet1.controls );
7173 mavlink_msg_set_actuator_control_target_decode(last_msg, &packet2);
7174 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7175
7176#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7177 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SET_ACTUATOR_CONTROL_TARGET") != NULL);
7178 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET) != NULL);
7179#endif
7180}
7181
7182static void mavlink_test_actuator_control_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7183{
7184#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7185 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7186 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET >= 256) {
7187 return;
7188 }
7189#endif
7190 mavlink_message_t msg;
7191 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7192 uint16_t i;
7193 mavlink_actuator_control_target_t packet_in = {
7194 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0, 77.0, 78.0, 79.0, 80.0 },125
7195 };
7196 mavlink_actuator_control_target_t packet1, packet2;
7197 memset(&packet1, 0, sizeof(packet1));
7198 packet1.time_usec = packet_in.time_usec;
7199 packet1.group_mlx = packet_in.group_mlx;
7200
7201 mav_array_memcpy(packet1.controls, packet_in.controls, sizeof(float)*8);
7202
7203#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7204 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7205 // cope with extensions
7206 memset(MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN);
7207 }
7208#endif
7209 memset(&packet2, 0, sizeof(packet2));
7210 mavlink_msg_actuator_control_target_encode(system_id, component_id, &msg, &packet1);
7211 mavlink_msg_actuator_control_target_decode(&msg, &packet2);
7212 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7213
7214 memset(&packet2, 0, sizeof(packet2));
7215 mavlink_msg_actuator_control_target_pack(system_id, component_id, &msg , packet1.time_usec , packet1.group_mlx , packet1.controls );
7216 mavlink_msg_actuator_control_target_decode(&msg, &packet2);
7217 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7218
7219 memset(&packet2, 0, sizeof(packet2));
7220 mavlink_msg_actuator_control_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.group_mlx , packet1.controls );
7221 mavlink_msg_actuator_control_target_decode(&msg, &packet2);
7222 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7223
7224 memset(&packet2, 0, sizeof(packet2));
7225 mavlink_msg_to_send_buffer(buffer, &msg);
7226 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7227 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7228 }
7229 mavlink_msg_actuator_control_target_decode(last_msg, &packet2);
7230 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7231
7232 memset(&packet2, 0, sizeof(packet2));
7233 mavlink_msg_actuator_control_target_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.group_mlx , packet1.controls );
7234 mavlink_msg_actuator_control_target_decode(last_msg, &packet2);
7235 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7236
7237#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7238 MAVLINK_ASSERT(mavlink_get_message_info_by_name("ACTUATOR_CONTROL_TARGET") != NULL);
7239 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET) != NULL);
7240#endif
7241}
7242
7243static void mavlink_test_altitude(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7244{
7245#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7246 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7247 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ALTITUDE >= 256) {
7248 return;
7249 }
7250#endif
7251 mavlink_message_t msg;
7252 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7253 uint16_t i;
7254 mavlink_altitude_t packet_in = {
7255 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0
7256 };
7257 mavlink_altitude_t packet1, packet2;
7258 memset(&packet1, 0, sizeof(packet1));
7259 packet1.time_usec = packet_in.time_usec;
7260 packet1.altitude_monotonic = packet_in.altitude_monotonic;
7261 packet1.altitude_amsl = packet_in.altitude_amsl;
7262 packet1.altitude_local = packet_in.altitude_local;
7263 packet1.altitude_relative = packet_in.altitude_relative;
7264 packet1.altitude_terrain = packet_in.altitude_terrain;
7265 packet1.bottom_clearance = packet_in.bottom_clearance;
7266
7267
7268#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7269 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7270 // cope with extensions
7271 memset(MAVLINK_MSG_ID_ALTITUDE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ALTITUDE_MIN_LEN);
7272 }
7273#endif
7274 memset(&packet2, 0, sizeof(packet2));
7275 mavlink_msg_altitude_encode(system_id, component_id, &msg, &packet1);
7276 mavlink_msg_altitude_decode(&msg, &packet2);
7277 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7278
7279 memset(&packet2, 0, sizeof(packet2));
7280 mavlink_msg_altitude_pack(system_id, component_id, &msg , packet1.time_usec , packet1.altitude_monotonic , packet1.altitude_amsl , packet1.altitude_local , packet1.altitude_relative , packet1.altitude_terrain , packet1.bottom_clearance );
7281 mavlink_msg_altitude_decode(&msg, &packet2);
7282 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7283
7284 memset(&packet2, 0, sizeof(packet2));
7285 mavlink_msg_altitude_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.altitude_monotonic , packet1.altitude_amsl , packet1.altitude_local , packet1.altitude_relative , packet1.altitude_terrain , packet1.bottom_clearance );
7286 mavlink_msg_altitude_decode(&msg, &packet2);
7287 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7288
7289 memset(&packet2, 0, sizeof(packet2));
7290 mavlink_msg_to_send_buffer(buffer, &msg);
7291 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7292 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7293 }
7294 mavlink_msg_altitude_decode(last_msg, &packet2);
7295 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7296
7297 memset(&packet2, 0, sizeof(packet2));
7298 mavlink_msg_altitude_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.altitude_monotonic , packet1.altitude_amsl , packet1.altitude_local , packet1.altitude_relative , packet1.altitude_terrain , packet1.bottom_clearance );
7299 mavlink_msg_altitude_decode(last_msg, &packet2);
7300 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7301
7302#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7303 MAVLINK_ASSERT(mavlink_get_message_info_by_name("ALTITUDE") != NULL);
7304 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ALTITUDE) != NULL);
7305#endif
7306}
7307
7308static void mavlink_test_resource_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7309{
7310#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7311 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7312 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RESOURCE_REQUEST >= 256) {
7313 return;
7314 }
7315#endif
7316 mavlink_message_t msg;
7317 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7318 uint16_t i;
7319 mavlink_resource_request_t packet_in = {
7320 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, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2 },243,{ 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, 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 }
7321 };
7322 mavlink_resource_request_t packet1, packet2;
7323 memset(&packet1, 0, sizeof(packet1));
7324 packet1.request_id = packet_in.request_id;
7325 packet1.uri_type = packet_in.uri_type;
7326 packet1.transfer_type = packet_in.transfer_type;
7327
7328 mav_array_memcpy(packet1.uri, packet_in.uri, sizeof(uint8_t)*120);
7329 mav_array_memcpy(packet1.storage, packet_in.storage, sizeof(uint8_t)*120);
7330
7331#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7332 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7333 // cope with extensions
7334 memset(MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN);
7335 }
7336#endif
7337 memset(&packet2, 0, sizeof(packet2));
7338 mavlink_msg_resource_request_encode(system_id, component_id, &msg, &packet1);
7339 mavlink_msg_resource_request_decode(&msg, &packet2);
7340 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7341
7342 memset(&packet2, 0, sizeof(packet2));
7343 mavlink_msg_resource_request_pack(system_id, component_id, &msg , packet1.request_id , packet1.uri_type , packet1.uri , packet1.transfer_type , packet1.storage );
7344 mavlink_msg_resource_request_decode(&msg, &packet2);
7345 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7346
7347 memset(&packet2, 0, sizeof(packet2));
7348 mavlink_msg_resource_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.request_id , packet1.uri_type , packet1.uri , packet1.transfer_type , packet1.storage );
7349 mavlink_msg_resource_request_decode(&msg, &packet2);
7350 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7351
7352 memset(&packet2, 0, sizeof(packet2));
7353 mavlink_msg_to_send_buffer(buffer, &msg);
7354 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7355 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7356 }
7357 mavlink_msg_resource_request_decode(last_msg, &packet2);
7358 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7359
7360 memset(&packet2, 0, sizeof(packet2));
7361 mavlink_msg_resource_request_send(MAVLINK_COMM_1 , packet1.request_id , packet1.uri_type , packet1.uri , packet1.transfer_type , packet1.storage );
7362 mavlink_msg_resource_request_decode(last_msg, &packet2);
7363 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7364
7365#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7366 MAVLINK_ASSERT(mavlink_get_message_info_by_name("RESOURCE_REQUEST") != NULL);
7367 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_RESOURCE_REQUEST) != NULL);
7368#endif
7369}
7370
7371static void mavlink_test_scaled_pressure3(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7372{
7373#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7374 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7375 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_PRESSURE3 >= 256) {
7376 return;
7377 }
7378#endif
7379 mavlink_message_t msg;
7380 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7381 uint16_t i;
7382 mavlink_scaled_pressure3_t packet_in = {
7383 963497464,45.0,73.0,17859,17963
7384 };
7385 mavlink_scaled_pressure3_t packet1, packet2;
7386 memset(&packet1, 0, sizeof(packet1));
7387 packet1.time_boot_ms = packet_in.time_boot_ms;
7388 packet1.press_abs = packet_in.press_abs;
7389 packet1.press_diff = packet_in.press_diff;
7390 packet1.temperature = packet_in.temperature;
7391 packet1.temperature_press_diff = packet_in.temperature_press_diff;
7392
7393
7394#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7395 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7396 // cope with extensions
7397 memset(MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN);
7398 }
7399#endif
7400 memset(&packet2, 0, sizeof(packet2));
7401 mavlink_msg_scaled_pressure3_encode(system_id, component_id, &msg, &packet1);
7402 mavlink_msg_scaled_pressure3_decode(&msg, &packet2);
7403 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7404
7405 memset(&packet2, 0, sizeof(packet2));
7406 mavlink_msg_scaled_pressure3_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature , packet1.temperature_press_diff );
7407 mavlink_msg_scaled_pressure3_decode(&msg, &packet2);
7408 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7409
7410 memset(&packet2, 0, sizeof(packet2));
7411 mavlink_msg_scaled_pressure3_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature , packet1.temperature_press_diff );
7412 mavlink_msg_scaled_pressure3_decode(&msg, &packet2);
7413 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7414
7415 memset(&packet2, 0, sizeof(packet2));
7416 mavlink_msg_to_send_buffer(buffer, &msg);
7417 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7418 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7419 }
7420 mavlink_msg_scaled_pressure3_decode(last_msg, &packet2);
7421 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7422
7423 memset(&packet2, 0, sizeof(packet2));
7424 mavlink_msg_scaled_pressure3_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature , packet1.temperature_press_diff );
7425 mavlink_msg_scaled_pressure3_decode(last_msg, &packet2);
7426 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7427
7428#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7429 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SCALED_PRESSURE3") != NULL);
7430 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SCALED_PRESSURE3) != NULL);
7431#endif
7432}
7433
7434static void mavlink_test_follow_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7435{
7436#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7437 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7438 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FOLLOW_TARGET >= 256) {
7439 return;
7440 }
7441#endif
7442 mavlink_message_t msg;
7443 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7444 uint16_t i;
7445 mavlink_follow_target_t packet_in = {
7446 93372036854775807ULL,93372036854776311ULL,963498296,963498504,185.0,{ 213.0, 214.0, 215.0 },{ 297.0, 298.0, 299.0 },{ 381.0, 382.0, 383.0, 384.0 },{ 493.0, 494.0, 495.0 },{ 577.0, 578.0, 579.0 },25
7447 };
7448 mavlink_follow_target_t packet1, packet2;
7449 memset(&packet1, 0, sizeof(packet1));
7450 packet1.timestamp = packet_in.timestamp;
7451 packet1.custom_state = packet_in.custom_state;
7452 packet1.lat = packet_in.lat;
7453 packet1.lon = packet_in.lon;
7454 packet1.alt = packet_in.alt;
7455 packet1.est_capabilities = packet_in.est_capabilities;
7456
7457 mav_array_memcpy(packet1.vel, packet_in.vel, sizeof(float)*3);
7458 mav_array_memcpy(packet1.acc, packet_in.acc, sizeof(float)*3);
7459 mav_array_memcpy(packet1.attitude_q, packet_in.attitude_q, sizeof(float)*4);
7460 mav_array_memcpy(packet1.rates, packet_in.rates, sizeof(float)*3);
7461 mav_array_memcpy(packet1.position_cov, packet_in.position_cov, sizeof(float)*3);
7462
7463#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7464 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7465 // cope with extensions
7466 memset(MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN);
7467 }
7468#endif
7469 memset(&packet2, 0, sizeof(packet2));
7470 mavlink_msg_follow_target_encode(system_id, component_id, &msg, &packet1);
7471 mavlink_msg_follow_target_decode(&msg, &packet2);
7472 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7473
7474 memset(&packet2, 0, sizeof(packet2));
7475 mavlink_msg_follow_target_pack(system_id, component_id, &msg , packet1.timestamp , packet1.est_capabilities , packet1.lat , packet1.lon , packet1.alt , packet1.vel , packet1.acc , packet1.attitude_q , packet1.rates , packet1.position_cov , packet1.custom_state );
7476 mavlink_msg_follow_target_decode(&msg, &packet2);
7477 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7478
7479 memset(&packet2, 0, sizeof(packet2));
7480 mavlink_msg_follow_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.est_capabilities , packet1.lat , packet1.lon , packet1.alt , packet1.vel , packet1.acc , packet1.attitude_q , packet1.rates , packet1.position_cov , packet1.custom_state );
7481 mavlink_msg_follow_target_decode(&msg, &packet2);
7482 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7483
7484 memset(&packet2, 0, sizeof(packet2));
7485 mavlink_msg_to_send_buffer(buffer, &msg);
7486 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7487 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7488 }
7489 mavlink_msg_follow_target_decode(last_msg, &packet2);
7490 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7491
7492 memset(&packet2, 0, sizeof(packet2));
7493 mavlink_msg_follow_target_send(MAVLINK_COMM_1 , packet1.timestamp , packet1.est_capabilities , packet1.lat , packet1.lon , packet1.alt , packet1.vel , packet1.acc , packet1.attitude_q , packet1.rates , packet1.position_cov , packet1.custom_state );
7494 mavlink_msg_follow_target_decode(last_msg, &packet2);
7495 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7496
7497#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7498 MAVLINK_ASSERT(mavlink_get_message_info_by_name("FOLLOW_TARGET") != NULL);
7499 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_FOLLOW_TARGET) != NULL);
7500#endif
7501}
7502
7503static void mavlink_test_control_system_state(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7504{
7505#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7506 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7507 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE >= 256) {
7508 return;
7509 }
7510#endif
7511 mavlink_message_t msg;
7512 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7513 uint16_t i;
7514 mavlink_control_system_state_t packet_in = {
7515 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,{ 353.0, 354.0, 355.0 },{ 437.0, 438.0, 439.0 },{ 521.0, 522.0, 523.0, 524.0 },633.0,661.0,689.0
7516 };
7517 mavlink_control_system_state_t packet1, packet2;
7518 memset(&packet1, 0, sizeof(packet1));
7519 packet1.time_usec = packet_in.time_usec;
7520 packet1.x_acc = packet_in.x_acc;
7521 packet1.y_acc = packet_in.y_acc;
7522 packet1.z_acc = packet_in.z_acc;
7523 packet1.x_vel = packet_in.x_vel;
7524 packet1.y_vel = packet_in.y_vel;
7525 packet1.z_vel = packet_in.z_vel;
7526 packet1.x_pos = packet_in.x_pos;
7527 packet1.y_pos = packet_in.y_pos;
7528 packet1.z_pos = packet_in.z_pos;
7529 packet1.airspeed = packet_in.airspeed;
7530 packet1.roll_rate = packet_in.roll_rate;
7531 packet1.pitch_rate = packet_in.pitch_rate;
7532 packet1.yaw_rate = packet_in.yaw_rate;
7533
7534 mav_array_memcpy(packet1.vel_variance, packet_in.vel_variance, sizeof(float)*3);
7535 mav_array_memcpy(packet1.pos_variance, packet_in.pos_variance, sizeof(float)*3);
7536 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
7537
7538#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7539 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7540 // cope with extensions
7541 memset(MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN);
7542 }
7543#endif
7544 memset(&packet2, 0, sizeof(packet2));
7545 mavlink_msg_control_system_state_encode(system_id, component_id, &msg, &packet1);
7546 mavlink_msg_control_system_state_decode(&msg, &packet2);
7547 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7548
7549 memset(&packet2, 0, sizeof(packet2));
7550 mavlink_msg_control_system_state_pack(system_id, component_id, &msg , packet1.time_usec , packet1.x_acc , packet1.y_acc , packet1.z_acc , packet1.x_vel , packet1.y_vel , packet1.z_vel , packet1.x_pos , packet1.y_pos , packet1.z_pos , packet1.airspeed , packet1.vel_variance , packet1.pos_variance , packet1.q , packet1.roll_rate , packet1.pitch_rate , packet1.yaw_rate );
7551 mavlink_msg_control_system_state_decode(&msg, &packet2);
7552 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7553
7554 memset(&packet2, 0, sizeof(packet2));
7555 mavlink_msg_control_system_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.x_acc , packet1.y_acc , packet1.z_acc , packet1.x_vel , packet1.y_vel , packet1.z_vel , packet1.x_pos , packet1.y_pos , packet1.z_pos , packet1.airspeed , packet1.vel_variance , packet1.pos_variance , packet1.q , packet1.roll_rate , packet1.pitch_rate , packet1.yaw_rate );
7556 mavlink_msg_control_system_state_decode(&msg, &packet2);
7557 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7558
7559 memset(&packet2, 0, sizeof(packet2));
7560 mavlink_msg_to_send_buffer(buffer, &msg);
7561 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7562 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7563 }
7564 mavlink_msg_control_system_state_decode(last_msg, &packet2);
7565 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7566
7567 memset(&packet2, 0, sizeof(packet2));
7568 mavlink_msg_control_system_state_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.x_acc , packet1.y_acc , packet1.z_acc , packet1.x_vel , packet1.y_vel , packet1.z_vel , packet1.x_pos , packet1.y_pos , packet1.z_pos , packet1.airspeed , packet1.vel_variance , packet1.pos_variance , packet1.q , packet1.roll_rate , packet1.pitch_rate , packet1.yaw_rate );
7569 mavlink_msg_control_system_state_decode(last_msg, &packet2);
7570 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7571
7572#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7573 MAVLINK_ASSERT(mavlink_get_message_info_by_name("CONTROL_SYSTEM_STATE") != NULL);
7574 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE) != NULL);
7575#endif
7576}
7577
7578static void mavlink_test_battery_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7579{
7580#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7581 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7582 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_BATTERY_STATUS >= 256) {
7583 return;
7584 }
7585#endif
7586 mavlink_message_t msg;
7587 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7588 uint16_t i;
7589 mavlink_battery_status_t packet_in = {
7590 963497464,963497672,17651,{ 17755, 17756, 17757, 17758, 17759, 17760, 17761, 17762, 17763, 17764 },18795,101,168,235,46,963499336,125,{ 19367, 19368, 19369, 19370 },216,963500064
7591 };
7592 mavlink_battery_status_t packet1, packet2;
7593 memset(&packet1, 0, sizeof(packet1));
7594 packet1.current_consumed = packet_in.current_consumed;
7595 packet1.energy_consumed = packet_in.energy_consumed;
7596 packet1.temperature = packet_in.temperature;
7597 packet1.current_battery = packet_in.current_battery;
7598 packet1.id = packet_in.id;
7599 packet1.battery_function = packet_in.battery_function;
7600 packet1.type = packet_in.type;
7601 packet1.battery_remaining = packet_in.battery_remaining;
7602 packet1.time_remaining = packet_in.time_remaining;
7603 packet1.charge_state = packet_in.charge_state;
7604 packet1.mode = packet_in.mode;
7605 packet1.fault_bitmask = packet_in.fault_bitmask;
7606
7607 mav_array_memcpy(packet1.voltages, packet_in.voltages, sizeof(uint16_t)*10);
7608 mav_array_memcpy(packet1.voltages_ext, packet_in.voltages_ext, sizeof(uint16_t)*4);
7609
7610#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7611 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7612 // cope with extensions
7613 memset(MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN);
7614 }
7615#endif
7616 memset(&packet2, 0, sizeof(packet2));
7617 mavlink_msg_battery_status_encode(system_id, component_id, &msg, &packet1);
7618 mavlink_msg_battery_status_decode(&msg, &packet2);
7619 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7620
7621 memset(&packet2, 0, sizeof(packet2));
7622 mavlink_msg_battery_status_pack(system_id, component_id, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.temperature , packet1.voltages , packet1.current_battery , packet1.current_consumed , packet1.energy_consumed , packet1.battery_remaining , packet1.time_remaining , packet1.charge_state , packet1.voltages_ext , packet1.mode , packet1.fault_bitmask );
7623 mavlink_msg_battery_status_decode(&msg, &packet2);
7624 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7625
7626 memset(&packet2, 0, sizeof(packet2));
7627 mavlink_msg_battery_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.temperature , packet1.voltages , packet1.current_battery , packet1.current_consumed , packet1.energy_consumed , packet1.battery_remaining , packet1.time_remaining , packet1.charge_state , packet1.voltages_ext , packet1.mode , packet1.fault_bitmask );
7628 mavlink_msg_battery_status_decode(&msg, &packet2);
7629 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7630
7631 memset(&packet2, 0, sizeof(packet2));
7632 mavlink_msg_to_send_buffer(buffer, &msg);
7633 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7634 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7635 }
7636 mavlink_msg_battery_status_decode(last_msg, &packet2);
7637 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7638
7639 memset(&packet2, 0, sizeof(packet2));
7640 mavlink_msg_battery_status_send(MAVLINK_COMM_1 , packet1.id , packet1.battery_function , packet1.type , packet1.temperature , packet1.voltages , packet1.current_battery , packet1.current_consumed , packet1.energy_consumed , packet1.battery_remaining , packet1.time_remaining , packet1.charge_state , packet1.voltages_ext , packet1.mode , packet1.fault_bitmask );
7641 mavlink_msg_battery_status_decode(last_msg, &packet2);
7642 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7643
7644#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7645 MAVLINK_ASSERT(mavlink_get_message_info_by_name("BATTERY_STATUS") != NULL);
7646 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_BATTERY_STATUS) != NULL);
7647#endif
7648}
7649
7650static void mavlink_test_landing_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7651{
7652#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7653 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7654 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LANDING_TARGET >= 256) {
7655 return;
7656 }
7657#endif
7658 mavlink_message_t msg;
7659 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7660 uint16_t i;
7661 mavlink_landing_target_t packet_in = {
7662 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,89,156,227.0,255.0,283.0,{ 311.0, 312.0, 313.0, 314.0 },51,118
7663 };
7664 mavlink_landing_target_t packet1, packet2;
7665 memset(&packet1, 0, sizeof(packet1));
7666 packet1.time_usec = packet_in.time_usec;
7667 packet1.angle_x = packet_in.angle_x;
7668 packet1.angle_y = packet_in.angle_y;
7669 packet1.distance = packet_in.distance;
7670 packet1.size_x = packet_in.size_x;
7671 packet1.size_y = packet_in.size_y;
7672 packet1.target_num = packet_in.target_num;
7673 packet1.frame = packet_in.frame;
7674 packet1.x = packet_in.x;
7675 packet1.y = packet_in.y;
7676 packet1.z = packet_in.z;
7677 packet1.type = packet_in.type;
7678 packet1.position_valid = packet_in.position_valid;
7679
7680 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
7681
7682#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7683 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7684 // cope with extensions
7685 memset(MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN);
7686 }
7687#endif
7688 memset(&packet2, 0, sizeof(packet2));
7689 mavlink_msg_landing_target_encode(system_id, component_id, &msg, &packet1);
7690 mavlink_msg_landing_target_decode(&msg, &packet2);
7691 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7692
7693 memset(&packet2, 0, sizeof(packet2));
7694 mavlink_msg_landing_target_pack(system_id, component_id, &msg , packet1.time_usec , packet1.target_num , packet1.frame , packet1.angle_x , packet1.angle_y , packet1.distance , packet1.size_x , packet1.size_y , packet1.x , packet1.y , packet1.z , packet1.q , packet1.type , packet1.position_valid );
7695 mavlink_msg_landing_target_decode(&msg, &packet2);
7696 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7697
7698 memset(&packet2, 0, sizeof(packet2));
7699 mavlink_msg_landing_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.target_num , packet1.frame , packet1.angle_x , packet1.angle_y , packet1.distance , packet1.size_x , packet1.size_y , packet1.x , packet1.y , packet1.z , packet1.q , packet1.type , packet1.position_valid );
7700 mavlink_msg_landing_target_decode(&msg, &packet2);
7701 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7702
7703 memset(&packet2, 0, sizeof(packet2));
7704 mavlink_msg_to_send_buffer(buffer, &msg);
7705 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7706 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7707 }
7708 mavlink_msg_landing_target_decode(last_msg, &packet2);
7709 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7710
7711 memset(&packet2, 0, sizeof(packet2));
7712 mavlink_msg_landing_target_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.target_num , packet1.frame , packet1.angle_x , packet1.angle_y , packet1.distance , packet1.size_x , packet1.size_y , packet1.x , packet1.y , packet1.z , packet1.q , packet1.type , packet1.position_valid );
7713 mavlink_msg_landing_target_decode(last_msg, &packet2);
7714 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7715
7716#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7717 MAVLINK_ASSERT(mavlink_get_message_info_by_name("LANDING_TARGET") != NULL);
7718 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LANDING_TARGET) != NULL);
7719#endif
7720}
7721
7722static void mavlink_test_fence_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7723{
7724#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7725 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7726 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FENCE_STATUS >= 256) {
7727 return;
7728 }
7729#endif
7730 mavlink_message_t msg;
7731 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7732 uint16_t i;
7733 mavlink_fence_status_t packet_in = {
7734 963497464,17443,151,218,29
7735 };
7736 mavlink_fence_status_t packet1, packet2;
7737 memset(&packet1, 0, sizeof(packet1));
7738 packet1.breach_time = packet_in.breach_time;
7739 packet1.breach_count = packet_in.breach_count;
7740 packet1.breach_status = packet_in.breach_status;
7741 packet1.breach_type = packet_in.breach_type;
7742 packet1.breach_mitigation = packet_in.breach_mitigation;
7743
7744
7745#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7746 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7747 // cope with extensions
7748 memset(MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN);
7749 }
7750#endif
7751 memset(&packet2, 0, sizeof(packet2));
7752 mavlink_msg_fence_status_encode(system_id, component_id, &msg, &packet1);
7753 mavlink_msg_fence_status_decode(&msg, &packet2);
7754 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7755
7756 memset(&packet2, 0, sizeof(packet2));
7757 mavlink_msg_fence_status_pack(system_id, component_id, &msg , packet1.breach_status , packet1.breach_count , packet1.breach_type , packet1.breach_time , packet1.breach_mitigation );
7758 mavlink_msg_fence_status_decode(&msg, &packet2);
7759 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7760
7761 memset(&packet2, 0, sizeof(packet2));
7762 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 , packet1.breach_mitigation );
7763 mavlink_msg_fence_status_decode(&msg, &packet2);
7764 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7765
7766 memset(&packet2, 0, sizeof(packet2));
7767 mavlink_msg_to_send_buffer(buffer, &msg);
7768 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7769 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7770 }
7771 mavlink_msg_fence_status_decode(last_msg, &packet2);
7772 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7773
7774 memset(&packet2, 0, sizeof(packet2));
7775 mavlink_msg_fence_status_send(MAVLINK_COMM_1 , packet1.breach_status , packet1.breach_count , packet1.breach_type , packet1.breach_time , packet1.breach_mitigation );
7776 mavlink_msg_fence_status_decode(last_msg, &packet2);
7777 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7778
7779#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7780 MAVLINK_ASSERT(mavlink_get_message_info_by_name("FENCE_STATUS") != NULL);
7781 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_FENCE_STATUS) != NULL);
7782#endif
7783}
7784
7785static void mavlink_test_mag_cal_report(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7786{
7787#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7788 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7789 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MAG_CAL_REPORT >= 256) {
7790 return;
7791 }
7792#endif
7793 mavlink_message_t msg;
7794 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7795 uint16_t i;
7796 mavlink_mag_cal_report_t packet_in = {
7797 17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,125,192,3,70,325.0,149,216,367.0
7798 };
7799 mavlink_mag_cal_report_t packet1, packet2;
7800 memset(&packet1, 0, sizeof(packet1));
7801 packet1.fitness = packet_in.fitness;
7802 packet1.ofs_x = packet_in.ofs_x;
7803 packet1.ofs_y = packet_in.ofs_y;
7804 packet1.ofs_z = packet_in.ofs_z;
7805 packet1.diag_x = packet_in.diag_x;
7806 packet1.diag_y = packet_in.diag_y;
7807 packet1.diag_z = packet_in.diag_z;
7808 packet1.offdiag_x = packet_in.offdiag_x;
7809 packet1.offdiag_y = packet_in.offdiag_y;
7810 packet1.offdiag_z = packet_in.offdiag_z;
7811 packet1.compass_id = packet_in.compass_id;
7812 packet1.cal_mask = packet_in.cal_mask;
7813 packet1.cal_status = packet_in.cal_status;
7814 packet1.autosaved = packet_in.autosaved;
7815 packet1.orientation_confidence = packet_in.orientation_confidence;
7816 packet1.old_orientation = packet_in.old_orientation;
7817 packet1.new_orientation = packet_in.new_orientation;
7818 packet1.scale_factor = packet_in.scale_factor;
7819
7820
7821#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7822 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7823 // cope with extensions
7824 memset(MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN);
7825 }
7826#endif
7827 memset(&packet2, 0, sizeof(packet2));
7828 mavlink_msg_mag_cal_report_encode(system_id, component_id, &msg, &packet1);
7829 mavlink_msg_mag_cal_report_decode(&msg, &packet2);
7830 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7831
7832 memset(&packet2, 0, sizeof(packet2));
7833 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 , packet1.orientation_confidence , packet1.old_orientation , packet1.new_orientation , packet1.scale_factor );
7834 mavlink_msg_mag_cal_report_decode(&msg, &packet2);
7835 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7836
7837 memset(&packet2, 0, sizeof(packet2));
7838 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 , packet1.orientation_confidence , packet1.old_orientation , packet1.new_orientation , packet1.scale_factor );
7839 mavlink_msg_mag_cal_report_decode(&msg, &packet2);
7840 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7841
7842 memset(&packet2, 0, sizeof(packet2));
7843 mavlink_msg_to_send_buffer(buffer, &msg);
7844 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7845 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7846 }
7847 mavlink_msg_mag_cal_report_decode(last_msg, &packet2);
7848 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7849
7850 memset(&packet2, 0, sizeof(packet2));
7851 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 , packet1.orientation_confidence , packet1.old_orientation , packet1.new_orientation , packet1.scale_factor );
7852 mavlink_msg_mag_cal_report_decode(last_msg, &packet2);
7853 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7854
7855#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7856 MAVLINK_ASSERT(mavlink_get_message_info_by_name("MAG_CAL_REPORT") != NULL);
7857 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MAG_CAL_REPORT) != NULL);
7858#endif
7859}
7860
7861static void mavlink_test_efi_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7862{
7863#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7864 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7865 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_EFI_STATUS >= 256) {
7866 return;
7867 }
7868#endif
7869 mavlink_message_t msg;
7870 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7871 uint16_t i;
7872 mavlink_efi_status_t packet_in = {
7873 17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,409.0,437.0,197,472.0,500.0
7874 };
7875 mavlink_efi_status_t packet1, packet2;
7876 memset(&packet1, 0, sizeof(packet1));
7877 packet1.ecu_index = packet_in.ecu_index;
7878 packet1.rpm = packet_in.rpm;
7879 packet1.fuel_consumed = packet_in.fuel_consumed;
7880 packet1.fuel_flow = packet_in.fuel_flow;
7881 packet1.engine_load = packet_in.engine_load;
7882 packet1.throttle_position = packet_in.throttle_position;
7883 packet1.spark_dwell_time = packet_in.spark_dwell_time;
7884 packet1.barometric_pressure = packet_in.barometric_pressure;
7885 packet1.intake_manifold_pressure = packet_in.intake_manifold_pressure;
7886 packet1.intake_manifold_temperature = packet_in.intake_manifold_temperature;
7887 packet1.cylinder_head_temperature = packet_in.cylinder_head_temperature;
7888 packet1.ignition_timing = packet_in.ignition_timing;
7889 packet1.injection_time = packet_in.injection_time;
7890 packet1.exhaust_gas_temperature = packet_in.exhaust_gas_temperature;
7891 packet1.throttle_out = packet_in.throttle_out;
7892 packet1.pt_compensation = packet_in.pt_compensation;
7893 packet1.health = packet_in.health;
7894 packet1.ignition_voltage = packet_in.ignition_voltage;
7895 packet1.fuel_pressure = packet_in.fuel_pressure;
7896
7897
7898#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7899 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7900 // cope with extensions
7901 memset(MAVLINK_MSG_ID_EFI_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_EFI_STATUS_MIN_LEN);
7902 }
7903#endif
7904 memset(&packet2, 0, sizeof(packet2));
7905 mavlink_msg_efi_status_encode(system_id, component_id, &msg, &packet1);
7906 mavlink_msg_efi_status_decode(&msg, &packet2);
7907 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7908
7909 memset(&packet2, 0, sizeof(packet2));
7910 mavlink_msg_efi_status_pack(system_id, component_id, &msg , packet1.health , packet1.ecu_index , packet1.rpm , packet1.fuel_consumed , packet1.fuel_flow , packet1.engine_load , packet1.throttle_position , packet1.spark_dwell_time , packet1.barometric_pressure , packet1.intake_manifold_pressure , packet1.intake_manifold_temperature , packet1.cylinder_head_temperature , packet1.ignition_timing , packet1.injection_time , packet1.exhaust_gas_temperature , packet1.throttle_out , packet1.pt_compensation , packet1.ignition_voltage , packet1.fuel_pressure );
7911 mavlink_msg_efi_status_decode(&msg, &packet2);
7912 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7913
7914 memset(&packet2, 0, sizeof(packet2));
7915 mavlink_msg_efi_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.health , packet1.ecu_index , packet1.rpm , packet1.fuel_consumed , packet1.fuel_flow , packet1.engine_load , packet1.throttle_position , packet1.spark_dwell_time , packet1.barometric_pressure , packet1.intake_manifold_pressure , packet1.intake_manifold_temperature , packet1.cylinder_head_temperature , packet1.ignition_timing , packet1.injection_time , packet1.exhaust_gas_temperature , packet1.throttle_out , packet1.pt_compensation , packet1.ignition_voltage , packet1.fuel_pressure );
7916 mavlink_msg_efi_status_decode(&msg, &packet2);
7917 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7918
7919 memset(&packet2, 0, sizeof(packet2));
7920 mavlink_msg_to_send_buffer(buffer, &msg);
7921 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7922 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7923 }
7924 mavlink_msg_efi_status_decode(last_msg, &packet2);
7925 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7926
7927 memset(&packet2, 0, sizeof(packet2));
7928 mavlink_msg_efi_status_send(MAVLINK_COMM_1 , packet1.health , packet1.ecu_index , packet1.rpm , packet1.fuel_consumed , packet1.fuel_flow , packet1.engine_load , packet1.throttle_position , packet1.spark_dwell_time , packet1.barometric_pressure , packet1.intake_manifold_pressure , packet1.intake_manifold_temperature , packet1.cylinder_head_temperature , packet1.ignition_timing , packet1.injection_time , packet1.exhaust_gas_temperature , packet1.throttle_out , packet1.pt_compensation , packet1.ignition_voltage , packet1.fuel_pressure );
7929 mavlink_msg_efi_status_decode(last_msg, &packet2);
7930 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7931
7932#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7933 MAVLINK_ASSERT(mavlink_get_message_info_by_name("EFI_STATUS") != NULL);
7934 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_EFI_STATUS) != NULL);
7935#endif
7936}
7937
7938static void mavlink_test_estimator_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7939{
7940#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7941 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7942 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ESTIMATOR_STATUS >= 256) {
7943 return;
7944 }
7945#endif
7946 mavlink_message_t msg;
7947 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7948 uint16_t i;
7949 mavlink_estimator_status_t packet_in = {
7950 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,19315
7951 };
7952 mavlink_estimator_status_t packet1, packet2;
7953 memset(&packet1, 0, sizeof(packet1));
7954 packet1.time_usec = packet_in.time_usec;
7955 packet1.vel_ratio = packet_in.vel_ratio;
7956 packet1.pos_horiz_ratio = packet_in.pos_horiz_ratio;
7957 packet1.pos_vert_ratio = packet_in.pos_vert_ratio;
7958 packet1.mag_ratio = packet_in.mag_ratio;
7959 packet1.hagl_ratio = packet_in.hagl_ratio;
7960 packet1.tas_ratio = packet_in.tas_ratio;
7961 packet1.pos_horiz_accuracy = packet_in.pos_horiz_accuracy;
7962 packet1.pos_vert_accuracy = packet_in.pos_vert_accuracy;
7963 packet1.flags = packet_in.flags;
7964
7965
7966#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7967 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7968 // cope with extensions
7969 memset(MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN);
7970 }
7971#endif
7972 memset(&packet2, 0, sizeof(packet2));
7973 mavlink_msg_estimator_status_encode(system_id, component_id, &msg, &packet1);
7974 mavlink_msg_estimator_status_decode(&msg, &packet2);
7975 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7976
7977 memset(&packet2, 0, sizeof(packet2));
7978 mavlink_msg_estimator_status_pack(system_id, component_id, &msg , packet1.time_usec , packet1.flags , packet1.vel_ratio , packet1.pos_horiz_ratio , packet1.pos_vert_ratio , packet1.mag_ratio , packet1.hagl_ratio , packet1.tas_ratio , packet1.pos_horiz_accuracy , packet1.pos_vert_accuracy );
7979 mavlink_msg_estimator_status_decode(&msg, &packet2);
7980 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7981
7982 memset(&packet2, 0, sizeof(packet2));
7983 mavlink_msg_estimator_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.flags , packet1.vel_ratio , packet1.pos_horiz_ratio , packet1.pos_vert_ratio , packet1.mag_ratio , packet1.hagl_ratio , packet1.tas_ratio , packet1.pos_horiz_accuracy , packet1.pos_vert_accuracy );
7984 mavlink_msg_estimator_status_decode(&msg, &packet2);
7985 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7986
7987 memset(&packet2, 0, sizeof(packet2));
7988 mavlink_msg_to_send_buffer(buffer, &msg);
7989 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7990 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7991 }
7992 mavlink_msg_estimator_status_decode(last_msg, &packet2);
7993 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7994
7995 memset(&packet2, 0, sizeof(packet2));
7996 mavlink_msg_estimator_status_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.flags , packet1.vel_ratio , packet1.pos_horiz_ratio , packet1.pos_vert_ratio , packet1.mag_ratio , packet1.hagl_ratio , packet1.tas_ratio , packet1.pos_horiz_accuracy , packet1.pos_vert_accuracy );
7997 mavlink_msg_estimator_status_decode(last_msg, &packet2);
7998 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7999
8000#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8001 MAVLINK_ASSERT(mavlink_get_message_info_by_name("ESTIMATOR_STATUS") != NULL);
8002 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ESTIMATOR_STATUS) != NULL);
8003#endif
8004}
8005
8006static void mavlink_test_wind_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8007{
8008#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8009 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8010 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_WIND_COV >= 256) {
8011 return;
8012 }
8013#endif
8014 mavlink_message_t msg;
8015 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8016 uint16_t i;
8017 mavlink_wind_cov_t packet_in = {
8018 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0
8019 };
8020 mavlink_wind_cov_t packet1, packet2;
8021 memset(&packet1, 0, sizeof(packet1));
8022 packet1.time_usec = packet_in.time_usec;
8023 packet1.wind_x = packet_in.wind_x;
8024 packet1.wind_y = packet_in.wind_y;
8025 packet1.wind_z = packet_in.wind_z;
8026 packet1.var_horiz = packet_in.var_horiz;
8027 packet1.var_vert = packet_in.var_vert;
8028 packet1.wind_alt = packet_in.wind_alt;
8029 packet1.horiz_accuracy = packet_in.horiz_accuracy;
8030 packet1.vert_accuracy = packet_in.vert_accuracy;
8031
8032
8033#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8034 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8035 // cope with extensions
8036 memset(MAVLINK_MSG_ID_WIND_COV_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_WIND_COV_MIN_LEN);
8037 }
8038#endif
8039 memset(&packet2, 0, sizeof(packet2));
8040 mavlink_msg_wind_cov_encode(system_id, component_id, &msg, &packet1);
8041 mavlink_msg_wind_cov_decode(&msg, &packet2);
8042 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8043
8044 memset(&packet2, 0, sizeof(packet2));
8045 mavlink_msg_wind_cov_pack(system_id, component_id, &msg , packet1.time_usec , packet1.wind_x , packet1.wind_y , packet1.wind_z , packet1.var_horiz , packet1.var_vert , packet1.wind_alt , packet1.horiz_accuracy , packet1.vert_accuracy );
8046 mavlink_msg_wind_cov_decode(&msg, &packet2);
8047 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8048
8049 memset(&packet2, 0, sizeof(packet2));
8050 mavlink_msg_wind_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.wind_x , packet1.wind_y , packet1.wind_z , packet1.var_horiz , packet1.var_vert , packet1.wind_alt , packet1.horiz_accuracy , packet1.vert_accuracy );
8051 mavlink_msg_wind_cov_decode(&msg, &packet2);
8052 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8053
8054 memset(&packet2, 0, sizeof(packet2));
8055 mavlink_msg_to_send_buffer(buffer, &msg);
8056 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8057 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8058 }
8059 mavlink_msg_wind_cov_decode(last_msg, &packet2);
8060 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8061
8062 memset(&packet2, 0, sizeof(packet2));
8063 mavlink_msg_wind_cov_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.wind_x , packet1.wind_y , packet1.wind_z , packet1.var_horiz , packet1.var_vert , packet1.wind_alt , packet1.horiz_accuracy , packet1.vert_accuracy );
8064 mavlink_msg_wind_cov_decode(last_msg, &packet2);
8065 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8066
8067#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8068 MAVLINK_ASSERT(mavlink_get_message_info_by_name("WIND_COV") != NULL);
8069 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_WIND_COV) != NULL);
8070#endif
8071}
8072
8073static void mavlink_test_gps_input(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8074{
8075#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8076 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8077 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_INPUT >= 256) {
8078 return;
8079 }
8080#endif
8081 mavlink_message_t msg;
8082 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8083 uint16_t i;
8084 mavlink_gps_input_t packet_in = {
8085 93372036854775807ULL,963497880,963498088,963498296,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,20147,20251,185,252,63,20511
8086 };
8087 mavlink_gps_input_t packet1, packet2;
8088 memset(&packet1, 0, sizeof(packet1));
8089 packet1.time_usec = packet_in.time_usec;
8090 packet1.time_week_ms = packet_in.time_week_ms;
8091 packet1.lat = packet_in.lat;
8092 packet1.lon = packet_in.lon;
8093 packet1.alt = packet_in.alt;
8094 packet1.hdop = packet_in.hdop;
8095 packet1.vdop = packet_in.vdop;
8096 packet1.vn = packet_in.vn;
8097 packet1.ve = packet_in.ve;
8098 packet1.vd = packet_in.vd;
8099 packet1.speed_accuracy = packet_in.speed_accuracy;
8100 packet1.horiz_accuracy = packet_in.horiz_accuracy;
8101 packet1.vert_accuracy = packet_in.vert_accuracy;
8102 packet1.ignore_flags = packet_in.ignore_flags;
8103 packet1.time_week = packet_in.time_week;
8104 packet1.gps_id = packet_in.gps_id;
8105 packet1.fix_type = packet_in.fix_type;
8106 packet1.satellites_visible = packet_in.satellites_visible;
8107 packet1.yaw = packet_in.yaw;
8108
8109
8110#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8111 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8112 // cope with extensions
8113 memset(MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN);
8114 }
8115#endif
8116 memset(&packet2, 0, sizeof(packet2));
8117 mavlink_msg_gps_input_encode(system_id, component_id, &msg, &packet1);
8118 mavlink_msg_gps_input_decode(&msg, &packet2);
8119 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8120
8121 memset(&packet2, 0, sizeof(packet2));
8122 mavlink_msg_gps_input_pack(system_id, component_id, &msg , packet1.time_usec , packet1.gps_id , packet1.ignore_flags , packet1.time_week_ms , packet1.time_week , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.hdop , packet1.vdop , packet1.vn , packet1.ve , packet1.vd , packet1.speed_accuracy , packet1.horiz_accuracy , packet1.vert_accuracy , packet1.satellites_visible , packet1.yaw );
8123 mavlink_msg_gps_input_decode(&msg, &packet2);
8124 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8125
8126 memset(&packet2, 0, sizeof(packet2));
8127 mavlink_msg_gps_input_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.gps_id , packet1.ignore_flags , packet1.time_week_ms , packet1.time_week , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.hdop , packet1.vdop , packet1.vn , packet1.ve , packet1.vd , packet1.speed_accuracy , packet1.horiz_accuracy , packet1.vert_accuracy , packet1.satellites_visible , packet1.yaw );
8128 mavlink_msg_gps_input_decode(&msg, &packet2);
8129 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8130
8131 memset(&packet2, 0, sizeof(packet2));
8132 mavlink_msg_to_send_buffer(buffer, &msg);
8133 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8134 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8135 }
8136 mavlink_msg_gps_input_decode(last_msg, &packet2);
8137 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8138
8139 memset(&packet2, 0, sizeof(packet2));
8140 mavlink_msg_gps_input_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.gps_id , packet1.ignore_flags , packet1.time_week_ms , packet1.time_week , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.hdop , packet1.vdop , packet1.vn , packet1.ve , packet1.vd , packet1.speed_accuracy , packet1.horiz_accuracy , packet1.vert_accuracy , packet1.satellites_visible , packet1.yaw );
8141 mavlink_msg_gps_input_decode(last_msg, &packet2);
8142 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8143
8144#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8145 MAVLINK_ASSERT(mavlink_get_message_info_by_name("GPS_INPUT") != NULL);
8146 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GPS_INPUT) != NULL);
8147#endif
8148}
8149
8150static void mavlink_test_gps_rtcm_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8151{
8152#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8153 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8154 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_RTCM_DATA >= 256) {
8155 return;
8156 }
8157#endif
8158 mavlink_message_t msg;
8159 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8160 uint16_t i;
8161 mavlink_gps_rtcm_data_t packet_in = {
8162 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, 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 }
8163 };
8164 mavlink_gps_rtcm_data_t packet1, packet2;
8165 memset(&packet1, 0, sizeof(packet1));
8166 packet1.flags = packet_in.flags;
8167 packet1.len = packet_in.len;
8168
8169 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*180);
8170
8171#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8172 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8173 // cope with extensions
8174 memset(MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN);
8175 }
8176#endif
8177 memset(&packet2, 0, sizeof(packet2));
8178 mavlink_msg_gps_rtcm_data_encode(system_id, component_id, &msg, &packet1);
8179 mavlink_msg_gps_rtcm_data_decode(&msg, &packet2);
8180 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8181
8182 memset(&packet2, 0, sizeof(packet2));
8183 mavlink_msg_gps_rtcm_data_pack(system_id, component_id, &msg , packet1.flags , packet1.len , packet1.data );
8184 mavlink_msg_gps_rtcm_data_decode(&msg, &packet2);
8185 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8186
8187 memset(&packet2, 0, sizeof(packet2));
8188 mavlink_msg_gps_rtcm_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.flags , packet1.len , packet1.data );
8189 mavlink_msg_gps_rtcm_data_decode(&msg, &packet2);
8190 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8191
8192 memset(&packet2, 0, sizeof(packet2));
8193 mavlink_msg_to_send_buffer(buffer, &msg);
8194 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8195 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8196 }
8197 mavlink_msg_gps_rtcm_data_decode(last_msg, &packet2);
8198 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8199
8200 memset(&packet2, 0, sizeof(packet2));
8201 mavlink_msg_gps_rtcm_data_send(MAVLINK_COMM_1 , packet1.flags , packet1.len , packet1.data );
8202 mavlink_msg_gps_rtcm_data_decode(last_msg, &packet2);
8203 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8204
8205#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8206 MAVLINK_ASSERT(mavlink_get_message_info_by_name("GPS_RTCM_DATA") != NULL);
8207 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GPS_RTCM_DATA) != NULL);
8208#endif
8209}
8210
8211static void mavlink_test_high_latency(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8212{
8213#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8214 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8215 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIGH_LATENCY >= 256) {
8216 return;
8217 }
8218#endif
8219 mavlink_message_t msg;
8220 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8221 uint16_t i;
8222 mavlink_high_latency_t packet_in = {
8223 963497464,963497672,963497880,17859,17963,18067,18171,18275,18379,18483,211,22,89,156,223,34,101,168,235,46,113,180,247,58
8224 };
8225 mavlink_high_latency_t packet1, packet2;
8226 memset(&packet1, 0, sizeof(packet1));
8227 packet1.custom_mode = packet_in.custom_mode;
8228 packet1.latitude = packet_in.latitude;
8229 packet1.longitude = packet_in.longitude;
8230 packet1.roll = packet_in.roll;
8231 packet1.pitch = packet_in.pitch;
8232 packet1.heading = packet_in.heading;
8233 packet1.heading_sp = packet_in.heading_sp;
8234 packet1.altitude_amsl = packet_in.altitude_amsl;
8235 packet1.altitude_sp = packet_in.altitude_sp;
8236 packet1.wp_distance = packet_in.wp_distance;
8237 packet1.base_mode = packet_in.base_mode;
8238 packet1.landed_state = packet_in.landed_state;
8239 packet1.throttle = packet_in.throttle;
8240 packet1.airspeed = packet_in.airspeed;
8241 packet1.airspeed_sp = packet_in.airspeed_sp;
8242 packet1.groundspeed = packet_in.groundspeed;
8243 packet1.climb_rate = packet_in.climb_rate;
8244 packet1.gps_nsat = packet_in.gps_nsat;
8245 packet1.gps_fix_type = packet_in.gps_fix_type;
8246 packet1.battery_remaining = packet_in.battery_remaining;
8247 packet1.temperature = packet_in.temperature;
8248 packet1.temperature_air = packet_in.temperature_air;
8249 packet1.failsafe = packet_in.failsafe;
8250 packet1.wp_num = packet_in.wp_num;
8251
8252
8253#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8254 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8255 // cope with extensions
8256 memset(MAVLINK_MSG_ID_HIGH_LATENCY_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIGH_LATENCY_MIN_LEN);
8257 }
8258#endif
8259 memset(&packet2, 0, sizeof(packet2));
8260 mavlink_msg_high_latency_encode(system_id, component_id, &msg, &packet1);
8261 mavlink_msg_high_latency_decode(&msg, &packet2);
8262 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8263
8264 memset(&packet2, 0, sizeof(packet2));
8265 mavlink_msg_high_latency_pack(system_id, component_id, &msg , packet1.base_mode , packet1.custom_mode , packet1.landed_state , packet1.roll , packet1.pitch , packet1.heading , packet1.throttle , packet1.heading_sp , packet1.latitude , packet1.longitude , packet1.altitude_amsl , packet1.altitude_sp , packet1.airspeed , packet1.airspeed_sp , packet1.groundspeed , packet1.climb_rate , packet1.gps_nsat , packet1.gps_fix_type , packet1.battery_remaining , packet1.temperature , packet1.temperature_air , packet1.failsafe , packet1.wp_num , packet1.wp_distance );
8266 mavlink_msg_high_latency_decode(&msg, &packet2);
8267 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8268
8269 memset(&packet2, 0, sizeof(packet2));
8270 mavlink_msg_high_latency_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.base_mode , packet1.custom_mode , packet1.landed_state , packet1.roll , packet1.pitch , packet1.heading , packet1.throttle , packet1.heading_sp , packet1.latitude , packet1.longitude , packet1.altitude_amsl , packet1.altitude_sp , packet1.airspeed , packet1.airspeed_sp , packet1.groundspeed , packet1.climb_rate , packet1.gps_nsat , packet1.gps_fix_type , packet1.battery_remaining , packet1.temperature , packet1.temperature_air , packet1.failsafe , packet1.wp_num , packet1.wp_distance );
8271 mavlink_msg_high_latency_decode(&msg, &packet2);
8272 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8273
8274 memset(&packet2, 0, sizeof(packet2));
8275 mavlink_msg_to_send_buffer(buffer, &msg);
8276 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8277 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8278 }
8279 mavlink_msg_high_latency_decode(last_msg, &packet2);
8280 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8281
8282 memset(&packet2, 0, sizeof(packet2));
8283 mavlink_msg_high_latency_send(MAVLINK_COMM_1 , packet1.base_mode , packet1.custom_mode , packet1.landed_state , packet1.roll , packet1.pitch , packet1.heading , packet1.throttle , packet1.heading_sp , packet1.latitude , packet1.longitude , packet1.altitude_amsl , packet1.altitude_sp , packet1.airspeed , packet1.airspeed_sp , packet1.groundspeed , packet1.climb_rate , packet1.gps_nsat , packet1.gps_fix_type , packet1.battery_remaining , packet1.temperature , packet1.temperature_air , packet1.failsafe , packet1.wp_num , packet1.wp_distance );
8284 mavlink_msg_high_latency_decode(last_msg, &packet2);
8285 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8286
8287#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8288 MAVLINK_ASSERT(mavlink_get_message_info_by_name("HIGH_LATENCY") != NULL);
8289 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HIGH_LATENCY) != NULL);
8290#endif
8291}
8292
8293static void mavlink_test_high_latency2(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8294{
8295#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8296 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8297 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIGH_LATENCY2 >= 256) {
8298 return;
8299 }
8300#endif
8301 mavlink_message_t msg;
8302 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8303 uint16_t i;
8304 mavlink_high_latency2_t packet_in = {
8305 963497464,963497672,963497880,17859,17963,18067,18171,18275,18379,77,144,211,22,89,156,223,34,101,168,235,46,113,180,247,58,125,192
8306 };
8307 mavlink_high_latency2_t packet1, packet2;
8308 memset(&packet1, 0, sizeof(packet1));
8309 packet1.timestamp = packet_in.timestamp;
8310 packet1.latitude = packet_in.latitude;
8311 packet1.longitude = packet_in.longitude;
8312 packet1.custom_mode = packet_in.custom_mode;
8313 packet1.altitude = packet_in.altitude;
8314 packet1.target_altitude = packet_in.target_altitude;
8315 packet1.target_distance = packet_in.target_distance;
8316 packet1.wp_num = packet_in.wp_num;
8317 packet1.failure_flags = packet_in.failure_flags;
8318 packet1.type = packet_in.type;
8319 packet1.autopilot = packet_in.autopilot;
8320 packet1.heading = packet_in.heading;
8321 packet1.target_heading = packet_in.target_heading;
8322 packet1.throttle = packet_in.throttle;
8323 packet1.airspeed = packet_in.airspeed;
8324 packet1.airspeed_sp = packet_in.airspeed_sp;
8325 packet1.groundspeed = packet_in.groundspeed;
8326 packet1.windspeed = packet_in.windspeed;
8327 packet1.wind_heading = packet_in.wind_heading;
8328 packet1.eph = packet_in.eph;
8329 packet1.epv = packet_in.epv;
8330 packet1.temperature_air = packet_in.temperature_air;
8331 packet1.climb_rate = packet_in.climb_rate;
8332 packet1.battery = packet_in.battery;
8333 packet1.custom0 = packet_in.custom0;
8334 packet1.custom1 = packet_in.custom1;
8335 packet1.custom2 = packet_in.custom2;
8336
8337
8338#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8339 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8340 // cope with extensions
8341 memset(MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN);
8342 }
8343#endif
8344 memset(&packet2, 0, sizeof(packet2));
8345 mavlink_msg_high_latency2_encode(system_id, component_id, &msg, &packet1);
8346 mavlink_msg_high_latency2_decode(&msg, &packet2);
8347 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8348
8349 memset(&packet2, 0, sizeof(packet2));
8350 mavlink_msg_high_latency2_pack(system_id, component_id, &msg , packet1.timestamp , packet1.type , packet1.autopilot , packet1.custom_mode , packet1.latitude , packet1.longitude , packet1.altitude , packet1.target_altitude , packet1.heading , packet1.target_heading , packet1.target_distance , packet1.throttle , packet1.airspeed , packet1.airspeed_sp , packet1.groundspeed , packet1.windspeed , packet1.wind_heading , packet1.eph , packet1.epv , packet1.temperature_air , packet1.climb_rate , packet1.battery , packet1.wp_num , packet1.failure_flags , packet1.custom0 , packet1.custom1 , packet1.custom2 );
8351 mavlink_msg_high_latency2_decode(&msg, &packet2);
8352 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8353
8354 memset(&packet2, 0, sizeof(packet2));
8355 mavlink_msg_high_latency2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.type , packet1.autopilot , packet1.custom_mode , packet1.latitude , packet1.longitude , packet1.altitude , packet1.target_altitude , packet1.heading , packet1.target_heading , packet1.target_distance , packet1.throttle , packet1.airspeed , packet1.airspeed_sp , packet1.groundspeed , packet1.windspeed , packet1.wind_heading , packet1.eph , packet1.epv , packet1.temperature_air , packet1.climb_rate , packet1.battery , packet1.wp_num , packet1.failure_flags , packet1.custom0 , packet1.custom1 , packet1.custom2 );
8356 mavlink_msg_high_latency2_decode(&msg, &packet2);
8357 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8358
8359 memset(&packet2, 0, sizeof(packet2));
8360 mavlink_msg_to_send_buffer(buffer, &msg);
8361 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8362 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8363 }
8364 mavlink_msg_high_latency2_decode(last_msg, &packet2);
8365 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8366
8367 memset(&packet2, 0, sizeof(packet2));
8368 mavlink_msg_high_latency2_send(MAVLINK_COMM_1 , packet1.timestamp , packet1.type , packet1.autopilot , packet1.custom_mode , packet1.latitude , packet1.longitude , packet1.altitude , packet1.target_altitude , packet1.heading , packet1.target_heading , packet1.target_distance , packet1.throttle , packet1.airspeed , packet1.airspeed_sp , packet1.groundspeed , packet1.windspeed , packet1.wind_heading , packet1.eph , packet1.epv , packet1.temperature_air , packet1.climb_rate , packet1.battery , packet1.wp_num , packet1.failure_flags , packet1.custom0 , packet1.custom1 , packet1.custom2 );
8369 mavlink_msg_high_latency2_decode(last_msg, &packet2);
8370 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8371
8372#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8373 MAVLINK_ASSERT(mavlink_get_message_info_by_name("HIGH_LATENCY2") != NULL);
8374 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HIGH_LATENCY2) != NULL);
8375#endif
8376}
8377
8378static void mavlink_test_vibration(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8379{
8380#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8381 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8382 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VIBRATION >= 256) {
8383 return;
8384 }
8385#endif
8386 mavlink_message_t msg;
8387 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8388 uint16_t i;
8389 mavlink_vibration_t packet_in = {
8390 93372036854775807ULL,73.0,101.0,129.0,963498504,963498712,963498920
8391 };
8392 mavlink_vibration_t packet1, packet2;
8393 memset(&packet1, 0, sizeof(packet1));
8394 packet1.time_usec = packet_in.time_usec;
8395 packet1.vibration_x = packet_in.vibration_x;
8396 packet1.vibration_y = packet_in.vibration_y;
8397 packet1.vibration_z = packet_in.vibration_z;
8398 packet1.clipping_0 = packet_in.clipping_0;
8399 packet1.clipping_1 = packet_in.clipping_1;
8400 packet1.clipping_2 = packet_in.clipping_2;
8401
8402
8403#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8404 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8405 // cope with extensions
8406 memset(MAVLINK_MSG_ID_VIBRATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VIBRATION_MIN_LEN);
8407 }
8408#endif
8409 memset(&packet2, 0, sizeof(packet2));
8410 mavlink_msg_vibration_encode(system_id, component_id, &msg, &packet1);
8411 mavlink_msg_vibration_decode(&msg, &packet2);
8412 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8413
8414 memset(&packet2, 0, sizeof(packet2));
8415 mavlink_msg_vibration_pack(system_id, component_id, &msg , packet1.time_usec , packet1.vibration_x , packet1.vibration_y , packet1.vibration_z , packet1.clipping_0 , packet1.clipping_1 , packet1.clipping_2 );
8416 mavlink_msg_vibration_decode(&msg, &packet2);
8417 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8418
8419 memset(&packet2, 0, sizeof(packet2));
8420 mavlink_msg_vibration_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.vibration_x , packet1.vibration_y , packet1.vibration_z , packet1.clipping_0 , packet1.clipping_1 , packet1.clipping_2 );
8421 mavlink_msg_vibration_decode(&msg, &packet2);
8422 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8423
8424 memset(&packet2, 0, sizeof(packet2));
8425 mavlink_msg_to_send_buffer(buffer, &msg);
8426 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8427 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8428 }
8429 mavlink_msg_vibration_decode(last_msg, &packet2);
8430 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8431
8432 memset(&packet2, 0, sizeof(packet2));
8433 mavlink_msg_vibration_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.vibration_x , packet1.vibration_y , packet1.vibration_z , packet1.clipping_0 , packet1.clipping_1 , packet1.clipping_2 );
8434 mavlink_msg_vibration_decode(last_msg, &packet2);
8435 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8436
8437#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8438 MAVLINK_ASSERT(mavlink_get_message_info_by_name("VIBRATION") != NULL);
8439 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_VIBRATION) != NULL);
8440#endif
8441}
8442
8443static void mavlink_test_home_position(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8444{
8445#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8446 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8447 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HOME_POSITION >= 256) {
8448 return;
8449 }
8450#endif
8451 mavlink_message_t msg;
8452 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8453 uint16_t i;
8454 mavlink_home_position_t packet_in = {
8455 963497464,963497672,963497880,101.0,129.0,157.0,{ 185.0, 186.0, 187.0, 188.0 },297.0,325.0,353.0,93372036854779083ULL
8456 };
8457 mavlink_home_position_t packet1, packet2;
8458 memset(&packet1, 0, sizeof(packet1));
8459 packet1.latitude = packet_in.latitude;
8460 packet1.longitude = packet_in.longitude;
8461 packet1.altitude = packet_in.altitude;
8462 packet1.x = packet_in.x;
8463 packet1.y = packet_in.y;
8464 packet1.z = packet_in.z;
8465 packet1.approach_x = packet_in.approach_x;
8466 packet1.approach_y = packet_in.approach_y;
8467 packet1.approach_z = packet_in.approach_z;
8468 packet1.time_usec = packet_in.time_usec;
8469
8470 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
8471
8472#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8473 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8474 // cope with extensions
8475 memset(MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN);
8476 }
8477#endif
8478 memset(&packet2, 0, sizeof(packet2));
8479 mavlink_msg_home_position_encode(system_id, component_id, &msg, &packet1);
8480 mavlink_msg_home_position_decode(&msg, &packet2);
8481 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8482
8483 memset(&packet2, 0, sizeof(packet2));
8484 mavlink_msg_home_position_pack(system_id, component_id, &msg , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z , packet1.time_usec );
8485 mavlink_msg_home_position_decode(&msg, &packet2);
8486 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8487
8488 memset(&packet2, 0, sizeof(packet2));
8489 mavlink_msg_home_position_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z , packet1.time_usec );
8490 mavlink_msg_home_position_decode(&msg, &packet2);
8491 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8492
8493 memset(&packet2, 0, sizeof(packet2));
8494 mavlink_msg_to_send_buffer(buffer, &msg);
8495 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8496 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8497 }
8498 mavlink_msg_home_position_decode(last_msg, &packet2);
8499 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8500
8501 memset(&packet2, 0, sizeof(packet2));
8502 mavlink_msg_home_position_send(MAVLINK_COMM_1 , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z , packet1.time_usec );
8503 mavlink_msg_home_position_decode(last_msg, &packet2);
8504 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8505
8506#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8507 MAVLINK_ASSERT(mavlink_get_message_info_by_name("HOME_POSITION") != NULL);
8508 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HOME_POSITION) != NULL);
8509#endif
8510}
8511
8512static void mavlink_test_set_home_position(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8513{
8514#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8515 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8516 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_HOME_POSITION >= 256) {
8517 return;
8518 }
8519#endif
8520 mavlink_message_t msg;
8521 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8522 uint16_t i;
8523 mavlink_set_home_position_t packet_in = {
8524 963497464,963497672,963497880,101.0,129.0,157.0,{ 185.0, 186.0, 187.0, 188.0 },297.0,325.0,353.0,161,93372036854779146ULL
8525 };
8526 mavlink_set_home_position_t packet1, packet2;
8527 memset(&packet1, 0, sizeof(packet1));
8528 packet1.latitude = packet_in.latitude;
8529 packet1.longitude = packet_in.longitude;
8530 packet1.altitude = packet_in.altitude;
8531 packet1.x = packet_in.x;
8532 packet1.y = packet_in.y;
8533 packet1.z = packet_in.z;
8534 packet1.approach_x = packet_in.approach_x;
8535 packet1.approach_y = packet_in.approach_y;
8536 packet1.approach_z = packet_in.approach_z;
8537 packet1.target_system = packet_in.target_system;
8538 packet1.time_usec = packet_in.time_usec;
8539
8540 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
8541
8542#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8543 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8544 // cope with extensions
8545 memset(MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN);
8546 }
8547#endif
8548 memset(&packet2, 0, sizeof(packet2));
8549 mavlink_msg_set_home_position_encode(system_id, component_id, &msg, &packet1);
8550 mavlink_msg_set_home_position_decode(&msg, &packet2);
8551 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8552
8553 memset(&packet2, 0, sizeof(packet2));
8554 mavlink_msg_set_home_position_pack(system_id, component_id, &msg , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z , packet1.time_usec );
8555 mavlink_msg_set_home_position_decode(&msg, &packet2);
8556 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8557
8558 memset(&packet2, 0, sizeof(packet2));
8559 mavlink_msg_set_home_position_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z , packet1.time_usec );
8560 mavlink_msg_set_home_position_decode(&msg, &packet2);
8561 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8562
8563 memset(&packet2, 0, sizeof(packet2));
8564 mavlink_msg_to_send_buffer(buffer, &msg);
8565 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8566 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8567 }
8568 mavlink_msg_set_home_position_decode(last_msg, &packet2);
8569 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8570
8571 memset(&packet2, 0, sizeof(packet2));
8572 mavlink_msg_set_home_position_send(MAVLINK_COMM_1 , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z , packet1.time_usec );
8573 mavlink_msg_set_home_position_decode(last_msg, &packet2);
8574 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8575
8576#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8577 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SET_HOME_POSITION") != NULL);
8578 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SET_HOME_POSITION) != NULL);
8579#endif
8580}
8581
8582static void mavlink_test_message_interval(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8583{
8584#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8585 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8586 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MESSAGE_INTERVAL >= 256) {
8587 return;
8588 }
8589#endif
8590 mavlink_message_t msg;
8591 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8592 uint16_t i;
8593 mavlink_message_interval_t packet_in = {
8594 963497464,17443
8595 };
8596 mavlink_message_interval_t packet1, packet2;
8597 memset(&packet1, 0, sizeof(packet1));
8598 packet1.interval_us = packet_in.interval_us;
8599 packet1.message_id = packet_in.message_id;
8600
8601
8602#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8603 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8604 // cope with extensions
8605 memset(MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN);
8606 }
8607#endif
8608 memset(&packet2, 0, sizeof(packet2));
8609 mavlink_msg_message_interval_encode(system_id, component_id, &msg, &packet1);
8610 mavlink_msg_message_interval_decode(&msg, &packet2);
8611 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8612
8613 memset(&packet2, 0, sizeof(packet2));
8614 mavlink_msg_message_interval_pack(system_id, component_id, &msg , packet1.message_id , packet1.interval_us );
8615 mavlink_msg_message_interval_decode(&msg, &packet2);
8616 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8617
8618 memset(&packet2, 0, sizeof(packet2));
8619 mavlink_msg_message_interval_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.message_id , packet1.interval_us );
8620 mavlink_msg_message_interval_decode(&msg, &packet2);
8621 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8622
8623 memset(&packet2, 0, sizeof(packet2));
8624 mavlink_msg_to_send_buffer(buffer, &msg);
8625 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8626 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8627 }
8628 mavlink_msg_message_interval_decode(last_msg, &packet2);
8629 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8630
8631 memset(&packet2, 0, sizeof(packet2));
8632 mavlink_msg_message_interval_send(MAVLINK_COMM_1 , packet1.message_id , packet1.interval_us );
8633 mavlink_msg_message_interval_decode(last_msg, &packet2);
8634 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8635
8636#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8637 MAVLINK_ASSERT(mavlink_get_message_info_by_name("MESSAGE_INTERVAL") != NULL);
8638 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MESSAGE_INTERVAL) != NULL);
8639#endif
8640}
8641
8642static void mavlink_test_extended_sys_state(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8643{
8644#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8645 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8646 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_EXTENDED_SYS_STATE >= 256) {
8647 return;
8648 }
8649#endif
8650 mavlink_message_t msg;
8651 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8652 uint16_t i;
8653 mavlink_extended_sys_state_t packet_in = {
8654 5,72
8655 };
8656 mavlink_extended_sys_state_t packet1, packet2;
8657 memset(&packet1, 0, sizeof(packet1));
8658 packet1.vtol_state = packet_in.vtol_state;
8659 packet1.landed_state = packet_in.landed_state;
8660
8661
8662#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8663 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8664 // cope with extensions
8665 memset(MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN);
8666 }
8667#endif
8668 memset(&packet2, 0, sizeof(packet2));
8669 mavlink_msg_extended_sys_state_encode(system_id, component_id, &msg, &packet1);
8670 mavlink_msg_extended_sys_state_decode(&msg, &packet2);
8671 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8672
8673 memset(&packet2, 0, sizeof(packet2));
8674 mavlink_msg_extended_sys_state_pack(system_id, component_id, &msg , packet1.vtol_state , packet1.landed_state );
8675 mavlink_msg_extended_sys_state_decode(&msg, &packet2);
8676 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8677
8678 memset(&packet2, 0, sizeof(packet2));
8679 mavlink_msg_extended_sys_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.vtol_state , packet1.landed_state );
8680 mavlink_msg_extended_sys_state_decode(&msg, &packet2);
8681 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8682
8683 memset(&packet2, 0, sizeof(packet2));
8684 mavlink_msg_to_send_buffer(buffer, &msg);
8685 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8686 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8687 }
8688 mavlink_msg_extended_sys_state_decode(last_msg, &packet2);
8689 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8690
8691 memset(&packet2, 0, sizeof(packet2));
8692 mavlink_msg_extended_sys_state_send(MAVLINK_COMM_1 , packet1.vtol_state , packet1.landed_state );
8693 mavlink_msg_extended_sys_state_decode(last_msg, &packet2);
8694 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8695
8696#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8697 MAVLINK_ASSERT(mavlink_get_message_info_by_name("EXTENDED_SYS_STATE") != NULL);
8698 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_EXTENDED_SYS_STATE) != NULL);
8699#endif
8700}
8701
8702static void mavlink_test_adsb_vehicle(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8703{
8704#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8705 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8706 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ADSB_VEHICLE >= 256) {
8707 return;
8708 }
8709#endif
8710 mavlink_message_t msg;
8711 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8712 uint16_t i;
8713 mavlink_adsb_vehicle_t packet_in = {
8714 963497464,963497672,963497880,963498088,18067,18171,18275,18379,18483,211,"BCDEFGHI",113,180
8715 };
8716 mavlink_adsb_vehicle_t packet1, packet2;
8717 memset(&packet1, 0, sizeof(packet1));
8718 packet1.ICAO_address = packet_in.ICAO_address;
8719 packet1.lat = packet_in.lat;
8720 packet1.lon = packet_in.lon;
8721 packet1.altitude = packet_in.altitude;
8722 packet1.heading = packet_in.heading;
8723 packet1.hor_velocity = packet_in.hor_velocity;
8724 packet1.ver_velocity = packet_in.ver_velocity;
8725 packet1.flags = packet_in.flags;
8726 packet1.squawk = packet_in.squawk;
8727 packet1.altitude_type = packet_in.altitude_type;
8728 packet1.emitter_type = packet_in.emitter_type;
8729 packet1.tslc = packet_in.tslc;
8730
8731 mav_array_memcpy(packet1.callsign, packet_in.callsign, sizeof(char)*9);
8732
8733#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8734 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8735 // cope with extensions
8736 memset(MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN);
8737 }
8738#endif
8739 memset(&packet2, 0, sizeof(packet2));
8740 mavlink_msg_adsb_vehicle_encode(system_id, component_id, &msg, &packet1);
8741 mavlink_msg_adsb_vehicle_decode(&msg, &packet2);
8742 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8743
8744 memset(&packet2, 0, sizeof(packet2));
8745 mavlink_msg_adsb_vehicle_pack(system_id, component_id, &msg , packet1.ICAO_address , packet1.lat , packet1.lon , packet1.altitude_type , packet1.altitude , packet1.heading , packet1.hor_velocity , packet1.ver_velocity , packet1.callsign , packet1.emitter_type , packet1.tslc , packet1.flags , packet1.squawk );
8746 mavlink_msg_adsb_vehicle_decode(&msg, &packet2);
8747 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8748
8749 memset(&packet2, 0, sizeof(packet2));
8750 mavlink_msg_adsb_vehicle_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.ICAO_address , packet1.lat , packet1.lon , packet1.altitude_type , packet1.altitude , packet1.heading , packet1.hor_velocity , packet1.ver_velocity , packet1.callsign , packet1.emitter_type , packet1.tslc , packet1.flags , packet1.squawk );
8751 mavlink_msg_adsb_vehicle_decode(&msg, &packet2);
8752 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8753
8754 memset(&packet2, 0, sizeof(packet2));
8755 mavlink_msg_to_send_buffer(buffer, &msg);
8756 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8757 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8758 }
8759 mavlink_msg_adsb_vehicle_decode(last_msg, &packet2);
8760 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8761
8762 memset(&packet2, 0, sizeof(packet2));
8763 mavlink_msg_adsb_vehicle_send(MAVLINK_COMM_1 , packet1.ICAO_address , packet1.lat , packet1.lon , packet1.altitude_type , packet1.altitude , packet1.heading , packet1.hor_velocity , packet1.ver_velocity , packet1.callsign , packet1.emitter_type , packet1.tslc , packet1.flags , packet1.squawk );
8764 mavlink_msg_adsb_vehicle_decode(last_msg, &packet2);
8765 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8766
8767#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8768 MAVLINK_ASSERT(mavlink_get_message_info_by_name("ADSB_VEHICLE") != NULL);
8769 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ADSB_VEHICLE) != NULL);
8770#endif
8771}
8772
8773static void mavlink_test_collision(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8774{
8775#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8776 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8777 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COLLISION >= 256) {
8778 return;
8779 }
8780#endif
8781 mavlink_message_t msg;
8782 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8783 uint16_t i;
8784 mavlink_collision_t packet_in = {
8785 963497464,45.0,73.0,101.0,53,120,187
8786 };
8787 mavlink_collision_t packet1, packet2;
8788 memset(&packet1, 0, sizeof(packet1));
8789 packet1.id = packet_in.id;
8790 packet1.time_to_minimum_delta = packet_in.time_to_minimum_delta;
8791 packet1.altitude_minimum_delta = packet_in.altitude_minimum_delta;
8792 packet1.horizontal_minimum_delta = packet_in.horizontal_minimum_delta;
8793 packet1.src = packet_in.src;
8794 packet1.action = packet_in.action;
8795 packet1.threat_level = packet_in.threat_level;
8796
8797
8798#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8799 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8800 // cope with extensions
8801 memset(MAVLINK_MSG_ID_COLLISION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COLLISION_MIN_LEN);
8802 }
8803#endif
8804 memset(&packet2, 0, sizeof(packet2));
8805 mavlink_msg_collision_encode(system_id, component_id, &msg, &packet1);
8806 mavlink_msg_collision_decode(&msg, &packet2);
8807 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8808
8809 memset(&packet2, 0, sizeof(packet2));
8810 mavlink_msg_collision_pack(system_id, component_id, &msg , packet1.src , packet1.id , packet1.action , packet1.threat_level , packet1.time_to_minimum_delta , packet1.altitude_minimum_delta , packet1.horizontal_minimum_delta );
8811 mavlink_msg_collision_decode(&msg, &packet2);
8812 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8813
8814 memset(&packet2, 0, sizeof(packet2));
8815 mavlink_msg_collision_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.src , packet1.id , packet1.action , packet1.threat_level , packet1.time_to_minimum_delta , packet1.altitude_minimum_delta , packet1.horizontal_minimum_delta );
8816 mavlink_msg_collision_decode(&msg, &packet2);
8817 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8818
8819 memset(&packet2, 0, sizeof(packet2));
8820 mavlink_msg_to_send_buffer(buffer, &msg);
8821 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8822 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8823 }
8824 mavlink_msg_collision_decode(last_msg, &packet2);
8825 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8826
8827 memset(&packet2, 0, sizeof(packet2));
8828 mavlink_msg_collision_send(MAVLINK_COMM_1 , packet1.src , packet1.id , packet1.action , packet1.threat_level , packet1.time_to_minimum_delta , packet1.altitude_minimum_delta , packet1.horizontal_minimum_delta );
8829 mavlink_msg_collision_decode(last_msg, &packet2);
8830 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8831
8832#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8833 MAVLINK_ASSERT(mavlink_get_message_info_by_name("COLLISION") != NULL);
8834 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_COLLISION) != NULL);
8835#endif
8836}
8837
8838static void mavlink_test_v2_extension(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8839{
8840#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8841 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8842 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_V2_EXTENSION >= 256) {
8843 return;
8844 }
8845#endif
8846 mavlink_message_t msg;
8847 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8848 uint16_t i;
8849 mavlink_v2_extension_t packet_in = {
8850 17235,139,206,17,{ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 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, 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 }
8851 };
8852 mavlink_v2_extension_t packet1, packet2;
8853 memset(&packet1, 0, sizeof(packet1));
8854 packet1.message_type = packet_in.message_type;
8855 packet1.target_network = packet_in.target_network;
8856 packet1.target_system = packet_in.target_system;
8857 packet1.target_component = packet_in.target_component;
8858
8859 mav_array_memcpy(packet1.payload, packet_in.payload, sizeof(uint8_t)*249);
8860
8861#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8862 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8863 // cope with extensions
8864 memset(MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN);
8865 }
8866#endif
8867 memset(&packet2, 0, sizeof(packet2));
8868 mavlink_msg_v2_extension_encode(system_id, component_id, &msg, &packet1);
8869 mavlink_msg_v2_extension_decode(&msg, &packet2);
8870 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8871
8872 memset(&packet2, 0, sizeof(packet2));
8873 mavlink_msg_v2_extension_pack(system_id, component_id, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.message_type , packet1.payload );
8874 mavlink_msg_v2_extension_decode(&msg, &packet2);
8875 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8876
8877 memset(&packet2, 0, sizeof(packet2));
8878 mavlink_msg_v2_extension_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.message_type , packet1.payload );
8879 mavlink_msg_v2_extension_decode(&msg, &packet2);
8880 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8881
8882 memset(&packet2, 0, sizeof(packet2));
8883 mavlink_msg_to_send_buffer(buffer, &msg);
8884 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8885 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8886 }
8887 mavlink_msg_v2_extension_decode(last_msg, &packet2);
8888 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8889
8890 memset(&packet2, 0, sizeof(packet2));
8891 mavlink_msg_v2_extension_send(MAVLINK_COMM_1 , packet1.target_network , packet1.target_system , packet1.target_component , packet1.message_type , packet1.payload );
8892 mavlink_msg_v2_extension_decode(last_msg, &packet2);
8893 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8894
8895#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8896 MAVLINK_ASSERT(mavlink_get_message_info_by_name("V2_EXTENSION") != NULL);
8897 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_V2_EXTENSION) != NULL);
8898#endif
8899}
8900
8901static void mavlink_test_memory_vect(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8902{
8903#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8904 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8905 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MEMORY_VECT >= 256) {
8906 return;
8907 }
8908#endif
8909 mavlink_message_t msg;
8910 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8911 uint16_t i;
8912 mavlink_memory_vect_t packet_in = {
8913 17235,139,206,{ 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 }
8914 };
8915 mavlink_memory_vect_t packet1, packet2;
8916 memset(&packet1, 0, sizeof(packet1));
8917 packet1.address = packet_in.address;
8918 packet1.ver = packet_in.ver;
8919 packet1.type = packet_in.type;
8920
8921 mav_array_memcpy(packet1.value, packet_in.value, sizeof(int8_t)*32);
8922
8923#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8924 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8925 // cope with extensions
8926 memset(MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN);
8927 }
8928#endif
8929 memset(&packet2, 0, sizeof(packet2));
8930 mavlink_msg_memory_vect_encode(system_id, component_id, &msg, &packet1);
8931 mavlink_msg_memory_vect_decode(&msg, &packet2);
8932 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8933
8934 memset(&packet2, 0, sizeof(packet2));
8935 mavlink_msg_memory_vect_pack(system_id, component_id, &msg , packet1.address , packet1.ver , packet1.type , packet1.value );
8936 mavlink_msg_memory_vect_decode(&msg, &packet2);
8937 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8938
8939 memset(&packet2, 0, sizeof(packet2));
8940 mavlink_msg_memory_vect_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.address , packet1.ver , packet1.type , packet1.value );
8941 mavlink_msg_memory_vect_decode(&msg, &packet2);
8942 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8943
8944 memset(&packet2, 0, sizeof(packet2));
8945 mavlink_msg_to_send_buffer(buffer, &msg);
8946 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8947 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8948 }
8949 mavlink_msg_memory_vect_decode(last_msg, &packet2);
8950 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8951
8952 memset(&packet2, 0, sizeof(packet2));
8953 mavlink_msg_memory_vect_send(MAVLINK_COMM_1 , packet1.address , packet1.ver , packet1.type , packet1.value );
8954 mavlink_msg_memory_vect_decode(last_msg, &packet2);
8955 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8956
8957#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8958 MAVLINK_ASSERT(mavlink_get_message_info_by_name("MEMORY_VECT") != NULL);
8959 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MEMORY_VECT) != NULL);
8960#endif
8961}
8962
8963static void mavlink_test_debug_vect(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8964{
8965#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8966 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8967 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DEBUG_VECT >= 256) {
8968 return;
8969 }
8970#endif
8971 mavlink_message_t msg;
8972 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8973 uint16_t i;
8974 mavlink_debug_vect_t packet_in = {
8975 93372036854775807ULL,73.0,101.0,129.0,"UVWXYZABC"
8976 };
8977 mavlink_debug_vect_t packet1, packet2;
8978 memset(&packet1, 0, sizeof(packet1));
8979 packet1.time_usec = packet_in.time_usec;
8980 packet1.x = packet_in.x;
8981 packet1.y = packet_in.y;
8982 packet1.z = packet_in.z;
8983
8984 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*10);
8985
8986#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8987 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8988 // cope with extensions
8989 memset(MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN);
8990 }
8991#endif
8992 memset(&packet2, 0, sizeof(packet2));
8993 mavlink_msg_debug_vect_encode(system_id, component_id, &msg, &packet1);
8994 mavlink_msg_debug_vect_decode(&msg, &packet2);
8995 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8996
8997 memset(&packet2, 0, sizeof(packet2));
8998 mavlink_msg_debug_vect_pack(system_id, component_id, &msg , packet1.name , packet1.time_usec , packet1.x , packet1.y , packet1.z );
8999 mavlink_msg_debug_vect_decode(&msg, &packet2);
9000 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9001
9002 memset(&packet2, 0, sizeof(packet2));
9003 mavlink_msg_debug_vect_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.name , packet1.time_usec , packet1.x , packet1.y , packet1.z );
9004 mavlink_msg_debug_vect_decode(&msg, &packet2);
9005 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9006
9007 memset(&packet2, 0, sizeof(packet2));
9008 mavlink_msg_to_send_buffer(buffer, &msg);
9009 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9010 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9011 }
9012 mavlink_msg_debug_vect_decode(last_msg, &packet2);
9013 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9014
9015 memset(&packet2, 0, sizeof(packet2));
9016 mavlink_msg_debug_vect_send(MAVLINK_COMM_1 , packet1.name , packet1.time_usec , packet1.x , packet1.y , packet1.z );
9017 mavlink_msg_debug_vect_decode(last_msg, &packet2);
9018 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9019
9020#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9021 MAVLINK_ASSERT(mavlink_get_message_info_by_name("DEBUG_VECT") != NULL);
9022 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_DEBUG_VECT) != NULL);
9023#endif
9024}
9025
9026static void mavlink_test_named_value_float(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9027{
9028#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9029 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9030 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_NAMED_VALUE_FLOAT >= 256) {
9031 return;
9032 }
9033#endif
9034 mavlink_message_t msg;
9035 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9036 uint16_t i;
9037 mavlink_named_value_float_t packet_in = {
9038 963497464,45.0,"IJKLMNOPQ"
9039 };
9040 mavlink_named_value_float_t packet1, packet2;
9041 memset(&packet1, 0, sizeof(packet1));
9042 packet1.time_boot_ms = packet_in.time_boot_ms;
9043 packet1.value = packet_in.value;
9044
9045 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*10);
9046
9047#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9048 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9049 // cope with extensions
9050 memset(MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN);
9051 }
9052#endif
9053 memset(&packet2, 0, sizeof(packet2));
9054 mavlink_msg_named_value_float_encode(system_id, component_id, &msg, &packet1);
9055 mavlink_msg_named_value_float_decode(&msg, &packet2);
9056 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9057
9058 memset(&packet2, 0, sizeof(packet2));
9059 mavlink_msg_named_value_float_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.name , packet1.value );
9060 mavlink_msg_named_value_float_decode(&msg, &packet2);
9061 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9062
9063 memset(&packet2, 0, sizeof(packet2));
9064 mavlink_msg_named_value_float_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.name , packet1.value );
9065 mavlink_msg_named_value_float_decode(&msg, &packet2);
9066 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9067
9068 memset(&packet2, 0, sizeof(packet2));
9069 mavlink_msg_to_send_buffer(buffer, &msg);
9070 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9071 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9072 }
9073 mavlink_msg_named_value_float_decode(last_msg, &packet2);
9074 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9075
9076 memset(&packet2, 0, sizeof(packet2));
9077 mavlink_msg_named_value_float_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.name , packet1.value );
9078 mavlink_msg_named_value_float_decode(last_msg, &packet2);
9079 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9080
9081#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9082 MAVLINK_ASSERT(mavlink_get_message_info_by_name("NAMED_VALUE_FLOAT") != NULL);
9083 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_NAMED_VALUE_FLOAT) != NULL);
9084#endif
9085}
9086
9087static void mavlink_test_named_value_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9088{
9089#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9090 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9091 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_NAMED_VALUE_INT >= 256) {
9092 return;
9093 }
9094#endif
9095 mavlink_message_t msg;
9096 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9097 uint16_t i;
9098 mavlink_named_value_int_t packet_in = {
9099 963497464,963497672,"IJKLMNOPQ"
9100 };
9101 mavlink_named_value_int_t packet1, packet2;
9102 memset(&packet1, 0, sizeof(packet1));
9103 packet1.time_boot_ms = packet_in.time_boot_ms;
9104 packet1.value = packet_in.value;
9105
9106 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*10);
9107
9108#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9109 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9110 // cope with extensions
9111 memset(MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN);
9112 }
9113#endif
9114 memset(&packet2, 0, sizeof(packet2));
9115 mavlink_msg_named_value_int_encode(system_id, component_id, &msg, &packet1);
9116 mavlink_msg_named_value_int_decode(&msg, &packet2);
9117 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9118
9119 memset(&packet2, 0, sizeof(packet2));
9120 mavlink_msg_named_value_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.name , packet1.value );
9121 mavlink_msg_named_value_int_decode(&msg, &packet2);
9122 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9123
9124 memset(&packet2, 0, sizeof(packet2));
9125 mavlink_msg_named_value_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.name , packet1.value );
9126 mavlink_msg_named_value_int_decode(&msg, &packet2);
9127 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9128
9129 memset(&packet2, 0, sizeof(packet2));
9130 mavlink_msg_to_send_buffer(buffer, &msg);
9131 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9132 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9133 }
9134 mavlink_msg_named_value_int_decode(last_msg, &packet2);
9135 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9136
9137 memset(&packet2, 0, sizeof(packet2));
9138 mavlink_msg_named_value_int_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.name , packet1.value );
9139 mavlink_msg_named_value_int_decode(last_msg, &packet2);
9140 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9141
9142#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9143 MAVLINK_ASSERT(mavlink_get_message_info_by_name("NAMED_VALUE_INT") != NULL);
9144 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_NAMED_VALUE_INT) != NULL);
9145#endif
9146}
9147
9148static void mavlink_test_statustext(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9149{
9150#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9151 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9152 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_STATUSTEXT >= 256) {
9153 return;
9154 }
9155#endif
9156 mavlink_message_t msg;
9157 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9158 uint16_t i;
9159 mavlink_statustext_t packet_in = {
9160 5,"BCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX",19887,228
9161 };
9162 mavlink_statustext_t packet1, packet2;
9163 memset(&packet1, 0, sizeof(packet1));
9164 packet1.severity = packet_in.severity;
9165 packet1.id = packet_in.id;
9166 packet1.chunk_seq = packet_in.chunk_seq;
9167
9168 mav_array_memcpy(packet1.text, packet_in.text, sizeof(char)*50);
9169
9170#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9171 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9172 // cope with extensions
9173 memset(MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN);
9174 }
9175#endif
9176 memset(&packet2, 0, sizeof(packet2));
9177 mavlink_msg_statustext_encode(system_id, component_id, &msg, &packet1);
9178 mavlink_msg_statustext_decode(&msg, &packet2);
9179 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9180
9181 memset(&packet2, 0, sizeof(packet2));
9182 mavlink_msg_statustext_pack(system_id, component_id, &msg , packet1.severity , packet1.text , packet1.id , packet1.chunk_seq );
9183 mavlink_msg_statustext_decode(&msg, &packet2);
9184 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9185
9186 memset(&packet2, 0, sizeof(packet2));
9187 mavlink_msg_statustext_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.severity , packet1.text , packet1.id , packet1.chunk_seq );
9188 mavlink_msg_statustext_decode(&msg, &packet2);
9189 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9190
9191 memset(&packet2, 0, sizeof(packet2));
9192 mavlink_msg_to_send_buffer(buffer, &msg);
9193 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9194 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9195 }
9196 mavlink_msg_statustext_decode(last_msg, &packet2);
9197 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9198
9199 memset(&packet2, 0, sizeof(packet2));
9200 mavlink_msg_statustext_send(MAVLINK_COMM_1 , packet1.severity , packet1.text , packet1.id , packet1.chunk_seq );
9201 mavlink_msg_statustext_decode(last_msg, &packet2);
9202 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9203
9204#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9205 MAVLINK_ASSERT(mavlink_get_message_info_by_name("STATUSTEXT") != NULL);
9206 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_STATUSTEXT) != NULL);
9207#endif
9208}
9209
9210static void mavlink_test_debug(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9211{
9212#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9213 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9214 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DEBUG >= 256) {
9215 return;
9216 }
9217#endif
9218 mavlink_message_t msg;
9219 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9220 uint16_t i;
9221 mavlink_debug_t packet_in = {
9222 963497464,45.0,29
9223 };
9224 mavlink_debug_t packet1, packet2;
9225 memset(&packet1, 0, sizeof(packet1));
9226 packet1.time_boot_ms = packet_in.time_boot_ms;
9227 packet1.value = packet_in.value;
9228 packet1.ind = packet_in.ind;
9229
9230
9231#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9232 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9233 // cope with extensions
9234 memset(MAVLINK_MSG_ID_DEBUG_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DEBUG_MIN_LEN);
9235 }
9236#endif
9237 memset(&packet2, 0, sizeof(packet2));
9238 mavlink_msg_debug_encode(system_id, component_id, &msg, &packet1);
9239 mavlink_msg_debug_decode(&msg, &packet2);
9240 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9241
9242 memset(&packet2, 0, sizeof(packet2));
9243 mavlink_msg_debug_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.ind , packet1.value );
9244 mavlink_msg_debug_decode(&msg, &packet2);
9245 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9246
9247 memset(&packet2, 0, sizeof(packet2));
9248 mavlink_msg_debug_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.ind , packet1.value );
9249 mavlink_msg_debug_decode(&msg, &packet2);
9250 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9251
9252 memset(&packet2, 0, sizeof(packet2));
9253 mavlink_msg_to_send_buffer(buffer, &msg);
9254 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9255 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9256 }
9257 mavlink_msg_debug_decode(last_msg, &packet2);
9258 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9259
9260 memset(&packet2, 0, sizeof(packet2));
9261 mavlink_msg_debug_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.ind , packet1.value );
9262 mavlink_msg_debug_decode(last_msg, &packet2);
9263 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9264
9265#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9266 MAVLINK_ASSERT(mavlink_get_message_info_by_name("DEBUG") != NULL);
9267 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_DEBUG) != NULL);
9268#endif
9269}
9270
9271static void mavlink_test_setup_signing(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9272{
9273#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9274 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9275 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SETUP_SIGNING >= 256) {
9276 return;
9277 }
9278#endif
9279 mavlink_message_t msg;
9280 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9281 uint16_t i;
9282 mavlink_setup_signing_t packet_in = {
9283 93372036854775807ULL,29,96,{ 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194 }
9284 };
9285 mavlink_setup_signing_t packet1, packet2;
9286 memset(&packet1, 0, sizeof(packet1));
9287 packet1.initial_timestamp = packet_in.initial_timestamp;
9288 packet1.target_system = packet_in.target_system;
9289 packet1.target_component = packet_in.target_component;
9290
9291 mav_array_memcpy(packet1.secret_key, packet_in.secret_key, sizeof(uint8_t)*32);
9292
9293#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9294 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9295 // cope with extensions
9296 memset(MAVLINK_MSG_ID_SETUP_SIGNING_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SETUP_SIGNING_MIN_LEN);
9297 }
9298#endif
9299 memset(&packet2, 0, sizeof(packet2));
9300 mavlink_msg_setup_signing_encode(system_id, component_id, &msg, &packet1);
9301 mavlink_msg_setup_signing_decode(&msg, &packet2);
9302 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9303
9304 memset(&packet2, 0, sizeof(packet2));
9305 mavlink_msg_setup_signing_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.secret_key , packet1.initial_timestamp );
9306 mavlink_msg_setup_signing_decode(&msg, &packet2);
9307 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9308
9309 memset(&packet2, 0, sizeof(packet2));
9310 mavlink_msg_setup_signing_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.secret_key , packet1.initial_timestamp );
9311 mavlink_msg_setup_signing_decode(&msg, &packet2);
9312 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9313
9314 memset(&packet2, 0, sizeof(packet2));
9315 mavlink_msg_to_send_buffer(buffer, &msg);
9316 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9317 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9318 }
9319 mavlink_msg_setup_signing_decode(last_msg, &packet2);
9320 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9321
9322 memset(&packet2, 0, sizeof(packet2));
9323 mavlink_msg_setup_signing_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.secret_key , packet1.initial_timestamp );
9324 mavlink_msg_setup_signing_decode(last_msg, &packet2);
9325 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9326
9327#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9328 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SETUP_SIGNING") != NULL);
9329 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SETUP_SIGNING) != NULL);
9330#endif
9331}
9332
9333static void mavlink_test_button_change(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9334{
9335#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9336 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9337 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_BUTTON_CHANGE >= 256) {
9338 return;
9339 }
9340#endif
9341 mavlink_message_t msg;
9342 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9343 uint16_t i;
9344 mavlink_button_change_t packet_in = {
9345 963497464,963497672,29
9346 };
9347 mavlink_button_change_t packet1, packet2;
9348 memset(&packet1, 0, sizeof(packet1));
9349 packet1.time_boot_ms = packet_in.time_boot_ms;
9350 packet1.last_change_ms = packet_in.last_change_ms;
9351 packet1.state = packet_in.state;
9352
9353
9354#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9355 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9356 // cope with extensions
9357 memset(MAVLINK_MSG_ID_BUTTON_CHANGE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_BUTTON_CHANGE_MIN_LEN);
9358 }
9359#endif
9360 memset(&packet2, 0, sizeof(packet2));
9361 mavlink_msg_button_change_encode(system_id, component_id, &msg, &packet1);
9362 mavlink_msg_button_change_decode(&msg, &packet2);
9363 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9364
9365 memset(&packet2, 0, sizeof(packet2));
9366 mavlink_msg_button_change_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.last_change_ms , packet1.state );
9367 mavlink_msg_button_change_decode(&msg, &packet2);
9368 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9369
9370 memset(&packet2, 0, sizeof(packet2));
9371 mavlink_msg_button_change_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.last_change_ms , packet1.state );
9372 mavlink_msg_button_change_decode(&msg, &packet2);
9373 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9374
9375 memset(&packet2, 0, sizeof(packet2));
9376 mavlink_msg_to_send_buffer(buffer, &msg);
9377 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9378 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9379 }
9380 mavlink_msg_button_change_decode(last_msg, &packet2);
9381 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9382
9383 memset(&packet2, 0, sizeof(packet2));
9384 mavlink_msg_button_change_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.last_change_ms , packet1.state );
9385 mavlink_msg_button_change_decode(last_msg, &packet2);
9386 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9387
9388#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9389 MAVLINK_ASSERT(mavlink_get_message_info_by_name("BUTTON_CHANGE") != NULL);
9390 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_BUTTON_CHANGE) != NULL);
9391#endif
9392}
9393
9394static void mavlink_test_play_tune(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9395{
9396#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9397 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9398 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PLAY_TUNE >= 256) {
9399 return;
9400 }
9401#endif
9402 mavlink_message_t msg;
9403 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9404 uint16_t i;
9405 mavlink_play_tune_t packet_in = {
9406 5,72,"CDEFGHIJKLMNOPQRSTUVWXYZABCDE","GHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVW"
9407 };
9408 mavlink_play_tune_t packet1, packet2;
9409 memset(&packet1, 0, sizeof(packet1));
9410 packet1.target_system = packet_in.target_system;
9411 packet1.target_component = packet_in.target_component;
9412
9413 mav_array_memcpy(packet1.tune, packet_in.tune, sizeof(char)*30);
9414 mav_array_memcpy(packet1.tune2, packet_in.tune2, sizeof(char)*200);
9415
9416#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9417 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9418 // cope with extensions
9419 memset(MAVLINK_MSG_ID_PLAY_TUNE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PLAY_TUNE_MIN_LEN);
9420 }
9421#endif
9422 memset(&packet2, 0, sizeof(packet2));
9423 mavlink_msg_play_tune_encode(system_id, component_id, &msg, &packet1);
9424 mavlink_msg_play_tune_decode(&msg, &packet2);
9425 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9426
9427 memset(&packet2, 0, sizeof(packet2));
9428 mavlink_msg_play_tune_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.tune , packet1.tune2 );
9429 mavlink_msg_play_tune_decode(&msg, &packet2);
9430 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9431
9432 memset(&packet2, 0, sizeof(packet2));
9433 mavlink_msg_play_tune_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.tune , packet1.tune2 );
9434 mavlink_msg_play_tune_decode(&msg, &packet2);
9435 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9436
9437 memset(&packet2, 0, sizeof(packet2));
9438 mavlink_msg_to_send_buffer(buffer, &msg);
9439 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9440 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9441 }
9442 mavlink_msg_play_tune_decode(last_msg, &packet2);
9443 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9444
9445 memset(&packet2, 0, sizeof(packet2));
9446 mavlink_msg_play_tune_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.tune , packet1.tune2 );
9447 mavlink_msg_play_tune_decode(last_msg, &packet2);
9448 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9449
9450#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9451 MAVLINK_ASSERT(mavlink_get_message_info_by_name("PLAY_TUNE") != NULL);
9452 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PLAY_TUNE) != NULL);
9453#endif
9454}
9455
9456static void mavlink_test_camera_information(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9457{
9458#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9459 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9460 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_INFORMATION >= 256) {
9461 return;
9462 }
9463#endif
9464 mavlink_message_t msg;
9465 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9466 uint16_t i;
9467 mavlink_camera_information_t packet_in = {
9468 963497464,963497672,73.0,101.0,129.0,963498504,18483,18587,18691,{ 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 },{ 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 },159,"RSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ",134,201
9469 };
9470 mavlink_camera_information_t packet1, packet2;
9471 memset(&packet1, 0, sizeof(packet1));
9472 packet1.time_boot_ms = packet_in.time_boot_ms;
9473 packet1.firmware_version = packet_in.firmware_version;
9474 packet1.focal_length = packet_in.focal_length;
9475 packet1.sensor_size_h = packet_in.sensor_size_h;
9476 packet1.sensor_size_v = packet_in.sensor_size_v;
9477 packet1.flags = packet_in.flags;
9478 packet1.resolution_h = packet_in.resolution_h;
9479 packet1.resolution_v = packet_in.resolution_v;
9480 packet1.cam_definition_version = packet_in.cam_definition_version;
9481 packet1.lens_id = packet_in.lens_id;
9482 packet1.gimbal_device_id = packet_in.gimbal_device_id;
9483 packet1.camera_device_id = packet_in.camera_device_id;
9484
9485 mav_array_memcpy(packet1.vendor_name, packet_in.vendor_name, sizeof(uint8_t)*32);
9486 mav_array_memcpy(packet1.model_name, packet_in.model_name, sizeof(uint8_t)*32);
9487 mav_array_memcpy(packet1.cam_definition_uri, packet_in.cam_definition_uri, sizeof(char)*140);
9488
9489#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9490 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9491 // cope with extensions
9492 memset(MAVLINK_MSG_ID_CAMERA_INFORMATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_INFORMATION_MIN_LEN);
9493 }
9494#endif
9495 memset(&packet2, 0, sizeof(packet2));
9496 mavlink_msg_camera_information_encode(system_id, component_id, &msg, &packet1);
9497 mavlink_msg_camera_information_decode(&msg, &packet2);
9498 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9499
9500 memset(&packet2, 0, sizeof(packet2));
9501 mavlink_msg_camera_information_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.vendor_name , packet1.model_name , packet1.firmware_version , packet1.focal_length , packet1.sensor_size_h , packet1.sensor_size_v , packet1.resolution_h , packet1.resolution_v , packet1.lens_id , packet1.flags , packet1.cam_definition_version , packet1.cam_definition_uri , packet1.gimbal_device_id , packet1.camera_device_id );
9502 mavlink_msg_camera_information_decode(&msg, &packet2);
9503 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9504
9505 memset(&packet2, 0, sizeof(packet2));
9506 mavlink_msg_camera_information_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.vendor_name , packet1.model_name , packet1.firmware_version , packet1.focal_length , packet1.sensor_size_h , packet1.sensor_size_v , packet1.resolution_h , packet1.resolution_v , packet1.lens_id , packet1.flags , packet1.cam_definition_version , packet1.cam_definition_uri , packet1.gimbal_device_id , packet1.camera_device_id );
9507 mavlink_msg_camera_information_decode(&msg, &packet2);
9508 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9509
9510 memset(&packet2, 0, sizeof(packet2));
9511 mavlink_msg_to_send_buffer(buffer, &msg);
9512 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9513 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9514 }
9515 mavlink_msg_camera_information_decode(last_msg, &packet2);
9516 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9517
9518 memset(&packet2, 0, sizeof(packet2));
9519 mavlink_msg_camera_information_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.vendor_name , packet1.model_name , packet1.firmware_version , packet1.focal_length , packet1.sensor_size_h , packet1.sensor_size_v , packet1.resolution_h , packet1.resolution_v , packet1.lens_id , packet1.flags , packet1.cam_definition_version , packet1.cam_definition_uri , packet1.gimbal_device_id , packet1.camera_device_id );
9520 mavlink_msg_camera_information_decode(last_msg, &packet2);
9521 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9522
9523#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9524 MAVLINK_ASSERT(mavlink_get_message_info_by_name("CAMERA_INFORMATION") != NULL);
9525 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CAMERA_INFORMATION) != NULL);
9526#endif
9527}
9528
9529static void mavlink_test_camera_settings(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9530{
9531#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9532 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9533 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_SETTINGS >= 256) {
9534 return;
9535 }
9536#endif
9537 mavlink_message_t msg;
9538 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9539 uint16_t i;
9540 mavlink_camera_settings_t packet_in = {
9541 963497464,17,52.0,80.0,108
9542 };
9543 mavlink_camera_settings_t packet1, packet2;
9544 memset(&packet1, 0, sizeof(packet1));
9545 packet1.time_boot_ms = packet_in.time_boot_ms;
9546 packet1.mode_id = packet_in.mode_id;
9547 packet1.zoomLevel = packet_in.zoomLevel;
9548 packet1.focusLevel = packet_in.focusLevel;
9549 packet1.camera_device_id = packet_in.camera_device_id;
9550
9551
9552#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9553 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9554 // cope with extensions
9555 memset(MAVLINK_MSG_ID_CAMERA_SETTINGS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_SETTINGS_MIN_LEN);
9556 }
9557#endif
9558 memset(&packet2, 0, sizeof(packet2));
9559 mavlink_msg_camera_settings_encode(system_id, component_id, &msg, &packet1);
9560 mavlink_msg_camera_settings_decode(&msg, &packet2);
9561 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9562
9563 memset(&packet2, 0, sizeof(packet2));
9564 mavlink_msg_camera_settings_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.mode_id , packet1.zoomLevel , packet1.focusLevel , packet1.camera_device_id );
9565 mavlink_msg_camera_settings_decode(&msg, &packet2);
9566 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9567
9568 memset(&packet2, 0, sizeof(packet2));
9569 mavlink_msg_camera_settings_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.mode_id , packet1.zoomLevel , packet1.focusLevel , packet1.camera_device_id );
9570 mavlink_msg_camera_settings_decode(&msg, &packet2);
9571 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9572
9573 memset(&packet2, 0, sizeof(packet2));
9574 mavlink_msg_to_send_buffer(buffer, &msg);
9575 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9576 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9577 }
9578 mavlink_msg_camera_settings_decode(last_msg, &packet2);
9579 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9580
9581 memset(&packet2, 0, sizeof(packet2));
9582 mavlink_msg_camera_settings_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.mode_id , packet1.zoomLevel , packet1.focusLevel , packet1.camera_device_id );
9583 mavlink_msg_camera_settings_decode(last_msg, &packet2);
9584 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9585
9586#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9587 MAVLINK_ASSERT(mavlink_get_message_info_by_name("CAMERA_SETTINGS") != NULL);
9588 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CAMERA_SETTINGS) != NULL);
9589#endif
9590}
9591
9592static void mavlink_test_storage_information(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9593{
9594#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9595 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9596 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_STORAGE_INFORMATION >= 256) {
9597 return;
9598 }
9599#endif
9600 mavlink_message_t msg;
9601 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9602 uint16_t i;
9603 mavlink_storage_information_t packet_in = {
9604 963497464,45.0,73.0,101.0,129.0,157.0,77,144,211,22,"CDEFGHIJKLMNOPQRSTUVWXYZABCDEFG",185
9605 };
9606 mavlink_storage_information_t packet1, packet2;
9607 memset(&packet1, 0, sizeof(packet1));
9608 packet1.time_boot_ms = packet_in.time_boot_ms;
9609 packet1.total_capacity = packet_in.total_capacity;
9610 packet1.used_capacity = packet_in.used_capacity;
9611 packet1.available_capacity = packet_in.available_capacity;
9612 packet1.read_speed = packet_in.read_speed;
9613 packet1.write_speed = packet_in.write_speed;
9614 packet1.storage_id = packet_in.storage_id;
9615 packet1.storage_count = packet_in.storage_count;
9616 packet1.status = packet_in.status;
9617 packet1.type = packet_in.type;
9618 packet1.storage_usage = packet_in.storage_usage;
9619
9620 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*32);
9621
9622#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9623 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9624 // cope with extensions
9625 memset(MAVLINK_MSG_ID_STORAGE_INFORMATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_STORAGE_INFORMATION_MIN_LEN);
9626 }
9627#endif
9628 memset(&packet2, 0, sizeof(packet2));
9629 mavlink_msg_storage_information_encode(system_id, component_id, &msg, &packet1);
9630 mavlink_msg_storage_information_decode(&msg, &packet2);
9631 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9632
9633 memset(&packet2, 0, sizeof(packet2));
9634 mavlink_msg_storage_information_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.storage_id , packet1.storage_count , packet1.status , packet1.total_capacity , packet1.used_capacity , packet1.available_capacity , packet1.read_speed , packet1.write_speed , packet1.type , packet1.name , packet1.storage_usage );
9635 mavlink_msg_storage_information_decode(&msg, &packet2);
9636 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9637
9638 memset(&packet2, 0, sizeof(packet2));
9639 mavlink_msg_storage_information_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.storage_id , packet1.storage_count , packet1.status , packet1.total_capacity , packet1.used_capacity , packet1.available_capacity , packet1.read_speed , packet1.write_speed , packet1.type , packet1.name , packet1.storage_usage );
9640 mavlink_msg_storage_information_decode(&msg, &packet2);
9641 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9642
9643 memset(&packet2, 0, sizeof(packet2));
9644 mavlink_msg_to_send_buffer(buffer, &msg);
9645 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9646 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9647 }
9648 mavlink_msg_storage_information_decode(last_msg, &packet2);
9649 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9650
9651 memset(&packet2, 0, sizeof(packet2));
9652 mavlink_msg_storage_information_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.storage_id , packet1.storage_count , packet1.status , packet1.total_capacity , packet1.used_capacity , packet1.available_capacity , packet1.read_speed , packet1.write_speed , packet1.type , packet1.name , packet1.storage_usage );
9653 mavlink_msg_storage_information_decode(last_msg, &packet2);
9654 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9655
9656#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9657 MAVLINK_ASSERT(mavlink_get_message_info_by_name("STORAGE_INFORMATION") != NULL);
9658 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_STORAGE_INFORMATION) != NULL);
9659#endif
9660}
9661
9662static void mavlink_test_camera_capture_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9663{
9664#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9665 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9666 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS >= 256) {
9667 return;
9668 }
9669#endif
9670 mavlink_message_t msg;
9671 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9672 uint16_t i;
9673 mavlink_camera_capture_status_t packet_in = {
9674 963497464,45.0,963497880,101.0,53,120,963498400,199
9675 };
9676 mavlink_camera_capture_status_t packet1, packet2;
9677 memset(&packet1, 0, sizeof(packet1));
9678 packet1.time_boot_ms = packet_in.time_boot_ms;
9679 packet1.image_interval = packet_in.image_interval;
9680 packet1.recording_time_ms = packet_in.recording_time_ms;
9681 packet1.available_capacity = packet_in.available_capacity;
9682 packet1.image_status = packet_in.image_status;
9683 packet1.video_status = packet_in.video_status;
9684 packet1.image_count = packet_in.image_count;
9685 packet1.camera_device_id = packet_in.camera_device_id;
9686
9687
9688#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9689 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9690 // cope with extensions
9691 memset(MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN);
9692 }
9693#endif
9694 memset(&packet2, 0, sizeof(packet2));
9695 mavlink_msg_camera_capture_status_encode(system_id, component_id, &msg, &packet1);
9696 mavlink_msg_camera_capture_status_decode(&msg, &packet2);
9697 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9698
9699 memset(&packet2, 0, sizeof(packet2));
9700 mavlink_msg_camera_capture_status_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.image_status , packet1.video_status , packet1.image_interval , packet1.recording_time_ms , packet1.available_capacity , packet1.image_count , packet1.camera_device_id );
9701 mavlink_msg_camera_capture_status_decode(&msg, &packet2);
9702 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9703
9704 memset(&packet2, 0, sizeof(packet2));
9705 mavlink_msg_camera_capture_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.image_status , packet1.video_status , packet1.image_interval , packet1.recording_time_ms , packet1.available_capacity , packet1.image_count , packet1.camera_device_id );
9706 mavlink_msg_camera_capture_status_decode(&msg, &packet2);
9707 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9708
9709 memset(&packet2, 0, sizeof(packet2));
9710 mavlink_msg_to_send_buffer(buffer, &msg);
9711 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9712 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9713 }
9714 mavlink_msg_camera_capture_status_decode(last_msg, &packet2);
9715 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9716
9717 memset(&packet2, 0, sizeof(packet2));
9718 mavlink_msg_camera_capture_status_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.image_status , packet1.video_status , packet1.image_interval , packet1.recording_time_ms , packet1.available_capacity , packet1.image_count , packet1.camera_device_id );
9719 mavlink_msg_camera_capture_status_decode(last_msg, &packet2);
9720 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9721
9722#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9723 MAVLINK_ASSERT(mavlink_get_message_info_by_name("CAMERA_CAPTURE_STATUS") != NULL);
9724 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS) != NULL);
9725#endif
9726}
9727
9728static void mavlink_test_camera_image_captured(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9729{
9730#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9731 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9732 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED >= 256) {
9733 return;
9734 }
9735#endif
9736 mavlink_message_t msg;
9737 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9738 uint16_t i;
9739 mavlink_camera_image_captured_t packet_in = {
9740 93372036854775807ULL,963497880,963498088,963498296,963498504,963498712,{ 213.0, 214.0, 215.0, 216.0 },963499752,149,216,"YZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRST"
9741 };
9742 mavlink_camera_image_captured_t packet1, packet2;
9743 memset(&packet1, 0, sizeof(packet1));
9744 packet1.time_utc = packet_in.time_utc;
9745 packet1.time_boot_ms = packet_in.time_boot_ms;
9746 packet1.lat = packet_in.lat;
9747 packet1.lon = packet_in.lon;
9748 packet1.alt = packet_in.alt;
9749 packet1.relative_alt = packet_in.relative_alt;
9750 packet1.image_index = packet_in.image_index;
9751 packet1.camera_id = packet_in.camera_id;
9752 packet1.capture_result = packet_in.capture_result;
9753
9754 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
9755 mav_array_memcpy(packet1.file_url, packet_in.file_url, sizeof(char)*205);
9756
9757#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9758 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9759 // cope with extensions
9760 memset(MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN);
9761 }
9762#endif
9763 memset(&packet2, 0, sizeof(packet2));
9764 mavlink_msg_camera_image_captured_encode(system_id, component_id, &msg, &packet1);
9765 mavlink_msg_camera_image_captured_decode(&msg, &packet2);
9766 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9767
9768 memset(&packet2, 0, sizeof(packet2));
9769 mavlink_msg_camera_image_captured_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.time_utc , packet1.camera_id , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.q , packet1.image_index , packet1.capture_result , packet1.file_url );
9770 mavlink_msg_camera_image_captured_decode(&msg, &packet2);
9771 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9772
9773 memset(&packet2, 0, sizeof(packet2));
9774 mavlink_msg_camera_image_captured_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.time_utc , packet1.camera_id , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.q , packet1.image_index , packet1.capture_result , packet1.file_url );
9775 mavlink_msg_camera_image_captured_decode(&msg, &packet2);
9776 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9777
9778 memset(&packet2, 0, sizeof(packet2));
9779 mavlink_msg_to_send_buffer(buffer, &msg);
9780 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9781 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9782 }
9783 mavlink_msg_camera_image_captured_decode(last_msg, &packet2);
9784 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9785
9786 memset(&packet2, 0, sizeof(packet2));
9787 mavlink_msg_camera_image_captured_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.time_utc , packet1.camera_id , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.q , packet1.image_index , packet1.capture_result , packet1.file_url );
9788 mavlink_msg_camera_image_captured_decode(last_msg, &packet2);
9789 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9790
9791#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9792 MAVLINK_ASSERT(mavlink_get_message_info_by_name("CAMERA_IMAGE_CAPTURED") != NULL);
9793 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED) != NULL);
9794#endif
9795}
9796
9797static void mavlink_test_flight_information(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9798{
9799#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9800 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9801 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FLIGHT_INFORMATION >= 256) {
9802 return;
9803 }
9804#endif
9805 mavlink_message_t msg;
9806 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9807 uint16_t i;
9808 mavlink_flight_information_t packet_in = {
9809 93372036854775807ULL,93372036854776311ULL,93372036854776815ULL,963498712,963498920
9810 };
9811 mavlink_flight_information_t packet1, packet2;
9812 memset(&packet1, 0, sizeof(packet1));
9813 packet1.arming_time_utc = packet_in.arming_time_utc;
9814 packet1.takeoff_time_utc = packet_in.takeoff_time_utc;
9815 packet1.flight_uuid = packet_in.flight_uuid;
9816 packet1.time_boot_ms = packet_in.time_boot_ms;
9817 packet1.landing_time = packet_in.landing_time;
9818
9819
9820#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9821 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9822 // cope with extensions
9823 memset(MAVLINK_MSG_ID_FLIGHT_INFORMATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FLIGHT_INFORMATION_MIN_LEN);
9824 }
9825#endif
9826 memset(&packet2, 0, sizeof(packet2));
9827 mavlink_msg_flight_information_encode(system_id, component_id, &msg, &packet1);
9828 mavlink_msg_flight_information_decode(&msg, &packet2);
9829 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9830
9831 memset(&packet2, 0, sizeof(packet2));
9832 mavlink_msg_flight_information_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.arming_time_utc , packet1.takeoff_time_utc , packet1.flight_uuid , packet1.landing_time );
9833 mavlink_msg_flight_information_decode(&msg, &packet2);
9834 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9835
9836 memset(&packet2, 0, sizeof(packet2));
9837 mavlink_msg_flight_information_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.arming_time_utc , packet1.takeoff_time_utc , packet1.flight_uuid , packet1.landing_time );
9838 mavlink_msg_flight_information_decode(&msg, &packet2);
9839 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9840
9841 memset(&packet2, 0, sizeof(packet2));
9842 mavlink_msg_to_send_buffer(buffer, &msg);
9843 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9844 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9845 }
9846 mavlink_msg_flight_information_decode(last_msg, &packet2);
9847 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9848
9849 memset(&packet2, 0, sizeof(packet2));
9850 mavlink_msg_flight_information_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.arming_time_utc , packet1.takeoff_time_utc , packet1.flight_uuid , packet1.landing_time );
9851 mavlink_msg_flight_information_decode(last_msg, &packet2);
9852 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9853
9854#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9855 MAVLINK_ASSERT(mavlink_get_message_info_by_name("FLIGHT_INFORMATION") != NULL);
9856 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_FLIGHT_INFORMATION) != NULL);
9857#endif
9858}
9859
9860static void mavlink_test_mount_orientation(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9861{
9862#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9863 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9864 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MOUNT_ORIENTATION >= 256) {
9865 return;
9866 }
9867#endif
9868 mavlink_message_t msg;
9869 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9870 uint16_t i;
9871 mavlink_mount_orientation_t packet_in = {
9872 963497464,45.0,73.0,101.0,129.0
9873 };
9874 mavlink_mount_orientation_t packet1, packet2;
9875 memset(&packet1, 0, sizeof(packet1));
9876 packet1.time_boot_ms = packet_in.time_boot_ms;
9877 packet1.roll = packet_in.roll;
9878 packet1.pitch = packet_in.pitch;
9879 packet1.yaw = packet_in.yaw;
9880 packet1.yaw_absolute = packet_in.yaw_absolute;
9881
9882
9883#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9884 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9885 // cope with extensions
9886 memset(MAVLINK_MSG_ID_MOUNT_ORIENTATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MOUNT_ORIENTATION_MIN_LEN);
9887 }
9888#endif
9889 memset(&packet2, 0, sizeof(packet2));
9890 mavlink_msg_mount_orientation_encode(system_id, component_id, &msg, &packet1);
9891 mavlink_msg_mount_orientation_decode(&msg, &packet2);
9892 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9893
9894 memset(&packet2, 0, sizeof(packet2));
9895 mavlink_msg_mount_orientation_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.yaw_absolute );
9896 mavlink_msg_mount_orientation_decode(&msg, &packet2);
9897 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9898
9899 memset(&packet2, 0, sizeof(packet2));
9900 mavlink_msg_mount_orientation_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.yaw_absolute );
9901 mavlink_msg_mount_orientation_decode(&msg, &packet2);
9902 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9903
9904 memset(&packet2, 0, sizeof(packet2));
9905 mavlink_msg_to_send_buffer(buffer, &msg);
9906 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9907 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9908 }
9909 mavlink_msg_mount_orientation_decode(last_msg, &packet2);
9910 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9911
9912 memset(&packet2, 0, sizeof(packet2));
9913 mavlink_msg_mount_orientation_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.yaw_absolute );
9914 mavlink_msg_mount_orientation_decode(last_msg, &packet2);
9915 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9916
9917#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9918 MAVLINK_ASSERT(mavlink_get_message_info_by_name("MOUNT_ORIENTATION") != NULL);
9919 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MOUNT_ORIENTATION) != NULL);
9920#endif
9921}
9922
9923static void mavlink_test_logging_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9924{
9925#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9926 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9927 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOGGING_DATA >= 256) {
9928 return;
9929 }
9930#endif
9931 mavlink_message_t msg;
9932 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9933 uint16_t i;
9934 mavlink_logging_data_t packet_in = {
9935 17235,139,206,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, 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 }
9936 };
9937 mavlink_logging_data_t packet1, packet2;
9938 memset(&packet1, 0, sizeof(packet1));
9939 packet1.sequence = packet_in.sequence;
9940 packet1.target_system = packet_in.target_system;
9941 packet1.target_component = packet_in.target_component;
9942 packet1.length = packet_in.length;
9943 packet1.first_message_offset = packet_in.first_message_offset;
9944
9945 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*249);
9946
9947#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9948 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9949 // cope with extensions
9950 memset(MAVLINK_MSG_ID_LOGGING_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOGGING_DATA_MIN_LEN);
9951 }
9952#endif
9953 memset(&packet2, 0, sizeof(packet2));
9954 mavlink_msg_logging_data_encode(system_id, component_id, &msg, &packet1);
9955 mavlink_msg_logging_data_decode(&msg, &packet2);
9956 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9957
9958 memset(&packet2, 0, sizeof(packet2));
9959 mavlink_msg_logging_data_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.sequence , packet1.length , packet1.first_message_offset , packet1.data );
9960 mavlink_msg_logging_data_decode(&msg, &packet2);
9961 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9962
9963 memset(&packet2, 0, sizeof(packet2));
9964 mavlink_msg_logging_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.sequence , packet1.length , packet1.first_message_offset , packet1.data );
9965 mavlink_msg_logging_data_decode(&msg, &packet2);
9966 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9967
9968 memset(&packet2, 0, sizeof(packet2));
9969 mavlink_msg_to_send_buffer(buffer, &msg);
9970 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9971 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9972 }
9973 mavlink_msg_logging_data_decode(last_msg, &packet2);
9974 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9975
9976 memset(&packet2, 0, sizeof(packet2));
9977 mavlink_msg_logging_data_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.sequence , packet1.length , packet1.first_message_offset , packet1.data );
9978 mavlink_msg_logging_data_decode(last_msg, &packet2);
9979 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9980
9981#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9982 MAVLINK_ASSERT(mavlink_get_message_info_by_name("LOGGING_DATA") != NULL);
9983 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOGGING_DATA) != NULL);
9984#endif
9985}
9986
9987static void mavlink_test_logging_data_acked(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9988{
9989#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9990 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9991 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOGGING_DATA_ACKED >= 256) {
9992 return;
9993 }
9994#endif
9995 mavlink_message_t msg;
9996 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9997 uint16_t i;
9998 mavlink_logging_data_acked_t packet_in = {
9999 17235,139,206,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, 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 }
10000 };
10001 mavlink_logging_data_acked_t packet1, packet2;
10002 memset(&packet1, 0, sizeof(packet1));
10003 packet1.sequence = packet_in.sequence;
10004 packet1.target_system = packet_in.target_system;
10005 packet1.target_component = packet_in.target_component;
10006 packet1.length = packet_in.length;
10007 packet1.first_message_offset = packet_in.first_message_offset;
10008
10009 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*249);
10010
10011#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10012 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10013 // cope with extensions
10014 memset(MAVLINK_MSG_ID_LOGGING_DATA_ACKED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOGGING_DATA_ACKED_MIN_LEN);
10015 }
10016#endif
10017 memset(&packet2, 0, sizeof(packet2));
10018 mavlink_msg_logging_data_acked_encode(system_id, component_id, &msg, &packet1);
10019 mavlink_msg_logging_data_acked_decode(&msg, &packet2);
10020 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10021
10022 memset(&packet2, 0, sizeof(packet2));
10023 mavlink_msg_logging_data_acked_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.sequence , packet1.length , packet1.first_message_offset , packet1.data );
10024 mavlink_msg_logging_data_acked_decode(&msg, &packet2);
10025 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10026
10027 memset(&packet2, 0, sizeof(packet2));
10028 mavlink_msg_logging_data_acked_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.sequence , packet1.length , packet1.first_message_offset , packet1.data );
10029 mavlink_msg_logging_data_acked_decode(&msg, &packet2);
10030 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10031
10032 memset(&packet2, 0, sizeof(packet2));
10033 mavlink_msg_to_send_buffer(buffer, &msg);
10034 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10035 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10036 }
10037 mavlink_msg_logging_data_acked_decode(last_msg, &packet2);
10038 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10039
10040 memset(&packet2, 0, sizeof(packet2));
10041 mavlink_msg_logging_data_acked_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.sequence , packet1.length , packet1.first_message_offset , packet1.data );
10042 mavlink_msg_logging_data_acked_decode(last_msg, &packet2);
10043 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10044
10045#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10046 MAVLINK_ASSERT(mavlink_get_message_info_by_name("LOGGING_DATA_ACKED") != NULL);
10047 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOGGING_DATA_ACKED) != NULL);
10048#endif
10049}
10050
10051static void mavlink_test_logging_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10052{
10053#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10054 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10055 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOGGING_ACK >= 256) {
10056 return;
10057 }
10058#endif
10059 mavlink_message_t msg;
10060 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10061 uint16_t i;
10062 mavlink_logging_ack_t packet_in = {
10063 17235,139,206
10064 };
10065 mavlink_logging_ack_t packet1, packet2;
10066 memset(&packet1, 0, sizeof(packet1));
10067 packet1.sequence = packet_in.sequence;
10068 packet1.target_system = packet_in.target_system;
10069 packet1.target_component = packet_in.target_component;
10070
10071
10072#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10073 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10074 // cope with extensions
10075 memset(MAVLINK_MSG_ID_LOGGING_ACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOGGING_ACK_MIN_LEN);
10076 }
10077#endif
10078 memset(&packet2, 0, sizeof(packet2));
10079 mavlink_msg_logging_ack_encode(system_id, component_id, &msg, &packet1);
10080 mavlink_msg_logging_ack_decode(&msg, &packet2);
10081 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10082
10083 memset(&packet2, 0, sizeof(packet2));
10084 mavlink_msg_logging_ack_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.sequence );
10085 mavlink_msg_logging_ack_decode(&msg, &packet2);
10086 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10087
10088 memset(&packet2, 0, sizeof(packet2));
10089 mavlink_msg_logging_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.sequence );
10090 mavlink_msg_logging_ack_decode(&msg, &packet2);
10091 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10092
10093 memset(&packet2, 0, sizeof(packet2));
10094 mavlink_msg_to_send_buffer(buffer, &msg);
10095 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10096 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10097 }
10098 mavlink_msg_logging_ack_decode(last_msg, &packet2);
10099 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10100
10101 memset(&packet2, 0, sizeof(packet2));
10102 mavlink_msg_logging_ack_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.sequence );
10103 mavlink_msg_logging_ack_decode(last_msg, &packet2);
10104 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10105
10106#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10107 MAVLINK_ASSERT(mavlink_get_message_info_by_name("LOGGING_ACK") != NULL);
10108 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOGGING_ACK) != NULL);
10109#endif
10110}
10111
10112static void mavlink_test_video_stream_information(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10113{
10114#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10115 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10116 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION >= 256) {
10117 return;
10118 }
10119#endif
10120 mavlink_message_t msg;
10121 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10122 uint16_t i;
10123 mavlink_video_stream_information_t packet_in = {
10124 17.0,963497672,17651,17755,17859,17963,18067,187,254,65,"VWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ","BCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCD",196,7
10125 };
10126 mavlink_video_stream_information_t packet1, packet2;
10127 memset(&packet1, 0, sizeof(packet1));
10128 packet1.framerate = packet_in.framerate;
10129 packet1.bitrate = packet_in.bitrate;
10130 packet1.flags = packet_in.flags;
10131 packet1.resolution_h = packet_in.resolution_h;
10132 packet1.resolution_v = packet_in.resolution_v;
10133 packet1.rotation = packet_in.rotation;
10134 packet1.hfov = packet_in.hfov;
10135 packet1.stream_id = packet_in.stream_id;
10136 packet1.count = packet_in.count;
10137 packet1.type = packet_in.type;
10138 packet1.encoding = packet_in.encoding;
10139 packet1.camera_device_id = packet_in.camera_device_id;
10140
10141 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*32);
10142 mav_array_memcpy(packet1.uri, packet_in.uri, sizeof(char)*160);
10143
10144#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10145 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10146 // cope with extensions
10147 memset(MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_MIN_LEN);
10148 }
10149#endif
10150 memset(&packet2, 0, sizeof(packet2));
10151 mavlink_msg_video_stream_information_encode(system_id, component_id, &msg, &packet1);
10152 mavlink_msg_video_stream_information_decode(&msg, &packet2);
10153 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10154
10155 memset(&packet2, 0, sizeof(packet2));
10156 mavlink_msg_video_stream_information_pack(system_id, component_id, &msg , packet1.stream_id , packet1.count , packet1.type , packet1.flags , packet1.framerate , packet1.resolution_h , packet1.resolution_v , packet1.bitrate , packet1.rotation , packet1.hfov , packet1.name , packet1.uri , packet1.encoding , packet1.camera_device_id );
10157 mavlink_msg_video_stream_information_decode(&msg, &packet2);
10158 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10159
10160 memset(&packet2, 0, sizeof(packet2));
10161 mavlink_msg_video_stream_information_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.stream_id , packet1.count , packet1.type , packet1.flags , packet1.framerate , packet1.resolution_h , packet1.resolution_v , packet1.bitrate , packet1.rotation , packet1.hfov , packet1.name , packet1.uri , packet1.encoding , packet1.camera_device_id );
10162 mavlink_msg_video_stream_information_decode(&msg, &packet2);
10163 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10164
10165 memset(&packet2, 0, sizeof(packet2));
10166 mavlink_msg_to_send_buffer(buffer, &msg);
10167 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10168 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10169 }
10170 mavlink_msg_video_stream_information_decode(last_msg, &packet2);
10171 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10172
10173 memset(&packet2, 0, sizeof(packet2));
10174 mavlink_msg_video_stream_information_send(MAVLINK_COMM_1 , packet1.stream_id , packet1.count , packet1.type , packet1.flags , packet1.framerate , packet1.resolution_h , packet1.resolution_v , packet1.bitrate , packet1.rotation , packet1.hfov , packet1.name , packet1.uri , packet1.encoding , packet1.camera_device_id );
10175 mavlink_msg_video_stream_information_decode(last_msg, &packet2);
10176 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10177
10178#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10179 MAVLINK_ASSERT(mavlink_get_message_info_by_name("VIDEO_STREAM_INFORMATION") != NULL);
10180 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION) != NULL);
10181#endif
10182}
10183
10184static void mavlink_test_video_stream_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10185{
10186#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10187 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10188 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VIDEO_STREAM_STATUS >= 256) {
10189 return;
10190 }
10191#endif
10192 mavlink_message_t msg;
10193 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10194 uint16_t i;
10195 mavlink_video_stream_status_t packet_in = {
10196 17.0,963497672,17651,17755,17859,17963,18067,187,254
10197 };
10198 mavlink_video_stream_status_t packet1, packet2;
10199 memset(&packet1, 0, sizeof(packet1));
10200 packet1.framerate = packet_in.framerate;
10201 packet1.bitrate = packet_in.bitrate;
10202 packet1.flags = packet_in.flags;
10203 packet1.resolution_h = packet_in.resolution_h;
10204 packet1.resolution_v = packet_in.resolution_v;
10205 packet1.rotation = packet_in.rotation;
10206 packet1.hfov = packet_in.hfov;
10207 packet1.stream_id = packet_in.stream_id;
10208 packet1.camera_device_id = packet_in.camera_device_id;
10209
10210
10211#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10212 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10213 // cope with extensions
10214 memset(MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_MIN_LEN);
10215 }
10216#endif
10217 memset(&packet2, 0, sizeof(packet2));
10218 mavlink_msg_video_stream_status_encode(system_id, component_id, &msg, &packet1);
10219 mavlink_msg_video_stream_status_decode(&msg, &packet2);
10220 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10221
10222 memset(&packet2, 0, sizeof(packet2));
10223 mavlink_msg_video_stream_status_pack(system_id, component_id, &msg , packet1.stream_id , packet1.flags , packet1.framerate , packet1.resolution_h , packet1.resolution_v , packet1.bitrate , packet1.rotation , packet1.hfov , packet1.camera_device_id );
10224 mavlink_msg_video_stream_status_decode(&msg, &packet2);
10225 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10226
10227 memset(&packet2, 0, sizeof(packet2));
10228 mavlink_msg_video_stream_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.stream_id , packet1.flags , packet1.framerate , packet1.resolution_h , packet1.resolution_v , packet1.bitrate , packet1.rotation , packet1.hfov , packet1.camera_device_id );
10229 mavlink_msg_video_stream_status_decode(&msg, &packet2);
10230 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10231
10232 memset(&packet2, 0, sizeof(packet2));
10233 mavlink_msg_to_send_buffer(buffer, &msg);
10234 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10235 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10236 }
10237 mavlink_msg_video_stream_status_decode(last_msg, &packet2);
10238 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10239
10240 memset(&packet2, 0, sizeof(packet2));
10241 mavlink_msg_video_stream_status_send(MAVLINK_COMM_1 , packet1.stream_id , packet1.flags , packet1.framerate , packet1.resolution_h , packet1.resolution_v , packet1.bitrate , packet1.rotation , packet1.hfov , packet1.camera_device_id );
10242 mavlink_msg_video_stream_status_decode(last_msg, &packet2);
10243 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10244
10245#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10246 MAVLINK_ASSERT(mavlink_get_message_info_by_name("VIDEO_STREAM_STATUS") != NULL);
10247 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_VIDEO_STREAM_STATUS) != NULL);
10248#endif
10249}
10250
10251static void mavlink_test_camera_fov_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10252{
10253#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10254 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10255 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_FOV_STATUS >= 256) {
10256 return;
10257 }
10258#endif
10259 mavlink_message_t msg;
10260 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10261 uint16_t i;
10262 mavlink_camera_fov_status_t packet_in = {
10263 963497464,963497672,963497880,963498088,963498296,963498504,963498712,{ 213.0, 214.0, 215.0, 216.0 },325.0,353.0,161
10264 };
10265 mavlink_camera_fov_status_t packet1, packet2;
10266 memset(&packet1, 0, sizeof(packet1));
10267 packet1.time_boot_ms = packet_in.time_boot_ms;
10268 packet1.lat_camera = packet_in.lat_camera;
10269 packet1.lon_camera = packet_in.lon_camera;
10270 packet1.alt_camera = packet_in.alt_camera;
10271 packet1.lat_image = packet_in.lat_image;
10272 packet1.lon_image = packet_in.lon_image;
10273 packet1.alt_image = packet_in.alt_image;
10274 packet1.hfov = packet_in.hfov;
10275 packet1.vfov = packet_in.vfov;
10276 packet1.camera_device_id = packet_in.camera_device_id;
10277
10278 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
10279
10280#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10281 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10282 // cope with extensions
10283 memset(MAVLINK_MSG_ID_CAMERA_FOV_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_FOV_STATUS_MIN_LEN);
10284 }
10285#endif
10286 memset(&packet2, 0, sizeof(packet2));
10287 mavlink_msg_camera_fov_status_encode(system_id, component_id, &msg, &packet1);
10288 mavlink_msg_camera_fov_status_decode(&msg, &packet2);
10289 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10290
10291 memset(&packet2, 0, sizeof(packet2));
10292 mavlink_msg_camera_fov_status_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.lat_camera , packet1.lon_camera , packet1.alt_camera , packet1.lat_image , packet1.lon_image , packet1.alt_image , packet1.q , packet1.hfov , packet1.vfov , packet1.camera_device_id );
10293 mavlink_msg_camera_fov_status_decode(&msg, &packet2);
10294 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10295
10296 memset(&packet2, 0, sizeof(packet2));
10297 mavlink_msg_camera_fov_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.lat_camera , packet1.lon_camera , packet1.alt_camera , packet1.lat_image , packet1.lon_image , packet1.alt_image , packet1.q , packet1.hfov , packet1.vfov , packet1.camera_device_id );
10298 mavlink_msg_camera_fov_status_decode(&msg, &packet2);
10299 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10300
10301 memset(&packet2, 0, sizeof(packet2));
10302 mavlink_msg_to_send_buffer(buffer, &msg);
10303 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10304 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10305 }
10306 mavlink_msg_camera_fov_status_decode(last_msg, &packet2);
10307 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10308
10309 memset(&packet2, 0, sizeof(packet2));
10310 mavlink_msg_camera_fov_status_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.lat_camera , packet1.lon_camera , packet1.alt_camera , packet1.lat_image , packet1.lon_image , packet1.alt_image , packet1.q , packet1.hfov , packet1.vfov , packet1.camera_device_id );
10311 mavlink_msg_camera_fov_status_decode(last_msg, &packet2);
10312 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10313
10314#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10315 MAVLINK_ASSERT(mavlink_get_message_info_by_name("CAMERA_FOV_STATUS") != NULL);
10316 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CAMERA_FOV_STATUS) != NULL);
10317#endif
10318}
10319
10320static void mavlink_test_camera_tracking_image_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10321{
10322#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10323 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10324 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS >= 256) {
10325 return;
10326 }
10327#endif
10328 mavlink_message_t msg;
10329 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10330 uint16_t i;
10331 mavlink_camera_tracking_image_status_t packet_in = {
10332 17.0,45.0,73.0,101.0,129.0,157.0,185.0,89,156,223,34
10333 };
10334 mavlink_camera_tracking_image_status_t packet1, packet2;
10335 memset(&packet1, 0, sizeof(packet1));
10336 packet1.point_x = packet_in.point_x;
10337 packet1.point_y = packet_in.point_y;
10338 packet1.radius = packet_in.radius;
10339 packet1.rec_top_x = packet_in.rec_top_x;
10340 packet1.rec_top_y = packet_in.rec_top_y;
10341 packet1.rec_bottom_x = packet_in.rec_bottom_x;
10342 packet1.rec_bottom_y = packet_in.rec_bottom_y;
10343 packet1.tracking_status = packet_in.tracking_status;
10344 packet1.tracking_mode = packet_in.tracking_mode;
10345 packet1.target_data = packet_in.target_data;
10346 packet1.camera_device_id = packet_in.camera_device_id;
10347
10348
10349#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10350 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10351 // cope with extensions
10352 memset(MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_MIN_LEN);
10353 }
10354#endif
10355 memset(&packet2, 0, sizeof(packet2));
10356 mavlink_msg_camera_tracking_image_status_encode(system_id, component_id, &msg, &packet1);
10357 mavlink_msg_camera_tracking_image_status_decode(&msg, &packet2);
10358 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10359
10360 memset(&packet2, 0, sizeof(packet2));
10361 mavlink_msg_camera_tracking_image_status_pack(system_id, component_id, &msg , packet1.tracking_status , packet1.tracking_mode , packet1.target_data , packet1.point_x , packet1.point_y , packet1.radius , packet1.rec_top_x , packet1.rec_top_y , packet1.rec_bottom_x , packet1.rec_bottom_y , packet1.camera_device_id );
10362 mavlink_msg_camera_tracking_image_status_decode(&msg, &packet2);
10363 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10364
10365 memset(&packet2, 0, sizeof(packet2));
10366 mavlink_msg_camera_tracking_image_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.tracking_status , packet1.tracking_mode , packet1.target_data , packet1.point_x , packet1.point_y , packet1.radius , packet1.rec_top_x , packet1.rec_top_y , packet1.rec_bottom_x , packet1.rec_bottom_y , packet1.camera_device_id );
10367 mavlink_msg_camera_tracking_image_status_decode(&msg, &packet2);
10368 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10369
10370 memset(&packet2, 0, sizeof(packet2));
10371 mavlink_msg_to_send_buffer(buffer, &msg);
10372 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10373 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10374 }
10375 mavlink_msg_camera_tracking_image_status_decode(last_msg, &packet2);
10376 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10377
10378 memset(&packet2, 0, sizeof(packet2));
10379 mavlink_msg_camera_tracking_image_status_send(MAVLINK_COMM_1 , packet1.tracking_status , packet1.tracking_mode , packet1.target_data , packet1.point_x , packet1.point_y , packet1.radius , packet1.rec_top_x , packet1.rec_top_y , packet1.rec_bottom_x , packet1.rec_bottom_y , packet1.camera_device_id );
10380 mavlink_msg_camera_tracking_image_status_decode(last_msg, &packet2);
10381 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10382
10383#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10384 MAVLINK_ASSERT(mavlink_get_message_info_by_name("CAMERA_TRACKING_IMAGE_STATUS") != NULL);
10385 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS) != NULL);
10386#endif
10387}
10388
10389static void mavlink_test_camera_tracking_geo_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10390{
10391#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10392 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10393 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_TRACKING_GEO_STATUS >= 256) {
10394 return;
10395 }
10396#endif
10397 mavlink_message_t msg;
10398 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10399 uint16_t i;
10400 mavlink_camera_tracking_geo_status_t packet_in = {
10401 963497464,963497672,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,149,216
10402 };
10403 mavlink_camera_tracking_geo_status_t packet1, packet2;
10404 memset(&packet1, 0, sizeof(packet1));
10405 packet1.lat = packet_in.lat;
10406 packet1.lon = packet_in.lon;
10407 packet1.alt = packet_in.alt;
10408 packet1.h_acc = packet_in.h_acc;
10409 packet1.v_acc = packet_in.v_acc;
10410 packet1.vel_n = packet_in.vel_n;
10411 packet1.vel_e = packet_in.vel_e;
10412 packet1.vel_d = packet_in.vel_d;
10413 packet1.vel_acc = packet_in.vel_acc;
10414 packet1.dist = packet_in.dist;
10415 packet1.hdg = packet_in.hdg;
10416 packet1.hdg_acc = packet_in.hdg_acc;
10417 packet1.tracking_status = packet_in.tracking_status;
10418 packet1.camera_device_id = packet_in.camera_device_id;
10419
10420
10421#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10422 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10423 // cope with extensions
10424 memset(MAVLINK_MSG_ID_CAMERA_TRACKING_GEO_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_TRACKING_GEO_STATUS_MIN_LEN);
10425 }
10426#endif
10427 memset(&packet2, 0, sizeof(packet2));
10428 mavlink_msg_camera_tracking_geo_status_encode(system_id, component_id, &msg, &packet1);
10429 mavlink_msg_camera_tracking_geo_status_decode(&msg, &packet2);
10430 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10431
10432 memset(&packet2, 0, sizeof(packet2));
10433 mavlink_msg_camera_tracking_geo_status_pack(system_id, component_id, &msg , packet1.tracking_status , packet1.lat , packet1.lon , packet1.alt , packet1.h_acc , packet1.v_acc , packet1.vel_n , packet1.vel_e , packet1.vel_d , packet1.vel_acc , packet1.dist , packet1.hdg , packet1.hdg_acc , packet1.camera_device_id );
10434 mavlink_msg_camera_tracking_geo_status_decode(&msg, &packet2);
10435 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10436
10437 memset(&packet2, 0, sizeof(packet2));
10438 mavlink_msg_camera_tracking_geo_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.tracking_status , packet1.lat , packet1.lon , packet1.alt , packet1.h_acc , packet1.v_acc , packet1.vel_n , packet1.vel_e , packet1.vel_d , packet1.vel_acc , packet1.dist , packet1.hdg , packet1.hdg_acc , packet1.camera_device_id );
10439 mavlink_msg_camera_tracking_geo_status_decode(&msg, &packet2);
10440 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10441
10442 memset(&packet2, 0, sizeof(packet2));
10443 mavlink_msg_to_send_buffer(buffer, &msg);
10444 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10445 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10446 }
10447 mavlink_msg_camera_tracking_geo_status_decode(last_msg, &packet2);
10448 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10449
10450 memset(&packet2, 0, sizeof(packet2));
10451 mavlink_msg_camera_tracking_geo_status_send(MAVLINK_COMM_1 , packet1.tracking_status , packet1.lat , packet1.lon , packet1.alt , packet1.h_acc , packet1.v_acc , packet1.vel_n , packet1.vel_e , packet1.vel_d , packet1.vel_acc , packet1.dist , packet1.hdg , packet1.hdg_acc , packet1.camera_device_id );
10452 mavlink_msg_camera_tracking_geo_status_decode(last_msg, &packet2);
10453 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10454
10455#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10456 MAVLINK_ASSERT(mavlink_get_message_info_by_name("CAMERA_TRACKING_GEO_STATUS") != NULL);
10457 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CAMERA_TRACKING_GEO_STATUS) != NULL);
10458#endif
10459}
10460
10461static void mavlink_test_camera_thermal_range(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10462{
10463#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10464 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10465 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_THERMAL_RANGE >= 256) {
10466 return;
10467 }
10468#endif
10469 mavlink_message_t msg;
10470 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10471 uint16_t i;
10472 mavlink_camera_thermal_range_t packet_in = {
10473 963497464,45.0,73.0,101.0,129.0,157.0,185.0,89,156
10474 };
10475 mavlink_camera_thermal_range_t packet1, packet2;
10476 memset(&packet1, 0, sizeof(packet1));
10477 packet1.time_boot_ms = packet_in.time_boot_ms;
10478 packet1.max = packet_in.max;
10479 packet1.max_point_x = packet_in.max_point_x;
10480 packet1.max_point_y = packet_in.max_point_y;
10481 packet1.min = packet_in.min;
10482 packet1.min_point_x = packet_in.min_point_x;
10483 packet1.min_point_y = packet_in.min_point_y;
10484 packet1.stream_id = packet_in.stream_id;
10485 packet1.camera_device_id = packet_in.camera_device_id;
10486
10487
10488#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10489 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10490 // cope with extensions
10491 memset(MAVLINK_MSG_ID_CAMERA_THERMAL_RANGE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_THERMAL_RANGE_MIN_LEN);
10492 }
10493#endif
10494 memset(&packet2, 0, sizeof(packet2));
10495 mavlink_msg_camera_thermal_range_encode(system_id, component_id, &msg, &packet1);
10496 mavlink_msg_camera_thermal_range_decode(&msg, &packet2);
10497 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10498
10499 memset(&packet2, 0, sizeof(packet2));
10500 mavlink_msg_camera_thermal_range_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.stream_id , packet1.camera_device_id , packet1.max , packet1.max_point_x , packet1.max_point_y , packet1.min , packet1.min_point_x , packet1.min_point_y );
10501 mavlink_msg_camera_thermal_range_decode(&msg, &packet2);
10502 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10503
10504 memset(&packet2, 0, sizeof(packet2));
10505 mavlink_msg_camera_thermal_range_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.stream_id , packet1.camera_device_id , packet1.max , packet1.max_point_x , packet1.max_point_y , packet1.min , packet1.min_point_x , packet1.min_point_y );
10506 mavlink_msg_camera_thermal_range_decode(&msg, &packet2);
10507 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10508
10509 memset(&packet2, 0, sizeof(packet2));
10510 mavlink_msg_to_send_buffer(buffer, &msg);
10511 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10512 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10513 }
10514 mavlink_msg_camera_thermal_range_decode(last_msg, &packet2);
10515 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10516
10517 memset(&packet2, 0, sizeof(packet2));
10518 mavlink_msg_camera_thermal_range_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.stream_id , packet1.camera_device_id , packet1.max , packet1.max_point_x , packet1.max_point_y , packet1.min , packet1.min_point_x , packet1.min_point_y );
10519 mavlink_msg_camera_thermal_range_decode(last_msg, &packet2);
10520 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10521
10522#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10523 MAVLINK_ASSERT(mavlink_get_message_info_by_name("CAMERA_THERMAL_RANGE") != NULL);
10524 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CAMERA_THERMAL_RANGE) != NULL);
10525#endif
10526}
10527
10528static void mavlink_test_gimbal_manager_information(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10529{
10530#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10531 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10532 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION >= 256) {
10533 return;
10534 }
10535#endif
10536 mavlink_message_t msg;
10537 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10538 uint16_t i;
10539 mavlink_gimbal_manager_information_t packet_in = {
10540 963497464,963497672,73.0,101.0,129.0,157.0,185.0,213.0,101
10541 };
10542 mavlink_gimbal_manager_information_t packet1, packet2;
10543 memset(&packet1, 0, sizeof(packet1));
10544 packet1.time_boot_ms = packet_in.time_boot_ms;
10545 packet1.cap_flags = packet_in.cap_flags;
10546 packet1.roll_min = packet_in.roll_min;
10547 packet1.roll_max = packet_in.roll_max;
10548 packet1.pitch_min = packet_in.pitch_min;
10549 packet1.pitch_max = packet_in.pitch_max;
10550 packet1.yaw_min = packet_in.yaw_min;
10551 packet1.yaw_max = packet_in.yaw_max;
10552 packet1.gimbal_device_id = packet_in.gimbal_device_id;
10553
10554
10555#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10556 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10557 // cope with extensions
10558 memset(MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_MIN_LEN);
10559 }
10560#endif
10561 memset(&packet2, 0, sizeof(packet2));
10562 mavlink_msg_gimbal_manager_information_encode(system_id, component_id, &msg, &packet1);
10563 mavlink_msg_gimbal_manager_information_decode(&msg, &packet2);
10564 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10565
10566 memset(&packet2, 0, sizeof(packet2));
10567 mavlink_msg_gimbal_manager_information_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.cap_flags , packet1.gimbal_device_id , packet1.roll_min , packet1.roll_max , packet1.pitch_min , packet1.pitch_max , packet1.yaw_min , packet1.yaw_max );
10568 mavlink_msg_gimbal_manager_information_decode(&msg, &packet2);
10569 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10570
10571 memset(&packet2, 0, sizeof(packet2));
10572 mavlink_msg_gimbal_manager_information_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.cap_flags , packet1.gimbal_device_id , packet1.roll_min , packet1.roll_max , packet1.pitch_min , packet1.pitch_max , packet1.yaw_min , packet1.yaw_max );
10573 mavlink_msg_gimbal_manager_information_decode(&msg, &packet2);
10574 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10575
10576 memset(&packet2, 0, sizeof(packet2));
10577 mavlink_msg_to_send_buffer(buffer, &msg);
10578 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10579 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10580 }
10581 mavlink_msg_gimbal_manager_information_decode(last_msg, &packet2);
10582 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10583
10584 memset(&packet2, 0, sizeof(packet2));
10585 mavlink_msg_gimbal_manager_information_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.cap_flags , packet1.gimbal_device_id , packet1.roll_min , packet1.roll_max , packet1.pitch_min , packet1.pitch_max , packet1.yaw_min , packet1.yaw_max );
10586 mavlink_msg_gimbal_manager_information_decode(last_msg, &packet2);
10587 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10588
10589#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10590 MAVLINK_ASSERT(mavlink_get_message_info_by_name("GIMBAL_MANAGER_INFORMATION") != NULL);
10591 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION) != NULL);
10592#endif
10593}
10594
10595static void mavlink_test_gimbal_manager_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10596{
10597#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10598 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10599 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_MANAGER_STATUS >= 256) {
10600 return;
10601 }
10602#endif
10603 mavlink_message_t msg;
10604 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10605 uint16_t i;
10606 mavlink_gimbal_manager_status_t packet_in = {
10607 963497464,963497672,29,96,163,230,41
10608 };
10609 mavlink_gimbal_manager_status_t packet1, packet2;
10610 memset(&packet1, 0, sizeof(packet1));
10611 packet1.time_boot_ms = packet_in.time_boot_ms;
10612 packet1.flags = packet_in.flags;
10613 packet1.gimbal_device_id = packet_in.gimbal_device_id;
10614 packet1.primary_control_sysid = packet_in.primary_control_sysid;
10615 packet1.primary_control_compid = packet_in.primary_control_compid;
10616 packet1.secondary_control_sysid = packet_in.secondary_control_sysid;
10617 packet1.secondary_control_compid = packet_in.secondary_control_compid;
10618
10619
10620#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10621 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10622 // cope with extensions
10623 memset(MAVLINK_MSG_ID_GIMBAL_MANAGER_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_MANAGER_STATUS_MIN_LEN);
10624 }
10625#endif
10626 memset(&packet2, 0, sizeof(packet2));
10627 mavlink_msg_gimbal_manager_status_encode(system_id, component_id, &msg, &packet1);
10628 mavlink_msg_gimbal_manager_status_decode(&msg, &packet2);
10629 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10630
10631 memset(&packet2, 0, sizeof(packet2));
10632 mavlink_msg_gimbal_manager_status_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.flags , packet1.gimbal_device_id , packet1.primary_control_sysid , packet1.primary_control_compid , packet1.secondary_control_sysid , packet1.secondary_control_compid );
10633 mavlink_msg_gimbal_manager_status_decode(&msg, &packet2);
10634 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10635
10636 memset(&packet2, 0, sizeof(packet2));
10637 mavlink_msg_gimbal_manager_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.flags , packet1.gimbal_device_id , packet1.primary_control_sysid , packet1.primary_control_compid , packet1.secondary_control_sysid , packet1.secondary_control_compid );
10638 mavlink_msg_gimbal_manager_status_decode(&msg, &packet2);
10639 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10640
10641 memset(&packet2, 0, sizeof(packet2));
10642 mavlink_msg_to_send_buffer(buffer, &msg);
10643 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10644 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10645 }
10646 mavlink_msg_gimbal_manager_status_decode(last_msg, &packet2);
10647 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10648
10649 memset(&packet2, 0, sizeof(packet2));
10650 mavlink_msg_gimbal_manager_status_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.flags , packet1.gimbal_device_id , packet1.primary_control_sysid , packet1.primary_control_compid , packet1.secondary_control_sysid , packet1.secondary_control_compid );
10651 mavlink_msg_gimbal_manager_status_decode(last_msg, &packet2);
10652 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10653
10654#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10655 MAVLINK_ASSERT(mavlink_get_message_info_by_name("GIMBAL_MANAGER_STATUS") != NULL);
10656 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GIMBAL_MANAGER_STATUS) != NULL);
10657#endif
10658}
10659
10660static void mavlink_test_gimbal_manager_set_attitude(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10661{
10662#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10663 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10664 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_ATTITUDE >= 256) {
10665 return;
10666 }
10667#endif
10668 mavlink_message_t msg;
10669 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10670 uint16_t i;
10671 mavlink_gimbal_manager_set_attitude_t packet_in = {
10672 963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,101,168,235
10673 };
10674 mavlink_gimbal_manager_set_attitude_t packet1, packet2;
10675 memset(&packet1, 0, sizeof(packet1));
10676 packet1.flags = packet_in.flags;
10677 packet1.angular_velocity_x = packet_in.angular_velocity_x;
10678 packet1.angular_velocity_y = packet_in.angular_velocity_y;
10679 packet1.angular_velocity_z = packet_in.angular_velocity_z;
10680 packet1.target_system = packet_in.target_system;
10681 packet1.target_component = packet_in.target_component;
10682 packet1.gimbal_device_id = packet_in.gimbal_device_id;
10683
10684 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
10685
10686#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10687 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10688 // cope with extensions
10689 memset(MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_ATTITUDE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_ATTITUDE_MIN_LEN);
10690 }
10691#endif
10692 memset(&packet2, 0, sizeof(packet2));
10693 mavlink_msg_gimbal_manager_set_attitude_encode(system_id, component_id, &msg, &packet1);
10694 mavlink_msg_gimbal_manager_set_attitude_decode(&msg, &packet2);
10695 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10696
10697 memset(&packet2, 0, sizeof(packet2));
10698 mavlink_msg_gimbal_manager_set_attitude_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.flags , packet1.gimbal_device_id , packet1.q , packet1.angular_velocity_x , packet1.angular_velocity_y , packet1.angular_velocity_z );
10699 mavlink_msg_gimbal_manager_set_attitude_decode(&msg, &packet2);
10700 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10701
10702 memset(&packet2, 0, sizeof(packet2));
10703 mavlink_msg_gimbal_manager_set_attitude_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.flags , packet1.gimbal_device_id , packet1.q , packet1.angular_velocity_x , packet1.angular_velocity_y , packet1.angular_velocity_z );
10704 mavlink_msg_gimbal_manager_set_attitude_decode(&msg, &packet2);
10705 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10706
10707 memset(&packet2, 0, sizeof(packet2));
10708 mavlink_msg_to_send_buffer(buffer, &msg);
10709 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10710 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10711 }
10712 mavlink_msg_gimbal_manager_set_attitude_decode(last_msg, &packet2);
10713 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10714
10715 memset(&packet2, 0, sizeof(packet2));
10716 mavlink_msg_gimbal_manager_set_attitude_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.flags , packet1.gimbal_device_id , packet1.q , packet1.angular_velocity_x , packet1.angular_velocity_y , packet1.angular_velocity_z );
10717 mavlink_msg_gimbal_manager_set_attitude_decode(last_msg, &packet2);
10718 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10719
10720#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10721 MAVLINK_ASSERT(mavlink_get_message_info_by_name("GIMBAL_MANAGER_SET_ATTITUDE") != NULL);
10722 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_ATTITUDE) != NULL);
10723#endif
10724}
10725
10726static void mavlink_test_gimbal_device_information(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10727{
10728#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10729 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10730 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION >= 256) {
10731 return;
10732 }
10733#endif
10734 mavlink_message_t msg;
10735 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10736 uint16_t i;
10737 mavlink_gimbal_device_information_t packet_in = {
10738 93372036854775807ULL,963497880,963498088,963498296,157.0,185.0,213.0,241.0,269.0,297.0,19523,19627,"WXYZABCDEFGHIJKLMNOPQRSTUVWXYZA","CDEFGHIJKLMNOPQRSTUVWXYZABCDEFG","IJKLMNOPQRSTUVWXYZABCDEFGHIJKLM",181,963505004
10739 };
10740 mavlink_gimbal_device_information_t packet1, packet2;
10741 memset(&packet1, 0, sizeof(packet1));
10742 packet1.uid = packet_in.uid;
10743 packet1.time_boot_ms = packet_in.time_boot_ms;
10744 packet1.firmware_version = packet_in.firmware_version;
10745 packet1.hardware_version = packet_in.hardware_version;
10746 packet1.roll_min = packet_in.roll_min;
10747 packet1.roll_max = packet_in.roll_max;
10748 packet1.pitch_min = packet_in.pitch_min;
10749 packet1.pitch_max = packet_in.pitch_max;
10750 packet1.yaw_min = packet_in.yaw_min;
10751 packet1.yaw_max = packet_in.yaw_max;
10752 packet1.cap_flags = packet_in.cap_flags;
10753 packet1.custom_cap_flags = packet_in.custom_cap_flags;
10754 packet1.gimbal_device_id = packet_in.gimbal_device_id;
10755 packet1.cap_flags2 = packet_in.cap_flags2;
10756
10757 mav_array_memcpy(packet1.vendor_name, packet_in.vendor_name, sizeof(char)*32);
10758 mav_array_memcpy(packet1.model_name, packet_in.model_name, sizeof(char)*32);
10759 mav_array_memcpy(packet1.custom_name, packet_in.custom_name, sizeof(char)*32);
10760
10761#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10762 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10763 // cope with extensions
10764 memset(MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN);
10765 }
10766#endif
10767 memset(&packet2, 0, sizeof(packet2));
10768 mavlink_msg_gimbal_device_information_encode(system_id, component_id, &msg, &packet1);
10769 mavlink_msg_gimbal_device_information_decode(&msg, &packet2);
10770 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10771
10772 memset(&packet2, 0, sizeof(packet2));
10773 mavlink_msg_gimbal_device_information_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.vendor_name , packet1.model_name , packet1.custom_name , packet1.firmware_version , packet1.hardware_version , packet1.uid , packet1.cap_flags , packet1.custom_cap_flags , packet1.roll_min , packet1.roll_max , packet1.pitch_min , packet1.pitch_max , packet1.yaw_min , packet1.yaw_max , packet1.gimbal_device_id , packet1.cap_flags2 );
10774 mavlink_msg_gimbal_device_information_decode(&msg, &packet2);
10775 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10776
10777 memset(&packet2, 0, sizeof(packet2));
10778 mavlink_msg_gimbal_device_information_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.vendor_name , packet1.model_name , packet1.custom_name , packet1.firmware_version , packet1.hardware_version , packet1.uid , packet1.cap_flags , packet1.custom_cap_flags , packet1.roll_min , packet1.roll_max , packet1.pitch_min , packet1.pitch_max , packet1.yaw_min , packet1.yaw_max , packet1.gimbal_device_id , packet1.cap_flags2 );
10779 mavlink_msg_gimbal_device_information_decode(&msg, &packet2);
10780 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10781
10782 memset(&packet2, 0, sizeof(packet2));
10783 mavlink_msg_to_send_buffer(buffer, &msg);
10784 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10785 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10786 }
10787 mavlink_msg_gimbal_device_information_decode(last_msg, &packet2);
10788 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10789
10790 memset(&packet2, 0, sizeof(packet2));
10791 mavlink_msg_gimbal_device_information_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.vendor_name , packet1.model_name , packet1.custom_name , packet1.firmware_version , packet1.hardware_version , packet1.uid , packet1.cap_flags , packet1.custom_cap_flags , packet1.roll_min , packet1.roll_max , packet1.pitch_min , packet1.pitch_max , packet1.yaw_min , packet1.yaw_max , packet1.gimbal_device_id , packet1.cap_flags2 );
10792 mavlink_msg_gimbal_device_information_decode(last_msg, &packet2);
10793 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10794
10795#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10796 MAVLINK_ASSERT(mavlink_get_message_info_by_name("GIMBAL_DEVICE_INFORMATION") != NULL);
10797 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION) != NULL);
10798#endif
10799}
10800
10801static void mavlink_test_gimbal_device_set_attitude(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10802{
10803#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10804 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10805 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE >= 256) {
10806 return;
10807 }
10808#endif
10809 mavlink_message_t msg;
10810 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10811 uint16_t i;
10812 mavlink_gimbal_device_set_attitude_t packet_in = {
10813 { 17.0, 18.0, 19.0, 20.0 },129.0,157.0,185.0,18691,223,34
10814 };
10815 mavlink_gimbal_device_set_attitude_t packet1, packet2;
10816 memset(&packet1, 0, sizeof(packet1));
10817 packet1.angular_velocity_x = packet_in.angular_velocity_x;
10818 packet1.angular_velocity_y = packet_in.angular_velocity_y;
10819 packet1.angular_velocity_z = packet_in.angular_velocity_z;
10820 packet1.flags = packet_in.flags;
10821 packet1.target_system = packet_in.target_system;
10822 packet1.target_component = packet_in.target_component;
10823
10824 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
10825
10826#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10827 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10828 // cope with extensions
10829 memset(MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_MIN_LEN);
10830 }
10831#endif
10832 memset(&packet2, 0, sizeof(packet2));
10833 mavlink_msg_gimbal_device_set_attitude_encode(system_id, component_id, &msg, &packet1);
10834 mavlink_msg_gimbal_device_set_attitude_decode(&msg, &packet2);
10835 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10836
10837 memset(&packet2, 0, sizeof(packet2));
10838 mavlink_msg_gimbal_device_set_attitude_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.flags , packet1.q , packet1.angular_velocity_x , packet1.angular_velocity_y , packet1.angular_velocity_z );
10839 mavlink_msg_gimbal_device_set_attitude_decode(&msg, &packet2);
10840 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10841
10842 memset(&packet2, 0, sizeof(packet2));
10843 mavlink_msg_gimbal_device_set_attitude_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.flags , packet1.q , packet1.angular_velocity_x , packet1.angular_velocity_y , packet1.angular_velocity_z );
10844 mavlink_msg_gimbal_device_set_attitude_decode(&msg, &packet2);
10845 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10846
10847 memset(&packet2, 0, sizeof(packet2));
10848 mavlink_msg_to_send_buffer(buffer, &msg);
10849 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10850 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10851 }
10852 mavlink_msg_gimbal_device_set_attitude_decode(last_msg, &packet2);
10853 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10854
10855 memset(&packet2, 0, sizeof(packet2));
10856 mavlink_msg_gimbal_device_set_attitude_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.flags , packet1.q , packet1.angular_velocity_x , packet1.angular_velocity_y , packet1.angular_velocity_z );
10857 mavlink_msg_gimbal_device_set_attitude_decode(last_msg, &packet2);
10858 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10859
10860#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10861 MAVLINK_ASSERT(mavlink_get_message_info_by_name("GIMBAL_DEVICE_SET_ATTITUDE") != NULL);
10862 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE) != NULL);
10863#endif
10864}
10865
10866static void mavlink_test_gimbal_device_attitude_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10867{
10868#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10869 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10870 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS >= 256) {
10871 return;
10872 }
10873#endif
10874 mavlink_message_t msg;
10875 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10876 uint16_t i;
10877 mavlink_gimbal_device_attitude_status_t packet_in = {
10878 963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,963499128,19107,247,58,297.0,325.0,149
10879 };
10880 mavlink_gimbal_device_attitude_status_t packet1, packet2;
10881 memset(&packet1, 0, sizeof(packet1));
10882 packet1.time_boot_ms = packet_in.time_boot_ms;
10883 packet1.angular_velocity_x = packet_in.angular_velocity_x;
10884 packet1.angular_velocity_y = packet_in.angular_velocity_y;
10885 packet1.angular_velocity_z = packet_in.angular_velocity_z;
10886 packet1.failure_flags = packet_in.failure_flags;
10887 packet1.flags = packet_in.flags;
10888 packet1.target_system = packet_in.target_system;
10889 packet1.target_component = packet_in.target_component;
10890 packet1.delta_yaw = packet_in.delta_yaw;
10891 packet1.delta_yaw_velocity = packet_in.delta_yaw_velocity;
10892 packet1.gimbal_device_id = packet_in.gimbal_device_id;
10893
10894 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
10895
10896#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10897 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10898 // cope with extensions
10899 memset(MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_MIN_LEN);
10900 }
10901#endif
10902 memset(&packet2, 0, sizeof(packet2));
10903 mavlink_msg_gimbal_device_attitude_status_encode(system_id, component_id, &msg, &packet1);
10904 mavlink_msg_gimbal_device_attitude_status_decode(&msg, &packet2);
10905 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10906
10907 memset(&packet2, 0, sizeof(packet2));
10908 mavlink_msg_gimbal_device_attitude_status_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.time_boot_ms , packet1.flags , packet1.q , packet1.angular_velocity_x , packet1.angular_velocity_y , packet1.angular_velocity_z , packet1.failure_flags , packet1.delta_yaw , packet1.delta_yaw_velocity , packet1.gimbal_device_id );
10909 mavlink_msg_gimbal_device_attitude_status_decode(&msg, &packet2);
10910 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10911
10912 memset(&packet2, 0, sizeof(packet2));
10913 mavlink_msg_gimbal_device_attitude_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.time_boot_ms , packet1.flags , packet1.q , packet1.angular_velocity_x , packet1.angular_velocity_y , packet1.angular_velocity_z , packet1.failure_flags , packet1.delta_yaw , packet1.delta_yaw_velocity , packet1.gimbal_device_id );
10914 mavlink_msg_gimbal_device_attitude_status_decode(&msg, &packet2);
10915 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10916
10917 memset(&packet2, 0, sizeof(packet2));
10918 mavlink_msg_to_send_buffer(buffer, &msg);
10919 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10920 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10921 }
10922 mavlink_msg_gimbal_device_attitude_status_decode(last_msg, &packet2);
10923 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10924
10925 memset(&packet2, 0, sizeof(packet2));
10926 mavlink_msg_gimbal_device_attitude_status_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.time_boot_ms , packet1.flags , packet1.q , packet1.angular_velocity_x , packet1.angular_velocity_y , packet1.angular_velocity_z , packet1.failure_flags , packet1.delta_yaw , packet1.delta_yaw_velocity , packet1.gimbal_device_id );
10927 mavlink_msg_gimbal_device_attitude_status_decode(last_msg, &packet2);
10928 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10929
10930#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10931 MAVLINK_ASSERT(mavlink_get_message_info_by_name("GIMBAL_DEVICE_ATTITUDE_STATUS") != NULL);
10932 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS) != NULL);
10933#endif
10934}
10935
10936static void mavlink_test_autopilot_state_for_gimbal_device(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10937{
10938#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10939 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10940 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE >= 256) {
10941 return;
10942 }
10943#endif
10944 mavlink_message_t msg;
10945 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10946 uint16_t i;
10947 mavlink_autopilot_state_for_gimbal_device_t packet_in = {
10948 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0 },963498712,213.0,241.0,269.0,963499544,325.0,19731,27,94,161,388.0
10949 };
10950 mavlink_autopilot_state_for_gimbal_device_t packet1, packet2;
10951 memset(&packet1, 0, sizeof(packet1));
10952 packet1.time_boot_us = packet_in.time_boot_us;
10953 packet1.q_estimated_delay_us = packet_in.q_estimated_delay_us;
10954 packet1.vx = packet_in.vx;
10955 packet1.vy = packet_in.vy;
10956 packet1.vz = packet_in.vz;
10957 packet1.v_estimated_delay_us = packet_in.v_estimated_delay_us;
10958 packet1.feed_forward_angular_velocity_z = packet_in.feed_forward_angular_velocity_z;
10959 packet1.estimator_status = packet_in.estimator_status;
10960 packet1.target_system = packet_in.target_system;
10961 packet1.target_component = packet_in.target_component;
10962 packet1.landed_state = packet_in.landed_state;
10963 packet1.angular_velocity_z = packet_in.angular_velocity_z;
10964
10965 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
10966
10967#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10968 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10969 // cope with extensions
10970 memset(MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_MIN_LEN);
10971 }
10972#endif
10973 memset(&packet2, 0, sizeof(packet2));
10974 mavlink_msg_autopilot_state_for_gimbal_device_encode(system_id, component_id, &msg, &packet1);
10975 mavlink_msg_autopilot_state_for_gimbal_device_decode(&msg, &packet2);
10976 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10977
10978 memset(&packet2, 0, sizeof(packet2));
10979 mavlink_msg_autopilot_state_for_gimbal_device_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.time_boot_us , packet1.q , packet1.q_estimated_delay_us , packet1.vx , packet1.vy , packet1.vz , packet1.v_estimated_delay_us , packet1.feed_forward_angular_velocity_z , packet1.estimator_status , packet1.landed_state , packet1.angular_velocity_z );
10980 mavlink_msg_autopilot_state_for_gimbal_device_decode(&msg, &packet2);
10981 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10982
10983 memset(&packet2, 0, sizeof(packet2));
10984 mavlink_msg_autopilot_state_for_gimbal_device_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.time_boot_us , packet1.q , packet1.q_estimated_delay_us , packet1.vx , packet1.vy , packet1.vz , packet1.v_estimated_delay_us , packet1.feed_forward_angular_velocity_z , packet1.estimator_status , packet1.landed_state , packet1.angular_velocity_z );
10985 mavlink_msg_autopilot_state_for_gimbal_device_decode(&msg, &packet2);
10986 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10987
10988 memset(&packet2, 0, sizeof(packet2));
10989 mavlink_msg_to_send_buffer(buffer, &msg);
10990 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10991 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10992 }
10993 mavlink_msg_autopilot_state_for_gimbal_device_decode(last_msg, &packet2);
10994 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10995
10996 memset(&packet2, 0, sizeof(packet2));
10997 mavlink_msg_autopilot_state_for_gimbal_device_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.time_boot_us , packet1.q , packet1.q_estimated_delay_us , packet1.vx , packet1.vy , packet1.vz , packet1.v_estimated_delay_us , packet1.feed_forward_angular_velocity_z , packet1.estimator_status , packet1.landed_state , packet1.angular_velocity_z );
10998 mavlink_msg_autopilot_state_for_gimbal_device_decode(last_msg, &packet2);
10999 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11000
11001#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11002 MAVLINK_ASSERT(mavlink_get_message_info_by_name("AUTOPILOT_STATE_FOR_GIMBAL_DEVICE") != NULL);
11003 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE) != NULL);
11004#endif
11005}
11006
11007static void mavlink_test_gimbal_manager_set_pitchyaw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11008{
11009#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11010 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11011 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_PITCHYAW >= 256) {
11012 return;
11013 }
11014#endif
11015 mavlink_message_t msg;
11016 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11017 uint16_t i;
11018 mavlink_gimbal_manager_set_pitchyaw_t packet_in = {
11019 963497464,45.0,73.0,101.0,129.0,65,132,199
11020 };
11021 mavlink_gimbal_manager_set_pitchyaw_t packet1, packet2;
11022 memset(&packet1, 0, sizeof(packet1));
11023 packet1.flags = packet_in.flags;
11024 packet1.pitch = packet_in.pitch;
11025 packet1.yaw = packet_in.yaw;
11026 packet1.pitch_rate = packet_in.pitch_rate;
11027 packet1.yaw_rate = packet_in.yaw_rate;
11028 packet1.target_system = packet_in.target_system;
11029 packet1.target_component = packet_in.target_component;
11030 packet1.gimbal_device_id = packet_in.gimbal_device_id;
11031
11032
11033#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11034 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11035 // cope with extensions
11036 memset(MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_PITCHYAW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_PITCHYAW_MIN_LEN);
11037 }
11038#endif
11039 memset(&packet2, 0, sizeof(packet2));
11040 mavlink_msg_gimbal_manager_set_pitchyaw_encode(system_id, component_id, &msg, &packet1);
11041 mavlink_msg_gimbal_manager_set_pitchyaw_decode(&msg, &packet2);
11042 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11043
11044 memset(&packet2, 0, sizeof(packet2));
11045 mavlink_msg_gimbal_manager_set_pitchyaw_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.flags , packet1.gimbal_device_id , packet1.pitch , packet1.yaw , packet1.pitch_rate , packet1.yaw_rate );
11046 mavlink_msg_gimbal_manager_set_pitchyaw_decode(&msg, &packet2);
11047 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11048
11049 memset(&packet2, 0, sizeof(packet2));
11050 mavlink_msg_gimbal_manager_set_pitchyaw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.flags , packet1.gimbal_device_id , packet1.pitch , packet1.yaw , packet1.pitch_rate , packet1.yaw_rate );
11051 mavlink_msg_gimbal_manager_set_pitchyaw_decode(&msg, &packet2);
11052 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11053
11054 memset(&packet2, 0, sizeof(packet2));
11055 mavlink_msg_to_send_buffer(buffer, &msg);
11056 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11057 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11058 }
11059 mavlink_msg_gimbal_manager_set_pitchyaw_decode(last_msg, &packet2);
11060 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11061
11062 memset(&packet2, 0, sizeof(packet2));
11063 mavlink_msg_gimbal_manager_set_pitchyaw_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.flags , packet1.gimbal_device_id , packet1.pitch , packet1.yaw , packet1.pitch_rate , packet1.yaw_rate );
11064 mavlink_msg_gimbal_manager_set_pitchyaw_decode(last_msg, &packet2);
11065 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11066
11067#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11068 MAVLINK_ASSERT(mavlink_get_message_info_by_name("GIMBAL_MANAGER_SET_PITCHYAW") != NULL);
11069 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_PITCHYAW) != NULL);
11070#endif
11071}
11072
11073static void mavlink_test_gimbal_manager_set_manual_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11074{
11075#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11076 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11077 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_MANUAL_CONTROL >= 256) {
11078 return;
11079 }
11080#endif
11081 mavlink_message_t msg;
11082 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11083 uint16_t i;
11084 mavlink_gimbal_manager_set_manual_control_t packet_in = {
11085 963497464,45.0,73.0,101.0,129.0,65,132,199
11086 };
11087 mavlink_gimbal_manager_set_manual_control_t packet1, packet2;
11088 memset(&packet1, 0, sizeof(packet1));
11089 packet1.flags = packet_in.flags;
11090 packet1.pitch = packet_in.pitch;
11091 packet1.yaw = packet_in.yaw;
11092 packet1.pitch_rate = packet_in.pitch_rate;
11093 packet1.yaw_rate = packet_in.yaw_rate;
11094 packet1.target_system = packet_in.target_system;
11095 packet1.target_component = packet_in.target_component;
11096 packet1.gimbal_device_id = packet_in.gimbal_device_id;
11097
11098
11099#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11100 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11101 // cope with extensions
11102 memset(MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_MANUAL_CONTROL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_MANUAL_CONTROL_MIN_LEN);
11103 }
11104#endif
11105 memset(&packet2, 0, sizeof(packet2));
11106 mavlink_msg_gimbal_manager_set_manual_control_encode(system_id, component_id, &msg, &packet1);
11107 mavlink_msg_gimbal_manager_set_manual_control_decode(&msg, &packet2);
11108 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11109
11110 memset(&packet2, 0, sizeof(packet2));
11111 mavlink_msg_gimbal_manager_set_manual_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.flags , packet1.gimbal_device_id , packet1.pitch , packet1.yaw , packet1.pitch_rate , packet1.yaw_rate );
11112 mavlink_msg_gimbal_manager_set_manual_control_decode(&msg, &packet2);
11113 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11114
11115 memset(&packet2, 0, sizeof(packet2));
11116 mavlink_msg_gimbal_manager_set_manual_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.flags , packet1.gimbal_device_id , packet1.pitch , packet1.yaw , packet1.pitch_rate , packet1.yaw_rate );
11117 mavlink_msg_gimbal_manager_set_manual_control_decode(&msg, &packet2);
11118 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11119
11120 memset(&packet2, 0, sizeof(packet2));
11121 mavlink_msg_to_send_buffer(buffer, &msg);
11122 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11123 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11124 }
11125 mavlink_msg_gimbal_manager_set_manual_control_decode(last_msg, &packet2);
11126 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11127
11128 memset(&packet2, 0, sizeof(packet2));
11129 mavlink_msg_gimbal_manager_set_manual_control_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.flags , packet1.gimbal_device_id , packet1.pitch , packet1.yaw , packet1.pitch_rate , packet1.yaw_rate );
11130 mavlink_msg_gimbal_manager_set_manual_control_decode(last_msg, &packet2);
11131 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11132
11133#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11134 MAVLINK_ASSERT(mavlink_get_message_info_by_name("GIMBAL_MANAGER_SET_MANUAL_CONTROL") != NULL);
11135 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_MANUAL_CONTROL) != NULL);
11136#endif
11137}
11138
11139static void mavlink_test_esc_info(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11140{
11141#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11142 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11143 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ESC_INFO >= 256) {
11144 return;
11145 }
11146#endif
11147 mavlink_message_t msg;
11148 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11149 uint16_t i;
11150 mavlink_esc_info_t packet_in = {
11151 93372036854775807ULL,{ 963497880, 963497881, 963497882, 963497883 },18483,{ 18587, 18588, 18589, 18590 },{ 19003, 19004, 19005, 19006 },3,70,137,204
11152 };
11153 mavlink_esc_info_t packet1, packet2;
11154 memset(&packet1, 0, sizeof(packet1));
11155 packet1.time_usec = packet_in.time_usec;
11156 packet1.counter = packet_in.counter;
11157 packet1.index = packet_in.index;
11158 packet1.count = packet_in.count;
11159 packet1.connection_type = packet_in.connection_type;
11160 packet1.info = packet_in.info;
11161
11162 mav_array_memcpy(packet1.error_count, packet_in.error_count, sizeof(uint32_t)*4);
11163 mav_array_memcpy(packet1.failure_flags, packet_in.failure_flags, sizeof(uint16_t)*4);
11164 mav_array_memcpy(packet1.temperature, packet_in.temperature, sizeof(int16_t)*4);
11165
11166#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11167 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11168 // cope with extensions
11169 memset(MAVLINK_MSG_ID_ESC_INFO_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ESC_INFO_MIN_LEN);
11170 }
11171#endif
11172 memset(&packet2, 0, sizeof(packet2));
11173 mavlink_msg_esc_info_encode(system_id, component_id, &msg, &packet1);
11174 mavlink_msg_esc_info_decode(&msg, &packet2);
11175 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11176
11177 memset(&packet2, 0, sizeof(packet2));
11178 mavlink_msg_esc_info_pack(system_id, component_id, &msg , packet1.index , packet1.time_usec , packet1.counter , packet1.count , packet1.connection_type , packet1.info , packet1.failure_flags , packet1.error_count , packet1.temperature );
11179 mavlink_msg_esc_info_decode(&msg, &packet2);
11180 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11181
11182 memset(&packet2, 0, sizeof(packet2));
11183 mavlink_msg_esc_info_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.index , packet1.time_usec , packet1.counter , packet1.count , packet1.connection_type , packet1.info , packet1.failure_flags , packet1.error_count , packet1.temperature );
11184 mavlink_msg_esc_info_decode(&msg, &packet2);
11185 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11186
11187 memset(&packet2, 0, sizeof(packet2));
11188 mavlink_msg_to_send_buffer(buffer, &msg);
11189 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11190 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11191 }
11192 mavlink_msg_esc_info_decode(last_msg, &packet2);
11193 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11194
11195 memset(&packet2, 0, sizeof(packet2));
11196 mavlink_msg_esc_info_send(MAVLINK_COMM_1 , packet1.index , packet1.time_usec , packet1.counter , packet1.count , packet1.connection_type , packet1.info , packet1.failure_flags , packet1.error_count , packet1.temperature );
11197 mavlink_msg_esc_info_decode(last_msg, &packet2);
11198 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11199
11200#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11201 MAVLINK_ASSERT(mavlink_get_message_info_by_name("ESC_INFO") != NULL);
11202 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ESC_INFO) != NULL);
11203#endif
11204}
11205
11206static void mavlink_test_esc_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11207{
11208#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11209 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11210 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ESC_STATUS >= 256) {
11211 return;
11212 }
11213#endif
11214 mavlink_message_t msg;
11215 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11216 uint16_t i;
11217 mavlink_esc_status_t packet_in = {
11218 93372036854775807ULL,{ 963497880, 963497881, 963497882, 963497883 },{ 185.0, 186.0, 187.0, 188.0 },{ 297.0, 298.0, 299.0, 300.0 },173
11219 };
11220 mavlink_esc_status_t packet1, packet2;
11221 memset(&packet1, 0, sizeof(packet1));
11222 packet1.time_usec = packet_in.time_usec;
11223 packet1.index = packet_in.index;
11224
11225 mav_array_memcpy(packet1.rpm, packet_in.rpm, sizeof(int32_t)*4);
11226 mav_array_memcpy(packet1.voltage, packet_in.voltage, sizeof(float)*4);
11227 mav_array_memcpy(packet1.current, packet_in.current, sizeof(float)*4);
11228
11229#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11230 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11231 // cope with extensions
11232 memset(MAVLINK_MSG_ID_ESC_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ESC_STATUS_MIN_LEN);
11233 }
11234#endif
11235 memset(&packet2, 0, sizeof(packet2));
11236 mavlink_msg_esc_status_encode(system_id, component_id, &msg, &packet1);
11237 mavlink_msg_esc_status_decode(&msg, &packet2);
11238 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11239
11240 memset(&packet2, 0, sizeof(packet2));
11241 mavlink_msg_esc_status_pack(system_id, component_id, &msg , packet1.index , packet1.time_usec , packet1.rpm , packet1.voltage , packet1.current );
11242 mavlink_msg_esc_status_decode(&msg, &packet2);
11243 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11244
11245 memset(&packet2, 0, sizeof(packet2));
11246 mavlink_msg_esc_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.index , packet1.time_usec , packet1.rpm , packet1.voltage , packet1.current );
11247 mavlink_msg_esc_status_decode(&msg, &packet2);
11248 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11249
11250 memset(&packet2, 0, sizeof(packet2));
11251 mavlink_msg_to_send_buffer(buffer, &msg);
11252 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11253 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11254 }
11255 mavlink_msg_esc_status_decode(last_msg, &packet2);
11256 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11257
11258 memset(&packet2, 0, sizeof(packet2));
11259 mavlink_msg_esc_status_send(MAVLINK_COMM_1 , packet1.index , packet1.time_usec , packet1.rpm , packet1.voltage , packet1.current );
11260 mavlink_msg_esc_status_decode(last_msg, &packet2);
11261 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11262
11263#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11264 MAVLINK_ASSERT(mavlink_get_message_info_by_name("ESC_STATUS") != NULL);
11265 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ESC_STATUS) != NULL);
11266#endif
11267}
11268
11269static void mavlink_test_airspeed(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11270{
11271#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11272 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11273 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AIRSPEED >= 256) {
11274 return;
11275 }
11276#endif
11277 mavlink_message_t msg;
11278 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11279 uint16_t i;
11280 mavlink_airspeed_t packet_in = {
11281 17.0,45.0,17651,163,230
11282 };
11283 mavlink_airspeed_t packet1, packet2;
11284 memset(&packet1, 0, sizeof(packet1));
11285 packet1.airspeed = packet_in.airspeed;
11286 packet1.raw_press = packet_in.raw_press;
11287 packet1.temperature = packet_in.temperature;
11288 packet1.id = packet_in.id;
11289 packet1.flags = packet_in.flags;
11290
11291
11292#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11293 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11294 // cope with extensions
11295 memset(MAVLINK_MSG_ID_AIRSPEED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AIRSPEED_MIN_LEN);
11296 }
11297#endif
11298 memset(&packet2, 0, sizeof(packet2));
11299 mavlink_msg_airspeed_encode(system_id, component_id, &msg, &packet1);
11300 mavlink_msg_airspeed_decode(&msg, &packet2);
11301 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11302
11303 memset(&packet2, 0, sizeof(packet2));
11304 mavlink_msg_airspeed_pack(system_id, component_id, &msg , packet1.id , packet1.airspeed , packet1.temperature , packet1.raw_press , packet1.flags );
11305 mavlink_msg_airspeed_decode(&msg, &packet2);
11306 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11307
11308 memset(&packet2, 0, sizeof(packet2));
11309 mavlink_msg_airspeed_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.airspeed , packet1.temperature , packet1.raw_press , packet1.flags );
11310 mavlink_msg_airspeed_decode(&msg, &packet2);
11311 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11312
11313 memset(&packet2, 0, sizeof(packet2));
11314 mavlink_msg_to_send_buffer(buffer, &msg);
11315 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11316 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11317 }
11318 mavlink_msg_airspeed_decode(last_msg, &packet2);
11319 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11320
11321 memset(&packet2, 0, sizeof(packet2));
11322 mavlink_msg_airspeed_send(MAVLINK_COMM_1 , packet1.id , packet1.airspeed , packet1.temperature , packet1.raw_press , packet1.flags );
11323 mavlink_msg_airspeed_decode(last_msg, &packet2);
11324 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11325
11326#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11327 MAVLINK_ASSERT(mavlink_get_message_info_by_name("AIRSPEED") != NULL);
11328 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_AIRSPEED) != NULL);
11329#endif
11330}
11331
11332static void mavlink_test_global_position_sensor(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11333{
11334#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11335 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11336 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GLOBAL_POSITION_SENSOR >= 256) {
11337 return;
11338 }
11339#endif
11340 mavlink_message_t msg;
11341 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11342 uint16_t i;
11343 mavlink_global_position_sensor_t packet_in = {
11344 93372036854775807ULL,963497880,963498088,963498296,157.0,185.0,213.0,241.0,113,180,247,58,125
11345 };
11346 mavlink_global_position_sensor_t packet1, packet2;
11347 memset(&packet1, 0, sizeof(packet1));
11348 packet1.time_usec = packet_in.time_usec;
11349 packet1.processing_time = packet_in.processing_time;
11350 packet1.lat = packet_in.lat;
11351 packet1.lon = packet_in.lon;
11352 packet1.alt_ellipsoid = packet_in.alt_ellipsoid;
11353 packet1.alt = packet_in.alt;
11354 packet1.eph = packet_in.eph;
11355 packet1.epv = packet_in.epv;
11356 packet1.target_system = packet_in.target_system;
11357 packet1.target_component = packet_in.target_component;
11358 packet1.id = packet_in.id;
11359 packet1.source = packet_in.source;
11360 packet1.flags = packet_in.flags;
11361
11362
11363#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11364 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11365 // cope with extensions
11366 memset(MAVLINK_MSG_ID_GLOBAL_POSITION_SENSOR_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GLOBAL_POSITION_SENSOR_MIN_LEN);
11367 }
11368#endif
11369 memset(&packet2, 0, sizeof(packet2));
11370 mavlink_msg_global_position_sensor_encode(system_id, component_id, &msg, &packet1);
11371 mavlink_msg_global_position_sensor_decode(&msg, &packet2);
11372 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11373
11374 memset(&packet2, 0, sizeof(packet2));
11375 mavlink_msg_global_position_sensor_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id , packet1.time_usec , packet1.processing_time , packet1.source , packet1.flags , packet1.lat , packet1.lon , packet1.alt_ellipsoid , packet1.alt , packet1.eph , packet1.epv );
11376 mavlink_msg_global_position_sensor_decode(&msg, &packet2);
11377 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11378
11379 memset(&packet2, 0, sizeof(packet2));
11380 mavlink_msg_global_position_sensor_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.id , packet1.time_usec , packet1.processing_time , packet1.source , packet1.flags , packet1.lat , packet1.lon , packet1.alt_ellipsoid , packet1.alt , packet1.eph , packet1.epv );
11381 mavlink_msg_global_position_sensor_decode(&msg, &packet2);
11382 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11383
11384 memset(&packet2, 0, sizeof(packet2));
11385 mavlink_msg_to_send_buffer(buffer, &msg);
11386 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11387 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11388 }
11389 mavlink_msg_global_position_sensor_decode(last_msg, &packet2);
11390 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11391
11392 memset(&packet2, 0, sizeof(packet2));
11393 mavlink_msg_global_position_sensor_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.id , packet1.time_usec , packet1.processing_time , packet1.source , packet1.flags , packet1.lat , packet1.lon , packet1.alt_ellipsoid , packet1.alt , packet1.eph , packet1.epv );
11394 mavlink_msg_global_position_sensor_decode(last_msg, &packet2);
11395 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11396
11397#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11398 MAVLINK_ASSERT(mavlink_get_message_info_by_name("GLOBAL_POSITION_SENSOR") != NULL);
11399 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GLOBAL_POSITION_SENSOR) != NULL);
11400#endif
11401}
11402
11403static void mavlink_test_wifi_config_ap(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11404{
11405#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11406 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11407 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_WIFI_CONFIG_AP >= 256) {
11408 return;
11409 }
11410#endif
11411 mavlink_message_t msg;
11412 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11413 uint16_t i;
11414 mavlink_wifi_config_ap_t packet_in = {
11415 "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDE","GHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQ",37,104
11416 };
11417 mavlink_wifi_config_ap_t packet1, packet2;
11418 memset(&packet1, 0, sizeof(packet1));
11419 packet1.mode = packet_in.mode;
11420 packet1.response = packet_in.response;
11421
11422 mav_array_memcpy(packet1.ssid, packet_in.ssid, sizeof(char)*32);
11423 mav_array_memcpy(packet1.password, packet_in.password, sizeof(char)*64);
11424
11425#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11426 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11427 // cope with extensions
11428 memset(MAVLINK_MSG_ID_WIFI_CONFIG_AP_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_WIFI_CONFIG_AP_MIN_LEN);
11429 }
11430#endif
11431 memset(&packet2, 0, sizeof(packet2));
11432 mavlink_msg_wifi_config_ap_encode(system_id, component_id, &msg, &packet1);
11433 mavlink_msg_wifi_config_ap_decode(&msg, &packet2);
11434 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11435
11436 memset(&packet2, 0, sizeof(packet2));
11437 mavlink_msg_wifi_config_ap_pack(system_id, component_id, &msg , packet1.ssid , packet1.password , packet1.mode , packet1.response );
11438 mavlink_msg_wifi_config_ap_decode(&msg, &packet2);
11439 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11440
11441 memset(&packet2, 0, sizeof(packet2));
11442 mavlink_msg_wifi_config_ap_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.ssid , packet1.password , packet1.mode , packet1.response );
11443 mavlink_msg_wifi_config_ap_decode(&msg, &packet2);
11444 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11445
11446 memset(&packet2, 0, sizeof(packet2));
11447 mavlink_msg_to_send_buffer(buffer, &msg);
11448 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11449 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11450 }
11451 mavlink_msg_wifi_config_ap_decode(last_msg, &packet2);
11452 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11453
11454 memset(&packet2, 0, sizeof(packet2));
11455 mavlink_msg_wifi_config_ap_send(MAVLINK_COMM_1 , packet1.ssid , packet1.password , packet1.mode , packet1.response );
11456 mavlink_msg_wifi_config_ap_decode(last_msg, &packet2);
11457 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11458
11459#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11460 MAVLINK_ASSERT(mavlink_get_message_info_by_name("WIFI_CONFIG_AP") != NULL);
11461 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_WIFI_CONFIG_AP) != NULL);
11462#endif
11463}
11464
11465static void mavlink_test_protocol_version(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11466{
11467#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11468 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11469 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PROTOCOL_VERSION >= 256) {
11470 return;
11471 }
11472#endif
11473 mavlink_message_t msg;
11474 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11475 uint16_t i;
11476 mavlink_protocol_version_t packet_in = {
11477 17235,17339,17443,{ 151, 152, 153, 154, 155, 156, 157, 158 },{ 175, 176, 177, 178, 179, 180, 181, 182 }
11478 };
11479 mavlink_protocol_version_t packet1, packet2;
11480 memset(&packet1, 0, sizeof(packet1));
11481 packet1.version = packet_in.version;
11482 packet1.min_version = packet_in.min_version;
11483 packet1.max_version = packet_in.max_version;
11484
11485 mav_array_memcpy(packet1.spec_version_hash, packet_in.spec_version_hash, sizeof(uint8_t)*8);
11486 mav_array_memcpy(packet1.library_version_hash, packet_in.library_version_hash, sizeof(uint8_t)*8);
11487
11488#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11489 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11490 // cope with extensions
11491 memset(MAVLINK_MSG_ID_PROTOCOL_VERSION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PROTOCOL_VERSION_MIN_LEN);
11492 }
11493#endif
11494 memset(&packet2, 0, sizeof(packet2));
11495 mavlink_msg_protocol_version_encode(system_id, component_id, &msg, &packet1);
11496 mavlink_msg_protocol_version_decode(&msg, &packet2);
11497 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11498
11499 memset(&packet2, 0, sizeof(packet2));
11500 mavlink_msg_protocol_version_pack(system_id, component_id, &msg , packet1.version , packet1.min_version , packet1.max_version , packet1.spec_version_hash , packet1.library_version_hash );
11501 mavlink_msg_protocol_version_decode(&msg, &packet2);
11502 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11503
11504 memset(&packet2, 0, sizeof(packet2));
11505 mavlink_msg_protocol_version_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.version , packet1.min_version , packet1.max_version , packet1.spec_version_hash , packet1.library_version_hash );
11506 mavlink_msg_protocol_version_decode(&msg, &packet2);
11507 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11508
11509 memset(&packet2, 0, sizeof(packet2));
11510 mavlink_msg_to_send_buffer(buffer, &msg);
11511 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11512 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11513 }
11514 mavlink_msg_protocol_version_decode(last_msg, &packet2);
11515 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11516
11517 memset(&packet2, 0, sizeof(packet2));
11518 mavlink_msg_protocol_version_send(MAVLINK_COMM_1 , packet1.version , packet1.min_version , packet1.max_version , packet1.spec_version_hash , packet1.library_version_hash );
11519 mavlink_msg_protocol_version_decode(last_msg, &packet2);
11520 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11521
11522#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11523 MAVLINK_ASSERT(mavlink_get_message_info_by_name("PROTOCOL_VERSION") != NULL);
11524 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PROTOCOL_VERSION) != NULL);
11525#endif
11526}
11527
11528static void mavlink_test_ais_vessel(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11529{
11530#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11531 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11532 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AIS_VESSEL >= 256) {
11533 return;
11534 }
11535#endif
11536 mavlink_message_t msg;
11537 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11538 uint16_t i;
11539 mavlink_ais_vessel_t packet_in = {
11540 963497464,963497672,963497880,17859,17963,18067,18171,18275,18379,18483,211,22,89,156,223,"FGHIJK","MNOPQRSTUVWXYZABCDE"
11541 };
11542 mavlink_ais_vessel_t packet1, packet2;
11543 memset(&packet1, 0, sizeof(packet1));
11544 packet1.MMSI = packet_in.MMSI;
11545 packet1.lat = packet_in.lat;
11546 packet1.lon = packet_in.lon;
11547 packet1.COG = packet_in.COG;
11548 packet1.heading = packet_in.heading;
11549 packet1.velocity = packet_in.velocity;
11550 packet1.dimension_bow = packet_in.dimension_bow;
11551 packet1.dimension_stern = packet_in.dimension_stern;
11552 packet1.tslc = packet_in.tslc;
11553 packet1.flags = packet_in.flags;
11554 packet1.turn_rate = packet_in.turn_rate;
11555 packet1.navigational_status = packet_in.navigational_status;
11556 packet1.type = packet_in.type;
11557 packet1.dimension_port = packet_in.dimension_port;
11558 packet1.dimension_starboard = packet_in.dimension_starboard;
11559
11560 mav_array_memcpy(packet1.callsign, packet_in.callsign, sizeof(char)*7);
11561 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*20);
11562
11563#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11564 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11565 // cope with extensions
11566 memset(MAVLINK_MSG_ID_AIS_VESSEL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AIS_VESSEL_MIN_LEN);
11567 }
11568#endif
11569 memset(&packet2, 0, sizeof(packet2));
11570 mavlink_msg_ais_vessel_encode(system_id, component_id, &msg, &packet1);
11571 mavlink_msg_ais_vessel_decode(&msg, &packet2);
11572 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11573
11574 memset(&packet2, 0, sizeof(packet2));
11575 mavlink_msg_ais_vessel_pack(system_id, component_id, &msg , packet1.MMSI , packet1.lat , packet1.lon , packet1.COG , packet1.heading , packet1.velocity , packet1.turn_rate , packet1.navigational_status , packet1.type , packet1.dimension_bow , packet1.dimension_stern , packet1.dimension_port , packet1.dimension_starboard , packet1.callsign , packet1.name , packet1.tslc , packet1.flags );
11576 mavlink_msg_ais_vessel_decode(&msg, &packet2);
11577 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11578
11579 memset(&packet2, 0, sizeof(packet2));
11580 mavlink_msg_ais_vessel_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.MMSI , packet1.lat , packet1.lon , packet1.COG , packet1.heading , packet1.velocity , packet1.turn_rate , packet1.navigational_status , packet1.type , packet1.dimension_bow , packet1.dimension_stern , packet1.dimension_port , packet1.dimension_starboard , packet1.callsign , packet1.name , packet1.tslc , packet1.flags );
11581 mavlink_msg_ais_vessel_decode(&msg, &packet2);
11582 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11583
11584 memset(&packet2, 0, sizeof(packet2));
11585 mavlink_msg_to_send_buffer(buffer, &msg);
11586 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11587 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11588 }
11589 mavlink_msg_ais_vessel_decode(last_msg, &packet2);
11590 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11591
11592 memset(&packet2, 0, sizeof(packet2));
11593 mavlink_msg_ais_vessel_send(MAVLINK_COMM_1 , packet1.MMSI , packet1.lat , packet1.lon , packet1.COG , packet1.heading , packet1.velocity , packet1.turn_rate , packet1.navigational_status , packet1.type , packet1.dimension_bow , packet1.dimension_stern , packet1.dimension_port , packet1.dimension_starboard , packet1.callsign , packet1.name , packet1.tslc , packet1.flags );
11594 mavlink_msg_ais_vessel_decode(last_msg, &packet2);
11595 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11596
11597#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11598 MAVLINK_ASSERT(mavlink_get_message_info_by_name("AIS_VESSEL") != NULL);
11599 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_AIS_VESSEL) != NULL);
11600#endif
11601}
11602
11603static void mavlink_test_uavcan_node_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11604{
11605#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11606 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11607 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_UAVCAN_NODE_STATUS >= 256) {
11608 return;
11609 }
11610#endif
11611 mavlink_message_t msg;
11612 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11613 uint16_t i;
11614 mavlink_uavcan_node_status_t packet_in = {
11615 93372036854775807ULL,963497880,17859,175,242,53
11616 };
11617 mavlink_uavcan_node_status_t packet1, packet2;
11618 memset(&packet1, 0, sizeof(packet1));
11619 packet1.time_usec = packet_in.time_usec;
11620 packet1.uptime_sec = packet_in.uptime_sec;
11621 packet1.vendor_specific_status_code = packet_in.vendor_specific_status_code;
11622 packet1.health = packet_in.health;
11623 packet1.mode = packet_in.mode;
11624 packet1.sub_mode = packet_in.sub_mode;
11625
11626
11627#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11628 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11629 // cope with extensions
11630 memset(MAVLINK_MSG_ID_UAVCAN_NODE_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_UAVCAN_NODE_STATUS_MIN_LEN);
11631 }
11632#endif
11633 memset(&packet2, 0, sizeof(packet2));
11634 mavlink_msg_uavcan_node_status_encode(system_id, component_id, &msg, &packet1);
11635 mavlink_msg_uavcan_node_status_decode(&msg, &packet2);
11636 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11637
11638 memset(&packet2, 0, sizeof(packet2));
11639 mavlink_msg_uavcan_node_status_pack(system_id, component_id, &msg , packet1.time_usec , packet1.uptime_sec , packet1.health , packet1.mode , packet1.sub_mode , packet1.vendor_specific_status_code );
11640 mavlink_msg_uavcan_node_status_decode(&msg, &packet2);
11641 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11642
11643 memset(&packet2, 0, sizeof(packet2));
11644 mavlink_msg_uavcan_node_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.uptime_sec , packet1.health , packet1.mode , packet1.sub_mode , packet1.vendor_specific_status_code );
11645 mavlink_msg_uavcan_node_status_decode(&msg, &packet2);
11646 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11647
11648 memset(&packet2, 0, sizeof(packet2));
11649 mavlink_msg_to_send_buffer(buffer, &msg);
11650 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11651 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11652 }
11653 mavlink_msg_uavcan_node_status_decode(last_msg, &packet2);
11654 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11655
11656 memset(&packet2, 0, sizeof(packet2));
11657 mavlink_msg_uavcan_node_status_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.uptime_sec , packet1.health , packet1.mode , packet1.sub_mode , packet1.vendor_specific_status_code );
11658 mavlink_msg_uavcan_node_status_decode(last_msg, &packet2);
11659 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11660
11661#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11662 MAVLINK_ASSERT(mavlink_get_message_info_by_name("UAVCAN_NODE_STATUS") != NULL);
11663 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_UAVCAN_NODE_STATUS) != NULL);
11664#endif
11665}
11666
11667static void mavlink_test_uavcan_node_info(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11668{
11669#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11670 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11671 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_UAVCAN_NODE_INFO >= 256) {
11672 return;
11673 }
11674#endif
11675 mavlink_message_t msg;
11676 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11677 uint16_t i;
11678 mavlink_uavcan_node_info_t packet_in = {
11679 93372036854775807ULL,963497880,963498088,"QRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQ",37,104,{ 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186 },219,30
11680 };
11681 mavlink_uavcan_node_info_t packet1, packet2;
11682 memset(&packet1, 0, sizeof(packet1));
11683 packet1.time_usec = packet_in.time_usec;
11684 packet1.uptime_sec = packet_in.uptime_sec;
11685 packet1.sw_vcs_commit = packet_in.sw_vcs_commit;
11686 packet1.hw_version_major = packet_in.hw_version_major;
11687 packet1.hw_version_minor = packet_in.hw_version_minor;
11688 packet1.sw_version_major = packet_in.sw_version_major;
11689 packet1.sw_version_minor = packet_in.sw_version_minor;
11690
11691 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*80);
11692 mav_array_memcpy(packet1.hw_unique_id, packet_in.hw_unique_id, sizeof(uint8_t)*16);
11693
11694#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11695 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11696 // cope with extensions
11697 memset(MAVLINK_MSG_ID_UAVCAN_NODE_INFO_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_UAVCAN_NODE_INFO_MIN_LEN);
11698 }
11699#endif
11700 memset(&packet2, 0, sizeof(packet2));
11701 mavlink_msg_uavcan_node_info_encode(system_id, component_id, &msg, &packet1);
11702 mavlink_msg_uavcan_node_info_decode(&msg, &packet2);
11703 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11704
11705 memset(&packet2, 0, sizeof(packet2));
11706 mavlink_msg_uavcan_node_info_pack(system_id, component_id, &msg , packet1.time_usec , packet1.uptime_sec , packet1.name , packet1.hw_version_major , packet1.hw_version_minor , packet1.hw_unique_id , packet1.sw_version_major , packet1.sw_version_minor , packet1.sw_vcs_commit );
11707 mavlink_msg_uavcan_node_info_decode(&msg, &packet2);
11708 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11709
11710 memset(&packet2, 0, sizeof(packet2));
11711 mavlink_msg_uavcan_node_info_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.uptime_sec , packet1.name , packet1.hw_version_major , packet1.hw_version_minor , packet1.hw_unique_id , packet1.sw_version_major , packet1.sw_version_minor , packet1.sw_vcs_commit );
11712 mavlink_msg_uavcan_node_info_decode(&msg, &packet2);
11713 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11714
11715 memset(&packet2, 0, sizeof(packet2));
11716 mavlink_msg_to_send_buffer(buffer, &msg);
11717 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11718 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11719 }
11720 mavlink_msg_uavcan_node_info_decode(last_msg, &packet2);
11721 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11722
11723 memset(&packet2, 0, sizeof(packet2));
11724 mavlink_msg_uavcan_node_info_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.uptime_sec , packet1.name , packet1.hw_version_major , packet1.hw_version_minor , packet1.hw_unique_id , packet1.sw_version_major , packet1.sw_version_minor , packet1.sw_vcs_commit );
11725 mavlink_msg_uavcan_node_info_decode(last_msg, &packet2);
11726 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11727
11728#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11729 MAVLINK_ASSERT(mavlink_get_message_info_by_name("UAVCAN_NODE_INFO") != NULL);
11730 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_UAVCAN_NODE_INFO) != NULL);
11731#endif
11732}
11733
11734static void mavlink_test_param_ext_request_read(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11735{
11736#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11737 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11738 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_EXT_REQUEST_READ >= 256) {
11739 return;
11740 }
11741#endif
11742 mavlink_message_t msg;
11743 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11744 uint16_t i;
11745 mavlink_param_ext_request_read_t packet_in = {
11746 17235,139,206,"EFGHIJKLMNOPQRS"
11747 };
11748 mavlink_param_ext_request_read_t packet1, packet2;
11749 memset(&packet1, 0, sizeof(packet1));
11750 packet1.param_index = packet_in.param_index;
11751 packet1.target_system = packet_in.target_system;
11752 packet1.target_component = packet_in.target_component;
11753
11754 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
11755
11756#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11757 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11758 // cope with extensions
11759 memset(MAVLINK_MSG_ID_PARAM_EXT_REQUEST_READ_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_EXT_REQUEST_READ_MIN_LEN);
11760 }
11761#endif
11762 memset(&packet2, 0, sizeof(packet2));
11763 mavlink_msg_param_ext_request_read_encode(system_id, component_id, &msg, &packet1);
11764 mavlink_msg_param_ext_request_read_decode(&msg, &packet2);
11765 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11766
11767 memset(&packet2, 0, sizeof(packet2));
11768 mavlink_msg_param_ext_request_read_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index );
11769 mavlink_msg_param_ext_request_read_decode(&msg, &packet2);
11770 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11771
11772 memset(&packet2, 0, sizeof(packet2));
11773 mavlink_msg_param_ext_request_read_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index );
11774 mavlink_msg_param_ext_request_read_decode(&msg, &packet2);
11775 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11776
11777 memset(&packet2, 0, sizeof(packet2));
11778 mavlink_msg_to_send_buffer(buffer, &msg);
11779 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11780 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11781 }
11782 mavlink_msg_param_ext_request_read_decode(last_msg, &packet2);
11783 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11784
11785 memset(&packet2, 0, sizeof(packet2));
11786 mavlink_msg_param_ext_request_read_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index );
11787 mavlink_msg_param_ext_request_read_decode(last_msg, &packet2);
11788 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11789
11790#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11791 MAVLINK_ASSERT(mavlink_get_message_info_by_name("PARAM_EXT_REQUEST_READ") != NULL);
11792 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PARAM_EXT_REQUEST_READ) != NULL);
11793#endif
11794}
11795
11796static void mavlink_test_param_ext_request_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11797{
11798#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11799 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11800 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_EXT_REQUEST_LIST >= 256) {
11801 return;
11802 }
11803#endif
11804 mavlink_message_t msg;
11805 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11806 uint16_t i;
11807 mavlink_param_ext_request_list_t packet_in = {
11808 5,72
11809 };
11810 mavlink_param_ext_request_list_t packet1, packet2;
11811 memset(&packet1, 0, sizeof(packet1));
11812 packet1.target_system = packet_in.target_system;
11813 packet1.target_component = packet_in.target_component;
11814
11815
11816#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11817 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11818 // cope with extensions
11819 memset(MAVLINK_MSG_ID_PARAM_EXT_REQUEST_LIST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_EXT_REQUEST_LIST_MIN_LEN);
11820 }
11821#endif
11822 memset(&packet2, 0, sizeof(packet2));
11823 mavlink_msg_param_ext_request_list_encode(system_id, component_id, &msg, &packet1);
11824 mavlink_msg_param_ext_request_list_decode(&msg, &packet2);
11825 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11826
11827 memset(&packet2, 0, sizeof(packet2));
11828 mavlink_msg_param_ext_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
11829 mavlink_msg_param_ext_request_list_decode(&msg, &packet2);
11830 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11831
11832 memset(&packet2, 0, sizeof(packet2));
11833 mavlink_msg_param_ext_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
11834 mavlink_msg_param_ext_request_list_decode(&msg, &packet2);
11835 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11836
11837 memset(&packet2, 0, sizeof(packet2));
11838 mavlink_msg_to_send_buffer(buffer, &msg);
11839 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11840 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11841 }
11842 mavlink_msg_param_ext_request_list_decode(last_msg, &packet2);
11843 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11844
11845 memset(&packet2, 0, sizeof(packet2));
11846 mavlink_msg_param_ext_request_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
11847 mavlink_msg_param_ext_request_list_decode(last_msg, &packet2);
11848 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11849
11850#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11851 MAVLINK_ASSERT(mavlink_get_message_info_by_name("PARAM_EXT_REQUEST_LIST") != NULL);
11852 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PARAM_EXT_REQUEST_LIST) != NULL);
11853#endif
11854}
11855
11856static void mavlink_test_param_ext_value(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11857{
11858#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11859 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11860 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_EXT_VALUE >= 256) {
11861 return;
11862 }
11863#endif
11864 mavlink_message_t msg;
11865 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11866 uint16_t i;
11867 mavlink_param_ext_value_t packet_in = {
11868 17235,17339,"EFGHIJKLMNOPQRS","UVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQ",193
11869 };
11870 mavlink_param_ext_value_t packet1, packet2;
11871 memset(&packet1, 0, sizeof(packet1));
11872 packet1.param_count = packet_in.param_count;
11873 packet1.param_index = packet_in.param_index;
11874 packet1.param_type = packet_in.param_type;
11875
11876 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
11877 mav_array_memcpy(packet1.param_value, packet_in.param_value, sizeof(char)*128);
11878
11879#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11880 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11881 // cope with extensions
11882 memset(MAVLINK_MSG_ID_PARAM_EXT_VALUE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_EXT_VALUE_MIN_LEN);
11883 }
11884#endif
11885 memset(&packet2, 0, sizeof(packet2));
11886 mavlink_msg_param_ext_value_encode(system_id, component_id, &msg, &packet1);
11887 mavlink_msg_param_ext_value_decode(&msg, &packet2);
11888 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11889
11890 memset(&packet2, 0, sizeof(packet2));
11891 mavlink_msg_param_ext_value_pack(system_id, component_id, &msg , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_count , packet1.param_index );
11892 mavlink_msg_param_ext_value_decode(&msg, &packet2);
11893 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11894
11895 memset(&packet2, 0, sizeof(packet2));
11896 mavlink_msg_param_ext_value_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_count , packet1.param_index );
11897 mavlink_msg_param_ext_value_decode(&msg, &packet2);
11898 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11899
11900 memset(&packet2, 0, sizeof(packet2));
11901 mavlink_msg_to_send_buffer(buffer, &msg);
11902 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11903 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11904 }
11905 mavlink_msg_param_ext_value_decode(last_msg, &packet2);
11906 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11907
11908 memset(&packet2, 0, sizeof(packet2));
11909 mavlink_msg_param_ext_value_send(MAVLINK_COMM_1 , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_count , packet1.param_index );
11910 mavlink_msg_param_ext_value_decode(last_msg, &packet2);
11911 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11912
11913#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11914 MAVLINK_ASSERT(mavlink_get_message_info_by_name("PARAM_EXT_VALUE") != NULL);
11915 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PARAM_EXT_VALUE) != NULL);
11916#endif
11917}
11918
11919static void mavlink_test_param_ext_set(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11920{
11921#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11922 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11923 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_EXT_SET >= 256) {
11924 return;
11925 }
11926#endif
11927 mavlink_message_t msg;
11928 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11929 uint16_t i;
11930 mavlink_param_ext_set_t packet_in = {
11931 5,72,"CDEFGHIJKLMNOPQ","STUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNO",59
11932 };
11933 mavlink_param_ext_set_t packet1, packet2;
11934 memset(&packet1, 0, sizeof(packet1));
11935 packet1.target_system = packet_in.target_system;
11936 packet1.target_component = packet_in.target_component;
11937 packet1.param_type = packet_in.param_type;
11938
11939 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
11940 mav_array_memcpy(packet1.param_value, packet_in.param_value, sizeof(char)*128);
11941
11942#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11943 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11944 // cope with extensions
11945 memset(MAVLINK_MSG_ID_PARAM_EXT_SET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_EXT_SET_MIN_LEN);
11946 }
11947#endif
11948 memset(&packet2, 0, sizeof(packet2));
11949 mavlink_msg_param_ext_set_encode(system_id, component_id, &msg, &packet1);
11950 mavlink_msg_param_ext_set_decode(&msg, &packet2);
11951 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11952
11953 memset(&packet2, 0, sizeof(packet2));
11954 mavlink_msg_param_ext_set_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type );
11955 mavlink_msg_param_ext_set_decode(&msg, &packet2);
11956 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11957
11958 memset(&packet2, 0, sizeof(packet2));
11959 mavlink_msg_param_ext_set_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type );
11960 mavlink_msg_param_ext_set_decode(&msg, &packet2);
11961 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11962
11963 memset(&packet2, 0, sizeof(packet2));
11964 mavlink_msg_to_send_buffer(buffer, &msg);
11965 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11966 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11967 }
11968 mavlink_msg_param_ext_set_decode(last_msg, &packet2);
11969 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11970
11971 memset(&packet2, 0, sizeof(packet2));
11972 mavlink_msg_param_ext_set_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type );
11973 mavlink_msg_param_ext_set_decode(last_msg, &packet2);
11974 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11975
11976#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11977 MAVLINK_ASSERT(mavlink_get_message_info_by_name("PARAM_EXT_SET") != NULL);
11978 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PARAM_EXT_SET) != NULL);
11979#endif
11980}
11981
11982static void mavlink_test_param_ext_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11983{
11984#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11985 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11986 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_EXT_ACK >= 256) {
11987 return;
11988 }
11989#endif
11990 mavlink_message_t msg;
11991 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11992 uint16_t i;
11993 mavlink_param_ext_ack_t packet_in = {
11994 "ABCDEFGHIJKLMNO","QRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM",181,248
11995 };
11996 mavlink_param_ext_ack_t packet1, packet2;
11997 memset(&packet1, 0, sizeof(packet1));
11998 packet1.param_type = packet_in.param_type;
11999 packet1.param_result = packet_in.param_result;
12000
12001 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
12002 mav_array_memcpy(packet1.param_value, packet_in.param_value, sizeof(char)*128);
12003
12004#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12005 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12006 // cope with extensions
12007 memset(MAVLINK_MSG_ID_PARAM_EXT_ACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_EXT_ACK_MIN_LEN);
12008 }
12009#endif
12010 memset(&packet2, 0, sizeof(packet2));
12011 mavlink_msg_param_ext_ack_encode(system_id, component_id, &msg, &packet1);
12012 mavlink_msg_param_ext_ack_decode(&msg, &packet2);
12013 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12014
12015 memset(&packet2, 0, sizeof(packet2));
12016 mavlink_msg_param_ext_ack_pack(system_id, component_id, &msg , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_result );
12017 mavlink_msg_param_ext_ack_decode(&msg, &packet2);
12018 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12019
12020 memset(&packet2, 0, sizeof(packet2));
12021 mavlink_msg_param_ext_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_result );
12022 mavlink_msg_param_ext_ack_decode(&msg, &packet2);
12023 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12024
12025 memset(&packet2, 0, sizeof(packet2));
12026 mavlink_msg_to_send_buffer(buffer, &msg);
12027 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12028 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12029 }
12030 mavlink_msg_param_ext_ack_decode(last_msg, &packet2);
12031 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12032
12033 memset(&packet2, 0, sizeof(packet2));
12034 mavlink_msg_param_ext_ack_send(MAVLINK_COMM_1 , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_result );
12035 mavlink_msg_param_ext_ack_decode(last_msg, &packet2);
12036 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12037
12038#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12039 MAVLINK_ASSERT(mavlink_get_message_info_by_name("PARAM_EXT_ACK") != NULL);
12040 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PARAM_EXT_ACK) != NULL);
12041#endif
12042}
12043
12044static void mavlink_test_obstacle_distance(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12045{
12046#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12047 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12048 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OBSTACLE_DISTANCE >= 256) {
12049 return;
12050 }
12051#endif
12052 mavlink_message_t msg;
12053 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12054 uint16_t i;
12055 mavlink_obstacle_distance_t packet_in = {
12056 93372036854775807ULL,{ 17651, 17652, 17653, 17654, 17655, 17656, 17657, 17658, 17659, 17660, 17661, 17662, 17663, 17664, 17665, 17666, 17667, 17668, 17669, 17670, 17671, 17672, 17673, 17674, 17675, 17676, 17677, 17678, 17679, 17680, 17681, 17682, 17683, 17684, 17685, 17686, 17687, 17688, 17689, 17690, 17691, 17692, 17693, 17694, 17695, 17696, 17697, 17698, 17699, 17700, 17701, 17702, 17703, 17704, 17705, 17706, 17707, 17708, 17709, 17710, 17711, 17712, 17713, 17714, 17715, 17716, 17717, 17718, 17719, 17720, 17721, 17722 },25139,25243,217,28,1123.0,1151.0,119
12057 };
12058 mavlink_obstacle_distance_t packet1, packet2;
12059 memset(&packet1, 0, sizeof(packet1));
12060 packet1.time_usec = packet_in.time_usec;
12061 packet1.min_distance = packet_in.min_distance;
12062 packet1.max_distance = packet_in.max_distance;
12063 packet1.sensor_type = packet_in.sensor_type;
12064 packet1.increment = packet_in.increment;
12065 packet1.increment_f = packet_in.increment_f;
12066 packet1.angle_offset = packet_in.angle_offset;
12067 packet1.frame = packet_in.frame;
12068
12069 mav_array_memcpy(packet1.distances, packet_in.distances, sizeof(uint16_t)*72);
12070
12071#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12072 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12073 // cope with extensions
12074 memset(MAVLINK_MSG_ID_OBSTACLE_DISTANCE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_OBSTACLE_DISTANCE_MIN_LEN);
12075 }
12076#endif
12077 memset(&packet2, 0, sizeof(packet2));
12078 mavlink_msg_obstacle_distance_encode(system_id, component_id, &msg, &packet1);
12079 mavlink_msg_obstacle_distance_decode(&msg, &packet2);
12080 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12081
12082 memset(&packet2, 0, sizeof(packet2));
12083 mavlink_msg_obstacle_distance_pack(system_id, component_id, &msg , packet1.time_usec , packet1.sensor_type , packet1.distances , packet1.increment , packet1.min_distance , packet1.max_distance , packet1.increment_f , packet1.angle_offset , packet1.frame );
12084 mavlink_msg_obstacle_distance_decode(&msg, &packet2);
12085 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12086
12087 memset(&packet2, 0, sizeof(packet2));
12088 mavlink_msg_obstacle_distance_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.sensor_type , packet1.distances , packet1.increment , packet1.min_distance , packet1.max_distance , packet1.increment_f , packet1.angle_offset , packet1.frame );
12089 mavlink_msg_obstacle_distance_decode(&msg, &packet2);
12090 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12091
12092 memset(&packet2, 0, sizeof(packet2));
12093 mavlink_msg_to_send_buffer(buffer, &msg);
12094 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12095 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12096 }
12097 mavlink_msg_obstacle_distance_decode(last_msg, &packet2);
12098 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12099
12100 memset(&packet2, 0, sizeof(packet2));
12101 mavlink_msg_obstacle_distance_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.sensor_type , packet1.distances , packet1.increment , packet1.min_distance , packet1.max_distance , packet1.increment_f , packet1.angle_offset , packet1.frame );
12102 mavlink_msg_obstacle_distance_decode(last_msg, &packet2);
12103 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12104
12105#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12106 MAVLINK_ASSERT(mavlink_get_message_info_by_name("OBSTACLE_DISTANCE") != NULL);
12107 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OBSTACLE_DISTANCE) != NULL);
12108#endif
12109}
12110
12111static void mavlink_test_odometry(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12112{
12113#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12114 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12115 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ODOMETRY >= 256) {
12116 return;
12117 }
12118#endif
12119 mavlink_message_t msg;
12120 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12121 uint16_t i;
12122 mavlink_odometry_t packet_in = {
12123 93372036854775807ULL,73.0,101.0,129.0,{ 157.0, 158.0, 159.0, 160.0 },269.0,297.0,325.0,353.0,381.0,409.0,{ 437.0, 438.0, 439.0, 440.0, 441.0, 442.0, 443.0, 444.0, 445.0, 446.0, 447.0, 448.0, 449.0, 450.0, 451.0, 452.0, 453.0, 454.0, 455.0, 456.0, 457.0 },{ 1025.0, 1026.0, 1027.0, 1028.0, 1029.0, 1030.0, 1031.0, 1032.0, 1033.0, 1034.0, 1035.0, 1036.0, 1037.0, 1038.0, 1039.0, 1040.0, 1041.0, 1042.0, 1043.0, 1044.0, 1045.0 },177,244,55,122,189
12124 };
12125 mavlink_odometry_t packet1, packet2;
12126 memset(&packet1, 0, sizeof(packet1));
12127 packet1.time_usec = packet_in.time_usec;
12128 packet1.x = packet_in.x;
12129 packet1.y = packet_in.y;
12130 packet1.z = packet_in.z;
12131 packet1.vx = packet_in.vx;
12132 packet1.vy = packet_in.vy;
12133 packet1.vz = packet_in.vz;
12134 packet1.rollspeed = packet_in.rollspeed;
12135 packet1.pitchspeed = packet_in.pitchspeed;
12136 packet1.yawspeed = packet_in.yawspeed;
12137 packet1.frame_id = packet_in.frame_id;
12138 packet1.child_frame_id = packet_in.child_frame_id;
12139 packet1.reset_counter = packet_in.reset_counter;
12140 packet1.estimator_type = packet_in.estimator_type;
12141 packet1.quality = packet_in.quality;
12142
12143 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
12144 mav_array_memcpy(packet1.pose_covariance, packet_in.pose_covariance, sizeof(float)*21);
12145 mav_array_memcpy(packet1.velocity_covariance, packet_in.velocity_covariance, sizeof(float)*21);
12146
12147#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12148 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12149 // cope with extensions
12150 memset(MAVLINK_MSG_ID_ODOMETRY_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ODOMETRY_MIN_LEN);
12151 }
12152#endif
12153 memset(&packet2, 0, sizeof(packet2));
12154 mavlink_msg_odometry_encode(system_id, component_id, &msg, &packet1);
12155 mavlink_msg_odometry_decode(&msg, &packet2);
12156 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12157
12158 memset(&packet2, 0, sizeof(packet2));
12159 mavlink_msg_odometry_pack(system_id, component_id, &msg , packet1.time_usec , packet1.frame_id , packet1.child_frame_id , packet1.x , packet1.y , packet1.z , packet1.q , packet1.vx , packet1.vy , packet1.vz , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.pose_covariance , packet1.velocity_covariance , packet1.reset_counter , packet1.estimator_type , packet1.quality );
12160 mavlink_msg_odometry_decode(&msg, &packet2);
12161 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12162
12163 memset(&packet2, 0, sizeof(packet2));
12164 mavlink_msg_odometry_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.frame_id , packet1.child_frame_id , packet1.x , packet1.y , packet1.z , packet1.q , packet1.vx , packet1.vy , packet1.vz , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.pose_covariance , packet1.velocity_covariance , packet1.reset_counter , packet1.estimator_type , packet1.quality );
12165 mavlink_msg_odometry_decode(&msg, &packet2);
12166 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12167
12168 memset(&packet2, 0, sizeof(packet2));
12169 mavlink_msg_to_send_buffer(buffer, &msg);
12170 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12171 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12172 }
12173 mavlink_msg_odometry_decode(last_msg, &packet2);
12174 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12175
12176 memset(&packet2, 0, sizeof(packet2));
12177 mavlink_msg_odometry_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.frame_id , packet1.child_frame_id , packet1.x , packet1.y , packet1.z , packet1.q , packet1.vx , packet1.vy , packet1.vz , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.pose_covariance , packet1.velocity_covariance , packet1.reset_counter , packet1.estimator_type , packet1.quality );
12178 mavlink_msg_odometry_decode(last_msg, &packet2);
12179 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12180
12181#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12182 MAVLINK_ASSERT(mavlink_get_message_info_by_name("ODOMETRY") != NULL);
12183 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ODOMETRY) != NULL);
12184#endif
12185}
12186
12187static void mavlink_test_trajectory_representation_waypoints(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12188{
12189#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12190 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12191 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS >= 256) {
12192 return;
12193 }
12194#endif
12195 mavlink_message_t msg;
12196 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12197 uint16_t i;
12198 mavlink_trajectory_representation_waypoints_t packet_in = {
12199 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0, 77.0 },{ 213.0, 214.0, 215.0, 216.0, 217.0 },{ 353.0, 354.0, 355.0, 356.0, 357.0 },{ 493.0, 494.0, 495.0, 496.0, 497.0 },{ 633.0, 634.0, 635.0, 636.0, 637.0 },{ 773.0, 774.0, 775.0, 776.0, 777.0 },{ 913.0, 914.0, 915.0, 916.0, 917.0 },{ 1053.0, 1054.0, 1055.0, 1056.0, 1057.0 },{ 1193.0, 1194.0, 1195.0, 1196.0, 1197.0 },{ 1333.0, 1334.0, 1335.0, 1336.0, 1337.0 },{ 1473.0, 1474.0, 1475.0, 1476.0, 1477.0 },{ 29091, 29092, 29093, 29094, 29095 },79
12200 };
12201 mavlink_trajectory_representation_waypoints_t packet1, packet2;
12202 memset(&packet1, 0, sizeof(packet1));
12203 packet1.time_usec = packet_in.time_usec;
12204 packet1.valid_points = packet_in.valid_points;
12205
12206 mav_array_memcpy(packet1.pos_x, packet_in.pos_x, sizeof(float)*5);
12207 mav_array_memcpy(packet1.pos_y, packet_in.pos_y, sizeof(float)*5);
12208 mav_array_memcpy(packet1.pos_z, packet_in.pos_z, sizeof(float)*5);
12209 mav_array_memcpy(packet1.vel_x, packet_in.vel_x, sizeof(float)*5);
12210 mav_array_memcpy(packet1.vel_y, packet_in.vel_y, sizeof(float)*5);
12211 mav_array_memcpy(packet1.vel_z, packet_in.vel_z, sizeof(float)*5);
12212 mav_array_memcpy(packet1.acc_x, packet_in.acc_x, sizeof(float)*5);
12213 mav_array_memcpy(packet1.acc_y, packet_in.acc_y, sizeof(float)*5);
12214 mav_array_memcpy(packet1.acc_z, packet_in.acc_z, sizeof(float)*5);
12215 mav_array_memcpy(packet1.pos_yaw, packet_in.pos_yaw, sizeof(float)*5);
12216 mav_array_memcpy(packet1.vel_yaw, packet_in.vel_yaw, sizeof(float)*5);
12217 mav_array_memcpy(packet1.command, packet_in.command, sizeof(uint16_t)*5);
12218
12219#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12220 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12221 // cope with extensions
12222 memset(MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN);
12223 }
12224#endif
12225 memset(&packet2, 0, sizeof(packet2));
12226 mavlink_msg_trajectory_representation_waypoints_encode(system_id, component_id, &msg, &packet1);
12227 mavlink_msg_trajectory_representation_waypoints_decode(&msg, &packet2);
12228 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12229
12230 memset(&packet2, 0, sizeof(packet2));
12231 mavlink_msg_trajectory_representation_waypoints_pack(system_id, component_id, &msg , packet1.time_usec , packet1.valid_points , packet1.pos_x , packet1.pos_y , packet1.pos_z , packet1.vel_x , packet1.vel_y , packet1.vel_z , packet1.acc_x , packet1.acc_y , packet1.acc_z , packet1.pos_yaw , packet1.vel_yaw , packet1.command );
12232 mavlink_msg_trajectory_representation_waypoints_decode(&msg, &packet2);
12233 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12234
12235 memset(&packet2, 0, sizeof(packet2));
12236 mavlink_msg_trajectory_representation_waypoints_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.valid_points , packet1.pos_x , packet1.pos_y , packet1.pos_z , packet1.vel_x , packet1.vel_y , packet1.vel_z , packet1.acc_x , packet1.acc_y , packet1.acc_z , packet1.pos_yaw , packet1.vel_yaw , packet1.command );
12237 mavlink_msg_trajectory_representation_waypoints_decode(&msg, &packet2);
12238 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12239
12240 memset(&packet2, 0, sizeof(packet2));
12241 mavlink_msg_to_send_buffer(buffer, &msg);
12242 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12243 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12244 }
12245 mavlink_msg_trajectory_representation_waypoints_decode(last_msg, &packet2);
12246 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12247
12248 memset(&packet2, 0, sizeof(packet2));
12249 mavlink_msg_trajectory_representation_waypoints_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.valid_points , packet1.pos_x , packet1.pos_y , packet1.pos_z , packet1.vel_x , packet1.vel_y , packet1.vel_z , packet1.acc_x , packet1.acc_y , packet1.acc_z , packet1.pos_yaw , packet1.vel_yaw , packet1.command );
12250 mavlink_msg_trajectory_representation_waypoints_decode(last_msg, &packet2);
12251 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12252
12253#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12254 MAVLINK_ASSERT(mavlink_get_message_info_by_name("TRAJECTORY_REPRESENTATION_WAYPOINTS") != NULL);
12255 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS) != NULL);
12256#endif
12257}
12258
12259static void mavlink_test_trajectory_representation_bezier(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12260{
12261#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12262 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12263 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER >= 256) {
12264 return;
12265 }
12266#endif
12267 mavlink_message_t msg;
12268 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12269 uint16_t i;
12270 mavlink_trajectory_representation_bezier_t packet_in = {
12271 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0, 77.0 },{ 213.0, 214.0, 215.0, 216.0, 217.0 },{ 353.0, 354.0, 355.0, 356.0, 357.0 },{ 493.0, 494.0, 495.0, 496.0, 497.0 },{ 633.0, 634.0, 635.0, 636.0, 637.0 },73
12272 };
12273 mavlink_trajectory_representation_bezier_t packet1, packet2;
12274 memset(&packet1, 0, sizeof(packet1));
12275 packet1.time_usec = packet_in.time_usec;
12276 packet1.valid_points = packet_in.valid_points;
12277
12278 mav_array_memcpy(packet1.pos_x, packet_in.pos_x, sizeof(float)*5);
12279 mav_array_memcpy(packet1.pos_y, packet_in.pos_y, sizeof(float)*5);
12280 mav_array_memcpy(packet1.pos_z, packet_in.pos_z, sizeof(float)*5);
12281 mav_array_memcpy(packet1.delta, packet_in.delta, sizeof(float)*5);
12282 mav_array_memcpy(packet1.pos_yaw, packet_in.pos_yaw, sizeof(float)*5);
12283
12284#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12285 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12286 // cope with extensions
12287 memset(MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_MIN_LEN);
12288 }
12289#endif
12290 memset(&packet2, 0, sizeof(packet2));
12291 mavlink_msg_trajectory_representation_bezier_encode(system_id, component_id, &msg, &packet1);
12292 mavlink_msg_trajectory_representation_bezier_decode(&msg, &packet2);
12293 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12294
12295 memset(&packet2, 0, sizeof(packet2));
12296 mavlink_msg_trajectory_representation_bezier_pack(system_id, component_id, &msg , packet1.time_usec , packet1.valid_points , packet1.pos_x , packet1.pos_y , packet1.pos_z , packet1.delta , packet1.pos_yaw );
12297 mavlink_msg_trajectory_representation_bezier_decode(&msg, &packet2);
12298 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12299
12300 memset(&packet2, 0, sizeof(packet2));
12301 mavlink_msg_trajectory_representation_bezier_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.valid_points , packet1.pos_x , packet1.pos_y , packet1.pos_z , packet1.delta , packet1.pos_yaw );
12302 mavlink_msg_trajectory_representation_bezier_decode(&msg, &packet2);
12303 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12304
12305 memset(&packet2, 0, sizeof(packet2));
12306 mavlink_msg_to_send_buffer(buffer, &msg);
12307 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12308 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12309 }
12310 mavlink_msg_trajectory_representation_bezier_decode(last_msg, &packet2);
12311 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12312
12313 memset(&packet2, 0, sizeof(packet2));
12314 mavlink_msg_trajectory_representation_bezier_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.valid_points , packet1.pos_x , packet1.pos_y , packet1.pos_z , packet1.delta , packet1.pos_yaw );
12315 mavlink_msg_trajectory_representation_bezier_decode(last_msg, &packet2);
12316 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12317
12318#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12319 MAVLINK_ASSERT(mavlink_get_message_info_by_name("TRAJECTORY_REPRESENTATION_BEZIER") != NULL);
12320 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER) != NULL);
12321#endif
12322}
12323
12324static void mavlink_test_cellular_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12325{
12326#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12327 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12328 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CELLULAR_STATUS >= 256) {
12329 return;
12330 }
12331#endif
12332 mavlink_message_t msg;
12333 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12334 uint16_t i;
12335 mavlink_cellular_status_t packet_in = {
12336 17235,17339,17443,151,218,29,96
12337 };
12338 mavlink_cellular_status_t packet1, packet2;
12339 memset(&packet1, 0, sizeof(packet1));
12340 packet1.mcc = packet_in.mcc;
12341 packet1.mnc = packet_in.mnc;
12342 packet1.lac = packet_in.lac;
12343 packet1.status = packet_in.status;
12344 packet1.failure_reason = packet_in.failure_reason;
12345 packet1.type = packet_in.type;
12346 packet1.quality = packet_in.quality;
12347
12348
12349#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12350 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12351 // cope with extensions
12352 memset(MAVLINK_MSG_ID_CELLULAR_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CELLULAR_STATUS_MIN_LEN);
12353 }
12354#endif
12355 memset(&packet2, 0, sizeof(packet2));
12356 mavlink_msg_cellular_status_encode(system_id, component_id, &msg, &packet1);
12357 mavlink_msg_cellular_status_decode(&msg, &packet2);
12358 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12359
12360 memset(&packet2, 0, sizeof(packet2));
12361 mavlink_msg_cellular_status_pack(system_id, component_id, &msg , packet1.status , packet1.failure_reason , packet1.type , packet1.quality , packet1.mcc , packet1.mnc , packet1.lac );
12362 mavlink_msg_cellular_status_decode(&msg, &packet2);
12363 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12364
12365 memset(&packet2, 0, sizeof(packet2));
12366 mavlink_msg_cellular_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.status , packet1.failure_reason , packet1.type , packet1.quality , packet1.mcc , packet1.mnc , packet1.lac );
12367 mavlink_msg_cellular_status_decode(&msg, &packet2);
12368 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12369
12370 memset(&packet2, 0, sizeof(packet2));
12371 mavlink_msg_to_send_buffer(buffer, &msg);
12372 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12373 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12374 }
12375 mavlink_msg_cellular_status_decode(last_msg, &packet2);
12376 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12377
12378 memset(&packet2, 0, sizeof(packet2));
12379 mavlink_msg_cellular_status_send(MAVLINK_COMM_1 , packet1.status , packet1.failure_reason , packet1.type , packet1.quality , packet1.mcc , packet1.mnc , packet1.lac );
12380 mavlink_msg_cellular_status_decode(last_msg, &packet2);
12381 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12382
12383#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12384 MAVLINK_ASSERT(mavlink_get_message_info_by_name("CELLULAR_STATUS") != NULL);
12385 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CELLULAR_STATUS) != NULL);
12386#endif
12387}
12388
12389static void mavlink_test_isbd_link_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12390{
12391#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12392 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12393 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ISBD_LINK_STATUS >= 256) {
12394 return;
12395 }
12396#endif
12397 mavlink_message_t msg;
12398 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12399 uint16_t i;
12400 mavlink_isbd_link_status_t packet_in = {
12401 93372036854775807ULL,93372036854776311ULL,18067,18171,65,132,199,10
12402 };
12403 mavlink_isbd_link_status_t packet1, packet2;
12404 memset(&packet1, 0, sizeof(packet1));
12405 packet1.timestamp = packet_in.timestamp;
12406 packet1.last_heartbeat = packet_in.last_heartbeat;
12407 packet1.failed_sessions = packet_in.failed_sessions;
12408 packet1.successful_sessions = packet_in.successful_sessions;
12409 packet1.signal_quality = packet_in.signal_quality;
12410 packet1.ring_pending = packet_in.ring_pending;
12411 packet1.tx_session_pending = packet_in.tx_session_pending;
12412 packet1.rx_session_pending = packet_in.rx_session_pending;
12413
12414
12415#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12416 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12417 // cope with extensions
12418 memset(MAVLINK_MSG_ID_ISBD_LINK_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ISBD_LINK_STATUS_MIN_LEN);
12419 }
12420#endif
12421 memset(&packet2, 0, sizeof(packet2));
12422 mavlink_msg_isbd_link_status_encode(system_id, component_id, &msg, &packet1);
12423 mavlink_msg_isbd_link_status_decode(&msg, &packet2);
12424 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12425
12426 memset(&packet2, 0, sizeof(packet2));
12427 mavlink_msg_isbd_link_status_pack(system_id, component_id, &msg , packet1.timestamp , packet1.last_heartbeat , packet1.failed_sessions , packet1.successful_sessions , packet1.signal_quality , packet1.ring_pending , packet1.tx_session_pending , packet1.rx_session_pending );
12428 mavlink_msg_isbd_link_status_decode(&msg, &packet2);
12429 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12430
12431 memset(&packet2, 0, sizeof(packet2));
12432 mavlink_msg_isbd_link_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.last_heartbeat , packet1.failed_sessions , packet1.successful_sessions , packet1.signal_quality , packet1.ring_pending , packet1.tx_session_pending , packet1.rx_session_pending );
12433 mavlink_msg_isbd_link_status_decode(&msg, &packet2);
12434 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12435
12436 memset(&packet2, 0, sizeof(packet2));
12437 mavlink_msg_to_send_buffer(buffer, &msg);
12438 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12439 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12440 }
12441 mavlink_msg_isbd_link_status_decode(last_msg, &packet2);
12442 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12443
12444 memset(&packet2, 0, sizeof(packet2));
12445 mavlink_msg_isbd_link_status_send(MAVLINK_COMM_1 , packet1.timestamp , packet1.last_heartbeat , packet1.failed_sessions , packet1.successful_sessions , packet1.signal_quality , packet1.ring_pending , packet1.tx_session_pending , packet1.rx_session_pending );
12446 mavlink_msg_isbd_link_status_decode(last_msg, &packet2);
12447 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12448
12449#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12450 MAVLINK_ASSERT(mavlink_get_message_info_by_name("ISBD_LINK_STATUS") != NULL);
12451 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ISBD_LINK_STATUS) != NULL);
12452#endif
12453}
12454
12455static void mavlink_test_cellular_config(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12456{
12457#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12458 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12459 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CELLULAR_CONFIG >= 256) {
12460 return;
12461 }
12462#endif
12463 mavlink_message_t msg;
12464 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12465 uint16_t i;
12466 mavlink_cellular_config_t packet_in = {
12467 5,72,"CDEFGHIJKLMNOPQ","STUVWXYZABCDEFG","IJKLMNOPQRSTUVWXYZABCDEFGHIJKLM","OPQRSTUVWXYZABC",123,190
12468 };
12469 mavlink_cellular_config_t packet1, packet2;
12470 memset(&packet1, 0, sizeof(packet1));
12471 packet1.enable_lte = packet_in.enable_lte;
12472 packet1.enable_pin = packet_in.enable_pin;
12473 packet1.roaming = packet_in.roaming;
12474 packet1.response = packet_in.response;
12475
12476 mav_array_memcpy(packet1.pin, packet_in.pin, sizeof(char)*16);
12477 mav_array_memcpy(packet1.new_pin, packet_in.new_pin, sizeof(char)*16);
12478 mav_array_memcpy(packet1.apn, packet_in.apn, sizeof(char)*32);
12479 mav_array_memcpy(packet1.puk, packet_in.puk, sizeof(char)*16);
12480
12481#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12482 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12483 // cope with extensions
12484 memset(MAVLINK_MSG_ID_CELLULAR_CONFIG_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CELLULAR_CONFIG_MIN_LEN);
12485 }
12486#endif
12487 memset(&packet2, 0, sizeof(packet2));
12488 mavlink_msg_cellular_config_encode(system_id, component_id, &msg, &packet1);
12489 mavlink_msg_cellular_config_decode(&msg, &packet2);
12490 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12491
12492 memset(&packet2, 0, sizeof(packet2));
12493 mavlink_msg_cellular_config_pack(system_id, component_id, &msg , packet1.enable_lte , packet1.enable_pin , packet1.pin , packet1.new_pin , packet1.apn , packet1.puk , packet1.roaming , packet1.response );
12494 mavlink_msg_cellular_config_decode(&msg, &packet2);
12495 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12496
12497 memset(&packet2, 0, sizeof(packet2));
12498 mavlink_msg_cellular_config_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.enable_lte , packet1.enable_pin , packet1.pin , packet1.new_pin , packet1.apn , packet1.puk , packet1.roaming , packet1.response );
12499 mavlink_msg_cellular_config_decode(&msg, &packet2);
12500 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12501
12502 memset(&packet2, 0, sizeof(packet2));
12503 mavlink_msg_to_send_buffer(buffer, &msg);
12504 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12505 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12506 }
12507 mavlink_msg_cellular_config_decode(last_msg, &packet2);
12508 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12509
12510 memset(&packet2, 0, sizeof(packet2));
12511 mavlink_msg_cellular_config_send(MAVLINK_COMM_1 , packet1.enable_lte , packet1.enable_pin , packet1.pin , packet1.new_pin , packet1.apn , packet1.puk , packet1.roaming , packet1.response );
12512 mavlink_msg_cellular_config_decode(last_msg, &packet2);
12513 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12514
12515#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12516 MAVLINK_ASSERT(mavlink_get_message_info_by_name("CELLULAR_CONFIG") != NULL);
12517 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CELLULAR_CONFIG) != NULL);
12518#endif
12519}
12520
12521static void mavlink_test_raw_rpm(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12522{
12523#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12524 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12525 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RAW_RPM >= 256) {
12526 return;
12527 }
12528#endif
12529 mavlink_message_t msg;
12530 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12531 uint16_t i;
12532 mavlink_raw_rpm_t packet_in = {
12533 17.0,17
12534 };
12535 mavlink_raw_rpm_t packet1, packet2;
12536 memset(&packet1, 0, sizeof(packet1));
12537 packet1.frequency = packet_in.frequency;
12538 packet1.index = packet_in.index;
12539
12540
12541#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12542 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12543 // cope with extensions
12544 memset(MAVLINK_MSG_ID_RAW_RPM_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RAW_RPM_MIN_LEN);
12545 }
12546#endif
12547 memset(&packet2, 0, sizeof(packet2));
12548 mavlink_msg_raw_rpm_encode(system_id, component_id, &msg, &packet1);
12549 mavlink_msg_raw_rpm_decode(&msg, &packet2);
12550 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12551
12552 memset(&packet2, 0, sizeof(packet2));
12553 mavlink_msg_raw_rpm_pack(system_id, component_id, &msg , packet1.index , packet1.frequency );
12554 mavlink_msg_raw_rpm_decode(&msg, &packet2);
12555 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12556
12557 memset(&packet2, 0, sizeof(packet2));
12558 mavlink_msg_raw_rpm_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.index , packet1.frequency );
12559 mavlink_msg_raw_rpm_decode(&msg, &packet2);
12560 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12561
12562 memset(&packet2, 0, sizeof(packet2));
12563 mavlink_msg_to_send_buffer(buffer, &msg);
12564 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12565 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12566 }
12567 mavlink_msg_raw_rpm_decode(last_msg, &packet2);
12568 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12569
12570 memset(&packet2, 0, sizeof(packet2));
12571 mavlink_msg_raw_rpm_send(MAVLINK_COMM_1 , packet1.index , packet1.frequency );
12572 mavlink_msg_raw_rpm_decode(last_msg, &packet2);
12573 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12574
12575#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12576 MAVLINK_ASSERT(mavlink_get_message_info_by_name("RAW_RPM") != NULL);
12577 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_RAW_RPM) != NULL);
12578#endif
12579}
12580
12581static void mavlink_test_utm_global_position(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12582{
12583#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12584 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12585 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_UTM_GLOBAL_POSITION >= 256) {
12586 return;
12587 }
12588#endif
12589 mavlink_message_t msg;
12590 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12591 uint16_t i;
12592 mavlink_utm_global_position_t packet_in = {
12593 93372036854775807ULL,963497880,963498088,963498296,963498504,963498712,963498920,963499128,19107,19211,19315,19419,19523,19627,19731,{ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44 },209,20
12594 };
12595 mavlink_utm_global_position_t packet1, packet2;
12596 memset(&packet1, 0, sizeof(packet1));
12597 packet1.time = packet_in.time;
12598 packet1.lat = packet_in.lat;
12599 packet1.lon = packet_in.lon;
12600 packet1.alt = packet_in.alt;
12601 packet1.relative_alt = packet_in.relative_alt;
12602 packet1.next_lat = packet_in.next_lat;
12603 packet1.next_lon = packet_in.next_lon;
12604 packet1.next_alt = packet_in.next_alt;
12605 packet1.vx = packet_in.vx;
12606 packet1.vy = packet_in.vy;
12607 packet1.vz = packet_in.vz;
12608 packet1.h_acc = packet_in.h_acc;
12609 packet1.v_acc = packet_in.v_acc;
12610 packet1.vel_acc = packet_in.vel_acc;
12611 packet1.update_rate = packet_in.update_rate;
12612 packet1.flight_state = packet_in.flight_state;
12613 packet1.flags = packet_in.flags;
12614
12615 mav_array_memcpy(packet1.uas_id, packet_in.uas_id, sizeof(uint8_t)*18);
12616
12617#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12618 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12619 // cope with extensions
12620 memset(MAVLINK_MSG_ID_UTM_GLOBAL_POSITION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_UTM_GLOBAL_POSITION_MIN_LEN);
12621 }
12622#endif
12623 memset(&packet2, 0, sizeof(packet2));
12624 mavlink_msg_utm_global_position_encode(system_id, component_id, &msg, &packet1);
12625 mavlink_msg_utm_global_position_decode(&msg, &packet2);
12626 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12627
12628 memset(&packet2, 0, sizeof(packet2));
12629 mavlink_msg_utm_global_position_pack(system_id, component_id, &msg , packet1.time , packet1.uas_id , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.h_acc , packet1.v_acc , packet1.vel_acc , packet1.next_lat , packet1.next_lon , packet1.next_alt , packet1.update_rate , packet1.flight_state , packet1.flags );
12630 mavlink_msg_utm_global_position_decode(&msg, &packet2);
12631 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12632
12633 memset(&packet2, 0, sizeof(packet2));
12634 mavlink_msg_utm_global_position_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time , packet1.uas_id , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.h_acc , packet1.v_acc , packet1.vel_acc , packet1.next_lat , packet1.next_lon , packet1.next_alt , packet1.update_rate , packet1.flight_state , packet1.flags );
12635 mavlink_msg_utm_global_position_decode(&msg, &packet2);
12636 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12637
12638 memset(&packet2, 0, sizeof(packet2));
12639 mavlink_msg_to_send_buffer(buffer, &msg);
12640 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12641 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12642 }
12643 mavlink_msg_utm_global_position_decode(last_msg, &packet2);
12644 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12645
12646 memset(&packet2, 0, sizeof(packet2));
12647 mavlink_msg_utm_global_position_send(MAVLINK_COMM_1 , packet1.time , packet1.uas_id , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.h_acc , packet1.v_acc , packet1.vel_acc , packet1.next_lat , packet1.next_lon , packet1.next_alt , packet1.update_rate , packet1.flight_state , packet1.flags );
12648 mavlink_msg_utm_global_position_decode(last_msg, &packet2);
12649 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12650
12651#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12652 MAVLINK_ASSERT(mavlink_get_message_info_by_name("UTM_GLOBAL_POSITION") != NULL);
12653 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_UTM_GLOBAL_POSITION) != NULL);
12654#endif
12655}
12656
12657static void mavlink_test_param_error(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12658{
12659#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12660 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12661 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_ERROR >= 256) {
12662 return;
12663 }
12664#endif
12665 mavlink_message_t msg;
12666 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12667 uint16_t i;
12668 mavlink_param_error_t packet_in = {
12669 17235,139,206,"EFGHIJKLMNOPQRS",65
12670 };
12671 mavlink_param_error_t packet1, packet2;
12672 memset(&packet1, 0, sizeof(packet1));
12673 packet1.param_index = packet_in.param_index;
12674 packet1.target_system = packet_in.target_system;
12675 packet1.target_component = packet_in.target_component;
12676 packet1.error = packet_in.error;
12677
12678 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
12679
12680#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12681 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12682 // cope with extensions
12683 memset(MAVLINK_MSG_ID_PARAM_ERROR_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_ERROR_MIN_LEN);
12684 }
12685#endif
12686 memset(&packet2, 0, sizeof(packet2));
12687 mavlink_msg_param_error_encode(system_id, component_id, &msg, &packet1);
12688 mavlink_msg_param_error_decode(&msg, &packet2);
12689 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12690
12691 memset(&packet2, 0, sizeof(packet2));
12692 mavlink_msg_param_error_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.error );
12693 mavlink_msg_param_error_decode(&msg, &packet2);
12694 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12695
12696 memset(&packet2, 0, sizeof(packet2));
12697 mavlink_msg_param_error_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.error );
12698 mavlink_msg_param_error_decode(&msg, &packet2);
12699 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12700
12701 memset(&packet2, 0, sizeof(packet2));
12702 mavlink_msg_to_send_buffer(buffer, &msg);
12703 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12704 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12705 }
12706 mavlink_msg_param_error_decode(last_msg, &packet2);
12707 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12708
12709 memset(&packet2, 0, sizeof(packet2));
12710 mavlink_msg_param_error_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.error );
12711 mavlink_msg_param_error_decode(last_msg, &packet2);
12712 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12713
12714#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12715 MAVLINK_ASSERT(mavlink_get_message_info_by_name("PARAM_ERROR") != NULL);
12716 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PARAM_ERROR) != NULL);
12717#endif
12718}
12719
12720static void mavlink_test_debug_float_array(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12721{
12722#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12723 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12724 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY >= 256) {
12725 return;
12726 }
12727#endif
12728 mavlink_message_t msg;
12729 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12730 uint16_t i;
12731 mavlink_debug_float_array_t packet_in = {
12732 93372036854775807ULL,17651,"KLMNOPQRS",{ 157.0, 158.0, 159.0, 160.0, 161.0, 162.0, 163.0, 164.0, 165.0, 166.0, 167.0, 168.0, 169.0, 170.0, 171.0, 172.0, 173.0, 174.0, 175.0, 176.0, 177.0, 178.0, 179.0, 180.0, 181.0, 182.0, 183.0, 184.0, 185.0, 186.0, 187.0, 188.0, 189.0, 190.0, 191.0, 192.0, 193.0, 194.0, 195.0, 196.0, 197.0, 198.0, 199.0, 200.0, 201.0, 202.0, 203.0, 204.0, 205.0, 206.0, 207.0, 208.0, 209.0, 210.0, 211.0, 212.0, 213.0, 214.0 }
12733 };
12734 mavlink_debug_float_array_t packet1, packet2;
12735 memset(&packet1, 0, sizeof(packet1));
12736 packet1.time_usec = packet_in.time_usec;
12737 packet1.array_id = packet_in.array_id;
12738
12739 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*10);
12740 mav_array_memcpy(packet1.data, packet_in.data, sizeof(float)*58);
12741
12742#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12743 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12744 // cope with extensions
12745 memset(MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY_MIN_LEN);
12746 }
12747#endif
12748 memset(&packet2, 0, sizeof(packet2));
12749 mavlink_msg_debug_float_array_encode(system_id, component_id, &msg, &packet1);
12750 mavlink_msg_debug_float_array_decode(&msg, &packet2);
12751 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12752
12753 memset(&packet2, 0, sizeof(packet2));
12754 mavlink_msg_debug_float_array_pack(system_id, component_id, &msg , packet1.time_usec , packet1.name , packet1.array_id , packet1.data );
12755 mavlink_msg_debug_float_array_decode(&msg, &packet2);
12756 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12757
12758 memset(&packet2, 0, sizeof(packet2));
12759 mavlink_msg_debug_float_array_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.name , packet1.array_id , packet1.data );
12760 mavlink_msg_debug_float_array_decode(&msg, &packet2);
12761 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12762
12763 memset(&packet2, 0, sizeof(packet2));
12764 mavlink_msg_to_send_buffer(buffer, &msg);
12765 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12766 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12767 }
12768 mavlink_msg_debug_float_array_decode(last_msg, &packet2);
12769 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12770
12771 memset(&packet2, 0, sizeof(packet2));
12772 mavlink_msg_debug_float_array_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.name , packet1.array_id , packet1.data );
12773 mavlink_msg_debug_float_array_decode(last_msg, &packet2);
12774 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12775
12776#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12777 MAVLINK_ASSERT(mavlink_get_message_info_by_name("DEBUG_FLOAT_ARRAY") != NULL);
12778 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY) != NULL);
12779#endif
12780}
12781
12782static void mavlink_test_orbit_execution_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12783{
12784#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12785 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12786 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS >= 256) {
12787 return;
12788 }
12789#endif
12790 mavlink_message_t msg;
12791 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12792 uint16_t i;
12793 mavlink_orbit_execution_status_t packet_in = {
12794 93372036854775807ULL,73.0,963498088,963498296,157.0,77
12795 };
12796 mavlink_orbit_execution_status_t packet1, packet2;
12797 memset(&packet1, 0, sizeof(packet1));
12798 packet1.time_usec = packet_in.time_usec;
12799 packet1.radius = packet_in.radius;
12800 packet1.x = packet_in.x;
12801 packet1.y = packet_in.y;
12802 packet1.z = packet_in.z;
12803 packet1.frame = packet_in.frame;
12804
12805
12806#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12807 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12808 // cope with extensions
12809 memset(MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_MIN_LEN);
12810 }
12811#endif
12812 memset(&packet2, 0, sizeof(packet2));
12813 mavlink_msg_orbit_execution_status_encode(system_id, component_id, &msg, &packet1);
12814 mavlink_msg_orbit_execution_status_decode(&msg, &packet2);
12815 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12816
12817 memset(&packet2, 0, sizeof(packet2));
12818 mavlink_msg_orbit_execution_status_pack(system_id, component_id, &msg , packet1.time_usec , packet1.radius , packet1.frame , packet1.x , packet1.y , packet1.z );
12819 mavlink_msg_orbit_execution_status_decode(&msg, &packet2);
12820 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12821
12822 memset(&packet2, 0, sizeof(packet2));
12823 mavlink_msg_orbit_execution_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.radius , packet1.frame , packet1.x , packet1.y , packet1.z );
12824 mavlink_msg_orbit_execution_status_decode(&msg, &packet2);
12825 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12826
12827 memset(&packet2, 0, sizeof(packet2));
12828 mavlink_msg_to_send_buffer(buffer, &msg);
12829 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12830 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12831 }
12832 mavlink_msg_orbit_execution_status_decode(last_msg, &packet2);
12833 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12834
12835 memset(&packet2, 0, sizeof(packet2));
12836 mavlink_msg_orbit_execution_status_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.radius , packet1.frame , packet1.x , packet1.y , packet1.z );
12837 mavlink_msg_orbit_execution_status_decode(last_msg, &packet2);
12838 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12839
12840#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12841 MAVLINK_ASSERT(mavlink_get_message_info_by_name("ORBIT_EXECUTION_STATUS") != NULL);
12842 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS) != NULL);
12843#endif
12844}
12845
12846static void mavlink_test_smart_battery_info(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12847{
12848#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12849 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12850 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SMART_BATTERY_INFO >= 256) {
12851 return;
12852 }
12853#endif
12854 mavlink_message_t msg;
12855 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12856 uint16_t i;
12857 mavlink_smart_battery_info_t packet_in = {
12858 963497464,963497672,17651,17755,17859,17963,18067,187,254,65,"VWXYZABCDEFGHIJ","LMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGH",21759,80,963502144,963502352,"UVWXYZABCD"
12859 };
12860 mavlink_smart_battery_info_t packet1, packet2;
12861 memset(&packet1, 0, sizeof(packet1));
12862 packet1.capacity_full_specification = packet_in.capacity_full_specification;
12863 packet1.capacity_full = packet_in.capacity_full;
12864 packet1.cycle_count = packet_in.cycle_count;
12865 packet1.weight = packet_in.weight;
12866 packet1.discharge_minimum_voltage = packet_in.discharge_minimum_voltage;
12867 packet1.charging_minimum_voltage = packet_in.charging_minimum_voltage;
12868 packet1.resting_minimum_voltage = packet_in.resting_minimum_voltage;
12869 packet1.id = packet_in.id;
12870 packet1.battery_function = packet_in.battery_function;
12871 packet1.type = packet_in.type;
12872 packet1.charging_maximum_voltage = packet_in.charging_maximum_voltage;
12873 packet1.cells_in_series = packet_in.cells_in_series;
12874 packet1.discharge_maximum_current = packet_in.discharge_maximum_current;
12875 packet1.discharge_maximum_burst_current = packet_in.discharge_maximum_burst_current;
12876
12877 mav_array_memcpy(packet1.serial_number, packet_in.serial_number, sizeof(char)*16);
12878 mav_array_memcpy(packet1.device_name, packet_in.device_name, sizeof(char)*50);
12879 mav_array_memcpy(packet1.manufacture_date, packet_in.manufacture_date, sizeof(char)*11);
12880
12881#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12882 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12883 // cope with extensions
12884 memset(MAVLINK_MSG_ID_SMART_BATTERY_INFO_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SMART_BATTERY_INFO_MIN_LEN);
12885 }
12886#endif
12887 memset(&packet2, 0, sizeof(packet2));
12888 mavlink_msg_smart_battery_info_encode(system_id, component_id, &msg, &packet1);
12889 mavlink_msg_smart_battery_info_decode(&msg, &packet2);
12890 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12891
12892 memset(&packet2, 0, sizeof(packet2));
12893 mavlink_msg_smart_battery_info_pack(system_id, component_id, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.capacity_full_specification , packet1.capacity_full , packet1.cycle_count , packet1.serial_number , packet1.device_name , packet1.weight , packet1.discharge_minimum_voltage , packet1.charging_minimum_voltage , packet1.resting_minimum_voltage , packet1.charging_maximum_voltage , packet1.cells_in_series , packet1.discharge_maximum_current , packet1.discharge_maximum_burst_current , packet1.manufacture_date );
12894 mavlink_msg_smart_battery_info_decode(&msg, &packet2);
12895 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12896
12897 memset(&packet2, 0, sizeof(packet2));
12898 mavlink_msg_smart_battery_info_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.capacity_full_specification , packet1.capacity_full , packet1.cycle_count , packet1.serial_number , packet1.device_name , packet1.weight , packet1.discharge_minimum_voltage , packet1.charging_minimum_voltage , packet1.resting_minimum_voltage , packet1.charging_maximum_voltage , packet1.cells_in_series , packet1.discharge_maximum_current , packet1.discharge_maximum_burst_current , packet1.manufacture_date );
12899 mavlink_msg_smart_battery_info_decode(&msg, &packet2);
12900 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12901
12902 memset(&packet2, 0, sizeof(packet2));
12903 mavlink_msg_to_send_buffer(buffer, &msg);
12904 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12905 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12906 }
12907 mavlink_msg_smart_battery_info_decode(last_msg, &packet2);
12908 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12909
12910 memset(&packet2, 0, sizeof(packet2));
12911 mavlink_msg_smart_battery_info_send(MAVLINK_COMM_1 , packet1.id , packet1.battery_function , packet1.type , packet1.capacity_full_specification , packet1.capacity_full , packet1.cycle_count , packet1.serial_number , packet1.device_name , packet1.weight , packet1.discharge_minimum_voltage , packet1.charging_minimum_voltage , packet1.resting_minimum_voltage , packet1.charging_maximum_voltage , packet1.cells_in_series , packet1.discharge_maximum_current , packet1.discharge_maximum_burst_current , packet1.manufacture_date );
12912 mavlink_msg_smart_battery_info_decode(last_msg, &packet2);
12913 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12914
12915#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12916 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SMART_BATTERY_INFO") != NULL);
12917 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SMART_BATTERY_INFO) != NULL);
12918#endif
12919}
12920
12921static void mavlink_test_figure_eight_execution_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12922{
12923#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12924 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12925 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FIGURE_EIGHT_EXECUTION_STATUS >= 256) {
12926 return;
12927 }
12928#endif
12929 mavlink_message_t msg;
12930 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12931 uint16_t i;
12932 mavlink_figure_eight_execution_status_t packet_in = {
12933 93372036854775807ULL,73.0,101.0,129.0,963498504,963498712,213.0,101
12934 };
12935 mavlink_figure_eight_execution_status_t packet1, packet2;
12936 memset(&packet1, 0, sizeof(packet1));
12937 packet1.time_usec = packet_in.time_usec;
12938 packet1.major_radius = packet_in.major_radius;
12939 packet1.minor_radius = packet_in.minor_radius;
12940 packet1.orientation = packet_in.orientation;
12941 packet1.x = packet_in.x;
12942 packet1.y = packet_in.y;
12943 packet1.z = packet_in.z;
12944 packet1.frame = packet_in.frame;
12945
12946
12947#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12948 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12949 // cope with extensions
12950 memset(MAVLINK_MSG_ID_FIGURE_EIGHT_EXECUTION_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FIGURE_EIGHT_EXECUTION_STATUS_MIN_LEN);
12951 }
12952#endif
12953 memset(&packet2, 0, sizeof(packet2));
12954 mavlink_msg_figure_eight_execution_status_encode(system_id, component_id, &msg, &packet1);
12955 mavlink_msg_figure_eight_execution_status_decode(&msg, &packet2);
12956 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12957
12958 memset(&packet2, 0, sizeof(packet2));
12959 mavlink_msg_figure_eight_execution_status_pack(system_id, component_id, &msg , packet1.time_usec , packet1.major_radius , packet1.minor_radius , packet1.orientation , packet1.frame , packet1.x , packet1.y , packet1.z );
12960 mavlink_msg_figure_eight_execution_status_decode(&msg, &packet2);
12961 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12962
12963 memset(&packet2, 0, sizeof(packet2));
12964 mavlink_msg_figure_eight_execution_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.major_radius , packet1.minor_radius , packet1.orientation , packet1.frame , packet1.x , packet1.y , packet1.z );
12965 mavlink_msg_figure_eight_execution_status_decode(&msg, &packet2);
12966 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12967
12968 memset(&packet2, 0, sizeof(packet2));
12969 mavlink_msg_to_send_buffer(buffer, &msg);
12970 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12971 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12972 }
12973 mavlink_msg_figure_eight_execution_status_decode(last_msg, &packet2);
12974 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12975
12976 memset(&packet2, 0, sizeof(packet2));
12977 mavlink_msg_figure_eight_execution_status_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.major_radius , packet1.minor_radius , packet1.orientation , packet1.frame , packet1.x , packet1.y , packet1.z );
12978 mavlink_msg_figure_eight_execution_status_decode(last_msg, &packet2);
12979 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12980
12981#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12982 MAVLINK_ASSERT(mavlink_get_message_info_by_name("FIGURE_EIGHT_EXECUTION_STATUS") != NULL);
12983 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_FIGURE_EIGHT_EXECUTION_STATUS) != NULL);
12984#endif
12985}
12986
12987static void mavlink_test_fuel_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12988{
12989#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12990 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12991 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FUEL_STATUS >= 256) {
12992 return;
12993 }
12994#endif
12995 mavlink_message_t msg;
12996 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12997 uint16_t i;
12998 mavlink_fuel_status_t packet_in = {
12999 17.0,45.0,73.0,101.0,129.0,963498504,77,144
13000 };
13001 mavlink_fuel_status_t packet1, packet2;
13002 memset(&packet1, 0, sizeof(packet1));
13003 packet1.maximum_fuel = packet_in.maximum_fuel;
13004 packet1.consumed_fuel = packet_in.consumed_fuel;
13005 packet1.remaining_fuel = packet_in.remaining_fuel;
13006 packet1.flow_rate = packet_in.flow_rate;
13007 packet1.temperature = packet_in.temperature;
13008 packet1.fuel_type = packet_in.fuel_type;
13009 packet1.id = packet_in.id;
13010 packet1.percent_remaining = packet_in.percent_remaining;
13011
13012
13013#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13014 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13015 // cope with extensions
13016 memset(MAVLINK_MSG_ID_FUEL_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FUEL_STATUS_MIN_LEN);
13017 }
13018#endif
13019 memset(&packet2, 0, sizeof(packet2));
13020 mavlink_msg_fuel_status_encode(system_id, component_id, &msg, &packet1);
13021 mavlink_msg_fuel_status_decode(&msg, &packet2);
13022 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13023
13024 memset(&packet2, 0, sizeof(packet2));
13025 mavlink_msg_fuel_status_pack(system_id, component_id, &msg , packet1.id , packet1.maximum_fuel , packet1.consumed_fuel , packet1.remaining_fuel , packet1.percent_remaining , packet1.flow_rate , packet1.temperature , packet1.fuel_type );
13026 mavlink_msg_fuel_status_decode(&msg, &packet2);
13027 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13028
13029 memset(&packet2, 0, sizeof(packet2));
13030 mavlink_msg_fuel_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.maximum_fuel , packet1.consumed_fuel , packet1.remaining_fuel , packet1.percent_remaining , packet1.flow_rate , packet1.temperature , packet1.fuel_type );
13031 mavlink_msg_fuel_status_decode(&msg, &packet2);
13032 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13033
13034 memset(&packet2, 0, sizeof(packet2));
13035 mavlink_msg_to_send_buffer(buffer, &msg);
13036 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13037 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13038 }
13039 mavlink_msg_fuel_status_decode(last_msg, &packet2);
13040 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13041
13042 memset(&packet2, 0, sizeof(packet2));
13043 mavlink_msg_fuel_status_send(MAVLINK_COMM_1 , packet1.id , packet1.maximum_fuel , packet1.consumed_fuel , packet1.remaining_fuel , packet1.percent_remaining , packet1.flow_rate , packet1.temperature , packet1.fuel_type );
13044 mavlink_msg_fuel_status_decode(last_msg, &packet2);
13045 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13046
13047#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13048 MAVLINK_ASSERT(mavlink_get_message_info_by_name("FUEL_STATUS") != NULL);
13049 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_FUEL_STATUS) != NULL);
13050#endif
13051}
13052
13053static void mavlink_test_battery_info(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13054{
13055#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13056 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13057 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_BATTERY_INFO >= 256) {
13058 return;
13059 }
13060#endif
13061 mavlink_message_t msg;
13062 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13063 uint16_t i;
13064 mavlink_battery_info_t packet_in = {
13065 17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,19315,19419,137,204,15,82,149,"XYZABCDE","GHIJKLMNOPQRSTUVWXYZABCDEFGHIJK","MNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHI"
13066 };
13067 mavlink_battery_info_t packet1, packet2;
13068 memset(&packet1, 0, sizeof(packet1));
13069 packet1.discharge_minimum_voltage = packet_in.discharge_minimum_voltage;
13070 packet1.charging_minimum_voltage = packet_in.charging_minimum_voltage;
13071 packet1.resting_minimum_voltage = packet_in.resting_minimum_voltage;
13072 packet1.charging_maximum_voltage = packet_in.charging_maximum_voltage;
13073 packet1.charging_maximum_current = packet_in.charging_maximum_current;
13074 packet1.nominal_voltage = packet_in.nominal_voltage;
13075 packet1.discharge_maximum_current = packet_in.discharge_maximum_current;
13076 packet1.discharge_maximum_burst_current = packet_in.discharge_maximum_burst_current;
13077 packet1.design_capacity = packet_in.design_capacity;
13078 packet1.full_charge_capacity = packet_in.full_charge_capacity;
13079 packet1.cycle_count = packet_in.cycle_count;
13080 packet1.weight = packet_in.weight;
13081 packet1.id = packet_in.id;
13082 packet1.battery_function = packet_in.battery_function;
13083 packet1.type = packet_in.type;
13084 packet1.state_of_health = packet_in.state_of_health;
13085 packet1.cells_in_series = packet_in.cells_in_series;
13086
13087 mav_array_memcpy(packet1.manufacture_date, packet_in.manufacture_date, sizeof(char)*9);
13088 mav_array_memcpy(packet1.serial_number, packet_in.serial_number, sizeof(char)*32);
13089 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*50);
13090
13091#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13092 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13093 // cope with extensions
13094 memset(MAVLINK_MSG_ID_BATTERY_INFO_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_BATTERY_INFO_MIN_LEN);
13095 }
13096#endif
13097 memset(&packet2, 0, sizeof(packet2));
13098 mavlink_msg_battery_info_encode(system_id, component_id, &msg, &packet1);
13099 mavlink_msg_battery_info_decode(&msg, &packet2);
13100 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13101
13102 memset(&packet2, 0, sizeof(packet2));
13103 mavlink_msg_battery_info_pack(system_id, component_id, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.state_of_health , packet1.cells_in_series , packet1.cycle_count , packet1.weight , packet1.discharge_minimum_voltage , packet1.charging_minimum_voltage , packet1.resting_minimum_voltage , packet1.charging_maximum_voltage , packet1.charging_maximum_current , packet1.nominal_voltage , packet1.discharge_maximum_current , packet1.discharge_maximum_burst_current , packet1.design_capacity , packet1.full_charge_capacity , packet1.manufacture_date , packet1.serial_number , packet1.name );
13104 mavlink_msg_battery_info_decode(&msg, &packet2);
13105 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13106
13107 memset(&packet2, 0, sizeof(packet2));
13108 mavlink_msg_battery_info_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.state_of_health , packet1.cells_in_series , packet1.cycle_count , packet1.weight , packet1.discharge_minimum_voltage , packet1.charging_minimum_voltage , packet1.resting_minimum_voltage , packet1.charging_maximum_voltage , packet1.charging_maximum_current , packet1.nominal_voltage , packet1.discharge_maximum_current , packet1.discharge_maximum_burst_current , packet1.design_capacity , packet1.full_charge_capacity , packet1.manufacture_date , packet1.serial_number , packet1.name );
13109 mavlink_msg_battery_info_decode(&msg, &packet2);
13110 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13111
13112 memset(&packet2, 0, sizeof(packet2));
13113 mavlink_msg_to_send_buffer(buffer, &msg);
13114 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13115 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13116 }
13117 mavlink_msg_battery_info_decode(last_msg, &packet2);
13118 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13119
13120 memset(&packet2, 0, sizeof(packet2));
13121 mavlink_msg_battery_info_send(MAVLINK_COMM_1 , packet1.id , packet1.battery_function , packet1.type , packet1.state_of_health , packet1.cells_in_series , packet1.cycle_count , packet1.weight , packet1.discharge_minimum_voltage , packet1.charging_minimum_voltage , packet1.resting_minimum_voltage , packet1.charging_maximum_voltage , packet1.charging_maximum_current , packet1.nominal_voltage , packet1.discharge_maximum_current , packet1.discharge_maximum_burst_current , packet1.design_capacity , packet1.full_charge_capacity , packet1.manufacture_date , packet1.serial_number , packet1.name );
13122 mavlink_msg_battery_info_decode(last_msg, &packet2);
13123 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13124
13125#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13126 MAVLINK_ASSERT(mavlink_get_message_info_by_name("BATTERY_INFO") != NULL);
13127 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_BATTERY_INFO) != NULL);
13128#endif
13129}
13130
13131static void mavlink_test_generator_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13132{
13133#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13134 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13135 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GENERATOR_STATUS >= 256) {
13136 return;
13137 }
13138#endif
13139 mavlink_message_t msg;
13140 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13141 uint16_t i;
13142 mavlink_generator_status_t packet_in = {
13143 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,963498920,963499128,19107,19211,19315
13144 };
13145 mavlink_generator_status_t packet1, packet2;
13146 memset(&packet1, 0, sizeof(packet1));
13147 packet1.status = packet_in.status;
13148 packet1.battery_current = packet_in.battery_current;
13149 packet1.load_current = packet_in.load_current;
13150 packet1.power_generated = packet_in.power_generated;
13151 packet1.bus_voltage = packet_in.bus_voltage;
13152 packet1.bat_current_setpoint = packet_in.bat_current_setpoint;
13153 packet1.runtime = packet_in.runtime;
13154 packet1.time_until_maintenance = packet_in.time_until_maintenance;
13155 packet1.generator_speed = packet_in.generator_speed;
13156 packet1.rectifier_temperature = packet_in.rectifier_temperature;
13157 packet1.generator_temperature = packet_in.generator_temperature;
13158
13159
13160#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13161 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13162 // cope with extensions
13163 memset(MAVLINK_MSG_ID_GENERATOR_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GENERATOR_STATUS_MIN_LEN);
13164 }
13165#endif
13166 memset(&packet2, 0, sizeof(packet2));
13167 mavlink_msg_generator_status_encode(system_id, component_id, &msg, &packet1);
13168 mavlink_msg_generator_status_decode(&msg, &packet2);
13169 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13170
13171 memset(&packet2, 0, sizeof(packet2));
13172 mavlink_msg_generator_status_pack(system_id, component_id, &msg , packet1.status , packet1.generator_speed , packet1.battery_current , packet1.load_current , packet1.power_generated , packet1.bus_voltage , packet1.rectifier_temperature , packet1.bat_current_setpoint , packet1.generator_temperature , packet1.runtime , packet1.time_until_maintenance );
13173 mavlink_msg_generator_status_decode(&msg, &packet2);
13174 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13175
13176 memset(&packet2, 0, sizeof(packet2));
13177 mavlink_msg_generator_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.status , packet1.generator_speed , packet1.battery_current , packet1.load_current , packet1.power_generated , packet1.bus_voltage , packet1.rectifier_temperature , packet1.bat_current_setpoint , packet1.generator_temperature , packet1.runtime , packet1.time_until_maintenance );
13178 mavlink_msg_generator_status_decode(&msg, &packet2);
13179 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13180
13181 memset(&packet2, 0, sizeof(packet2));
13182 mavlink_msg_to_send_buffer(buffer, &msg);
13183 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13184 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13185 }
13186 mavlink_msg_generator_status_decode(last_msg, &packet2);
13187 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13188
13189 memset(&packet2, 0, sizeof(packet2));
13190 mavlink_msg_generator_status_send(MAVLINK_COMM_1 , packet1.status , packet1.generator_speed , packet1.battery_current , packet1.load_current , packet1.power_generated , packet1.bus_voltage , packet1.rectifier_temperature , packet1.bat_current_setpoint , packet1.generator_temperature , packet1.runtime , packet1.time_until_maintenance );
13191 mavlink_msg_generator_status_decode(last_msg, &packet2);
13192 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13193
13194#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13195 MAVLINK_ASSERT(mavlink_get_message_info_by_name("GENERATOR_STATUS") != NULL);
13196 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GENERATOR_STATUS) != NULL);
13197#endif
13198}
13199
13200static void mavlink_test_actuator_output_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13201{
13202#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13203 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13204 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS >= 256) {
13205 return;
13206 }
13207#endif
13208 mavlink_message_t msg;
13209 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13210 uint16_t i;
13211 mavlink_actuator_output_status_t packet_in = {
13212 93372036854775807ULL,963497880,{ 101.0, 102.0, 103.0, 104.0, 105.0, 106.0, 107.0, 108.0, 109.0, 110.0, 111.0, 112.0, 113.0, 114.0, 115.0, 116.0, 117.0, 118.0, 119.0, 120.0, 121.0, 122.0, 123.0, 124.0, 125.0, 126.0, 127.0, 128.0, 129.0, 130.0, 131.0, 132.0 }
13213 };
13214 mavlink_actuator_output_status_t packet1, packet2;
13215 memset(&packet1, 0, sizeof(packet1));
13216 packet1.time_usec = packet_in.time_usec;
13217 packet1.active = packet_in.active;
13218
13219 mav_array_memcpy(packet1.actuator, packet_in.actuator, sizeof(float)*32);
13220
13221#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13222 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13223 // cope with extensions
13224 memset(MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS_MIN_LEN);
13225 }
13226#endif
13227 memset(&packet2, 0, sizeof(packet2));
13228 mavlink_msg_actuator_output_status_encode(system_id, component_id, &msg, &packet1);
13229 mavlink_msg_actuator_output_status_decode(&msg, &packet2);
13230 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13231
13232 memset(&packet2, 0, sizeof(packet2));
13233 mavlink_msg_actuator_output_status_pack(system_id, component_id, &msg , packet1.time_usec , packet1.active , packet1.actuator );
13234 mavlink_msg_actuator_output_status_decode(&msg, &packet2);
13235 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13236
13237 memset(&packet2, 0, sizeof(packet2));
13238 mavlink_msg_actuator_output_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.active , packet1.actuator );
13239 mavlink_msg_actuator_output_status_decode(&msg, &packet2);
13240 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13241
13242 memset(&packet2, 0, sizeof(packet2));
13243 mavlink_msg_to_send_buffer(buffer, &msg);
13244 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13245 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13246 }
13247 mavlink_msg_actuator_output_status_decode(last_msg, &packet2);
13248 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13249
13250 memset(&packet2, 0, sizeof(packet2));
13251 mavlink_msg_actuator_output_status_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.active , packet1.actuator );
13252 mavlink_msg_actuator_output_status_decode(last_msg, &packet2);
13253 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13254
13255#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13256 MAVLINK_ASSERT(mavlink_get_message_info_by_name("ACTUATOR_OUTPUT_STATUS") != NULL);
13257 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS) != NULL);
13258#endif
13259}
13260
13261static void mavlink_test_relay_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13262{
13263#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13264 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13265 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RELAY_STATUS >= 256) {
13266 return;
13267 }
13268#endif
13269 mavlink_message_t msg;
13270 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13271 uint16_t i;
13272 mavlink_relay_status_t packet_in = {
13273 963497464,17443,17547
13274 };
13275 mavlink_relay_status_t packet1, packet2;
13276 memset(&packet1, 0, sizeof(packet1));
13277 packet1.time_boot_ms = packet_in.time_boot_ms;
13278 packet1.on = packet_in.on;
13279 packet1.present = packet_in.present;
13280
13281
13282#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13283 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13284 // cope with extensions
13285 memset(MAVLINK_MSG_ID_RELAY_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RELAY_STATUS_MIN_LEN);
13286 }
13287#endif
13288 memset(&packet2, 0, sizeof(packet2));
13289 mavlink_msg_relay_status_encode(system_id, component_id, &msg, &packet1);
13290 mavlink_msg_relay_status_decode(&msg, &packet2);
13291 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13292
13293 memset(&packet2, 0, sizeof(packet2));
13294 mavlink_msg_relay_status_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.on , packet1.present );
13295 mavlink_msg_relay_status_decode(&msg, &packet2);
13296 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13297
13298 memset(&packet2, 0, sizeof(packet2));
13299 mavlink_msg_relay_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.on , packet1.present );
13300 mavlink_msg_relay_status_decode(&msg, &packet2);
13301 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13302
13303 memset(&packet2, 0, sizeof(packet2));
13304 mavlink_msg_to_send_buffer(buffer, &msg);
13305 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13306 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13307 }
13308 mavlink_msg_relay_status_decode(last_msg, &packet2);
13309 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13310
13311 memset(&packet2, 0, sizeof(packet2));
13312 mavlink_msg_relay_status_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.on , packet1.present );
13313 mavlink_msg_relay_status_decode(last_msg, &packet2);
13314 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13315
13316#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13317 MAVLINK_ASSERT(mavlink_get_message_info_by_name("RELAY_STATUS") != NULL);
13318 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_RELAY_STATUS) != NULL);
13319#endif
13320}
13321
13322static void mavlink_test_time_estimate_to_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13323{
13324#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13325 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13326 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET >= 256) {
13327 return;
13328 }
13329#endif
13330 mavlink_message_t msg;
13331 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13332 uint16_t i;
13333 mavlink_time_estimate_to_target_t packet_in = {
13334 963497464,963497672,963497880,963498088,963498296
13335 };
13336 mavlink_time_estimate_to_target_t packet1, packet2;
13337 memset(&packet1, 0, sizeof(packet1));
13338 packet1.safe_return = packet_in.safe_return;
13339 packet1.land = packet_in.land;
13340 packet1.mission_next_item = packet_in.mission_next_item;
13341 packet1.mission_end = packet_in.mission_end;
13342 packet1.commanded_action = packet_in.commanded_action;
13343
13344
13345#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13346 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13347 // cope with extensions
13348 memset(MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_MIN_LEN);
13349 }
13350#endif
13351 memset(&packet2, 0, sizeof(packet2));
13352 mavlink_msg_time_estimate_to_target_encode(system_id, component_id, &msg, &packet1);
13353 mavlink_msg_time_estimate_to_target_decode(&msg, &packet2);
13354 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13355
13356 memset(&packet2, 0, sizeof(packet2));
13357 mavlink_msg_time_estimate_to_target_pack(system_id, component_id, &msg , packet1.safe_return , packet1.land , packet1.mission_next_item , packet1.mission_end , packet1.commanded_action );
13358 mavlink_msg_time_estimate_to_target_decode(&msg, &packet2);
13359 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13360
13361 memset(&packet2, 0, sizeof(packet2));
13362 mavlink_msg_time_estimate_to_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.safe_return , packet1.land , packet1.mission_next_item , packet1.mission_end , packet1.commanded_action );
13363 mavlink_msg_time_estimate_to_target_decode(&msg, &packet2);
13364 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13365
13366 memset(&packet2, 0, sizeof(packet2));
13367 mavlink_msg_to_send_buffer(buffer, &msg);
13368 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13369 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13370 }
13371 mavlink_msg_time_estimate_to_target_decode(last_msg, &packet2);
13372 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13373
13374 memset(&packet2, 0, sizeof(packet2));
13375 mavlink_msg_time_estimate_to_target_send(MAVLINK_COMM_1 , packet1.safe_return , packet1.land , packet1.mission_next_item , packet1.mission_end , packet1.commanded_action );
13376 mavlink_msg_time_estimate_to_target_decode(last_msg, &packet2);
13377 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13378
13379#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13380 MAVLINK_ASSERT(mavlink_get_message_info_by_name("TIME_ESTIMATE_TO_TARGET") != NULL);
13381 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET) != NULL);
13382#endif
13383}
13384
13385static void mavlink_test_tunnel(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13386{
13387#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13388 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13389 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TUNNEL >= 256) {
13390 return;
13391 }
13392#endif
13393 mavlink_message_t msg;
13394 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13395 uint16_t i;
13396 mavlink_tunnel_t packet_in = {
13397 17235,139,206,17,{ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 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 }
13398 };
13399 mavlink_tunnel_t packet1, packet2;
13400 memset(&packet1, 0, sizeof(packet1));
13401 packet1.payload_type = packet_in.payload_type;
13402 packet1.target_system = packet_in.target_system;
13403 packet1.target_component = packet_in.target_component;
13404 packet1.payload_length = packet_in.payload_length;
13405
13406 mav_array_memcpy(packet1.payload, packet_in.payload, sizeof(uint8_t)*128);
13407
13408#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13409 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13410 // cope with extensions
13411 memset(MAVLINK_MSG_ID_TUNNEL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TUNNEL_MIN_LEN);
13412 }
13413#endif
13414 memset(&packet2, 0, sizeof(packet2));
13415 mavlink_msg_tunnel_encode(system_id, component_id, &msg, &packet1);
13416 mavlink_msg_tunnel_decode(&msg, &packet2);
13417 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13418
13419 memset(&packet2, 0, sizeof(packet2));
13420 mavlink_msg_tunnel_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.payload_type , packet1.payload_length , packet1.payload );
13421 mavlink_msg_tunnel_decode(&msg, &packet2);
13422 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13423
13424 memset(&packet2, 0, sizeof(packet2));
13425 mavlink_msg_tunnel_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.payload_type , packet1.payload_length , packet1.payload );
13426 mavlink_msg_tunnel_decode(&msg, &packet2);
13427 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13428
13429 memset(&packet2, 0, sizeof(packet2));
13430 mavlink_msg_to_send_buffer(buffer, &msg);
13431 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13432 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13433 }
13434 mavlink_msg_tunnel_decode(last_msg, &packet2);
13435 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13436
13437 memset(&packet2, 0, sizeof(packet2));
13438 mavlink_msg_tunnel_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.payload_type , packet1.payload_length , packet1.payload );
13439 mavlink_msg_tunnel_decode(last_msg, &packet2);
13440 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13441
13442#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13443 MAVLINK_ASSERT(mavlink_get_message_info_by_name("TUNNEL") != NULL);
13444 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_TUNNEL) != NULL);
13445#endif
13446}
13447
13448static void mavlink_test_can_frame(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13449{
13450#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13451 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13452 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAN_FRAME >= 256) {
13453 return;
13454 }
13455#endif
13456 mavlink_message_t msg;
13457 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13458 uint16_t i;
13459 mavlink_can_frame_t packet_in = {
13460 963497464,17,84,151,218,{ 29, 30, 31, 32, 33, 34, 35, 36 }
13461 };
13462 mavlink_can_frame_t packet1, packet2;
13463 memset(&packet1, 0, sizeof(packet1));
13464 packet1.id = packet_in.id;
13465 packet1.target_system = packet_in.target_system;
13466 packet1.target_component = packet_in.target_component;
13467 packet1.bus = packet_in.bus;
13468 packet1.len = packet_in.len;
13469
13470 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*8);
13471
13472#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13473 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13474 // cope with extensions
13475 memset(MAVLINK_MSG_ID_CAN_FRAME_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAN_FRAME_MIN_LEN);
13476 }
13477#endif
13478 memset(&packet2, 0, sizeof(packet2));
13479 mavlink_msg_can_frame_encode(system_id, component_id, &msg, &packet1);
13480 mavlink_msg_can_frame_decode(&msg, &packet2);
13481 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13482
13483 memset(&packet2, 0, sizeof(packet2));
13484 mavlink_msg_can_frame_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.bus , packet1.len , packet1.id , packet1.data );
13485 mavlink_msg_can_frame_decode(&msg, &packet2);
13486 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13487
13488 memset(&packet2, 0, sizeof(packet2));
13489 mavlink_msg_can_frame_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.bus , packet1.len , packet1.id , packet1.data );
13490 mavlink_msg_can_frame_decode(&msg, &packet2);
13491 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13492
13493 memset(&packet2, 0, sizeof(packet2));
13494 mavlink_msg_to_send_buffer(buffer, &msg);
13495 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13496 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13497 }
13498 mavlink_msg_can_frame_decode(last_msg, &packet2);
13499 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13500
13501 memset(&packet2, 0, sizeof(packet2));
13502 mavlink_msg_can_frame_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.bus , packet1.len , packet1.id , packet1.data );
13503 mavlink_msg_can_frame_decode(last_msg, &packet2);
13504 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13505
13506#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13507 MAVLINK_ASSERT(mavlink_get_message_info_by_name("CAN_FRAME") != NULL);
13508 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CAN_FRAME) != NULL);
13509#endif
13510}
13511
13512static void mavlink_test_onboard_computer_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13513{
13514#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13515 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13516 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS >= 256) {
13517 return;
13518 }
13519#endif
13520 mavlink_message_t msg;
13521 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13522 uint16_t i;
13523 mavlink_onboard_computer_status_t packet_in = {
13524 93372036854775807ULL,963497880,963498088,963498296,{ 963498504, 963498505, 963498506, 963498507 },{ 963499336, 963499337, 963499338, 963499339 },{ 963500168, 963500169, 963500170, 963500171 },{ 963501000, 963501001, 963501002, 963501003, 963501004, 963501005 },{ 963502248, 963502249, 963502250, 963502251, 963502252, 963502253 },{ 963503496, 963503497, 963503498, 963503499, 963503500, 963503501 },{ 963504744, 963504745, 963504746, 963504747, 963504748, 963504749 },{ 963505992, 963505993, 963505994, 963505995, 963505996, 963505997 },{ 27011, 27012, 27013, 27014 },81,{ 148, 149, 150, 151, 152, 153, 154, 155 },{ 172, 173, 174, 175, 176, 177, 178, 179, 180, 181 },{ 74, 75, 76, 77 },{ 86, 87, 88, 89, 90, 91, 92, 93, 94, 95 },244,{ 55, 56, 57, 58, 59, 60, 61, 62 },29611
13525 };
13526 mavlink_onboard_computer_status_t packet1, packet2;
13527 memset(&packet1, 0, sizeof(packet1));
13528 packet1.time_usec = packet_in.time_usec;
13529 packet1.uptime = packet_in.uptime;
13530 packet1.ram_usage = packet_in.ram_usage;
13531 packet1.ram_total = packet_in.ram_total;
13532 packet1.type = packet_in.type;
13533 packet1.temperature_board = packet_in.temperature_board;
13534 packet1.status_flags = packet_in.status_flags;
13535
13536 mav_array_memcpy(packet1.storage_type, packet_in.storage_type, sizeof(uint32_t)*4);
13537 mav_array_memcpy(packet1.storage_usage, packet_in.storage_usage, sizeof(uint32_t)*4);
13538 mav_array_memcpy(packet1.storage_total, packet_in.storage_total, sizeof(uint32_t)*4);
13539 mav_array_memcpy(packet1.link_type, packet_in.link_type, sizeof(uint32_t)*6);
13540 mav_array_memcpy(packet1.link_tx_rate, packet_in.link_tx_rate, sizeof(uint32_t)*6);
13541 mav_array_memcpy(packet1.link_rx_rate, packet_in.link_rx_rate, sizeof(uint32_t)*6);
13542 mav_array_memcpy(packet1.link_tx_max, packet_in.link_tx_max, sizeof(uint32_t)*6);
13543 mav_array_memcpy(packet1.link_rx_max, packet_in.link_rx_max, sizeof(uint32_t)*6);
13544 mav_array_memcpy(packet1.fan_speed, packet_in.fan_speed, sizeof(int16_t)*4);
13545 mav_array_memcpy(packet1.cpu_cores, packet_in.cpu_cores, sizeof(uint8_t)*8);
13546 mav_array_memcpy(packet1.cpu_combined, packet_in.cpu_combined, sizeof(uint8_t)*10);
13547 mav_array_memcpy(packet1.gpu_cores, packet_in.gpu_cores, sizeof(uint8_t)*4);
13548 mav_array_memcpy(packet1.gpu_combined, packet_in.gpu_combined, sizeof(uint8_t)*10);
13549 mav_array_memcpy(packet1.temperature_core, packet_in.temperature_core, sizeof(int8_t)*8);
13550
13551#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13552 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13553 // cope with extensions
13554 memset(MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_MIN_LEN);
13555 }
13556#endif
13557 memset(&packet2, 0, sizeof(packet2));
13558 mavlink_msg_onboard_computer_status_encode(system_id, component_id, &msg, &packet1);
13559 mavlink_msg_onboard_computer_status_decode(&msg, &packet2);
13560 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13561
13562 memset(&packet2, 0, sizeof(packet2));
13563 mavlink_msg_onboard_computer_status_pack(system_id, component_id, &msg , packet1.time_usec , packet1.uptime , packet1.type , packet1.cpu_cores , packet1.cpu_combined , packet1.gpu_cores , packet1.gpu_combined , packet1.temperature_board , packet1.temperature_core , packet1.fan_speed , packet1.ram_usage , packet1.ram_total , packet1.storage_type , packet1.storage_usage , packet1.storage_total , packet1.link_type , packet1.link_tx_rate , packet1.link_rx_rate , packet1.link_tx_max , packet1.link_rx_max , packet1.status_flags );
13564 mavlink_msg_onboard_computer_status_decode(&msg, &packet2);
13565 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13566
13567 memset(&packet2, 0, sizeof(packet2));
13568 mavlink_msg_onboard_computer_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.uptime , packet1.type , packet1.cpu_cores , packet1.cpu_combined , packet1.gpu_cores , packet1.gpu_combined , packet1.temperature_board , packet1.temperature_core , packet1.fan_speed , packet1.ram_usage , packet1.ram_total , packet1.storage_type , packet1.storage_usage , packet1.storage_total , packet1.link_type , packet1.link_tx_rate , packet1.link_rx_rate , packet1.link_tx_max , packet1.link_rx_max , packet1.status_flags );
13569 mavlink_msg_onboard_computer_status_decode(&msg, &packet2);
13570 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13571
13572 memset(&packet2, 0, sizeof(packet2));
13573 mavlink_msg_to_send_buffer(buffer, &msg);
13574 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13575 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13576 }
13577 mavlink_msg_onboard_computer_status_decode(last_msg, &packet2);
13578 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13579
13580 memset(&packet2, 0, sizeof(packet2));
13581 mavlink_msg_onboard_computer_status_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.uptime , packet1.type , packet1.cpu_cores , packet1.cpu_combined , packet1.gpu_cores , packet1.gpu_combined , packet1.temperature_board , packet1.temperature_core , packet1.fan_speed , packet1.ram_usage , packet1.ram_total , packet1.storage_type , packet1.storage_usage , packet1.storage_total , packet1.link_type , packet1.link_tx_rate , packet1.link_rx_rate , packet1.link_tx_max , packet1.link_rx_max , packet1.status_flags );
13582 mavlink_msg_onboard_computer_status_decode(last_msg, &packet2);
13583 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13584
13585#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13586 MAVLINK_ASSERT(mavlink_get_message_info_by_name("ONBOARD_COMPUTER_STATUS") != NULL);
13587 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS) != NULL);
13588#endif
13589}
13590
13591static void mavlink_test_component_information(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13592{
13593#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13594 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13595 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMPONENT_INFORMATION >= 256) {
13596 return;
13597 }
13598#endif
13599 mavlink_message_t msg;
13600 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13601 uint16_t i;
13602 mavlink_component_information_t packet_in = {
13603 963497464,963497672,963497880,"MNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFG","IJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABC"
13604 };
13605 mavlink_component_information_t packet1, packet2;
13606 memset(&packet1, 0, sizeof(packet1));
13607 packet1.time_boot_ms = packet_in.time_boot_ms;
13608 packet1.general_metadata_file_crc = packet_in.general_metadata_file_crc;
13609 packet1.peripherals_metadata_file_crc = packet_in.peripherals_metadata_file_crc;
13610
13611 mav_array_memcpy(packet1.general_metadata_uri, packet_in.general_metadata_uri, sizeof(char)*100);
13612 mav_array_memcpy(packet1.peripherals_metadata_uri, packet_in.peripherals_metadata_uri, sizeof(char)*100);
13613
13614#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13615 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13616 // cope with extensions
13617 memset(MAVLINK_MSG_ID_COMPONENT_INFORMATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COMPONENT_INFORMATION_MIN_LEN);
13618 }
13619#endif
13620 memset(&packet2, 0, sizeof(packet2));
13621 mavlink_msg_component_information_encode(system_id, component_id, &msg, &packet1);
13622 mavlink_msg_component_information_decode(&msg, &packet2);
13623 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13624
13625 memset(&packet2, 0, sizeof(packet2));
13626 mavlink_msg_component_information_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.general_metadata_file_crc , packet1.general_metadata_uri , packet1.peripherals_metadata_file_crc , packet1.peripherals_metadata_uri );
13627 mavlink_msg_component_information_decode(&msg, &packet2);
13628 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13629
13630 memset(&packet2, 0, sizeof(packet2));
13631 mavlink_msg_component_information_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.general_metadata_file_crc , packet1.general_metadata_uri , packet1.peripherals_metadata_file_crc , packet1.peripherals_metadata_uri );
13632 mavlink_msg_component_information_decode(&msg, &packet2);
13633 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13634
13635 memset(&packet2, 0, sizeof(packet2));
13636 mavlink_msg_to_send_buffer(buffer, &msg);
13637 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13638 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13639 }
13640 mavlink_msg_component_information_decode(last_msg, &packet2);
13641 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13642
13643 memset(&packet2, 0, sizeof(packet2));
13644 mavlink_msg_component_information_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.general_metadata_file_crc , packet1.general_metadata_uri , packet1.peripherals_metadata_file_crc , packet1.peripherals_metadata_uri );
13645 mavlink_msg_component_information_decode(last_msg, &packet2);
13646 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13647
13648#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13649 MAVLINK_ASSERT(mavlink_get_message_info_by_name("COMPONENT_INFORMATION") != NULL);
13650 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_COMPONENT_INFORMATION) != NULL);
13651#endif
13652}
13653
13654static void mavlink_test_component_information_basic(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13655{
13656#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13657 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13658 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC >= 256) {
13659 return;
13660 }
13661#endif
13662 mavlink_message_t msg;
13663 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13664 uint16_t i;
13665 mavlink_component_information_basic_t packet_in = {
13666 93372036854775807ULL,963497880,963498088,"QRSTUVWXYZABCDEFGHIJKLMNOPQRSTU","WXYZABCDEFGHIJKLMNOPQRSTUVWXYZA","CDEFGHIJKLMNOPQRSTUVWXY","ABCDEFGHIJKLMNOPQRSTUVW","YZABCDEFGHIJKLMNOPQRSTUVWXYZABC"
13667 };
13668 mavlink_component_information_basic_t packet1, packet2;
13669 memset(&packet1, 0, sizeof(packet1));
13670 packet1.capabilities = packet_in.capabilities;
13671 packet1.time_boot_ms = packet_in.time_boot_ms;
13672 packet1.time_manufacture_s = packet_in.time_manufacture_s;
13673
13674 mav_array_memcpy(packet1.vendor_name, packet_in.vendor_name, sizeof(char)*32);
13675 mav_array_memcpy(packet1.model_name, packet_in.model_name, sizeof(char)*32);
13676 mav_array_memcpy(packet1.software_version, packet_in.software_version, sizeof(char)*24);
13677 mav_array_memcpy(packet1.hardware_version, packet_in.hardware_version, sizeof(char)*24);
13678 mav_array_memcpy(packet1.serial_number, packet_in.serial_number, sizeof(char)*32);
13679
13680#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13681 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13682 // cope with extensions
13683 memset(MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_MIN_LEN);
13684 }
13685#endif
13686 memset(&packet2, 0, sizeof(packet2));
13687 mavlink_msg_component_information_basic_encode(system_id, component_id, &msg, &packet1);
13688 mavlink_msg_component_information_basic_decode(&msg, &packet2);
13689 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13690
13691 memset(&packet2, 0, sizeof(packet2));
13692 mavlink_msg_component_information_basic_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.capabilities , packet1.time_manufacture_s , packet1.vendor_name , packet1.model_name , packet1.software_version , packet1.hardware_version , packet1.serial_number );
13693 mavlink_msg_component_information_basic_decode(&msg, &packet2);
13694 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13695
13696 memset(&packet2, 0, sizeof(packet2));
13697 mavlink_msg_component_information_basic_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.capabilities , packet1.time_manufacture_s , packet1.vendor_name , packet1.model_name , packet1.software_version , packet1.hardware_version , packet1.serial_number );
13698 mavlink_msg_component_information_basic_decode(&msg, &packet2);
13699 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13700
13701 memset(&packet2, 0, sizeof(packet2));
13702 mavlink_msg_to_send_buffer(buffer, &msg);
13703 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13704 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13705 }
13706 mavlink_msg_component_information_basic_decode(last_msg, &packet2);
13707 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13708
13709 memset(&packet2, 0, sizeof(packet2));
13710 mavlink_msg_component_information_basic_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.capabilities , packet1.time_manufacture_s , packet1.vendor_name , packet1.model_name , packet1.software_version , packet1.hardware_version , packet1.serial_number );
13711 mavlink_msg_component_information_basic_decode(last_msg, &packet2);
13712 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13713
13714#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13715 MAVLINK_ASSERT(mavlink_get_message_info_by_name("COMPONENT_INFORMATION_BASIC") != NULL);
13716 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC) != NULL);
13717#endif
13718}
13719
13720static void mavlink_test_component_metadata(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13721{
13722#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13723 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13724 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMPONENT_METADATA >= 256) {
13725 return;
13726 }
13727#endif
13728 mavlink_message_t msg;
13729 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13730 uint16_t i;
13731 mavlink_component_metadata_t packet_in = {
13732 963497464,963497672,"IJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABC"
13733 };
13734 mavlink_component_metadata_t packet1, packet2;
13735 memset(&packet1, 0, sizeof(packet1));
13736 packet1.time_boot_ms = packet_in.time_boot_ms;
13737 packet1.file_crc = packet_in.file_crc;
13738
13739 mav_array_memcpy(packet1.uri, packet_in.uri, sizeof(char)*100);
13740
13741#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13742 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13743 // cope with extensions
13744 memset(MAVLINK_MSG_ID_COMPONENT_METADATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COMPONENT_METADATA_MIN_LEN);
13745 }
13746#endif
13747 memset(&packet2, 0, sizeof(packet2));
13748 mavlink_msg_component_metadata_encode(system_id, component_id, &msg, &packet1);
13749 mavlink_msg_component_metadata_decode(&msg, &packet2);
13750 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13751
13752 memset(&packet2, 0, sizeof(packet2));
13753 mavlink_msg_component_metadata_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.file_crc , packet1.uri );
13754 mavlink_msg_component_metadata_decode(&msg, &packet2);
13755 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13756
13757 memset(&packet2, 0, sizeof(packet2));
13758 mavlink_msg_component_metadata_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.file_crc , packet1.uri );
13759 mavlink_msg_component_metadata_decode(&msg, &packet2);
13760 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13761
13762 memset(&packet2, 0, sizeof(packet2));
13763 mavlink_msg_to_send_buffer(buffer, &msg);
13764 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13765 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13766 }
13767 mavlink_msg_component_metadata_decode(last_msg, &packet2);
13768 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13769
13770 memset(&packet2, 0, sizeof(packet2));
13771 mavlink_msg_component_metadata_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.file_crc , packet1.uri );
13772 mavlink_msg_component_metadata_decode(last_msg, &packet2);
13773 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13774
13775#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13776 MAVLINK_ASSERT(mavlink_get_message_info_by_name("COMPONENT_METADATA") != NULL);
13777 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_COMPONENT_METADATA) != NULL);
13778#endif
13779}
13780
13781static void mavlink_test_play_tune_v2(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13782{
13783#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13784 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13785 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PLAY_TUNE_V2 >= 256) {
13786 return;
13787 }
13788#endif
13789 mavlink_message_t msg;
13790 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13791 uint16_t i;
13792 mavlink_play_tune_v2_t packet_in = {
13793 963497464,17,84,"GHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRS"
13794 };
13795 mavlink_play_tune_v2_t packet1, packet2;
13796 memset(&packet1, 0, sizeof(packet1));
13797 packet1.format = packet_in.format;
13798 packet1.target_system = packet_in.target_system;
13799 packet1.target_component = packet_in.target_component;
13800
13801 mav_array_memcpy(packet1.tune, packet_in.tune, sizeof(char)*248);
13802
13803#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13804 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13805 // cope with extensions
13806 memset(MAVLINK_MSG_ID_PLAY_TUNE_V2_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PLAY_TUNE_V2_MIN_LEN);
13807 }
13808#endif
13809 memset(&packet2, 0, sizeof(packet2));
13810 mavlink_msg_play_tune_v2_encode(system_id, component_id, &msg, &packet1);
13811 mavlink_msg_play_tune_v2_decode(&msg, &packet2);
13812 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13813
13814 memset(&packet2, 0, sizeof(packet2));
13815 mavlink_msg_play_tune_v2_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.format , packet1.tune );
13816 mavlink_msg_play_tune_v2_decode(&msg, &packet2);
13817 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13818
13819 memset(&packet2, 0, sizeof(packet2));
13820 mavlink_msg_play_tune_v2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.format , packet1.tune );
13821 mavlink_msg_play_tune_v2_decode(&msg, &packet2);
13822 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13823
13824 memset(&packet2, 0, sizeof(packet2));
13825 mavlink_msg_to_send_buffer(buffer, &msg);
13826 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13827 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13828 }
13829 mavlink_msg_play_tune_v2_decode(last_msg, &packet2);
13830 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13831
13832 memset(&packet2, 0, sizeof(packet2));
13833 mavlink_msg_play_tune_v2_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.format , packet1.tune );
13834 mavlink_msg_play_tune_v2_decode(last_msg, &packet2);
13835 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13836
13837#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13838 MAVLINK_ASSERT(mavlink_get_message_info_by_name("PLAY_TUNE_V2") != NULL);
13839 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PLAY_TUNE_V2) != NULL);
13840#endif
13841}
13842
13843static void mavlink_test_supported_tunes(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13844{
13845#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13846 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13847 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SUPPORTED_TUNES >= 256) {
13848 return;
13849 }
13850#endif
13851 mavlink_message_t msg;
13852 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13853 uint16_t i;
13854 mavlink_supported_tunes_t packet_in = {
13855 963497464,17,84
13856 };
13857 mavlink_supported_tunes_t packet1, packet2;
13858 memset(&packet1, 0, sizeof(packet1));
13859 packet1.format = packet_in.format;
13860 packet1.target_system = packet_in.target_system;
13861 packet1.target_component = packet_in.target_component;
13862
13863
13864#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13865 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13866 // cope with extensions
13867 memset(MAVLINK_MSG_ID_SUPPORTED_TUNES_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SUPPORTED_TUNES_MIN_LEN);
13868 }
13869#endif
13870 memset(&packet2, 0, sizeof(packet2));
13871 mavlink_msg_supported_tunes_encode(system_id, component_id, &msg, &packet1);
13872 mavlink_msg_supported_tunes_decode(&msg, &packet2);
13873 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13874
13875 memset(&packet2, 0, sizeof(packet2));
13876 mavlink_msg_supported_tunes_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.format );
13877 mavlink_msg_supported_tunes_decode(&msg, &packet2);
13878 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13879
13880 memset(&packet2, 0, sizeof(packet2));
13881 mavlink_msg_supported_tunes_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.format );
13882 mavlink_msg_supported_tunes_decode(&msg, &packet2);
13883 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13884
13885 memset(&packet2, 0, sizeof(packet2));
13886 mavlink_msg_to_send_buffer(buffer, &msg);
13887 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13888 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13889 }
13890 mavlink_msg_supported_tunes_decode(last_msg, &packet2);
13891 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13892
13893 memset(&packet2, 0, sizeof(packet2));
13894 mavlink_msg_supported_tunes_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.format );
13895 mavlink_msg_supported_tunes_decode(last_msg, &packet2);
13896 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13897
13898#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13899 MAVLINK_ASSERT(mavlink_get_message_info_by_name("SUPPORTED_TUNES") != NULL);
13900 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SUPPORTED_TUNES) != NULL);
13901#endif
13902}
13903
13904static void mavlink_test_event(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13905{
13906#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13907 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13908 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_EVENT >= 256) {
13909 return;
13910 }
13911#endif
13912 mavlink_message_t msg;
13913 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13914 uint16_t i;
13915 mavlink_event_t packet_in = {
13916 963497464,963497672,17651,163,230,41,{ 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 }
13917 };
13918 mavlink_event_t packet1, packet2;
13919 memset(&packet1, 0, sizeof(packet1));
13920 packet1.id = packet_in.id;
13921 packet1.event_time_boot_ms = packet_in.event_time_boot_ms;
13922 packet1.sequence = packet_in.sequence;
13923 packet1.destination_component = packet_in.destination_component;
13924 packet1.destination_system = packet_in.destination_system;
13925 packet1.log_levels = packet_in.log_levels;
13926
13927 mav_array_memcpy(packet1.arguments, packet_in.arguments, sizeof(uint8_t)*40);
13928
13929#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13930 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13931 // cope with extensions
13932 memset(MAVLINK_MSG_ID_EVENT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_EVENT_MIN_LEN);
13933 }
13934#endif
13935 memset(&packet2, 0, sizeof(packet2));
13936 mavlink_msg_event_encode(system_id, component_id, &msg, &packet1);
13937 mavlink_msg_event_decode(&msg, &packet2);
13938 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13939
13940 memset(&packet2, 0, sizeof(packet2));
13941 mavlink_msg_event_pack(system_id, component_id, &msg , packet1.destination_component , packet1.destination_system , packet1.id , packet1.event_time_boot_ms , packet1.sequence , packet1.log_levels , packet1.arguments );
13942 mavlink_msg_event_decode(&msg, &packet2);
13943 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13944
13945 memset(&packet2, 0, sizeof(packet2));
13946 mavlink_msg_event_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.destination_component , packet1.destination_system , packet1.id , packet1.event_time_boot_ms , packet1.sequence , packet1.log_levels , packet1.arguments );
13947 mavlink_msg_event_decode(&msg, &packet2);
13948 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13949
13950 memset(&packet2, 0, sizeof(packet2));
13951 mavlink_msg_to_send_buffer(buffer, &msg);
13952 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13953 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13954 }
13955 mavlink_msg_event_decode(last_msg, &packet2);
13956 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13957
13958 memset(&packet2, 0, sizeof(packet2));
13959 mavlink_msg_event_send(MAVLINK_COMM_1 , packet1.destination_component , packet1.destination_system , packet1.id , packet1.event_time_boot_ms , packet1.sequence , packet1.log_levels , packet1.arguments );
13960 mavlink_msg_event_decode(last_msg, &packet2);
13961 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13962
13963#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13964 MAVLINK_ASSERT(mavlink_get_message_info_by_name("EVENT") != NULL);
13965 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_EVENT) != NULL);
13966#endif
13967}
13968
13969static void mavlink_test_current_event_sequence(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13970{
13971#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13972 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13973 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CURRENT_EVENT_SEQUENCE >= 256) {
13974 return;
13975 }
13976#endif
13977 mavlink_message_t msg;
13978 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13979 uint16_t i;
13980 mavlink_current_event_sequence_t packet_in = {
13981 17235,139
13982 };
13983 mavlink_current_event_sequence_t packet1, packet2;
13984 memset(&packet1, 0, sizeof(packet1));
13985 packet1.sequence = packet_in.sequence;
13986 packet1.flags = packet_in.flags;
13987
13988
13989#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13990 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13991 // cope with extensions
13992 memset(MAVLINK_MSG_ID_CURRENT_EVENT_SEQUENCE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CURRENT_EVENT_SEQUENCE_MIN_LEN);
13993 }
13994#endif
13995 memset(&packet2, 0, sizeof(packet2));
13996 mavlink_msg_current_event_sequence_encode(system_id, component_id, &msg, &packet1);
13997 mavlink_msg_current_event_sequence_decode(&msg, &packet2);
13998 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
13999
14000 memset(&packet2, 0, sizeof(packet2));
14001 mavlink_msg_current_event_sequence_pack(system_id, component_id, &msg , packet1.sequence , packet1.flags );
14002 mavlink_msg_current_event_sequence_decode(&msg, &packet2);
14003 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14004
14005 memset(&packet2, 0, sizeof(packet2));
14006 mavlink_msg_current_event_sequence_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.sequence , packet1.flags );
14007 mavlink_msg_current_event_sequence_decode(&msg, &packet2);
14008 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14009
14010 memset(&packet2, 0, sizeof(packet2));
14011 mavlink_msg_to_send_buffer(buffer, &msg);
14012 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14013 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14014 }
14015 mavlink_msg_current_event_sequence_decode(last_msg, &packet2);
14016 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14017
14018 memset(&packet2, 0, sizeof(packet2));
14019 mavlink_msg_current_event_sequence_send(MAVLINK_COMM_1 , packet1.sequence , packet1.flags );
14020 mavlink_msg_current_event_sequence_decode(last_msg, &packet2);
14021 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14022
14023#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14024 MAVLINK_ASSERT(mavlink_get_message_info_by_name("CURRENT_EVENT_SEQUENCE") != NULL);
14025 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CURRENT_EVENT_SEQUENCE) != NULL);
14026#endif
14027}
14028
14029static void mavlink_test_request_event(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14030{
14031#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14032 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14033 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_REQUEST_EVENT >= 256) {
14034 return;
14035 }
14036#endif
14037 mavlink_message_t msg;
14038 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14039 uint16_t i;
14040 mavlink_request_event_t packet_in = {
14041 17235,17339,17,84
14042 };
14043 mavlink_request_event_t packet1, packet2;
14044 memset(&packet1, 0, sizeof(packet1));
14045 packet1.first_sequence = packet_in.first_sequence;
14046 packet1.last_sequence = packet_in.last_sequence;
14047 packet1.target_system = packet_in.target_system;
14048 packet1.target_component = packet_in.target_component;
14049
14050
14051#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14052 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14053 // cope with extensions
14054 memset(MAVLINK_MSG_ID_REQUEST_EVENT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_REQUEST_EVENT_MIN_LEN);
14055 }
14056#endif
14057 memset(&packet2, 0, sizeof(packet2));
14058 mavlink_msg_request_event_encode(system_id, component_id, &msg, &packet1);
14059 mavlink_msg_request_event_decode(&msg, &packet2);
14060 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14061
14062 memset(&packet2, 0, sizeof(packet2));
14063 mavlink_msg_request_event_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.first_sequence , packet1.last_sequence );
14064 mavlink_msg_request_event_decode(&msg, &packet2);
14065 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14066
14067 memset(&packet2, 0, sizeof(packet2));
14068 mavlink_msg_request_event_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.first_sequence , packet1.last_sequence );
14069 mavlink_msg_request_event_decode(&msg, &packet2);
14070 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14071
14072 memset(&packet2, 0, sizeof(packet2));
14073 mavlink_msg_to_send_buffer(buffer, &msg);
14074 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14075 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14076 }
14077 mavlink_msg_request_event_decode(last_msg, &packet2);
14078 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14079
14080 memset(&packet2, 0, sizeof(packet2));
14081 mavlink_msg_request_event_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.first_sequence , packet1.last_sequence );
14082 mavlink_msg_request_event_decode(last_msg, &packet2);
14083 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14084
14085#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14086 MAVLINK_ASSERT(mavlink_get_message_info_by_name("REQUEST_EVENT") != NULL);
14087 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_REQUEST_EVENT) != NULL);
14088#endif
14089}
14090
14091static void mavlink_test_response_event_error(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14092{
14093#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14094 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14095 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RESPONSE_EVENT_ERROR >= 256) {
14096 return;
14097 }
14098#endif
14099 mavlink_message_t msg;
14100 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14101 uint16_t i;
14102 mavlink_response_event_error_t packet_in = {
14103 17235,17339,17,84,151
14104 };
14105 mavlink_response_event_error_t packet1, packet2;
14106 memset(&packet1, 0, sizeof(packet1));
14107 packet1.sequence = packet_in.sequence;
14108 packet1.sequence_oldest_available = packet_in.sequence_oldest_available;
14109 packet1.target_system = packet_in.target_system;
14110 packet1.target_component = packet_in.target_component;
14111 packet1.reason = packet_in.reason;
14112
14113
14114#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14115 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14116 // cope with extensions
14117 memset(MAVLINK_MSG_ID_RESPONSE_EVENT_ERROR_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RESPONSE_EVENT_ERROR_MIN_LEN);
14118 }
14119#endif
14120 memset(&packet2, 0, sizeof(packet2));
14121 mavlink_msg_response_event_error_encode(system_id, component_id, &msg, &packet1);
14122 mavlink_msg_response_event_error_decode(&msg, &packet2);
14123 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14124
14125 memset(&packet2, 0, sizeof(packet2));
14126 mavlink_msg_response_event_error_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.sequence , packet1.sequence_oldest_available , packet1.reason );
14127 mavlink_msg_response_event_error_decode(&msg, &packet2);
14128 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14129
14130 memset(&packet2, 0, sizeof(packet2));
14131 mavlink_msg_response_event_error_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.sequence , packet1.sequence_oldest_available , packet1.reason );
14132 mavlink_msg_response_event_error_decode(&msg, &packet2);
14133 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14134
14135 memset(&packet2, 0, sizeof(packet2));
14136 mavlink_msg_to_send_buffer(buffer, &msg);
14137 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14138 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14139 }
14140 mavlink_msg_response_event_error_decode(last_msg, &packet2);
14141 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14142
14143 memset(&packet2, 0, sizeof(packet2));
14144 mavlink_msg_response_event_error_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.sequence , packet1.sequence_oldest_available , packet1.reason );
14145 mavlink_msg_response_event_error_decode(last_msg, &packet2);
14146 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14147
14148#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14149 MAVLINK_ASSERT(mavlink_get_message_info_by_name("RESPONSE_EVENT_ERROR") != NULL);
14150 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_RESPONSE_EVENT_ERROR) != NULL);
14151#endif
14152}
14153
14154static void mavlink_test_available_modes(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14155{
14156#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14157 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14158 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AVAILABLE_MODES >= 256) {
14159 return;
14160 }
14161#endif
14162 mavlink_message_t msg;
14163 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14164 uint16_t i;
14165 mavlink_available_modes_t packet_in = {
14166 963497464,963497672,29,96,163,"LMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRS"
14167 };
14168 mavlink_available_modes_t packet1, packet2;
14169 memset(&packet1, 0, sizeof(packet1));
14170 packet1.custom_mode = packet_in.custom_mode;
14171 packet1.properties = packet_in.properties;
14172 packet1.number_modes = packet_in.number_modes;
14173 packet1.mode_index = packet_in.mode_index;
14174 packet1.standard_mode = packet_in.standard_mode;
14175
14176 mav_array_memcpy(packet1.mode_name, packet_in.mode_name, sizeof(char)*35);
14177
14178#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14179 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14180 // cope with extensions
14181 memset(MAVLINK_MSG_ID_AVAILABLE_MODES_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AVAILABLE_MODES_MIN_LEN);
14182 }
14183#endif
14184 memset(&packet2, 0, sizeof(packet2));
14185 mavlink_msg_available_modes_encode(system_id, component_id, &msg, &packet1);
14186 mavlink_msg_available_modes_decode(&msg, &packet2);
14187 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14188
14189 memset(&packet2, 0, sizeof(packet2));
14190 mavlink_msg_available_modes_pack(system_id, component_id, &msg , packet1.number_modes , packet1.mode_index , packet1.standard_mode , packet1.custom_mode , packet1.properties , packet1.mode_name );
14191 mavlink_msg_available_modes_decode(&msg, &packet2);
14192 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14193
14194 memset(&packet2, 0, sizeof(packet2));
14195 mavlink_msg_available_modes_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.number_modes , packet1.mode_index , packet1.standard_mode , packet1.custom_mode , packet1.properties , packet1.mode_name );
14196 mavlink_msg_available_modes_decode(&msg, &packet2);
14197 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14198
14199 memset(&packet2, 0, sizeof(packet2));
14200 mavlink_msg_to_send_buffer(buffer, &msg);
14201 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14202 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14203 }
14204 mavlink_msg_available_modes_decode(last_msg, &packet2);
14205 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14206
14207 memset(&packet2, 0, sizeof(packet2));
14208 mavlink_msg_available_modes_send(MAVLINK_COMM_1 , packet1.number_modes , packet1.mode_index , packet1.standard_mode , packet1.custom_mode , packet1.properties , packet1.mode_name );
14209 mavlink_msg_available_modes_decode(last_msg, &packet2);
14210 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14211
14212#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14213 MAVLINK_ASSERT(mavlink_get_message_info_by_name("AVAILABLE_MODES") != NULL);
14214 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_AVAILABLE_MODES) != NULL);
14215#endif
14216}
14217
14218static void mavlink_test_current_mode(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14219{
14220#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14221 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14222 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CURRENT_MODE >= 256) {
14223 return;
14224 }
14225#endif
14226 mavlink_message_t msg;
14227 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14228 uint16_t i;
14229 mavlink_current_mode_t packet_in = {
14230 963497464,963497672,29
14231 };
14232 mavlink_current_mode_t packet1, packet2;
14233 memset(&packet1, 0, sizeof(packet1));
14234 packet1.custom_mode = packet_in.custom_mode;
14235 packet1.intended_custom_mode = packet_in.intended_custom_mode;
14236 packet1.standard_mode = packet_in.standard_mode;
14237
14238
14239#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14240 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14241 // cope with extensions
14242 memset(MAVLINK_MSG_ID_CURRENT_MODE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CURRENT_MODE_MIN_LEN);
14243 }
14244#endif
14245 memset(&packet2, 0, sizeof(packet2));
14246 mavlink_msg_current_mode_encode(system_id, component_id, &msg, &packet1);
14247 mavlink_msg_current_mode_decode(&msg, &packet2);
14248 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14249
14250 memset(&packet2, 0, sizeof(packet2));
14251 mavlink_msg_current_mode_pack(system_id, component_id, &msg , packet1.standard_mode , packet1.custom_mode , packet1.intended_custom_mode );
14252 mavlink_msg_current_mode_decode(&msg, &packet2);
14253 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14254
14255 memset(&packet2, 0, sizeof(packet2));
14256 mavlink_msg_current_mode_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.standard_mode , packet1.custom_mode , packet1.intended_custom_mode );
14257 mavlink_msg_current_mode_decode(&msg, &packet2);
14258 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14259
14260 memset(&packet2, 0, sizeof(packet2));
14261 mavlink_msg_to_send_buffer(buffer, &msg);
14262 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14263 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14264 }
14265 mavlink_msg_current_mode_decode(last_msg, &packet2);
14266 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14267
14268 memset(&packet2, 0, sizeof(packet2));
14269 mavlink_msg_current_mode_send(MAVLINK_COMM_1 , packet1.standard_mode , packet1.custom_mode , packet1.intended_custom_mode );
14270 mavlink_msg_current_mode_decode(last_msg, &packet2);
14271 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14272
14273#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14274 MAVLINK_ASSERT(mavlink_get_message_info_by_name("CURRENT_MODE") != NULL);
14275 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CURRENT_MODE) != NULL);
14276#endif
14277}
14278
14279static void mavlink_test_available_modes_monitor(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14280{
14281#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14282 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14283 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR >= 256) {
14284 return;
14285 }
14286#endif
14287 mavlink_message_t msg;
14288 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14289 uint16_t i;
14290 mavlink_available_modes_monitor_t packet_in = {
14291 5
14292 };
14293 mavlink_available_modes_monitor_t packet1, packet2;
14294 memset(&packet1, 0, sizeof(packet1));
14295 packet1.seq = packet_in.seq;
14296
14297
14298#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14299 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14300 // cope with extensions
14301 memset(MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_MIN_LEN);
14302 }
14303#endif
14304 memset(&packet2, 0, sizeof(packet2));
14305 mavlink_msg_available_modes_monitor_encode(system_id, component_id, &msg, &packet1);
14306 mavlink_msg_available_modes_monitor_decode(&msg, &packet2);
14307 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14308
14309 memset(&packet2, 0, sizeof(packet2));
14310 mavlink_msg_available_modes_monitor_pack(system_id, component_id, &msg , packet1.seq );
14311 mavlink_msg_available_modes_monitor_decode(&msg, &packet2);
14312 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14313
14314 memset(&packet2, 0, sizeof(packet2));
14315 mavlink_msg_available_modes_monitor_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seq );
14316 mavlink_msg_available_modes_monitor_decode(&msg, &packet2);
14317 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14318
14319 memset(&packet2, 0, sizeof(packet2));
14320 mavlink_msg_to_send_buffer(buffer, &msg);
14321 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14322 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14323 }
14324 mavlink_msg_available_modes_monitor_decode(last_msg, &packet2);
14325 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14326
14327 memset(&packet2, 0, sizeof(packet2));
14328 mavlink_msg_available_modes_monitor_send(MAVLINK_COMM_1 , packet1.seq );
14329 mavlink_msg_available_modes_monitor_decode(last_msg, &packet2);
14330 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14331
14332#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14333 MAVLINK_ASSERT(mavlink_get_message_info_by_name("AVAILABLE_MODES_MONITOR") != NULL);
14334 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR) != NULL);
14335#endif
14336}
14337
14338static void mavlink_test_illuminator_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14339{
14340#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14341 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14342 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ILLUMINATOR_STATUS >= 256) {
14343 return;
14344 }
14345#endif
14346 mavlink_message_t msg;
14347 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14348 uint16_t i;
14349 mavlink_illuminator_status_t packet_in = {
14350 963497464,963497672,73.0,101.0,129.0,157.0,185.0,213.0,101,168,235
14351 };
14352 mavlink_illuminator_status_t packet1, packet2;
14353 memset(&packet1, 0, sizeof(packet1));
14354 packet1.uptime_ms = packet_in.uptime_ms;
14355 packet1.error_status = packet_in.error_status;
14356 packet1.brightness = packet_in.brightness;
14357 packet1.strobe_period = packet_in.strobe_period;
14358 packet1.strobe_duty_cycle = packet_in.strobe_duty_cycle;
14359 packet1.temp_c = packet_in.temp_c;
14360 packet1.min_strobe_period = packet_in.min_strobe_period;
14361 packet1.max_strobe_period = packet_in.max_strobe_period;
14362 packet1.enable = packet_in.enable;
14363 packet1.mode_bitmask = packet_in.mode_bitmask;
14364 packet1.mode = packet_in.mode;
14365
14366
14367#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14368 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14369 // cope with extensions
14370 memset(MAVLINK_MSG_ID_ILLUMINATOR_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ILLUMINATOR_STATUS_MIN_LEN);
14371 }
14372#endif
14373 memset(&packet2, 0, sizeof(packet2));
14374 mavlink_msg_illuminator_status_encode(system_id, component_id, &msg, &packet1);
14375 mavlink_msg_illuminator_status_decode(&msg, &packet2);
14376 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14377
14378 memset(&packet2, 0, sizeof(packet2));
14379 mavlink_msg_illuminator_status_pack(system_id, component_id, &msg , packet1.uptime_ms , packet1.enable , packet1.mode_bitmask , packet1.error_status , packet1.mode , packet1.brightness , packet1.strobe_period , packet1.strobe_duty_cycle , packet1.temp_c , packet1.min_strobe_period , packet1.max_strobe_period );
14380 mavlink_msg_illuminator_status_decode(&msg, &packet2);
14381 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14382
14383 memset(&packet2, 0, sizeof(packet2));
14384 mavlink_msg_illuminator_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.uptime_ms , packet1.enable , packet1.mode_bitmask , packet1.error_status , packet1.mode , packet1.brightness , packet1.strobe_period , packet1.strobe_duty_cycle , packet1.temp_c , packet1.min_strobe_period , packet1.max_strobe_period );
14385 mavlink_msg_illuminator_status_decode(&msg, &packet2);
14386 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14387
14388 memset(&packet2, 0, sizeof(packet2));
14389 mavlink_msg_to_send_buffer(buffer, &msg);
14390 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14391 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14392 }
14393 mavlink_msg_illuminator_status_decode(last_msg, &packet2);
14394 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14395
14396 memset(&packet2, 0, sizeof(packet2));
14397 mavlink_msg_illuminator_status_send(MAVLINK_COMM_1 , packet1.uptime_ms , packet1.enable , packet1.mode_bitmask , packet1.error_status , packet1.mode , packet1.brightness , packet1.strobe_period , packet1.strobe_duty_cycle , packet1.temp_c , packet1.min_strobe_period , packet1.max_strobe_period );
14398 mavlink_msg_illuminator_status_decode(last_msg, &packet2);
14399 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14400
14401#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14402 MAVLINK_ASSERT(mavlink_get_message_info_by_name("ILLUMINATOR_STATUS") != NULL);
14403 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ILLUMINATOR_STATUS) != NULL);
14404#endif
14405}
14406
14407static void mavlink_test_canfd_frame(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14408{
14409#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14410 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14411 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CANFD_FRAME >= 256) {
14412 return;
14413 }
14414#endif
14415 mavlink_message_t msg;
14416 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14417 uint16_t i;
14418 mavlink_canfd_frame_t packet_in = {
14419 963497464,17,84,151,218,{ 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 }
14420 };
14421 mavlink_canfd_frame_t packet1, packet2;
14422 memset(&packet1, 0, sizeof(packet1));
14423 packet1.id = packet_in.id;
14424 packet1.target_system = packet_in.target_system;
14425 packet1.target_component = packet_in.target_component;
14426 packet1.bus = packet_in.bus;
14427 packet1.len = packet_in.len;
14428
14429 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*64);
14430
14431#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14432 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14433 // cope with extensions
14434 memset(MAVLINK_MSG_ID_CANFD_FRAME_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CANFD_FRAME_MIN_LEN);
14435 }
14436#endif
14437 memset(&packet2, 0, sizeof(packet2));
14438 mavlink_msg_canfd_frame_encode(system_id, component_id, &msg, &packet1);
14439 mavlink_msg_canfd_frame_decode(&msg, &packet2);
14440 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14441
14442 memset(&packet2, 0, sizeof(packet2));
14443 mavlink_msg_canfd_frame_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.bus , packet1.len , packet1.id , packet1.data );
14444 mavlink_msg_canfd_frame_decode(&msg, &packet2);
14445 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14446
14447 memset(&packet2, 0, sizeof(packet2));
14448 mavlink_msg_canfd_frame_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.bus , packet1.len , packet1.id , packet1.data );
14449 mavlink_msg_canfd_frame_decode(&msg, &packet2);
14450 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14451
14452 memset(&packet2, 0, sizeof(packet2));
14453 mavlink_msg_to_send_buffer(buffer, &msg);
14454 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14455 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14456 }
14457 mavlink_msg_canfd_frame_decode(last_msg, &packet2);
14458 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14459
14460 memset(&packet2, 0, sizeof(packet2));
14461 mavlink_msg_canfd_frame_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.bus , packet1.len , packet1.id , packet1.data );
14462 mavlink_msg_canfd_frame_decode(last_msg, &packet2);
14463 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14464
14465#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14466 MAVLINK_ASSERT(mavlink_get_message_info_by_name("CANFD_FRAME") != NULL);
14467 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CANFD_FRAME) != NULL);
14468#endif
14469}
14470
14471static void mavlink_test_can_filter_modify(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14472{
14473#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14474 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14475 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAN_FILTER_MODIFY >= 256) {
14476 return;
14477 }
14478#endif
14479 mavlink_message_t msg;
14480 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14481 uint16_t i;
14482 mavlink_can_filter_modify_t packet_in = {
14483 { 17235, 17236, 17237, 17238, 17239, 17240, 17241, 17242, 17243, 17244, 17245, 17246, 17247, 17248, 17249, 17250 },101,168,235,46,113
14484 };
14485 mavlink_can_filter_modify_t packet1, packet2;
14486 memset(&packet1, 0, sizeof(packet1));
14487 packet1.target_system = packet_in.target_system;
14488 packet1.target_component = packet_in.target_component;
14489 packet1.bus = packet_in.bus;
14490 packet1.operation = packet_in.operation;
14491 packet1.num_ids = packet_in.num_ids;
14492
14493 mav_array_memcpy(packet1.ids, packet_in.ids, sizeof(uint16_t)*16);
14494
14495#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14496 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14497 // cope with extensions
14498 memset(MAVLINK_MSG_ID_CAN_FILTER_MODIFY_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAN_FILTER_MODIFY_MIN_LEN);
14499 }
14500#endif
14501 memset(&packet2, 0, sizeof(packet2));
14502 mavlink_msg_can_filter_modify_encode(system_id, component_id, &msg, &packet1);
14503 mavlink_msg_can_filter_modify_decode(&msg, &packet2);
14504 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14505
14506 memset(&packet2, 0, sizeof(packet2));
14507 mavlink_msg_can_filter_modify_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.bus , packet1.operation , packet1.num_ids , packet1.ids );
14508 mavlink_msg_can_filter_modify_decode(&msg, &packet2);
14509 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14510
14511 memset(&packet2, 0, sizeof(packet2));
14512 mavlink_msg_can_filter_modify_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.bus , packet1.operation , packet1.num_ids , packet1.ids );
14513 mavlink_msg_can_filter_modify_decode(&msg, &packet2);
14514 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14515
14516 memset(&packet2, 0, sizeof(packet2));
14517 mavlink_msg_to_send_buffer(buffer, &msg);
14518 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14519 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14520 }
14521 mavlink_msg_can_filter_modify_decode(last_msg, &packet2);
14522 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14523
14524 memset(&packet2, 0, sizeof(packet2));
14525 mavlink_msg_can_filter_modify_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.bus , packet1.operation , packet1.num_ids , packet1.ids );
14526 mavlink_msg_can_filter_modify_decode(last_msg, &packet2);
14527 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14528
14529#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14530 MAVLINK_ASSERT(mavlink_get_message_info_by_name("CAN_FILTER_MODIFY") != NULL);
14531 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CAN_FILTER_MODIFY) != NULL);
14532#endif
14533}
14534
14535static void mavlink_test_wheel_distance(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14536{
14537#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14538 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14539 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_WHEEL_DISTANCE >= 256) {
14540 return;
14541 }
14542#endif
14543 mavlink_message_t msg;
14544 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14545 uint16_t i;
14546 mavlink_wheel_distance_t packet_in = {
14547 93372036854775807ULL,{ 179.0, 180.0, 181.0, 182.0, 183.0, 184.0, 185.0, 186.0, 187.0, 188.0, 189.0, 190.0, 191.0, 192.0, 193.0, 194.0 },157
14548 };
14549 mavlink_wheel_distance_t packet1, packet2;
14550 memset(&packet1, 0, sizeof(packet1));
14551 packet1.time_usec = packet_in.time_usec;
14552 packet1.count = packet_in.count;
14553
14554 mav_array_memcpy(packet1.distance, packet_in.distance, sizeof(double)*16);
14555
14556#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14557 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14558 // cope with extensions
14559 memset(MAVLINK_MSG_ID_WHEEL_DISTANCE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_WHEEL_DISTANCE_MIN_LEN);
14560 }
14561#endif
14562 memset(&packet2, 0, sizeof(packet2));
14563 mavlink_msg_wheel_distance_encode(system_id, component_id, &msg, &packet1);
14564 mavlink_msg_wheel_distance_decode(&msg, &packet2);
14565 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14566
14567 memset(&packet2, 0, sizeof(packet2));
14568 mavlink_msg_wheel_distance_pack(system_id, component_id, &msg , packet1.time_usec , packet1.count , packet1.distance );
14569 mavlink_msg_wheel_distance_decode(&msg, &packet2);
14570 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14571
14572 memset(&packet2, 0, sizeof(packet2));
14573 mavlink_msg_wheel_distance_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.count , packet1.distance );
14574 mavlink_msg_wheel_distance_decode(&msg, &packet2);
14575 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14576
14577 memset(&packet2, 0, sizeof(packet2));
14578 mavlink_msg_to_send_buffer(buffer, &msg);
14579 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14580 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14581 }
14582 mavlink_msg_wheel_distance_decode(last_msg, &packet2);
14583 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14584
14585 memset(&packet2, 0, sizeof(packet2));
14586 mavlink_msg_wheel_distance_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.count , packet1.distance );
14587 mavlink_msg_wheel_distance_decode(last_msg, &packet2);
14588 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14589
14590#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14591 MAVLINK_ASSERT(mavlink_get_message_info_by_name("WHEEL_DISTANCE") != NULL);
14592 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_WHEEL_DISTANCE) != NULL);
14593#endif
14594}
14595
14596static void mavlink_test_winch_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14597{
14598#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14599 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14600 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_WINCH_STATUS >= 256) {
14601 return;
14602 }
14603#endif
14604 mavlink_message_t msg;
14605 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14606 uint16_t i;
14607 mavlink_winch_status_t packet_in = {
14608 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,963498920,18899
14609 };
14610 mavlink_winch_status_t packet1, packet2;
14611 memset(&packet1, 0, sizeof(packet1));
14612 packet1.time_usec = packet_in.time_usec;
14613 packet1.line_length = packet_in.line_length;
14614 packet1.speed = packet_in.speed;
14615 packet1.tension = packet_in.tension;
14616 packet1.voltage = packet_in.voltage;
14617 packet1.current = packet_in.current;
14618 packet1.status = packet_in.status;
14619 packet1.temperature = packet_in.temperature;
14620
14621
14622#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14623 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14624 // cope with extensions
14625 memset(MAVLINK_MSG_ID_WINCH_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_WINCH_STATUS_MIN_LEN);
14626 }
14627#endif
14628 memset(&packet2, 0, sizeof(packet2));
14629 mavlink_msg_winch_status_encode(system_id, component_id, &msg, &packet1);
14630 mavlink_msg_winch_status_decode(&msg, &packet2);
14631 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14632
14633 memset(&packet2, 0, sizeof(packet2));
14634 mavlink_msg_winch_status_pack(system_id, component_id, &msg , packet1.time_usec , packet1.line_length , packet1.speed , packet1.tension , packet1.voltage , packet1.current , packet1.temperature , packet1.status );
14635 mavlink_msg_winch_status_decode(&msg, &packet2);
14636 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14637
14638 memset(&packet2, 0, sizeof(packet2));
14639 mavlink_msg_winch_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.line_length , packet1.speed , packet1.tension , packet1.voltage , packet1.current , packet1.temperature , packet1.status );
14640 mavlink_msg_winch_status_decode(&msg, &packet2);
14641 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14642
14643 memset(&packet2, 0, sizeof(packet2));
14644 mavlink_msg_to_send_buffer(buffer, &msg);
14645 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14646 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14647 }
14648 mavlink_msg_winch_status_decode(last_msg, &packet2);
14649 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14650
14651 memset(&packet2, 0, sizeof(packet2));
14652 mavlink_msg_winch_status_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.line_length , packet1.speed , packet1.tension , packet1.voltage , packet1.current , packet1.temperature , packet1.status );
14653 mavlink_msg_winch_status_decode(last_msg, &packet2);
14654 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14655
14656#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14657 MAVLINK_ASSERT(mavlink_get_message_info_by_name("WINCH_STATUS") != NULL);
14658 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_WINCH_STATUS) != NULL);
14659#endif
14660}
14661
14662static void mavlink_test_open_drone_id_basic_id(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14663{
14664#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14665 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14666 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID >= 256) {
14667 return;
14668 }
14669#endif
14670 mavlink_message_t msg;
14671 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14672 uint16_t i;
14673 mavlink_open_drone_id_basic_id_t packet_in = {
14674 5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158 },199,10,{ 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 }
14675 };
14676 mavlink_open_drone_id_basic_id_t packet1, packet2;
14677 memset(&packet1, 0, sizeof(packet1));
14678 packet1.target_system = packet_in.target_system;
14679 packet1.target_component = packet_in.target_component;
14680 packet1.id_type = packet_in.id_type;
14681 packet1.ua_type = packet_in.ua_type;
14682
14683 mav_array_memcpy(packet1.id_or_mac, packet_in.id_or_mac, sizeof(uint8_t)*20);
14684 mav_array_memcpy(packet1.uas_id, packet_in.uas_id, sizeof(uint8_t)*20);
14685
14686#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14687 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14688 // cope with extensions
14689 memset(MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_MIN_LEN);
14690 }
14691#endif
14692 memset(&packet2, 0, sizeof(packet2));
14693 mavlink_msg_open_drone_id_basic_id_encode(system_id, component_id, &msg, &packet1);
14694 mavlink_msg_open_drone_id_basic_id_decode(&msg, &packet2);
14695 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14696
14697 memset(&packet2, 0, sizeof(packet2));
14698 mavlink_msg_open_drone_id_basic_id_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.id_type , packet1.ua_type , packet1.uas_id );
14699 mavlink_msg_open_drone_id_basic_id_decode(&msg, &packet2);
14700 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14701
14702 memset(&packet2, 0, sizeof(packet2));
14703 mavlink_msg_open_drone_id_basic_id_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.id_type , packet1.ua_type , packet1.uas_id );
14704 mavlink_msg_open_drone_id_basic_id_decode(&msg, &packet2);
14705 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14706
14707 memset(&packet2, 0, sizeof(packet2));
14708 mavlink_msg_to_send_buffer(buffer, &msg);
14709 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14710 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14711 }
14712 mavlink_msg_open_drone_id_basic_id_decode(last_msg, &packet2);
14713 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14714
14715 memset(&packet2, 0, sizeof(packet2));
14716 mavlink_msg_open_drone_id_basic_id_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.id_type , packet1.ua_type , packet1.uas_id );
14717 mavlink_msg_open_drone_id_basic_id_decode(last_msg, &packet2);
14718 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14719
14720#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14721 MAVLINK_ASSERT(mavlink_get_message_info_by_name("OPEN_DRONE_ID_BASIC_ID") != NULL);
14722 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID) != NULL);
14723#endif
14724}
14725
14726static void mavlink_test_open_drone_id_location(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14727{
14728#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14729 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14730 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION >= 256) {
14731 return;
14732 }
14733#endif
14734 mavlink_message_t msg;
14735 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14736 uint16_t i;
14737 mavlink_open_drone_id_location_t packet_in = {
14738 963497464,963497672,73.0,101.0,129.0,157.0,18483,18587,18691,223,34,{ 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120 },161,228,39,106,173,240,51
14739 };
14740 mavlink_open_drone_id_location_t packet1, packet2;
14741 memset(&packet1, 0, sizeof(packet1));
14742 packet1.latitude = packet_in.latitude;
14743 packet1.longitude = packet_in.longitude;
14744 packet1.altitude_barometric = packet_in.altitude_barometric;
14745 packet1.altitude_geodetic = packet_in.altitude_geodetic;
14746 packet1.height = packet_in.height;
14747 packet1.timestamp = packet_in.timestamp;
14748 packet1.direction = packet_in.direction;
14749 packet1.speed_horizontal = packet_in.speed_horizontal;
14750 packet1.speed_vertical = packet_in.speed_vertical;
14751 packet1.target_system = packet_in.target_system;
14752 packet1.target_component = packet_in.target_component;
14753 packet1.status = packet_in.status;
14754 packet1.height_reference = packet_in.height_reference;
14755 packet1.horizontal_accuracy = packet_in.horizontal_accuracy;
14756 packet1.vertical_accuracy = packet_in.vertical_accuracy;
14757 packet1.barometer_accuracy = packet_in.barometer_accuracy;
14758 packet1.speed_accuracy = packet_in.speed_accuracy;
14759 packet1.timestamp_accuracy = packet_in.timestamp_accuracy;
14760
14761 mav_array_memcpy(packet1.id_or_mac, packet_in.id_or_mac, sizeof(uint8_t)*20);
14762
14763#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14764 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14765 // cope with extensions
14766 memset(MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_MIN_LEN);
14767 }
14768#endif
14769 memset(&packet2, 0, sizeof(packet2));
14770 mavlink_msg_open_drone_id_location_encode(system_id, component_id, &msg, &packet1);
14771 mavlink_msg_open_drone_id_location_decode(&msg, &packet2);
14772 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14773
14774 memset(&packet2, 0, sizeof(packet2));
14775 mavlink_msg_open_drone_id_location_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.status , packet1.direction , packet1.speed_horizontal , packet1.speed_vertical , packet1.latitude , packet1.longitude , packet1.altitude_barometric , packet1.altitude_geodetic , packet1.height_reference , packet1.height , packet1.horizontal_accuracy , packet1.vertical_accuracy , packet1.barometer_accuracy , packet1.speed_accuracy , packet1.timestamp , packet1.timestamp_accuracy );
14776 mavlink_msg_open_drone_id_location_decode(&msg, &packet2);
14777 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14778
14779 memset(&packet2, 0, sizeof(packet2));
14780 mavlink_msg_open_drone_id_location_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.status , packet1.direction , packet1.speed_horizontal , packet1.speed_vertical , packet1.latitude , packet1.longitude , packet1.altitude_barometric , packet1.altitude_geodetic , packet1.height_reference , packet1.height , packet1.horizontal_accuracy , packet1.vertical_accuracy , packet1.barometer_accuracy , packet1.speed_accuracy , packet1.timestamp , packet1.timestamp_accuracy );
14781 mavlink_msg_open_drone_id_location_decode(&msg, &packet2);
14782 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14783
14784 memset(&packet2, 0, sizeof(packet2));
14785 mavlink_msg_to_send_buffer(buffer, &msg);
14786 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14787 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14788 }
14789 mavlink_msg_open_drone_id_location_decode(last_msg, &packet2);
14790 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14791
14792 memset(&packet2, 0, sizeof(packet2));
14793 mavlink_msg_open_drone_id_location_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.status , packet1.direction , packet1.speed_horizontal , packet1.speed_vertical , packet1.latitude , packet1.longitude , packet1.altitude_barometric , packet1.altitude_geodetic , packet1.height_reference , packet1.height , packet1.horizontal_accuracy , packet1.vertical_accuracy , packet1.barometer_accuracy , packet1.speed_accuracy , packet1.timestamp , packet1.timestamp_accuracy );
14794 mavlink_msg_open_drone_id_location_decode(last_msg, &packet2);
14795 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14796
14797#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14798 MAVLINK_ASSERT(mavlink_get_message_info_by_name("OPEN_DRONE_ID_LOCATION") != NULL);
14799 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION) != NULL);
14800#endif
14801}
14802
14803static void mavlink_test_open_drone_id_authentication(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14804{
14805#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14806 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14807 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION >= 256) {
14808 return;
14809 }
14810#endif
14811 mavlink_message_t msg;
14812 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14813 uint16_t i;
14814 mavlink_open_drone_id_authentication_t packet_in = {
14815 963497464,17,84,{ 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170 },211,22,89,156,{ 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245 }
14816 };
14817 mavlink_open_drone_id_authentication_t packet1, packet2;
14818 memset(&packet1, 0, sizeof(packet1));
14819 packet1.timestamp = packet_in.timestamp;
14820 packet1.target_system = packet_in.target_system;
14821 packet1.target_component = packet_in.target_component;
14822 packet1.authentication_type = packet_in.authentication_type;
14823 packet1.data_page = packet_in.data_page;
14824 packet1.last_page_index = packet_in.last_page_index;
14825 packet1.length = packet_in.length;
14826
14827 mav_array_memcpy(packet1.id_or_mac, packet_in.id_or_mac, sizeof(uint8_t)*20);
14828 mav_array_memcpy(packet1.authentication_data, packet_in.authentication_data, sizeof(uint8_t)*23);
14829
14830#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14831 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14832 // cope with extensions
14833 memset(MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_MIN_LEN);
14834 }
14835#endif
14836 memset(&packet2, 0, sizeof(packet2));
14837 mavlink_msg_open_drone_id_authentication_encode(system_id, component_id, &msg, &packet1);
14838 mavlink_msg_open_drone_id_authentication_decode(&msg, &packet2);
14839 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14840
14841 memset(&packet2, 0, sizeof(packet2));
14842 mavlink_msg_open_drone_id_authentication_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.authentication_type , packet1.data_page , packet1.last_page_index , packet1.length , packet1.timestamp , packet1.authentication_data );
14843 mavlink_msg_open_drone_id_authentication_decode(&msg, &packet2);
14844 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14845
14846 memset(&packet2, 0, sizeof(packet2));
14847 mavlink_msg_open_drone_id_authentication_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.authentication_type , packet1.data_page , packet1.last_page_index , packet1.length , packet1.timestamp , packet1.authentication_data );
14848 mavlink_msg_open_drone_id_authentication_decode(&msg, &packet2);
14849 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14850
14851 memset(&packet2, 0, sizeof(packet2));
14852 mavlink_msg_to_send_buffer(buffer, &msg);
14853 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14854 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14855 }
14856 mavlink_msg_open_drone_id_authentication_decode(last_msg, &packet2);
14857 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14858
14859 memset(&packet2, 0, sizeof(packet2));
14860 mavlink_msg_open_drone_id_authentication_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.authentication_type , packet1.data_page , packet1.last_page_index , packet1.length , packet1.timestamp , packet1.authentication_data );
14861 mavlink_msg_open_drone_id_authentication_decode(last_msg, &packet2);
14862 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14863
14864#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14865 MAVLINK_ASSERT(mavlink_get_message_info_by_name("OPEN_DRONE_ID_AUTHENTICATION") != NULL);
14866 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION) != NULL);
14867#endif
14868}
14869
14870static void mavlink_test_open_drone_id_self_id(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14871{
14872#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14873 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14874 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_SELF_ID >= 256) {
14875 return;
14876 }
14877#endif
14878 mavlink_message_t msg;
14879 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14880 uint16_t i;
14881 mavlink_open_drone_id_self_id_t packet_in = {
14882 5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158 },199,"XYZABCDEFGHIJKLMNOPQRS"
14883 };
14884 mavlink_open_drone_id_self_id_t packet1, packet2;
14885 memset(&packet1, 0, sizeof(packet1));
14886 packet1.target_system = packet_in.target_system;
14887 packet1.target_component = packet_in.target_component;
14888 packet1.description_type = packet_in.description_type;
14889
14890 mav_array_memcpy(packet1.id_or_mac, packet_in.id_or_mac, sizeof(uint8_t)*20);
14891 mav_array_memcpy(packet1.description, packet_in.description, sizeof(char)*23);
14892
14893#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14894 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14895 // cope with extensions
14896 memset(MAVLINK_MSG_ID_OPEN_DRONE_ID_SELF_ID_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_OPEN_DRONE_ID_SELF_ID_MIN_LEN);
14897 }
14898#endif
14899 memset(&packet2, 0, sizeof(packet2));
14900 mavlink_msg_open_drone_id_self_id_encode(system_id, component_id, &msg, &packet1);
14901 mavlink_msg_open_drone_id_self_id_decode(&msg, &packet2);
14902 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14903
14904 memset(&packet2, 0, sizeof(packet2));
14905 mavlink_msg_open_drone_id_self_id_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.description_type , packet1.description );
14906 mavlink_msg_open_drone_id_self_id_decode(&msg, &packet2);
14907 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14908
14909 memset(&packet2, 0, sizeof(packet2));
14910 mavlink_msg_open_drone_id_self_id_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.description_type , packet1.description );
14911 mavlink_msg_open_drone_id_self_id_decode(&msg, &packet2);
14912 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14913
14914 memset(&packet2, 0, sizeof(packet2));
14915 mavlink_msg_to_send_buffer(buffer, &msg);
14916 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14917 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14918 }
14919 mavlink_msg_open_drone_id_self_id_decode(last_msg, &packet2);
14920 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14921
14922 memset(&packet2, 0, sizeof(packet2));
14923 mavlink_msg_open_drone_id_self_id_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.description_type , packet1.description );
14924 mavlink_msg_open_drone_id_self_id_decode(last_msg, &packet2);
14925 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14926
14927#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14928 MAVLINK_ASSERT(mavlink_get_message_info_by_name("OPEN_DRONE_ID_SELF_ID") != NULL);
14929 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OPEN_DRONE_ID_SELF_ID) != NULL);
14930#endif
14931}
14932
14933static void mavlink_test_open_drone_id_system(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14934{
14935#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14936 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14937 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM >= 256) {
14938 return;
14939 }
14940#endif
14941 mavlink_message_t msg;
14942 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14943 uint16_t i;
14944 mavlink_open_drone_id_system_t packet_in = {
14945 963497464,963497672,73.0,101.0,129.0,963498504,18483,18587,89,156,{ 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242 },27,94,161,228
14946 };
14947 mavlink_open_drone_id_system_t packet1, packet2;
14948 memset(&packet1, 0, sizeof(packet1));
14949 packet1.operator_latitude = packet_in.operator_latitude;
14950 packet1.operator_longitude = packet_in.operator_longitude;
14951 packet1.area_ceiling = packet_in.area_ceiling;
14952 packet1.area_floor = packet_in.area_floor;
14953 packet1.operator_altitude_geo = packet_in.operator_altitude_geo;
14954 packet1.timestamp = packet_in.timestamp;
14955 packet1.area_count = packet_in.area_count;
14956 packet1.area_radius = packet_in.area_radius;
14957 packet1.target_system = packet_in.target_system;
14958 packet1.target_component = packet_in.target_component;
14959 packet1.operator_location_type = packet_in.operator_location_type;
14960 packet1.classification_type = packet_in.classification_type;
14961 packet1.category_eu = packet_in.category_eu;
14962 packet1.class_eu = packet_in.class_eu;
14963
14964 mav_array_memcpy(packet1.id_or_mac, packet_in.id_or_mac, sizeof(uint8_t)*20);
14965
14966#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14967 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14968 // cope with extensions
14969 memset(MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_MIN_LEN);
14970 }
14971#endif
14972 memset(&packet2, 0, sizeof(packet2));
14973 mavlink_msg_open_drone_id_system_encode(system_id, component_id, &msg, &packet1);
14974 mavlink_msg_open_drone_id_system_decode(&msg, &packet2);
14975 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14976
14977 memset(&packet2, 0, sizeof(packet2));
14978 mavlink_msg_open_drone_id_system_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.operator_location_type , packet1.classification_type , packet1.operator_latitude , packet1.operator_longitude , packet1.area_count , packet1.area_radius , packet1.area_ceiling , packet1.area_floor , packet1.category_eu , packet1.class_eu , packet1.operator_altitude_geo , packet1.timestamp );
14979 mavlink_msg_open_drone_id_system_decode(&msg, &packet2);
14980 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14981
14982 memset(&packet2, 0, sizeof(packet2));
14983 mavlink_msg_open_drone_id_system_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.operator_location_type , packet1.classification_type , packet1.operator_latitude , packet1.operator_longitude , packet1.area_count , packet1.area_radius , packet1.area_ceiling , packet1.area_floor , packet1.category_eu , packet1.class_eu , packet1.operator_altitude_geo , packet1.timestamp );
14984 mavlink_msg_open_drone_id_system_decode(&msg, &packet2);
14985 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14986
14987 memset(&packet2, 0, sizeof(packet2));
14988 mavlink_msg_to_send_buffer(buffer, &msg);
14989 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14990 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14991 }
14992 mavlink_msg_open_drone_id_system_decode(last_msg, &packet2);
14993 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14994
14995 memset(&packet2, 0, sizeof(packet2));
14996 mavlink_msg_open_drone_id_system_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.operator_location_type , packet1.classification_type , packet1.operator_latitude , packet1.operator_longitude , packet1.area_count , packet1.area_radius , packet1.area_ceiling , packet1.area_floor , packet1.category_eu , packet1.class_eu , packet1.operator_altitude_geo , packet1.timestamp );
14997 mavlink_msg_open_drone_id_system_decode(last_msg, &packet2);
14998 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
14999
15000#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
15001 MAVLINK_ASSERT(mavlink_get_message_info_by_name("OPEN_DRONE_ID_SYSTEM") != NULL);
15002 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM) != NULL);
15003#endif
15004}
15005
15006static void mavlink_test_open_drone_id_operator_id(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
15007{
15008#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
15009 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
15010 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_OPERATOR_ID >= 256) {
15011 return;
15012 }
15013#endif
15014 mavlink_message_t msg;
15015 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
15016 uint16_t i;
15017 mavlink_open_drone_id_operator_id_t packet_in = {
15018 5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158 },199,"XYZABCDEFGHIJKLMNOP"
15019 };
15020 mavlink_open_drone_id_operator_id_t packet1, packet2;
15021 memset(&packet1, 0, sizeof(packet1));
15022 packet1.target_system = packet_in.target_system;
15023 packet1.target_component = packet_in.target_component;
15024 packet1.operator_id_type = packet_in.operator_id_type;
15025
15026 mav_array_memcpy(packet1.id_or_mac, packet_in.id_or_mac, sizeof(uint8_t)*20);
15027 mav_array_memcpy(packet1.operator_id, packet_in.operator_id, sizeof(char)*20);
15028
15029#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
15030 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
15031 // cope with extensions
15032 memset(MAVLINK_MSG_ID_OPEN_DRONE_ID_OPERATOR_ID_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_OPEN_DRONE_ID_OPERATOR_ID_MIN_LEN);
15033 }
15034#endif
15035 memset(&packet2, 0, sizeof(packet2));
15036 mavlink_msg_open_drone_id_operator_id_encode(system_id, component_id, &msg, &packet1);
15037 mavlink_msg_open_drone_id_operator_id_decode(&msg, &packet2);
15038 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15039
15040 memset(&packet2, 0, sizeof(packet2));
15041 mavlink_msg_open_drone_id_operator_id_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.operator_id_type , packet1.operator_id );
15042 mavlink_msg_open_drone_id_operator_id_decode(&msg, &packet2);
15043 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15044
15045 memset(&packet2, 0, sizeof(packet2));
15046 mavlink_msg_open_drone_id_operator_id_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.operator_id_type , packet1.operator_id );
15047 mavlink_msg_open_drone_id_operator_id_decode(&msg, &packet2);
15048 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15049
15050 memset(&packet2, 0, sizeof(packet2));
15051 mavlink_msg_to_send_buffer(buffer, &msg);
15052 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
15053 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
15054 }
15055 mavlink_msg_open_drone_id_operator_id_decode(last_msg, &packet2);
15056 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15057
15058 memset(&packet2, 0, sizeof(packet2));
15059 mavlink_msg_open_drone_id_operator_id_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.operator_id_type , packet1.operator_id );
15060 mavlink_msg_open_drone_id_operator_id_decode(last_msg, &packet2);
15061 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15062
15063#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
15064 MAVLINK_ASSERT(mavlink_get_message_info_by_name("OPEN_DRONE_ID_OPERATOR_ID") != NULL);
15065 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OPEN_DRONE_ID_OPERATOR_ID) != NULL);
15066#endif
15067}
15068
15069static void mavlink_test_open_drone_id_message_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
15070{
15071#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
15072 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
15073 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_MESSAGE_PACK >= 256) {
15074 return;
15075 }
15076#endif
15077 mavlink_message_t msg;
15078 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
15079 uint16_t i;
15080 mavlink_open_drone_id_message_pack_t packet_in = {
15081 5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158 },199,10,{ 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 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, 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 }
15082 };
15083 mavlink_open_drone_id_message_pack_t packet1, packet2;
15084 memset(&packet1, 0, sizeof(packet1));
15085 packet1.target_system = packet_in.target_system;
15086 packet1.target_component = packet_in.target_component;
15087 packet1.single_message_size = packet_in.single_message_size;
15088 packet1.msg_pack_size = packet_in.msg_pack_size;
15089
15090 mav_array_memcpy(packet1.id_or_mac, packet_in.id_or_mac, sizeof(uint8_t)*20);
15091 mav_array_memcpy(packet1.messages, packet_in.messages, sizeof(uint8_t)*225);
15092
15093#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
15094 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
15095 // cope with extensions
15096 memset(MAVLINK_MSG_ID_OPEN_DRONE_ID_MESSAGE_PACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_OPEN_DRONE_ID_MESSAGE_PACK_MIN_LEN);
15097 }
15098#endif
15099 memset(&packet2, 0, sizeof(packet2));
15100 mavlink_msg_open_drone_id_message_pack_encode(system_id, component_id, &msg, &packet1);
15101 mavlink_msg_open_drone_id_message_pack_decode(&msg, &packet2);
15102 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15103
15104 memset(&packet2, 0, sizeof(packet2));
15105 mavlink_msg_open_drone_id_message_pack_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.single_message_size , packet1.msg_pack_size , packet1.messages );
15106 mavlink_msg_open_drone_id_message_pack_decode(&msg, &packet2);
15107 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15108
15109 memset(&packet2, 0, sizeof(packet2));
15110 mavlink_msg_open_drone_id_message_pack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.single_message_size , packet1.msg_pack_size , packet1.messages );
15111 mavlink_msg_open_drone_id_message_pack_decode(&msg, &packet2);
15112 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15113
15114 memset(&packet2, 0, sizeof(packet2));
15115 mavlink_msg_to_send_buffer(buffer, &msg);
15116 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
15117 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
15118 }
15119 mavlink_msg_open_drone_id_message_pack_decode(last_msg, &packet2);
15120 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15121
15122 memset(&packet2, 0, sizeof(packet2));
15123 mavlink_msg_open_drone_id_message_pack_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.single_message_size , packet1.msg_pack_size , packet1.messages );
15124 mavlink_msg_open_drone_id_message_pack_decode(last_msg, &packet2);
15125 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15126
15127#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
15128 MAVLINK_ASSERT(mavlink_get_message_info_by_name("OPEN_DRONE_ID_MESSAGE_PACK") != NULL);
15129 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OPEN_DRONE_ID_MESSAGE_PACK) != NULL);
15130#endif
15131}
15132
15133static void mavlink_test_open_drone_id_arm_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
15134{
15135#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
15136 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
15137 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS >= 256) {
15138 return;
15139 }
15140#endif
15141 mavlink_message_t msg;
15142 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
15143 uint16_t i;
15144 mavlink_open_drone_id_arm_status_t packet_in = {
15145 5,"BCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX"
15146 };
15147 mavlink_open_drone_id_arm_status_t packet1, packet2;
15148 memset(&packet1, 0, sizeof(packet1));
15149 packet1.status = packet_in.status;
15150
15151 mav_array_memcpy(packet1.error, packet_in.error, sizeof(char)*50);
15152
15153#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
15154 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
15155 // cope with extensions
15156 memset(MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_MIN_LEN);
15157 }
15158#endif
15159 memset(&packet2, 0, sizeof(packet2));
15160 mavlink_msg_open_drone_id_arm_status_encode(system_id, component_id, &msg, &packet1);
15161 mavlink_msg_open_drone_id_arm_status_decode(&msg, &packet2);
15162 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15163
15164 memset(&packet2, 0, sizeof(packet2));
15165 mavlink_msg_open_drone_id_arm_status_pack(system_id, component_id, &msg , packet1.status , packet1.error );
15166 mavlink_msg_open_drone_id_arm_status_decode(&msg, &packet2);
15167 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15168
15169 memset(&packet2, 0, sizeof(packet2));
15170 mavlink_msg_open_drone_id_arm_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.status , packet1.error );
15171 mavlink_msg_open_drone_id_arm_status_decode(&msg, &packet2);
15172 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15173
15174 memset(&packet2, 0, sizeof(packet2));
15175 mavlink_msg_to_send_buffer(buffer, &msg);
15176 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
15177 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
15178 }
15179 mavlink_msg_open_drone_id_arm_status_decode(last_msg, &packet2);
15180 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15181
15182 memset(&packet2, 0, sizeof(packet2));
15183 mavlink_msg_open_drone_id_arm_status_send(MAVLINK_COMM_1 , packet1.status , packet1.error );
15184 mavlink_msg_open_drone_id_arm_status_decode(last_msg, &packet2);
15185 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15186
15187#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
15188 MAVLINK_ASSERT(mavlink_get_message_info_by_name("OPEN_DRONE_ID_ARM_STATUS") != NULL);
15189 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS) != NULL);
15190#endif
15191}
15192
15193static void mavlink_test_open_drone_id_system_update(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
15194{
15195#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
15196 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
15197 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_UPDATE >= 256) {
15198 return;
15199 }
15200#endif
15201 mavlink_message_t msg;
15202 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
15203 uint16_t i;
15204 mavlink_open_drone_id_system_update_t packet_in = {
15205 963497464,963497672,73.0,963498088,53,120
15206 };
15207 mavlink_open_drone_id_system_update_t packet1, packet2;
15208 memset(&packet1, 0, sizeof(packet1));
15209 packet1.operator_latitude = packet_in.operator_latitude;
15210 packet1.operator_longitude = packet_in.operator_longitude;
15211 packet1.operator_altitude_geo = packet_in.operator_altitude_geo;
15212 packet1.timestamp = packet_in.timestamp;
15213 packet1.target_system = packet_in.target_system;
15214 packet1.target_component = packet_in.target_component;
15215
15216
15217#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
15218 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
15219 // cope with extensions
15220 memset(MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_UPDATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_UPDATE_MIN_LEN);
15221 }
15222#endif
15223 memset(&packet2, 0, sizeof(packet2));
15224 mavlink_msg_open_drone_id_system_update_encode(system_id, component_id, &msg, &packet1);
15225 mavlink_msg_open_drone_id_system_update_decode(&msg, &packet2);
15226 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15227
15228 memset(&packet2, 0, sizeof(packet2));
15229 mavlink_msg_open_drone_id_system_update_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.operator_latitude , packet1.operator_longitude , packet1.operator_altitude_geo , packet1.timestamp );
15230 mavlink_msg_open_drone_id_system_update_decode(&msg, &packet2);
15231 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15232
15233 memset(&packet2, 0, sizeof(packet2));
15234 mavlink_msg_open_drone_id_system_update_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.operator_latitude , packet1.operator_longitude , packet1.operator_altitude_geo , packet1.timestamp );
15235 mavlink_msg_open_drone_id_system_update_decode(&msg, &packet2);
15236 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15237
15238 memset(&packet2, 0, sizeof(packet2));
15239 mavlink_msg_to_send_buffer(buffer, &msg);
15240 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
15241 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
15242 }
15243 mavlink_msg_open_drone_id_system_update_decode(last_msg, &packet2);
15244 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15245
15246 memset(&packet2, 0, sizeof(packet2));
15247 mavlink_msg_open_drone_id_system_update_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.operator_latitude , packet1.operator_longitude , packet1.operator_altitude_geo , packet1.timestamp );
15248 mavlink_msg_open_drone_id_system_update_decode(last_msg, &packet2);
15249 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15250
15251#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
15252 MAVLINK_ASSERT(mavlink_get_message_info_by_name("OPEN_DRONE_ID_SYSTEM_UPDATE") != NULL);
15253 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_UPDATE) != NULL);
15254#endif
15255}
15256
15257static void mavlink_test_hygrometer_sensor(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
15258{
15259#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
15260 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
15261 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HYGROMETER_SENSOR >= 256) {
15262 return;
15263 }
15264#endif
15265 mavlink_message_t msg;
15266 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
15267 uint16_t i;
15268 mavlink_hygrometer_sensor_t packet_in = {
15269 17235,17339,17
15270 };
15271 mavlink_hygrometer_sensor_t packet1, packet2;
15272 memset(&packet1, 0, sizeof(packet1));
15273 packet1.temperature = packet_in.temperature;
15274 packet1.humidity = packet_in.humidity;
15275 packet1.id = packet_in.id;
15276
15277
15278#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
15279 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
15280 // cope with extensions
15281 memset(MAVLINK_MSG_ID_HYGROMETER_SENSOR_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HYGROMETER_SENSOR_MIN_LEN);
15282 }
15283#endif
15284 memset(&packet2, 0, sizeof(packet2));
15285 mavlink_msg_hygrometer_sensor_encode(system_id, component_id, &msg, &packet1);
15286 mavlink_msg_hygrometer_sensor_decode(&msg, &packet2);
15287 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15288
15289 memset(&packet2, 0, sizeof(packet2));
15290 mavlink_msg_hygrometer_sensor_pack(system_id, component_id, &msg , packet1.id , packet1.temperature , packet1.humidity );
15291 mavlink_msg_hygrometer_sensor_decode(&msg, &packet2);
15292 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15293
15294 memset(&packet2, 0, sizeof(packet2));
15295 mavlink_msg_hygrometer_sensor_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.temperature , packet1.humidity );
15296 mavlink_msg_hygrometer_sensor_decode(&msg, &packet2);
15297 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15298
15299 memset(&packet2, 0, sizeof(packet2));
15300 mavlink_msg_to_send_buffer(buffer, &msg);
15301 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
15302 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
15303 }
15304 mavlink_msg_hygrometer_sensor_decode(last_msg, &packet2);
15305 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15306
15307 memset(&packet2, 0, sizeof(packet2));
15308 mavlink_msg_hygrometer_sensor_send(MAVLINK_COMM_1 , packet1.id , packet1.temperature , packet1.humidity );
15309 mavlink_msg_hygrometer_sensor_decode(last_msg, &packet2);
15310 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
15311
15312#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
15313 MAVLINK_ASSERT(mavlink_get_message_info_by_name("HYGROMETER_SENSOR") != NULL);
15314 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HYGROMETER_SENSOR) != NULL);
15315#endif
15316}
15317
15318static void mavlink_test_common(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
15319{
15320 mavlink_test_sys_status(system_id, component_id, last_msg);
15321 mavlink_test_system_time(system_id, component_id, last_msg);
15322 mavlink_test_ping(system_id, component_id, last_msg);
15323 mavlink_test_change_operator_control(system_id, component_id, last_msg);
15324 mavlink_test_change_operator_control_ack(system_id, component_id, last_msg);
15325 mavlink_test_auth_key(system_id, component_id, last_msg);
15326 mavlink_test_link_node_status(system_id, component_id, last_msg);
15327 mavlink_test_set_mode(system_id, component_id, last_msg);
15328 mavlink_test_param_request_read(system_id, component_id, last_msg);
15329 mavlink_test_param_request_list(system_id, component_id, last_msg);
15330 mavlink_test_param_value(system_id, component_id, last_msg);
15331 mavlink_test_param_set(system_id, component_id, last_msg);
15332 mavlink_test_gps_raw_int(system_id, component_id, last_msg);
15333 mavlink_test_gps_status(system_id, component_id, last_msg);
15334 mavlink_test_scaled_imu(system_id, component_id, last_msg);
15335 mavlink_test_raw_imu(system_id, component_id, last_msg);
15336 mavlink_test_raw_pressure(system_id, component_id, last_msg);
15337 mavlink_test_scaled_pressure(system_id, component_id, last_msg);
15338 mavlink_test_attitude(system_id, component_id, last_msg);
15339 mavlink_test_attitude_quaternion(system_id, component_id, last_msg);
15340 mavlink_test_local_position_ned(system_id, component_id, last_msg);
15341 mavlink_test_rc_channels_scaled(system_id, component_id, last_msg);
15342 mavlink_test_rc_channels_raw(system_id, component_id, last_msg);
15343 mavlink_test_servo_output_raw(system_id, component_id, last_msg);
15344 mavlink_test_mission_request_partial_list(system_id, component_id, last_msg);
15345 mavlink_test_mission_write_partial_list(system_id, component_id, last_msg);
15346 mavlink_test_mission_item(system_id, component_id, last_msg);
15347 mavlink_test_mission_request(system_id, component_id, last_msg);
15348 mavlink_test_mission_set_current(system_id, component_id, last_msg);
15349 mavlink_test_mission_current(system_id, component_id, last_msg);
15350 mavlink_test_mission_request_list(system_id, component_id, last_msg);
15351 mavlink_test_mission_count(system_id, component_id, last_msg);
15352 mavlink_test_mission_clear_all(system_id, component_id, last_msg);
15353 mavlink_test_mission_item_reached(system_id, component_id, last_msg);
15354 mavlink_test_mission_ack(system_id, component_id, last_msg);
15355 mavlink_test_set_gps_global_origin(system_id, component_id, last_msg);
15356 mavlink_test_gps_global_origin(system_id, component_id, last_msg);
15357 mavlink_test_param_map_rc(system_id, component_id, last_msg);
15358 mavlink_test_mission_request_int(system_id, component_id, last_msg);
15359 mavlink_test_safety_set_allowed_area(system_id, component_id, last_msg);
15360 mavlink_test_safety_allowed_area(system_id, component_id, last_msg);
15361 mavlink_test_attitude_quaternion_cov(system_id, component_id, last_msg);
15362 mavlink_test_nav_controller_output(system_id, component_id, last_msg);
15363 mavlink_test_global_position_int_cov(system_id, component_id, last_msg);
15364 mavlink_test_local_position_ned_cov(system_id, component_id, last_msg);
15365 mavlink_test_rc_channels(system_id, component_id, last_msg);
15366 mavlink_test_request_data_stream(system_id, component_id, last_msg);
15367 mavlink_test_data_stream(system_id, component_id, last_msg);
15368 mavlink_test_manual_control(system_id, component_id, last_msg);
15369 mavlink_test_rc_channels_override(system_id, component_id, last_msg);
15370 mavlink_test_mission_item_int(system_id, component_id, last_msg);
15371 mavlink_test_vfr_hud(system_id, component_id, last_msg);
15372 mavlink_test_command_int(system_id, component_id, last_msg);
15373 mavlink_test_command_long(system_id, component_id, last_msg);
15374 mavlink_test_command_ack(system_id, component_id, last_msg);
15375 mavlink_test_command_cancel(system_id, component_id, last_msg);
15376 mavlink_test_manual_setpoint(system_id, component_id, last_msg);
15377 mavlink_test_set_attitude_target(system_id, component_id, last_msg);
15378 mavlink_test_attitude_target(system_id, component_id, last_msg);
15379 mavlink_test_set_position_target_local_ned(system_id, component_id, last_msg);
15380 mavlink_test_position_target_local_ned(system_id, component_id, last_msg);
15381 mavlink_test_set_position_target_global_int(system_id, component_id, last_msg);
15382 mavlink_test_position_target_global_int(system_id, component_id, last_msg);
15383 mavlink_test_local_position_ned_system_global_offset(system_id, component_id, last_msg);
15384 mavlink_test_hil_state(system_id, component_id, last_msg);
15385 mavlink_test_hil_controls(system_id, component_id, last_msg);
15386 mavlink_test_hil_rc_inputs_raw(system_id, component_id, last_msg);
15387 mavlink_test_hil_actuator_controls(system_id, component_id, last_msg);
15388 mavlink_test_optical_flow(system_id, component_id, last_msg);
15389 mavlink_test_global_vision_position_estimate(system_id, component_id, last_msg);
15390 mavlink_test_vision_position_estimate(system_id, component_id, last_msg);
15391 mavlink_test_vision_speed_estimate(system_id, component_id, last_msg);
15392 mavlink_test_vicon_position_estimate(system_id, component_id, last_msg);
15393 mavlink_test_highres_imu(system_id, component_id, last_msg);
15394 mavlink_test_optical_flow_rad(system_id, component_id, last_msg);
15395 mavlink_test_hil_sensor(system_id, component_id, last_msg);
15396 mavlink_test_sim_state(system_id, component_id, last_msg);
15397 mavlink_test_radio_status(system_id, component_id, last_msg);
15398 mavlink_test_file_transfer_protocol(system_id, component_id, last_msg);
15399 mavlink_test_timesync(system_id, component_id, last_msg);
15400 mavlink_test_camera_trigger(system_id, component_id, last_msg);
15401 mavlink_test_hil_gps(system_id, component_id, last_msg);
15402 mavlink_test_hil_optical_flow(system_id, component_id, last_msg);
15403 mavlink_test_hil_state_quaternion(system_id, component_id, last_msg);
15404 mavlink_test_scaled_imu2(system_id, component_id, last_msg);
15405 mavlink_test_log_request_list(system_id, component_id, last_msg);
15406 mavlink_test_log_entry(system_id, component_id, last_msg);
15407 mavlink_test_log_request_data(system_id, component_id, last_msg);
15408 mavlink_test_log_data(system_id, component_id, last_msg);
15409 mavlink_test_log_erase(system_id, component_id, last_msg);
15410 mavlink_test_log_request_end(system_id, component_id, last_msg);
15411 mavlink_test_gps_inject_data(system_id, component_id, last_msg);
15412 mavlink_test_gps2_raw(system_id, component_id, last_msg);
15413 mavlink_test_power_status(system_id, component_id, last_msg);
15414 mavlink_test_serial_control(system_id, component_id, last_msg);
15415 mavlink_test_gps_rtk(system_id, component_id, last_msg);
15416 mavlink_test_gps2_rtk(system_id, component_id, last_msg);
15417 mavlink_test_scaled_imu3(system_id, component_id, last_msg);
15418 mavlink_test_data_transmission_handshake(system_id, component_id, last_msg);
15419 mavlink_test_encapsulated_data(system_id, component_id, last_msg);
15420 mavlink_test_distance_sensor(system_id, component_id, last_msg);
15421 mavlink_test_terrain_request(system_id, component_id, last_msg);
15422 mavlink_test_terrain_data(system_id, component_id, last_msg);
15423 mavlink_test_terrain_check(system_id, component_id, last_msg);
15424 mavlink_test_terrain_report(system_id, component_id, last_msg);
15425 mavlink_test_scaled_pressure2(system_id, component_id, last_msg);
15426 mavlink_test_att_pos_mocap(system_id, component_id, last_msg);
15427 mavlink_test_set_actuator_control_target(system_id, component_id, last_msg);
15428 mavlink_test_actuator_control_target(system_id, component_id, last_msg);
15429 mavlink_test_altitude(system_id, component_id, last_msg);
15430 mavlink_test_resource_request(system_id, component_id, last_msg);
15431 mavlink_test_scaled_pressure3(system_id, component_id, last_msg);
15432 mavlink_test_follow_target(system_id, component_id, last_msg);
15433 mavlink_test_control_system_state(system_id, component_id, last_msg);
15434 mavlink_test_battery_status(system_id, component_id, last_msg);
15435 mavlink_test_landing_target(system_id, component_id, last_msg);
15436 mavlink_test_fence_status(system_id, component_id, last_msg);
15437 mavlink_test_mag_cal_report(system_id, component_id, last_msg);
15438 mavlink_test_efi_status(system_id, component_id, last_msg);
15439 mavlink_test_estimator_status(system_id, component_id, last_msg);
15440 mavlink_test_wind_cov(system_id, component_id, last_msg);
15441 mavlink_test_gps_input(system_id, component_id, last_msg);
15442 mavlink_test_gps_rtcm_data(system_id, component_id, last_msg);
15443 mavlink_test_high_latency(system_id, component_id, last_msg);
15444 mavlink_test_high_latency2(system_id, component_id, last_msg);
15445 mavlink_test_vibration(system_id, component_id, last_msg);
15446 mavlink_test_home_position(system_id, component_id, last_msg);
15447 mavlink_test_set_home_position(system_id, component_id, last_msg);
15448 mavlink_test_message_interval(system_id, component_id, last_msg);
15449 mavlink_test_extended_sys_state(system_id, component_id, last_msg);
15450 mavlink_test_adsb_vehicle(system_id, component_id, last_msg);
15451 mavlink_test_collision(system_id, component_id, last_msg);
15452 mavlink_test_v2_extension(system_id, component_id, last_msg);
15453 mavlink_test_memory_vect(system_id, component_id, last_msg);
15454 mavlink_test_debug_vect(system_id, component_id, last_msg);
15455 mavlink_test_named_value_float(system_id, component_id, last_msg);
15456 mavlink_test_named_value_int(system_id, component_id, last_msg);
15457 mavlink_test_statustext(system_id, component_id, last_msg);
15458 mavlink_test_debug(system_id, component_id, last_msg);
15459 mavlink_test_setup_signing(system_id, component_id, last_msg);
15460 mavlink_test_button_change(system_id, component_id, last_msg);
15461 mavlink_test_play_tune(system_id, component_id, last_msg);
15462 mavlink_test_camera_information(system_id, component_id, last_msg);
15463 mavlink_test_camera_settings(system_id, component_id, last_msg);
15464 mavlink_test_storage_information(system_id, component_id, last_msg);
15465 mavlink_test_camera_capture_status(system_id, component_id, last_msg);
15466 mavlink_test_camera_image_captured(system_id, component_id, last_msg);
15467 mavlink_test_flight_information(system_id, component_id, last_msg);
15468 mavlink_test_mount_orientation(system_id, component_id, last_msg);
15469 mavlink_test_logging_data(system_id, component_id, last_msg);
15470 mavlink_test_logging_data_acked(system_id, component_id, last_msg);
15471 mavlink_test_logging_ack(system_id, component_id, last_msg);
15472 mavlink_test_video_stream_information(system_id, component_id, last_msg);
15473 mavlink_test_video_stream_status(system_id, component_id, last_msg);
15474 mavlink_test_camera_fov_status(system_id, component_id, last_msg);
15475 mavlink_test_camera_tracking_image_status(system_id, component_id, last_msg);
15476 mavlink_test_camera_tracking_geo_status(system_id, component_id, last_msg);
15477 mavlink_test_camera_thermal_range(system_id, component_id, last_msg);
15478 mavlink_test_gimbal_manager_information(system_id, component_id, last_msg);
15479 mavlink_test_gimbal_manager_status(system_id, component_id, last_msg);
15480 mavlink_test_gimbal_manager_set_attitude(system_id, component_id, last_msg);
15481 mavlink_test_gimbal_device_information(system_id, component_id, last_msg);
15482 mavlink_test_gimbal_device_set_attitude(system_id, component_id, last_msg);
15483 mavlink_test_gimbal_device_attitude_status(system_id, component_id, last_msg);
15484 mavlink_test_autopilot_state_for_gimbal_device(system_id, component_id, last_msg);
15485 mavlink_test_gimbal_manager_set_pitchyaw(system_id, component_id, last_msg);
15486 mavlink_test_gimbal_manager_set_manual_control(system_id, component_id, last_msg);
15487 mavlink_test_esc_info(system_id, component_id, last_msg);
15488 mavlink_test_esc_status(system_id, component_id, last_msg);
15489 mavlink_test_airspeed(system_id, component_id, last_msg);
15490 mavlink_test_global_position_sensor(system_id, component_id, last_msg);
15491 mavlink_test_wifi_config_ap(system_id, component_id, last_msg);
15492 mavlink_test_protocol_version(system_id, component_id, last_msg);
15493 mavlink_test_ais_vessel(system_id, component_id, last_msg);
15494 mavlink_test_uavcan_node_status(system_id, component_id, last_msg);
15495 mavlink_test_uavcan_node_info(system_id, component_id, last_msg);
15496 mavlink_test_param_ext_request_read(system_id, component_id, last_msg);
15497 mavlink_test_param_ext_request_list(system_id, component_id, last_msg);
15498 mavlink_test_param_ext_value(system_id, component_id, last_msg);
15499 mavlink_test_param_ext_set(system_id, component_id, last_msg);
15500 mavlink_test_param_ext_ack(system_id, component_id, last_msg);
15501 mavlink_test_obstacle_distance(system_id, component_id, last_msg);
15502 mavlink_test_odometry(system_id, component_id, last_msg);
15503 mavlink_test_trajectory_representation_waypoints(system_id, component_id, last_msg);
15504 mavlink_test_trajectory_representation_bezier(system_id, component_id, last_msg);
15505 mavlink_test_cellular_status(system_id, component_id, last_msg);
15506 mavlink_test_isbd_link_status(system_id, component_id, last_msg);
15507 mavlink_test_cellular_config(system_id, component_id, last_msg);
15508 mavlink_test_raw_rpm(system_id, component_id, last_msg);
15509 mavlink_test_utm_global_position(system_id, component_id, last_msg);
15510 mavlink_test_param_error(system_id, component_id, last_msg);
15511 mavlink_test_debug_float_array(system_id, component_id, last_msg);
15512 mavlink_test_orbit_execution_status(system_id, component_id, last_msg);
15513 mavlink_test_smart_battery_info(system_id, component_id, last_msg);
15514 mavlink_test_figure_eight_execution_status(system_id, component_id, last_msg);
15515 mavlink_test_fuel_status(system_id, component_id, last_msg);
15516 mavlink_test_battery_info(system_id, component_id, last_msg);
15517 mavlink_test_generator_status(system_id, component_id, last_msg);
15518 mavlink_test_actuator_output_status(system_id, component_id, last_msg);
15519 mavlink_test_relay_status(system_id, component_id, last_msg);
15520 mavlink_test_time_estimate_to_target(system_id, component_id, last_msg);
15521 mavlink_test_tunnel(system_id, component_id, last_msg);
15522 mavlink_test_can_frame(system_id, component_id, last_msg);
15523 mavlink_test_onboard_computer_status(system_id, component_id, last_msg);
15524 mavlink_test_component_information(system_id, component_id, last_msg);
15525 mavlink_test_component_information_basic(system_id, component_id, last_msg);
15526 mavlink_test_component_metadata(system_id, component_id, last_msg);
15527 mavlink_test_play_tune_v2(system_id, component_id, last_msg);
15528 mavlink_test_supported_tunes(system_id, component_id, last_msg);
15529 mavlink_test_event(system_id, component_id, last_msg);
15530 mavlink_test_current_event_sequence(system_id, component_id, last_msg);
15531 mavlink_test_request_event(system_id, component_id, last_msg);
15532 mavlink_test_response_event_error(system_id, component_id, last_msg);
15533 mavlink_test_available_modes(system_id, component_id, last_msg);
15534 mavlink_test_current_mode(system_id, component_id, last_msg);
15535 mavlink_test_available_modes_monitor(system_id, component_id, last_msg);
15536 mavlink_test_illuminator_status(system_id, component_id, last_msg);
15537 mavlink_test_canfd_frame(system_id, component_id, last_msg);
15538 mavlink_test_can_filter_modify(system_id, component_id, last_msg);
15539 mavlink_test_wheel_distance(system_id, component_id, last_msg);
15540 mavlink_test_winch_status(system_id, component_id, last_msg);
15541 mavlink_test_open_drone_id_basic_id(system_id, component_id, last_msg);
15542 mavlink_test_open_drone_id_location(system_id, component_id, last_msg);
15543 mavlink_test_open_drone_id_authentication(system_id, component_id, last_msg);
15544 mavlink_test_open_drone_id_self_id(system_id, component_id, last_msg);
15545 mavlink_test_open_drone_id_system(system_id, component_id, last_msg);
15546 mavlink_test_open_drone_id_operator_id(system_id, component_id, last_msg);
15547 mavlink_test_open_drone_id_message_pack(system_id, component_id, last_msg);
15548 mavlink_test_open_drone_id_arm_status(system_id, component_id, last_msg);
15549 mavlink_test_open_drone_id_system_update(system_id, component_id, last_msg);
15550 mavlink_test_hygrometer_sensor(system_id, component_id, last_msg);
15551}
15552
15553#ifdef __cplusplus
15554}
15555#endif // __cplusplus
15556#endif // COMMON_TESTSUITE_H