Merge remote-tracking branch 'upstream/master' into abo_fw_alt_vel_control
[inav.git] / lib / main / MAVLink / common / testsuite.h
blob8cea375547c17efbee1c80c324dc29efd669e8f7
1 /** @file
2 * @brief MAVLink comm protocol testsuite generated from common.xml
3 * @see http://qgroundcontrol.org/mavlink/
4 */
5 #pragma once
6 #ifndef COMMON_TESTSUITE_H
7 #define COMMON_TESTSUITE_H
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
13 #ifndef MAVLINK_TEST_ALL
14 #define MAVLINK_TEST_ALL
15 static void mavlink_test_minimal(uint8_t, uint8_t, mavlink_message_t *last_msg);
16 static void mavlink_test_common(uint8_t, uint8_t, mavlink_message_t *last_msg);
18 static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
20 mavlink_test_minimal(system_id, component_id, last_msg);
21 mavlink_test_common(system_id, component_id, last_msg);
23 #endif
25 #include "../minimal/testsuite.h"
28 static void mavlink_test_sys_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
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;
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
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;
59 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
60 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
61 // cope with extensions
62 memset(MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN);
64 #endif
65 memset(&packet2, 0, sizeof(packet2));
66 mavlink_msg_sys_status_encode(system_id, component_id, &msg, &packet1);
67 mavlink_msg_sys_status_decode(&msg, &packet2);
68 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
70 memset(&packet2, 0, sizeof(packet2));
71 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 );
72 mavlink_msg_sys_status_decode(&msg, &packet2);
73 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
75 memset(&packet2, 0, sizeof(packet2));
76 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 );
77 mavlink_msg_sys_status_decode(&msg, &packet2);
78 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
80 memset(&packet2, 0, sizeof(packet2));
81 mavlink_msg_to_send_buffer(buffer, &msg);
82 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
83 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
85 mavlink_msg_sys_status_decode(last_msg, &packet2);
86 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
88 memset(&packet2, 0, sizeof(packet2));
89 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 );
90 mavlink_msg_sys_status_decode(last_msg, &packet2);
91 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
94 static void mavlink_test_system_time(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
96 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
97 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
98 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SYSTEM_TIME >= 256) {
99 return;
101 #endif
102 mavlink_message_t msg;
103 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
104 uint16_t i;
105 mavlink_system_time_t packet_in = {
106 93372036854775807ULL,963497880
108 mavlink_system_time_t packet1, packet2;
109 memset(&packet1, 0, sizeof(packet1));
110 packet1.time_unix_usec = packet_in.time_unix_usec;
111 packet1.time_boot_ms = packet_in.time_boot_ms;
114 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
115 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
116 // cope with extensions
117 memset(MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN);
119 #endif
120 memset(&packet2, 0, sizeof(packet2));
121 mavlink_msg_system_time_encode(system_id, component_id, &msg, &packet1);
122 mavlink_msg_system_time_decode(&msg, &packet2);
123 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
125 memset(&packet2, 0, sizeof(packet2));
126 mavlink_msg_system_time_pack(system_id, component_id, &msg , packet1.time_unix_usec , packet1.time_boot_ms );
127 mavlink_msg_system_time_decode(&msg, &packet2);
128 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
130 memset(&packet2, 0, sizeof(packet2));
131 mavlink_msg_system_time_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_unix_usec , packet1.time_boot_ms );
132 mavlink_msg_system_time_decode(&msg, &packet2);
133 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
135 memset(&packet2, 0, sizeof(packet2));
136 mavlink_msg_to_send_buffer(buffer, &msg);
137 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
138 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
140 mavlink_msg_system_time_decode(last_msg, &packet2);
141 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
143 memset(&packet2, 0, sizeof(packet2));
144 mavlink_msg_system_time_send(MAVLINK_COMM_1 , packet1.time_unix_usec , packet1.time_boot_ms );
145 mavlink_msg_system_time_decode(last_msg, &packet2);
146 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
149 static void mavlink_test_ping(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
151 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
152 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
153 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PING >= 256) {
154 return;
156 #endif
157 mavlink_message_t msg;
158 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
159 uint16_t i;
160 mavlink_ping_t packet_in = {
161 93372036854775807ULL,963497880,41,108
163 mavlink_ping_t packet1, packet2;
164 memset(&packet1, 0, sizeof(packet1));
165 packet1.time_usec = packet_in.time_usec;
166 packet1.seq = packet_in.seq;
167 packet1.target_system = packet_in.target_system;
168 packet1.target_component = packet_in.target_component;
171 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
172 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
173 // cope with extensions
174 memset(MAVLINK_MSG_ID_PING_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PING_MIN_LEN);
176 #endif
177 memset(&packet2, 0, sizeof(packet2));
178 mavlink_msg_ping_encode(system_id, component_id, &msg, &packet1);
179 mavlink_msg_ping_decode(&msg, &packet2);
180 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
182 memset(&packet2, 0, sizeof(packet2));
183 mavlink_msg_ping_pack(system_id, component_id, &msg , packet1.time_usec , packet1.seq , packet1.target_system , packet1.target_component );
184 mavlink_msg_ping_decode(&msg, &packet2);
185 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
187 memset(&packet2, 0, sizeof(packet2));
188 mavlink_msg_ping_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.seq , packet1.target_system , packet1.target_component );
189 mavlink_msg_ping_decode(&msg, &packet2);
190 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
192 memset(&packet2, 0, sizeof(packet2));
193 mavlink_msg_to_send_buffer(buffer, &msg);
194 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
195 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
197 mavlink_msg_ping_decode(last_msg, &packet2);
198 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
200 memset(&packet2, 0, sizeof(packet2));
201 mavlink_msg_ping_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.seq , packet1.target_system , packet1.target_component );
202 mavlink_msg_ping_decode(last_msg, &packet2);
203 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
206 static void mavlink_test_change_operator_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
208 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
209 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
210 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL >= 256) {
211 return;
213 #endif
214 mavlink_message_t msg;
215 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
216 uint16_t i;
217 mavlink_change_operator_control_t packet_in = {
218 5,72,139,"DEFGHIJKLMNOPQRSTUVWXYZA"
220 mavlink_change_operator_control_t packet1, packet2;
221 memset(&packet1, 0, sizeof(packet1));
222 packet1.target_system = packet_in.target_system;
223 packet1.control_request = packet_in.control_request;
224 packet1.version = packet_in.version;
226 mav_array_memcpy(packet1.passkey, packet_in.passkey, sizeof(char)*25);
228 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
229 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
230 // cope with extensions
231 memset(MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN);
233 #endif
234 memset(&packet2, 0, sizeof(packet2));
235 mavlink_msg_change_operator_control_encode(system_id, component_id, &msg, &packet1);
236 mavlink_msg_change_operator_control_decode(&msg, &packet2);
237 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
239 memset(&packet2, 0, sizeof(packet2));
240 mavlink_msg_change_operator_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.control_request , packet1.version , packet1.passkey );
241 mavlink_msg_change_operator_control_decode(&msg, &packet2);
242 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
244 memset(&packet2, 0, sizeof(packet2));
245 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 );
246 mavlink_msg_change_operator_control_decode(&msg, &packet2);
247 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
249 memset(&packet2, 0, sizeof(packet2));
250 mavlink_msg_to_send_buffer(buffer, &msg);
251 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
252 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
254 mavlink_msg_change_operator_control_decode(last_msg, &packet2);
255 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
257 memset(&packet2, 0, sizeof(packet2));
258 mavlink_msg_change_operator_control_send(MAVLINK_COMM_1 , packet1.target_system , packet1.control_request , packet1.version , packet1.passkey );
259 mavlink_msg_change_operator_control_decode(last_msg, &packet2);
260 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
263 static void mavlink_test_change_operator_control_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
265 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
266 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
267 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK >= 256) {
268 return;
270 #endif
271 mavlink_message_t msg;
272 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
273 uint16_t i;
274 mavlink_change_operator_control_ack_t packet_in = {
275 5,72,139
277 mavlink_change_operator_control_ack_t packet1, packet2;
278 memset(&packet1, 0, sizeof(packet1));
279 packet1.gcs_system_id = packet_in.gcs_system_id;
280 packet1.control_request = packet_in.control_request;
281 packet1.ack = packet_in.ack;
284 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
285 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
286 // cope with extensions
287 memset(MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN);
289 #endif
290 memset(&packet2, 0, sizeof(packet2));
291 mavlink_msg_change_operator_control_ack_encode(system_id, component_id, &msg, &packet1);
292 mavlink_msg_change_operator_control_ack_decode(&msg, &packet2);
293 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
295 memset(&packet2, 0, sizeof(packet2));
296 mavlink_msg_change_operator_control_ack_pack(system_id, component_id, &msg , packet1.gcs_system_id , packet1.control_request , packet1.ack );
297 mavlink_msg_change_operator_control_ack_decode(&msg, &packet2);
298 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
300 memset(&packet2, 0, sizeof(packet2));
301 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 );
302 mavlink_msg_change_operator_control_ack_decode(&msg, &packet2);
303 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
305 memset(&packet2, 0, sizeof(packet2));
306 mavlink_msg_to_send_buffer(buffer, &msg);
307 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
308 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
310 mavlink_msg_change_operator_control_ack_decode(last_msg, &packet2);
311 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
313 memset(&packet2, 0, sizeof(packet2));
314 mavlink_msg_change_operator_control_ack_send(MAVLINK_COMM_1 , packet1.gcs_system_id , packet1.control_request , packet1.ack );
315 mavlink_msg_change_operator_control_ack_decode(last_msg, &packet2);
316 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
319 static void mavlink_test_auth_key(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
321 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
322 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
323 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AUTH_KEY >= 256) {
324 return;
326 #endif
327 mavlink_message_t msg;
328 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
329 uint16_t i;
330 mavlink_auth_key_t packet_in = {
331 "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDE"
333 mavlink_auth_key_t packet1, packet2;
334 memset(&packet1, 0, sizeof(packet1));
336 mav_array_memcpy(packet1.key, packet_in.key, sizeof(char)*32);
338 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
339 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
340 // cope with extensions
341 memset(MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN);
343 #endif
344 memset(&packet2, 0, sizeof(packet2));
345 mavlink_msg_auth_key_encode(system_id, component_id, &msg, &packet1);
346 mavlink_msg_auth_key_decode(&msg, &packet2);
347 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
349 memset(&packet2, 0, sizeof(packet2));
350 mavlink_msg_auth_key_pack(system_id, component_id, &msg , packet1.key );
351 mavlink_msg_auth_key_decode(&msg, &packet2);
352 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
354 memset(&packet2, 0, sizeof(packet2));
355 mavlink_msg_auth_key_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.key );
356 mavlink_msg_auth_key_decode(&msg, &packet2);
357 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
359 memset(&packet2, 0, sizeof(packet2));
360 mavlink_msg_to_send_buffer(buffer, &msg);
361 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
362 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
364 mavlink_msg_auth_key_decode(last_msg, &packet2);
365 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
367 memset(&packet2, 0, sizeof(packet2));
368 mavlink_msg_auth_key_send(MAVLINK_COMM_1 , packet1.key );
369 mavlink_msg_auth_key_decode(last_msg, &packet2);
370 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
373 static void mavlink_test_link_node_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
375 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
376 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
377 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LINK_NODE_STATUS >= 256) {
378 return;
380 #endif
381 mavlink_message_t msg;
382 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
383 uint16_t i;
384 mavlink_link_node_status_t packet_in = {
385 93372036854775807ULL,963497880,963498088,963498296,963498504,963498712,18691,18795,18899,235,46
387 mavlink_link_node_status_t packet1, packet2;
388 memset(&packet1, 0, sizeof(packet1));
389 packet1.timestamp = packet_in.timestamp;
390 packet1.tx_rate = packet_in.tx_rate;
391 packet1.rx_rate = packet_in.rx_rate;
392 packet1.messages_sent = packet_in.messages_sent;
393 packet1.messages_received = packet_in.messages_received;
394 packet1.messages_lost = packet_in.messages_lost;
395 packet1.rx_parse_err = packet_in.rx_parse_err;
396 packet1.tx_overflows = packet_in.tx_overflows;
397 packet1.rx_overflows = packet_in.rx_overflows;
398 packet1.tx_buf = packet_in.tx_buf;
399 packet1.rx_buf = packet_in.rx_buf;
402 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
403 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
404 // cope with extensions
405 memset(MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN);
407 #endif
408 memset(&packet2, 0, sizeof(packet2));
409 mavlink_msg_link_node_status_encode(system_id, component_id, &msg, &packet1);
410 mavlink_msg_link_node_status_decode(&msg, &packet2);
411 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
413 memset(&packet2, 0, sizeof(packet2));
414 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 );
415 mavlink_msg_link_node_status_decode(&msg, &packet2);
416 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
418 memset(&packet2, 0, sizeof(packet2));
419 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 );
420 mavlink_msg_link_node_status_decode(&msg, &packet2);
421 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
423 memset(&packet2, 0, sizeof(packet2));
424 mavlink_msg_to_send_buffer(buffer, &msg);
425 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
426 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
428 mavlink_msg_link_node_status_decode(last_msg, &packet2);
429 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
431 memset(&packet2, 0, sizeof(packet2));
432 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 );
433 mavlink_msg_link_node_status_decode(last_msg, &packet2);
434 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
437 static void mavlink_test_set_mode(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
439 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
440 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
441 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_MODE >= 256) {
442 return;
444 #endif
445 mavlink_message_t msg;
446 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
447 uint16_t i;
448 mavlink_set_mode_t packet_in = {
449 963497464,17,84
451 mavlink_set_mode_t packet1, packet2;
452 memset(&packet1, 0, sizeof(packet1));
453 packet1.custom_mode = packet_in.custom_mode;
454 packet1.target_system = packet_in.target_system;
455 packet1.base_mode = packet_in.base_mode;
458 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
459 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
460 // cope with extensions
461 memset(MAVLINK_MSG_ID_SET_MODE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_MODE_MIN_LEN);
463 #endif
464 memset(&packet2, 0, sizeof(packet2));
465 mavlink_msg_set_mode_encode(system_id, component_id, &msg, &packet1);
466 mavlink_msg_set_mode_decode(&msg, &packet2);
467 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
469 memset(&packet2, 0, sizeof(packet2));
470 mavlink_msg_set_mode_pack(system_id, component_id, &msg , packet1.target_system , packet1.base_mode , packet1.custom_mode );
471 mavlink_msg_set_mode_decode(&msg, &packet2);
472 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
474 memset(&packet2, 0, sizeof(packet2));
475 mavlink_msg_set_mode_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.base_mode , packet1.custom_mode );
476 mavlink_msg_set_mode_decode(&msg, &packet2);
477 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
479 memset(&packet2, 0, sizeof(packet2));
480 mavlink_msg_to_send_buffer(buffer, &msg);
481 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
482 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
484 mavlink_msg_set_mode_decode(last_msg, &packet2);
485 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
487 memset(&packet2, 0, sizeof(packet2));
488 mavlink_msg_set_mode_send(MAVLINK_COMM_1 , packet1.target_system , packet1.base_mode , packet1.custom_mode );
489 mavlink_msg_set_mode_decode(last_msg, &packet2);
490 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
493 static void mavlink_test_param_ack_transaction(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
495 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
496 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
497 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION >= 256) {
498 return;
500 #endif
501 mavlink_message_t msg;
502 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
503 uint16_t i;
504 mavlink_param_ack_transaction_t packet_in = {
505 17.0,17,84,"GHIJKLMNOPQRSTU",199,10
507 mavlink_param_ack_transaction_t packet1, packet2;
508 memset(&packet1, 0, sizeof(packet1));
509 packet1.param_value = packet_in.param_value;
510 packet1.target_system = packet_in.target_system;
511 packet1.target_component = packet_in.target_component;
512 packet1.param_type = packet_in.param_type;
513 packet1.param_result = packet_in.param_result;
515 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
517 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
518 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
519 // cope with extensions
520 memset(MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_ACK_TRANSACTION_MIN_LEN);
522 #endif
523 memset(&packet2, 0, sizeof(packet2));
524 mavlink_msg_param_ack_transaction_encode(system_id, component_id, &msg, &packet1);
525 mavlink_msg_param_ack_transaction_decode(&msg, &packet2);
526 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
528 memset(&packet2, 0, sizeof(packet2));
529 mavlink_msg_param_ack_transaction_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_result );
530 mavlink_msg_param_ack_transaction_decode(&msg, &packet2);
531 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
533 memset(&packet2, 0, sizeof(packet2));
534 mavlink_msg_param_ack_transaction_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 , packet1.param_result );
535 mavlink_msg_param_ack_transaction_decode(&msg, &packet2);
536 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
538 memset(&packet2, 0, sizeof(packet2));
539 mavlink_msg_to_send_buffer(buffer, &msg);
540 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
541 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
543 mavlink_msg_param_ack_transaction_decode(last_msg, &packet2);
544 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
546 memset(&packet2, 0, sizeof(packet2));
547 mavlink_msg_param_ack_transaction_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_result );
548 mavlink_msg_param_ack_transaction_decode(last_msg, &packet2);
549 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
552 static void mavlink_test_param_request_read(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
554 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
555 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
556 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_REQUEST_READ >= 256) {
557 return;
559 #endif
560 mavlink_message_t msg;
561 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
562 uint16_t i;
563 mavlink_param_request_read_t packet_in = {
564 17235,139,206,"EFGHIJKLMNOPQRS"
566 mavlink_param_request_read_t packet1, packet2;
567 memset(&packet1, 0, sizeof(packet1));
568 packet1.param_index = packet_in.param_index;
569 packet1.target_system = packet_in.target_system;
570 packet1.target_component = packet_in.target_component;
572 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
574 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
575 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
576 // cope with extensions
577 memset(MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN);
579 #endif
580 memset(&packet2, 0, sizeof(packet2));
581 mavlink_msg_param_request_read_encode(system_id, component_id, &msg, &packet1);
582 mavlink_msg_param_request_read_decode(&msg, &packet2);
583 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
585 memset(&packet2, 0, sizeof(packet2));
586 mavlink_msg_param_request_read_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index );
587 mavlink_msg_param_request_read_decode(&msg, &packet2);
588 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
590 memset(&packet2, 0, sizeof(packet2));
591 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 );
592 mavlink_msg_param_request_read_decode(&msg, &packet2);
593 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
595 memset(&packet2, 0, sizeof(packet2));
596 mavlink_msg_to_send_buffer(buffer, &msg);
597 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
598 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
600 mavlink_msg_param_request_read_decode(last_msg, &packet2);
601 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
603 memset(&packet2, 0, sizeof(packet2));
604 mavlink_msg_param_request_read_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index );
605 mavlink_msg_param_request_read_decode(last_msg, &packet2);
606 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
609 static void mavlink_test_param_request_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
611 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
612 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
613 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_REQUEST_LIST >= 256) {
614 return;
616 #endif
617 mavlink_message_t msg;
618 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
619 uint16_t i;
620 mavlink_param_request_list_t packet_in = {
621 5,72
623 mavlink_param_request_list_t packet1, packet2;
624 memset(&packet1, 0, sizeof(packet1));
625 packet1.target_system = packet_in.target_system;
626 packet1.target_component = packet_in.target_component;
629 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
630 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
631 // cope with extensions
632 memset(MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN);
634 #endif
635 memset(&packet2, 0, sizeof(packet2));
636 mavlink_msg_param_request_list_encode(system_id, component_id, &msg, &packet1);
637 mavlink_msg_param_request_list_decode(&msg, &packet2);
638 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
640 memset(&packet2, 0, sizeof(packet2));
641 mavlink_msg_param_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
642 mavlink_msg_param_request_list_decode(&msg, &packet2);
643 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
645 memset(&packet2, 0, sizeof(packet2));
646 mavlink_msg_param_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
647 mavlink_msg_param_request_list_decode(&msg, &packet2);
648 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
650 memset(&packet2, 0, sizeof(packet2));
651 mavlink_msg_to_send_buffer(buffer, &msg);
652 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
653 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
655 mavlink_msg_param_request_list_decode(last_msg, &packet2);
656 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
658 memset(&packet2, 0, sizeof(packet2));
659 mavlink_msg_param_request_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
660 mavlink_msg_param_request_list_decode(last_msg, &packet2);
661 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
664 static void mavlink_test_param_value(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
666 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
667 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
668 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_VALUE >= 256) {
669 return;
671 #endif
672 mavlink_message_t msg;
673 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
674 uint16_t i;
675 mavlink_param_value_t packet_in = {
676 17.0,17443,17547,"IJKLMNOPQRSTUVW",77
678 mavlink_param_value_t packet1, packet2;
679 memset(&packet1, 0, sizeof(packet1));
680 packet1.param_value = packet_in.param_value;
681 packet1.param_count = packet_in.param_count;
682 packet1.param_index = packet_in.param_index;
683 packet1.param_type = packet_in.param_type;
685 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
687 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
688 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
689 // cope with extensions
690 memset(MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN);
692 #endif
693 memset(&packet2, 0, sizeof(packet2));
694 mavlink_msg_param_value_encode(system_id, component_id, &msg, &packet1);
695 mavlink_msg_param_value_decode(&msg, &packet2);
696 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
698 memset(&packet2, 0, sizeof(packet2));
699 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 );
700 mavlink_msg_param_value_decode(&msg, &packet2);
701 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
703 memset(&packet2, 0, sizeof(packet2));
704 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 );
705 mavlink_msg_param_value_decode(&msg, &packet2);
706 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
708 memset(&packet2, 0, sizeof(packet2));
709 mavlink_msg_to_send_buffer(buffer, &msg);
710 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
711 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
713 mavlink_msg_param_value_decode(last_msg, &packet2);
714 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
716 memset(&packet2, 0, sizeof(packet2));
717 mavlink_msg_param_value_send(MAVLINK_COMM_1 , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_count , packet1.param_index );
718 mavlink_msg_param_value_decode(last_msg, &packet2);
719 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
722 static void mavlink_test_param_set(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
724 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
725 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
726 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_SET >= 256) {
727 return;
729 #endif
730 mavlink_message_t msg;
731 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
732 uint16_t i;
733 mavlink_param_set_t packet_in = {
734 17.0,17,84,"GHIJKLMNOPQRSTU",199
736 mavlink_param_set_t packet1, packet2;
737 memset(&packet1, 0, sizeof(packet1));
738 packet1.param_value = packet_in.param_value;
739 packet1.target_system = packet_in.target_system;
740 packet1.target_component = packet_in.target_component;
741 packet1.param_type = packet_in.param_type;
743 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
745 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
746 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
747 // cope with extensions
748 memset(MAVLINK_MSG_ID_PARAM_SET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_SET_MIN_LEN);
750 #endif
751 memset(&packet2, 0, sizeof(packet2));
752 mavlink_msg_param_set_encode(system_id, component_id, &msg, &packet1);
753 mavlink_msg_param_set_decode(&msg, &packet2);
754 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
756 memset(&packet2, 0, sizeof(packet2));
757 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 );
758 mavlink_msg_param_set_decode(&msg, &packet2);
759 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
761 memset(&packet2, 0, sizeof(packet2));
762 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 );
763 mavlink_msg_param_set_decode(&msg, &packet2);
764 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
766 memset(&packet2, 0, sizeof(packet2));
767 mavlink_msg_to_send_buffer(buffer, &msg);
768 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
769 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
771 mavlink_msg_param_set_decode(last_msg, &packet2);
772 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
774 memset(&packet2, 0, sizeof(packet2));
775 mavlink_msg_param_set_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type );
776 mavlink_msg_param_set_decode(last_msg, &packet2);
777 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
780 static void mavlink_test_gps_raw_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
782 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
783 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
784 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_RAW_INT >= 256) {
785 return;
787 #endif
788 mavlink_message_t msg;
789 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
790 uint16_t i;
791 mavlink_gps_raw_int_t packet_in = {
792 93372036854775807ULL,963497880,963498088,963498296,18275,18379,18483,18587,89,156,963499024,963499232,963499440,963499648,963499856,19835
794 mavlink_gps_raw_int_t packet1, packet2;
795 memset(&packet1, 0, sizeof(packet1));
796 packet1.time_usec = packet_in.time_usec;
797 packet1.lat = packet_in.lat;
798 packet1.lon = packet_in.lon;
799 packet1.alt = packet_in.alt;
800 packet1.eph = packet_in.eph;
801 packet1.epv = packet_in.epv;
802 packet1.vel = packet_in.vel;
803 packet1.cog = packet_in.cog;
804 packet1.fix_type = packet_in.fix_type;
805 packet1.satellites_visible = packet_in.satellites_visible;
806 packet1.alt_ellipsoid = packet_in.alt_ellipsoid;
807 packet1.h_acc = packet_in.h_acc;
808 packet1.v_acc = packet_in.v_acc;
809 packet1.vel_acc = packet_in.vel_acc;
810 packet1.hdg_acc = packet_in.hdg_acc;
811 packet1.yaw = packet_in.yaw;
814 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
815 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
816 // cope with extensions
817 memset(MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN);
819 #endif
820 memset(&packet2, 0, sizeof(packet2));
821 mavlink_msg_gps_raw_int_encode(system_id, component_id, &msg, &packet1);
822 mavlink_msg_gps_raw_int_decode(&msg, &packet2);
823 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
825 memset(&packet2, 0, sizeof(packet2));
826 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 );
827 mavlink_msg_gps_raw_int_decode(&msg, &packet2);
828 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
830 memset(&packet2, 0, sizeof(packet2));
831 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 );
832 mavlink_msg_gps_raw_int_decode(&msg, &packet2);
833 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
835 memset(&packet2, 0, sizeof(packet2));
836 mavlink_msg_to_send_buffer(buffer, &msg);
837 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
838 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
840 mavlink_msg_gps_raw_int_decode(last_msg, &packet2);
841 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
843 memset(&packet2, 0, sizeof(packet2));
844 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 );
845 mavlink_msg_gps_raw_int_decode(last_msg, &packet2);
846 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
849 static void mavlink_test_gps_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
851 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
852 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
853 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_STATUS >= 256) {
854 return;
856 #endif
857 mavlink_message_t msg;
858 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
859 uint16_t i;
860 mavlink_gps_status_t packet_in = {
861 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 }
863 mavlink_gps_status_t packet1, packet2;
864 memset(&packet1, 0, sizeof(packet1));
865 packet1.satellites_visible = packet_in.satellites_visible;
867 mav_array_memcpy(packet1.satellite_prn, packet_in.satellite_prn, sizeof(uint8_t)*20);
868 mav_array_memcpy(packet1.satellite_used, packet_in.satellite_used, sizeof(uint8_t)*20);
869 mav_array_memcpy(packet1.satellite_elevation, packet_in.satellite_elevation, sizeof(uint8_t)*20);
870 mav_array_memcpy(packet1.satellite_azimuth, packet_in.satellite_azimuth, sizeof(uint8_t)*20);
871 mav_array_memcpy(packet1.satellite_snr, packet_in.satellite_snr, sizeof(uint8_t)*20);
873 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
874 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
875 // cope with extensions
876 memset(MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN);
878 #endif
879 memset(&packet2, 0, sizeof(packet2));
880 mavlink_msg_gps_status_encode(system_id, component_id, &msg, &packet1);
881 mavlink_msg_gps_status_decode(&msg, &packet2);
882 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
884 memset(&packet2, 0, sizeof(packet2));
885 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 );
886 mavlink_msg_gps_status_decode(&msg, &packet2);
887 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
889 memset(&packet2, 0, sizeof(packet2));
890 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 );
891 mavlink_msg_gps_status_decode(&msg, &packet2);
892 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
894 memset(&packet2, 0, sizeof(packet2));
895 mavlink_msg_to_send_buffer(buffer, &msg);
896 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
897 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
899 mavlink_msg_gps_status_decode(last_msg, &packet2);
900 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
902 memset(&packet2, 0, sizeof(packet2));
903 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 );
904 mavlink_msg_gps_status_decode(last_msg, &packet2);
905 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
908 static void mavlink_test_scaled_imu(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
910 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
911 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
912 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_IMU >= 256) {
913 return;
915 #endif
916 mavlink_message_t msg;
917 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
918 uint16_t i;
919 mavlink_scaled_imu_t packet_in = {
920 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275,18379
922 mavlink_scaled_imu_t packet1, packet2;
923 memset(&packet1, 0, sizeof(packet1));
924 packet1.time_boot_ms = packet_in.time_boot_ms;
925 packet1.xacc = packet_in.xacc;
926 packet1.yacc = packet_in.yacc;
927 packet1.zacc = packet_in.zacc;
928 packet1.xgyro = packet_in.xgyro;
929 packet1.ygyro = packet_in.ygyro;
930 packet1.zgyro = packet_in.zgyro;
931 packet1.xmag = packet_in.xmag;
932 packet1.ymag = packet_in.ymag;
933 packet1.zmag = packet_in.zmag;
934 packet1.temperature = packet_in.temperature;
937 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
938 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
939 // cope with extensions
940 memset(MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN);
942 #endif
943 memset(&packet2, 0, sizeof(packet2));
944 mavlink_msg_scaled_imu_encode(system_id, component_id, &msg, &packet1);
945 mavlink_msg_scaled_imu_decode(&msg, &packet2);
946 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
948 memset(&packet2, 0, sizeof(packet2));
949 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 );
950 mavlink_msg_scaled_imu_decode(&msg, &packet2);
951 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
953 memset(&packet2, 0, sizeof(packet2));
954 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 );
955 mavlink_msg_scaled_imu_decode(&msg, &packet2);
956 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
958 memset(&packet2, 0, sizeof(packet2));
959 mavlink_msg_to_send_buffer(buffer, &msg);
960 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
961 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
963 mavlink_msg_scaled_imu_decode(last_msg, &packet2);
964 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
966 memset(&packet2, 0, sizeof(packet2));
967 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 );
968 mavlink_msg_scaled_imu_decode(last_msg, &packet2);
969 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
972 static void mavlink_test_raw_imu(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
974 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
975 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
976 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RAW_IMU >= 256) {
977 return;
979 #endif
980 mavlink_message_t msg;
981 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
982 uint16_t i;
983 mavlink_raw_imu_t packet_in = {
984 93372036854775807ULL,17651,17755,17859,17963,18067,18171,18275,18379,18483,211,18639
986 mavlink_raw_imu_t packet1, packet2;
987 memset(&packet1, 0, sizeof(packet1));
988 packet1.time_usec = packet_in.time_usec;
989 packet1.xacc = packet_in.xacc;
990 packet1.yacc = packet_in.yacc;
991 packet1.zacc = packet_in.zacc;
992 packet1.xgyro = packet_in.xgyro;
993 packet1.ygyro = packet_in.ygyro;
994 packet1.zgyro = packet_in.zgyro;
995 packet1.xmag = packet_in.xmag;
996 packet1.ymag = packet_in.ymag;
997 packet1.zmag = packet_in.zmag;
998 packet1.id = packet_in.id;
999 packet1.temperature = packet_in.temperature;
1002 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1003 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1004 // cope with extensions
1005 memset(MAVLINK_MSG_ID_RAW_IMU_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RAW_IMU_MIN_LEN);
1007 #endif
1008 memset(&packet2, 0, sizeof(packet2));
1009 mavlink_msg_raw_imu_encode(system_id, component_id, &msg, &packet1);
1010 mavlink_msg_raw_imu_decode(&msg, &packet2);
1011 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1013 memset(&packet2, 0, sizeof(packet2));
1014 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 );
1015 mavlink_msg_raw_imu_decode(&msg, &packet2);
1016 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1018 memset(&packet2, 0, sizeof(packet2));
1019 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 );
1020 mavlink_msg_raw_imu_decode(&msg, &packet2);
1021 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1023 memset(&packet2, 0, sizeof(packet2));
1024 mavlink_msg_to_send_buffer(buffer, &msg);
1025 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1026 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1028 mavlink_msg_raw_imu_decode(last_msg, &packet2);
1029 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1031 memset(&packet2, 0, sizeof(packet2));
1032 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 );
1033 mavlink_msg_raw_imu_decode(last_msg, &packet2);
1034 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1037 static void mavlink_test_raw_pressure(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1039 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1040 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1041 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RAW_PRESSURE >= 256) {
1042 return;
1044 #endif
1045 mavlink_message_t msg;
1046 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1047 uint16_t i;
1048 mavlink_raw_pressure_t packet_in = {
1049 93372036854775807ULL,17651,17755,17859,17963
1051 mavlink_raw_pressure_t packet1, packet2;
1052 memset(&packet1, 0, sizeof(packet1));
1053 packet1.time_usec = packet_in.time_usec;
1054 packet1.press_abs = packet_in.press_abs;
1055 packet1.press_diff1 = packet_in.press_diff1;
1056 packet1.press_diff2 = packet_in.press_diff2;
1057 packet1.temperature = packet_in.temperature;
1060 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1061 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1062 // cope with extensions
1063 memset(MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN);
1065 #endif
1066 memset(&packet2, 0, sizeof(packet2));
1067 mavlink_msg_raw_pressure_encode(system_id, component_id, &msg, &packet1);
1068 mavlink_msg_raw_pressure_decode(&msg, &packet2);
1069 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1071 memset(&packet2, 0, sizeof(packet2));
1072 mavlink_msg_raw_pressure_pack(system_id, component_id, &msg , packet1.time_usec , packet1.press_abs , packet1.press_diff1 , packet1.press_diff2 , packet1.temperature );
1073 mavlink_msg_raw_pressure_decode(&msg, &packet2);
1074 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1076 memset(&packet2, 0, sizeof(packet2));
1077 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 );
1078 mavlink_msg_raw_pressure_decode(&msg, &packet2);
1079 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1081 memset(&packet2, 0, sizeof(packet2));
1082 mavlink_msg_to_send_buffer(buffer, &msg);
1083 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1084 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1086 mavlink_msg_raw_pressure_decode(last_msg, &packet2);
1087 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1089 memset(&packet2, 0, sizeof(packet2));
1090 mavlink_msg_raw_pressure_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.press_abs , packet1.press_diff1 , packet1.press_diff2 , packet1.temperature );
1091 mavlink_msg_raw_pressure_decode(last_msg, &packet2);
1092 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1095 static void mavlink_test_scaled_pressure(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1097 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1098 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1099 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_PRESSURE >= 256) {
1100 return;
1102 #endif
1103 mavlink_message_t msg;
1104 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1105 uint16_t i;
1106 mavlink_scaled_pressure_t packet_in = {
1107 963497464,45.0,73.0,17859,17963
1109 mavlink_scaled_pressure_t packet1, packet2;
1110 memset(&packet1, 0, sizeof(packet1));
1111 packet1.time_boot_ms = packet_in.time_boot_ms;
1112 packet1.press_abs = packet_in.press_abs;
1113 packet1.press_diff = packet_in.press_diff;
1114 packet1.temperature = packet_in.temperature;
1115 packet1.temperature_press_diff = packet_in.temperature_press_diff;
1118 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1119 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1120 // cope with extensions
1121 memset(MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN);
1123 #endif
1124 memset(&packet2, 0, sizeof(packet2));
1125 mavlink_msg_scaled_pressure_encode(system_id, component_id, &msg, &packet1);
1126 mavlink_msg_scaled_pressure_decode(&msg, &packet2);
1127 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1129 memset(&packet2, 0, sizeof(packet2));
1130 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 );
1131 mavlink_msg_scaled_pressure_decode(&msg, &packet2);
1132 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1134 memset(&packet2, 0, sizeof(packet2));
1135 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 );
1136 mavlink_msg_scaled_pressure_decode(&msg, &packet2);
1137 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1139 memset(&packet2, 0, sizeof(packet2));
1140 mavlink_msg_to_send_buffer(buffer, &msg);
1141 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1142 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1144 mavlink_msg_scaled_pressure_decode(last_msg, &packet2);
1145 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1147 memset(&packet2, 0, sizeof(packet2));
1148 mavlink_msg_scaled_pressure_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature , packet1.temperature_press_diff );
1149 mavlink_msg_scaled_pressure_decode(last_msg, &packet2);
1150 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1153 static void mavlink_test_attitude(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1155 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1156 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1157 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATTITUDE >= 256) {
1158 return;
1160 #endif
1161 mavlink_message_t msg;
1162 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1163 uint16_t i;
1164 mavlink_attitude_t packet_in = {
1165 963497464,45.0,73.0,101.0,129.0,157.0,185.0
1167 mavlink_attitude_t packet1, packet2;
1168 memset(&packet1, 0, sizeof(packet1));
1169 packet1.time_boot_ms = packet_in.time_boot_ms;
1170 packet1.roll = packet_in.roll;
1171 packet1.pitch = packet_in.pitch;
1172 packet1.yaw = packet_in.yaw;
1173 packet1.rollspeed = packet_in.rollspeed;
1174 packet1.pitchspeed = packet_in.pitchspeed;
1175 packet1.yawspeed = packet_in.yawspeed;
1178 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1179 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1180 // cope with extensions
1181 memset(MAVLINK_MSG_ID_ATTITUDE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ATTITUDE_MIN_LEN);
1183 #endif
1184 memset(&packet2, 0, sizeof(packet2));
1185 mavlink_msg_attitude_encode(system_id, component_id, &msg, &packet1);
1186 mavlink_msg_attitude_decode(&msg, &packet2);
1187 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1189 memset(&packet2, 0, sizeof(packet2));
1190 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 );
1191 mavlink_msg_attitude_decode(&msg, &packet2);
1192 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1194 memset(&packet2, 0, sizeof(packet2));
1195 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 );
1196 mavlink_msg_attitude_decode(&msg, &packet2);
1197 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1199 memset(&packet2, 0, sizeof(packet2));
1200 mavlink_msg_to_send_buffer(buffer, &msg);
1201 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1202 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1204 mavlink_msg_attitude_decode(last_msg, &packet2);
1205 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1207 memset(&packet2, 0, sizeof(packet2));
1208 mavlink_msg_attitude_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed );
1209 mavlink_msg_attitude_decode(last_msg, &packet2);
1210 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1213 static void mavlink_test_attitude_quaternion(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1215 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1216 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1217 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATTITUDE_QUATERNION >= 256) {
1218 return;
1220 #endif
1221 mavlink_message_t msg;
1222 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1223 uint16_t i;
1224 mavlink_attitude_quaternion_t packet_in = {
1225 963497464,45.0,73.0,101.0,129.0,157.0,185.0,213.0,{ 241.0, 242.0, 243.0, 244.0 }
1227 mavlink_attitude_quaternion_t packet1, packet2;
1228 memset(&packet1, 0, sizeof(packet1));
1229 packet1.time_boot_ms = packet_in.time_boot_ms;
1230 packet1.q1 = packet_in.q1;
1231 packet1.q2 = packet_in.q2;
1232 packet1.q3 = packet_in.q3;
1233 packet1.q4 = packet_in.q4;
1234 packet1.rollspeed = packet_in.rollspeed;
1235 packet1.pitchspeed = packet_in.pitchspeed;
1236 packet1.yawspeed = packet_in.yawspeed;
1238 mav_array_memcpy(packet1.repr_offset_q, packet_in.repr_offset_q, sizeof(float)*4);
1240 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1241 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1242 // cope with extensions
1243 memset(MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN);
1245 #endif
1246 memset(&packet2, 0, sizeof(packet2));
1247 mavlink_msg_attitude_quaternion_encode(system_id, component_id, &msg, &packet1);
1248 mavlink_msg_attitude_quaternion_decode(&msg, &packet2);
1249 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1251 memset(&packet2, 0, sizeof(packet2));
1252 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 );
1253 mavlink_msg_attitude_quaternion_decode(&msg, &packet2);
1254 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1256 memset(&packet2, 0, sizeof(packet2));
1257 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 );
1258 mavlink_msg_attitude_quaternion_decode(&msg, &packet2);
1259 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1261 memset(&packet2, 0, sizeof(packet2));
1262 mavlink_msg_to_send_buffer(buffer, &msg);
1263 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1264 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1266 mavlink_msg_attitude_quaternion_decode(last_msg, &packet2);
1267 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1269 memset(&packet2, 0, sizeof(packet2));
1270 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 );
1271 mavlink_msg_attitude_quaternion_decode(last_msg, &packet2);
1272 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1275 static void mavlink_test_local_position_ned(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1277 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1278 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1279 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOCAL_POSITION_NED >= 256) {
1280 return;
1282 #endif
1283 mavlink_message_t msg;
1284 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1285 uint16_t i;
1286 mavlink_local_position_ned_t packet_in = {
1287 963497464,45.0,73.0,101.0,129.0,157.0,185.0
1289 mavlink_local_position_ned_t packet1, packet2;
1290 memset(&packet1, 0, sizeof(packet1));
1291 packet1.time_boot_ms = packet_in.time_boot_ms;
1292 packet1.x = packet_in.x;
1293 packet1.y = packet_in.y;
1294 packet1.z = packet_in.z;
1295 packet1.vx = packet_in.vx;
1296 packet1.vy = packet_in.vy;
1297 packet1.vz = packet_in.vz;
1300 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1301 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1302 // cope with extensions
1303 memset(MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN);
1305 #endif
1306 memset(&packet2, 0, sizeof(packet2));
1307 mavlink_msg_local_position_ned_encode(system_id, component_id, &msg, &packet1);
1308 mavlink_msg_local_position_ned_decode(&msg, &packet2);
1309 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1311 memset(&packet2, 0, sizeof(packet2));
1312 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 );
1313 mavlink_msg_local_position_ned_decode(&msg, &packet2);
1314 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1316 memset(&packet2, 0, sizeof(packet2));
1317 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 );
1318 mavlink_msg_local_position_ned_decode(&msg, &packet2);
1319 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1321 memset(&packet2, 0, sizeof(packet2));
1322 mavlink_msg_to_send_buffer(buffer, &msg);
1323 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1324 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1326 mavlink_msg_local_position_ned_decode(last_msg, &packet2);
1327 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1329 memset(&packet2, 0, sizeof(packet2));
1330 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 );
1331 mavlink_msg_local_position_ned_decode(last_msg, &packet2);
1332 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1335 static void mavlink_test_global_position_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1337 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1338 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1339 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GLOBAL_POSITION_INT >= 256) {
1340 return;
1342 #endif
1343 mavlink_message_t msg;
1344 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1345 uint16_t i;
1346 mavlink_global_position_int_t packet_in = {
1347 963497464,963497672,963497880,963498088,963498296,18275,18379,18483,18587
1349 mavlink_global_position_int_t packet1, packet2;
1350 memset(&packet1, 0, sizeof(packet1));
1351 packet1.time_boot_ms = packet_in.time_boot_ms;
1352 packet1.lat = packet_in.lat;
1353 packet1.lon = packet_in.lon;
1354 packet1.alt = packet_in.alt;
1355 packet1.relative_alt = packet_in.relative_alt;
1356 packet1.vx = packet_in.vx;
1357 packet1.vy = packet_in.vy;
1358 packet1.vz = packet_in.vz;
1359 packet1.hdg = packet_in.hdg;
1362 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1363 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1364 // cope with extensions
1365 memset(MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GLOBAL_POSITION_INT_MIN_LEN);
1367 #endif
1368 memset(&packet2, 0, sizeof(packet2));
1369 mavlink_msg_global_position_int_encode(system_id, component_id, &msg, &packet1);
1370 mavlink_msg_global_position_int_decode(&msg, &packet2);
1371 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1373 memset(&packet2, 0, sizeof(packet2));
1374 mavlink_msg_global_position_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.hdg );
1375 mavlink_msg_global_position_int_decode(&msg, &packet2);
1376 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1378 memset(&packet2, 0, sizeof(packet2));
1379 mavlink_msg_global_position_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.hdg );
1380 mavlink_msg_global_position_int_decode(&msg, &packet2);
1381 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1383 memset(&packet2, 0, sizeof(packet2));
1384 mavlink_msg_to_send_buffer(buffer, &msg);
1385 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1386 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1388 mavlink_msg_global_position_int_decode(last_msg, &packet2);
1389 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1391 memset(&packet2, 0, sizeof(packet2));
1392 mavlink_msg_global_position_int_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.hdg );
1393 mavlink_msg_global_position_int_decode(last_msg, &packet2);
1394 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1397 static void mavlink_test_rc_channels_scaled(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1399 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1400 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1401 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RC_CHANNELS_SCALED >= 256) {
1402 return;
1404 #endif
1405 mavlink_message_t msg;
1406 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1407 uint16_t i;
1408 mavlink_rc_channels_scaled_t packet_in = {
1409 963497464,17443,17547,17651,17755,17859,17963,18067,18171,65,132
1411 mavlink_rc_channels_scaled_t packet1, packet2;
1412 memset(&packet1, 0, sizeof(packet1));
1413 packet1.time_boot_ms = packet_in.time_boot_ms;
1414 packet1.chan1_scaled = packet_in.chan1_scaled;
1415 packet1.chan2_scaled = packet_in.chan2_scaled;
1416 packet1.chan3_scaled = packet_in.chan3_scaled;
1417 packet1.chan4_scaled = packet_in.chan4_scaled;
1418 packet1.chan5_scaled = packet_in.chan5_scaled;
1419 packet1.chan6_scaled = packet_in.chan6_scaled;
1420 packet1.chan7_scaled = packet_in.chan7_scaled;
1421 packet1.chan8_scaled = packet_in.chan8_scaled;
1422 packet1.port = packet_in.port;
1423 packet1.rssi = packet_in.rssi;
1426 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1427 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1428 // cope with extensions
1429 memset(MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN);
1431 #endif
1432 memset(&packet2, 0, sizeof(packet2));
1433 mavlink_msg_rc_channels_scaled_encode(system_id, component_id, &msg, &packet1);
1434 mavlink_msg_rc_channels_scaled_decode(&msg, &packet2);
1435 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1437 memset(&packet2, 0, sizeof(packet2));
1438 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 );
1439 mavlink_msg_rc_channels_scaled_decode(&msg, &packet2);
1440 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1442 memset(&packet2, 0, sizeof(packet2));
1443 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 );
1444 mavlink_msg_rc_channels_scaled_decode(&msg, &packet2);
1445 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1447 memset(&packet2, 0, sizeof(packet2));
1448 mavlink_msg_to_send_buffer(buffer, &msg);
1449 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1450 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1452 mavlink_msg_rc_channels_scaled_decode(last_msg, &packet2);
1453 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1455 memset(&packet2, 0, sizeof(packet2));
1456 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 );
1457 mavlink_msg_rc_channels_scaled_decode(last_msg, &packet2);
1458 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1461 static void mavlink_test_rc_channels_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1463 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1464 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1465 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RC_CHANNELS_RAW >= 256) {
1466 return;
1468 #endif
1469 mavlink_message_t msg;
1470 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1471 uint16_t i;
1472 mavlink_rc_channels_raw_t packet_in = {
1473 963497464,17443,17547,17651,17755,17859,17963,18067,18171,65,132
1475 mavlink_rc_channels_raw_t packet1, packet2;
1476 memset(&packet1, 0, sizeof(packet1));
1477 packet1.time_boot_ms = packet_in.time_boot_ms;
1478 packet1.chan1_raw = packet_in.chan1_raw;
1479 packet1.chan2_raw = packet_in.chan2_raw;
1480 packet1.chan3_raw = packet_in.chan3_raw;
1481 packet1.chan4_raw = packet_in.chan4_raw;
1482 packet1.chan5_raw = packet_in.chan5_raw;
1483 packet1.chan6_raw = packet_in.chan6_raw;
1484 packet1.chan7_raw = packet_in.chan7_raw;
1485 packet1.chan8_raw = packet_in.chan8_raw;
1486 packet1.port = packet_in.port;
1487 packet1.rssi = packet_in.rssi;
1490 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1491 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1492 // cope with extensions
1493 memset(MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN);
1495 #endif
1496 memset(&packet2, 0, sizeof(packet2));
1497 mavlink_msg_rc_channels_raw_encode(system_id, component_id, &msg, &packet1);
1498 mavlink_msg_rc_channels_raw_decode(&msg, &packet2);
1499 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1501 memset(&packet2, 0, sizeof(packet2));
1502 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 );
1503 mavlink_msg_rc_channels_raw_decode(&msg, &packet2);
1504 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1506 memset(&packet2, 0, sizeof(packet2));
1507 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 );
1508 mavlink_msg_rc_channels_raw_decode(&msg, &packet2);
1509 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1511 memset(&packet2, 0, sizeof(packet2));
1512 mavlink_msg_to_send_buffer(buffer, &msg);
1513 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1514 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1516 mavlink_msg_rc_channels_raw_decode(last_msg, &packet2);
1517 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1519 memset(&packet2, 0, sizeof(packet2));
1520 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 );
1521 mavlink_msg_rc_channels_raw_decode(last_msg, &packet2);
1522 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1525 static void mavlink_test_servo_output_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1527 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1528 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1529 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERVO_OUTPUT_RAW >= 256) {
1530 return;
1532 #endif
1533 mavlink_message_t msg;
1534 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1535 uint16_t i;
1536 mavlink_servo_output_raw_t packet_in = {
1537 963497464,17443,17547,17651,17755,17859,17963,18067,18171,65,18327,18431,18535,18639,18743,18847,18951,19055
1539 mavlink_servo_output_raw_t packet1, packet2;
1540 memset(&packet1, 0, sizeof(packet1));
1541 packet1.time_usec = packet_in.time_usec;
1542 packet1.servo1_raw = packet_in.servo1_raw;
1543 packet1.servo2_raw = packet_in.servo2_raw;
1544 packet1.servo3_raw = packet_in.servo3_raw;
1545 packet1.servo4_raw = packet_in.servo4_raw;
1546 packet1.servo5_raw = packet_in.servo5_raw;
1547 packet1.servo6_raw = packet_in.servo6_raw;
1548 packet1.servo7_raw = packet_in.servo7_raw;
1549 packet1.servo8_raw = packet_in.servo8_raw;
1550 packet1.port = packet_in.port;
1551 packet1.servo9_raw = packet_in.servo9_raw;
1552 packet1.servo10_raw = packet_in.servo10_raw;
1553 packet1.servo11_raw = packet_in.servo11_raw;
1554 packet1.servo12_raw = packet_in.servo12_raw;
1555 packet1.servo13_raw = packet_in.servo13_raw;
1556 packet1.servo14_raw = packet_in.servo14_raw;
1557 packet1.servo15_raw = packet_in.servo15_raw;
1558 packet1.servo16_raw = packet_in.servo16_raw;
1561 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1562 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1563 // cope with extensions
1564 memset(MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN);
1566 #endif
1567 memset(&packet2, 0, sizeof(packet2));
1568 mavlink_msg_servo_output_raw_encode(system_id, component_id, &msg, &packet1);
1569 mavlink_msg_servo_output_raw_decode(&msg, &packet2);
1570 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1572 memset(&packet2, 0, sizeof(packet2));
1573 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 );
1574 mavlink_msg_servo_output_raw_decode(&msg, &packet2);
1575 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1577 memset(&packet2, 0, sizeof(packet2));
1578 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 );
1579 mavlink_msg_servo_output_raw_decode(&msg, &packet2);
1580 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1582 memset(&packet2, 0, sizeof(packet2));
1583 mavlink_msg_to_send_buffer(buffer, &msg);
1584 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1585 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1587 mavlink_msg_servo_output_raw_decode(last_msg, &packet2);
1588 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1590 memset(&packet2, 0, sizeof(packet2));
1591 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 );
1592 mavlink_msg_servo_output_raw_decode(last_msg, &packet2);
1593 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1596 static void mavlink_test_mission_request_partial_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1598 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1599 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1600 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST >= 256) {
1601 return;
1603 #endif
1604 mavlink_message_t msg;
1605 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1606 uint16_t i;
1607 mavlink_mission_request_partial_list_t packet_in = {
1608 17235,17339,17,84,151
1610 mavlink_mission_request_partial_list_t packet1, packet2;
1611 memset(&packet1, 0, sizeof(packet1));
1612 packet1.start_index = packet_in.start_index;
1613 packet1.end_index = packet_in.end_index;
1614 packet1.target_system = packet_in.target_system;
1615 packet1.target_component = packet_in.target_component;
1616 packet1.mission_type = packet_in.mission_type;
1619 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1620 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1621 // cope with extensions
1622 memset(MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN);
1624 #endif
1625 memset(&packet2, 0, sizeof(packet2));
1626 mavlink_msg_mission_request_partial_list_encode(system_id, component_id, &msg, &packet1);
1627 mavlink_msg_mission_request_partial_list_decode(&msg, &packet2);
1628 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1630 memset(&packet2, 0, sizeof(packet2));
1631 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 );
1632 mavlink_msg_mission_request_partial_list_decode(&msg, &packet2);
1633 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1635 memset(&packet2, 0, sizeof(packet2));
1636 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 );
1637 mavlink_msg_mission_request_partial_list_decode(&msg, &packet2);
1638 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1640 memset(&packet2, 0, sizeof(packet2));
1641 mavlink_msg_to_send_buffer(buffer, &msg);
1642 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1643 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1645 mavlink_msg_mission_request_partial_list_decode(last_msg, &packet2);
1646 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1648 memset(&packet2, 0, sizeof(packet2));
1649 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 );
1650 mavlink_msg_mission_request_partial_list_decode(last_msg, &packet2);
1651 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1654 static void mavlink_test_mission_write_partial_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1656 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1657 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1658 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST >= 256) {
1659 return;
1661 #endif
1662 mavlink_message_t msg;
1663 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1664 uint16_t i;
1665 mavlink_mission_write_partial_list_t packet_in = {
1666 17235,17339,17,84,151
1668 mavlink_mission_write_partial_list_t packet1, packet2;
1669 memset(&packet1, 0, sizeof(packet1));
1670 packet1.start_index = packet_in.start_index;
1671 packet1.end_index = packet_in.end_index;
1672 packet1.target_system = packet_in.target_system;
1673 packet1.target_component = packet_in.target_component;
1674 packet1.mission_type = packet_in.mission_type;
1677 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1678 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1679 // cope with extensions
1680 memset(MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN);
1682 #endif
1683 memset(&packet2, 0, sizeof(packet2));
1684 mavlink_msg_mission_write_partial_list_encode(system_id, component_id, &msg, &packet1);
1685 mavlink_msg_mission_write_partial_list_decode(&msg, &packet2);
1686 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1688 memset(&packet2, 0, sizeof(packet2));
1689 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 );
1690 mavlink_msg_mission_write_partial_list_decode(&msg, &packet2);
1691 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1693 memset(&packet2, 0, sizeof(packet2));
1694 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 );
1695 mavlink_msg_mission_write_partial_list_decode(&msg, &packet2);
1696 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1698 memset(&packet2, 0, sizeof(packet2));
1699 mavlink_msg_to_send_buffer(buffer, &msg);
1700 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1701 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1703 mavlink_msg_mission_write_partial_list_decode(last_msg, &packet2);
1704 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1706 memset(&packet2, 0, sizeof(packet2));
1707 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 );
1708 mavlink_msg_mission_write_partial_list_decode(last_msg, &packet2);
1709 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1712 static void mavlink_test_mission_item(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1714 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1715 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1716 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_ITEM >= 256) {
1717 return;
1719 #endif
1720 mavlink_message_t msg;
1721 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1722 uint16_t i;
1723 mavlink_mission_item_t packet_in = {
1724 17.0,45.0,73.0,101.0,129.0,157.0,185.0,18691,18795,101,168,235,46,113,180
1726 mavlink_mission_item_t packet1, packet2;
1727 memset(&packet1, 0, sizeof(packet1));
1728 packet1.param1 = packet_in.param1;
1729 packet1.param2 = packet_in.param2;
1730 packet1.param3 = packet_in.param3;
1731 packet1.param4 = packet_in.param4;
1732 packet1.x = packet_in.x;
1733 packet1.y = packet_in.y;
1734 packet1.z = packet_in.z;
1735 packet1.seq = packet_in.seq;
1736 packet1.command = packet_in.command;
1737 packet1.target_system = packet_in.target_system;
1738 packet1.target_component = packet_in.target_component;
1739 packet1.frame = packet_in.frame;
1740 packet1.current = packet_in.current;
1741 packet1.autocontinue = packet_in.autocontinue;
1742 packet1.mission_type = packet_in.mission_type;
1745 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1746 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1747 // cope with extensions
1748 memset(MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN);
1750 #endif
1751 memset(&packet2, 0, sizeof(packet2));
1752 mavlink_msg_mission_item_encode(system_id, component_id, &msg, &packet1);
1753 mavlink_msg_mission_item_decode(&msg, &packet2);
1754 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1756 memset(&packet2, 0, sizeof(packet2));
1757 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 );
1758 mavlink_msg_mission_item_decode(&msg, &packet2);
1759 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1761 memset(&packet2, 0, sizeof(packet2));
1762 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 );
1763 mavlink_msg_mission_item_decode(&msg, &packet2);
1764 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1766 memset(&packet2, 0, sizeof(packet2));
1767 mavlink_msg_to_send_buffer(buffer, &msg);
1768 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1769 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1771 mavlink_msg_mission_item_decode(last_msg, &packet2);
1772 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1774 memset(&packet2, 0, sizeof(packet2));
1775 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 );
1776 mavlink_msg_mission_item_decode(last_msg, &packet2);
1777 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1780 static void mavlink_test_mission_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1782 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1783 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1784 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_REQUEST >= 256) {
1785 return;
1787 #endif
1788 mavlink_message_t msg;
1789 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1790 uint16_t i;
1791 mavlink_mission_request_t packet_in = {
1792 17235,139,206,17
1794 mavlink_mission_request_t packet1, packet2;
1795 memset(&packet1, 0, sizeof(packet1));
1796 packet1.seq = packet_in.seq;
1797 packet1.target_system = packet_in.target_system;
1798 packet1.target_component = packet_in.target_component;
1799 packet1.mission_type = packet_in.mission_type;
1802 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1803 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1804 // cope with extensions
1805 memset(MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN);
1807 #endif
1808 memset(&packet2, 0, sizeof(packet2));
1809 mavlink_msg_mission_request_encode(system_id, component_id, &msg, &packet1);
1810 mavlink_msg_mission_request_decode(&msg, &packet2);
1811 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1813 memset(&packet2, 0, sizeof(packet2));
1814 mavlink_msg_mission_request_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.mission_type );
1815 mavlink_msg_mission_request_decode(&msg, &packet2);
1816 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1818 memset(&packet2, 0, sizeof(packet2));
1819 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 );
1820 mavlink_msg_mission_request_decode(&msg, &packet2);
1821 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1823 memset(&packet2, 0, sizeof(packet2));
1824 mavlink_msg_to_send_buffer(buffer, &msg);
1825 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1826 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1828 mavlink_msg_mission_request_decode(last_msg, &packet2);
1829 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1831 memset(&packet2, 0, sizeof(packet2));
1832 mavlink_msg_mission_request_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seq , packet1.mission_type );
1833 mavlink_msg_mission_request_decode(last_msg, &packet2);
1834 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1837 static void mavlink_test_mission_set_current(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1839 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1840 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1841 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_SET_CURRENT >= 256) {
1842 return;
1844 #endif
1845 mavlink_message_t msg;
1846 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1847 uint16_t i;
1848 mavlink_mission_set_current_t packet_in = {
1849 17235,139,206
1851 mavlink_mission_set_current_t packet1, packet2;
1852 memset(&packet1, 0, sizeof(packet1));
1853 packet1.seq = packet_in.seq;
1854 packet1.target_system = packet_in.target_system;
1855 packet1.target_component = packet_in.target_component;
1858 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1859 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1860 // cope with extensions
1861 memset(MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN);
1863 #endif
1864 memset(&packet2, 0, sizeof(packet2));
1865 mavlink_msg_mission_set_current_encode(system_id, component_id, &msg, &packet1);
1866 mavlink_msg_mission_set_current_decode(&msg, &packet2);
1867 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1869 memset(&packet2, 0, sizeof(packet2));
1870 mavlink_msg_mission_set_current_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq );
1871 mavlink_msg_mission_set_current_decode(&msg, &packet2);
1872 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1874 memset(&packet2, 0, sizeof(packet2));
1875 mavlink_msg_mission_set_current_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq );
1876 mavlink_msg_mission_set_current_decode(&msg, &packet2);
1877 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1879 memset(&packet2, 0, sizeof(packet2));
1880 mavlink_msg_to_send_buffer(buffer, &msg);
1881 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1882 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1884 mavlink_msg_mission_set_current_decode(last_msg, &packet2);
1885 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1887 memset(&packet2, 0, sizeof(packet2));
1888 mavlink_msg_mission_set_current_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seq );
1889 mavlink_msg_mission_set_current_decode(last_msg, &packet2);
1890 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1893 static void mavlink_test_mission_current(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1895 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1896 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1897 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_CURRENT >= 256) {
1898 return;
1900 #endif
1901 mavlink_message_t msg;
1902 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1903 uint16_t i;
1904 mavlink_mission_current_t packet_in = {
1905 17235
1907 mavlink_mission_current_t packet1, packet2;
1908 memset(&packet1, 0, sizeof(packet1));
1909 packet1.seq = packet_in.seq;
1912 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1913 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1914 // cope with extensions
1915 memset(MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN);
1917 #endif
1918 memset(&packet2, 0, sizeof(packet2));
1919 mavlink_msg_mission_current_encode(system_id, component_id, &msg, &packet1);
1920 mavlink_msg_mission_current_decode(&msg, &packet2);
1921 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1923 memset(&packet2, 0, sizeof(packet2));
1924 mavlink_msg_mission_current_pack(system_id, component_id, &msg , packet1.seq );
1925 mavlink_msg_mission_current_decode(&msg, &packet2);
1926 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1928 memset(&packet2, 0, sizeof(packet2));
1929 mavlink_msg_mission_current_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seq );
1930 mavlink_msg_mission_current_decode(&msg, &packet2);
1931 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1933 memset(&packet2, 0, sizeof(packet2));
1934 mavlink_msg_to_send_buffer(buffer, &msg);
1935 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1936 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1938 mavlink_msg_mission_current_decode(last_msg, &packet2);
1939 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1941 memset(&packet2, 0, sizeof(packet2));
1942 mavlink_msg_mission_current_send(MAVLINK_COMM_1 , packet1.seq );
1943 mavlink_msg_mission_current_decode(last_msg, &packet2);
1944 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1947 static void mavlink_test_mission_request_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1949 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1950 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1951 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_REQUEST_LIST >= 256) {
1952 return;
1954 #endif
1955 mavlink_message_t msg;
1956 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1957 uint16_t i;
1958 mavlink_mission_request_list_t packet_in = {
1959 5,72,139
1961 mavlink_mission_request_list_t packet1, packet2;
1962 memset(&packet1, 0, sizeof(packet1));
1963 packet1.target_system = packet_in.target_system;
1964 packet1.target_component = packet_in.target_component;
1965 packet1.mission_type = packet_in.mission_type;
1968 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1969 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1970 // cope with extensions
1971 memset(MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN);
1973 #endif
1974 memset(&packet2, 0, sizeof(packet2));
1975 mavlink_msg_mission_request_list_encode(system_id, component_id, &msg, &packet1);
1976 mavlink_msg_mission_request_list_decode(&msg, &packet2);
1977 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1979 memset(&packet2, 0, sizeof(packet2));
1980 mavlink_msg_mission_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.mission_type );
1981 mavlink_msg_mission_request_list_decode(&msg, &packet2);
1982 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1984 memset(&packet2, 0, sizeof(packet2));
1985 mavlink_msg_mission_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.mission_type );
1986 mavlink_msg_mission_request_list_decode(&msg, &packet2);
1987 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1989 memset(&packet2, 0, sizeof(packet2));
1990 mavlink_msg_to_send_buffer(buffer, &msg);
1991 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1992 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1994 mavlink_msg_mission_request_list_decode(last_msg, &packet2);
1995 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
1997 memset(&packet2, 0, sizeof(packet2));
1998 mavlink_msg_mission_request_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.mission_type );
1999 mavlink_msg_mission_request_list_decode(last_msg, &packet2);
2000 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2003 static void mavlink_test_mission_count(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2005 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2006 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2007 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_COUNT >= 256) {
2008 return;
2010 #endif
2011 mavlink_message_t msg;
2012 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2013 uint16_t i;
2014 mavlink_mission_count_t packet_in = {
2015 17235,139,206,17
2017 mavlink_mission_count_t packet1, packet2;
2018 memset(&packet1, 0, sizeof(packet1));
2019 packet1.count = packet_in.count;
2020 packet1.target_system = packet_in.target_system;
2021 packet1.target_component = packet_in.target_component;
2022 packet1.mission_type = packet_in.mission_type;
2025 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2026 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2027 // cope with extensions
2028 memset(MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN);
2030 #endif
2031 memset(&packet2, 0, sizeof(packet2));
2032 mavlink_msg_mission_count_encode(system_id, component_id, &msg, &packet1);
2033 mavlink_msg_mission_count_decode(&msg, &packet2);
2034 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2036 memset(&packet2, 0, sizeof(packet2));
2037 mavlink_msg_mission_count_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.count , packet1.mission_type );
2038 mavlink_msg_mission_count_decode(&msg, &packet2);
2039 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2041 memset(&packet2, 0, sizeof(packet2));
2042 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 );
2043 mavlink_msg_mission_count_decode(&msg, &packet2);
2044 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2046 memset(&packet2, 0, sizeof(packet2));
2047 mavlink_msg_to_send_buffer(buffer, &msg);
2048 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2049 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2051 mavlink_msg_mission_count_decode(last_msg, &packet2);
2052 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2054 memset(&packet2, 0, sizeof(packet2));
2055 mavlink_msg_mission_count_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.count , packet1.mission_type );
2056 mavlink_msg_mission_count_decode(last_msg, &packet2);
2057 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2060 static void mavlink_test_mission_clear_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2062 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2063 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2064 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_CLEAR_ALL >= 256) {
2065 return;
2067 #endif
2068 mavlink_message_t msg;
2069 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2070 uint16_t i;
2071 mavlink_mission_clear_all_t packet_in = {
2072 5,72,139
2074 mavlink_mission_clear_all_t packet1, packet2;
2075 memset(&packet1, 0, sizeof(packet1));
2076 packet1.target_system = packet_in.target_system;
2077 packet1.target_component = packet_in.target_component;
2078 packet1.mission_type = packet_in.mission_type;
2081 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2082 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2083 // cope with extensions
2084 memset(MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN);
2086 #endif
2087 memset(&packet2, 0, sizeof(packet2));
2088 mavlink_msg_mission_clear_all_encode(system_id, component_id, &msg, &packet1);
2089 mavlink_msg_mission_clear_all_decode(&msg, &packet2);
2090 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2092 memset(&packet2, 0, sizeof(packet2));
2093 mavlink_msg_mission_clear_all_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.mission_type );
2094 mavlink_msg_mission_clear_all_decode(&msg, &packet2);
2095 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2097 memset(&packet2, 0, sizeof(packet2));
2098 mavlink_msg_mission_clear_all_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.mission_type );
2099 mavlink_msg_mission_clear_all_decode(&msg, &packet2);
2100 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2102 memset(&packet2, 0, sizeof(packet2));
2103 mavlink_msg_to_send_buffer(buffer, &msg);
2104 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2105 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2107 mavlink_msg_mission_clear_all_decode(last_msg, &packet2);
2108 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2110 memset(&packet2, 0, sizeof(packet2));
2111 mavlink_msg_mission_clear_all_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.mission_type );
2112 mavlink_msg_mission_clear_all_decode(last_msg, &packet2);
2113 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2116 static void mavlink_test_mission_item_reached(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2118 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2119 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2120 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_ITEM_REACHED >= 256) {
2121 return;
2123 #endif
2124 mavlink_message_t msg;
2125 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2126 uint16_t i;
2127 mavlink_mission_item_reached_t packet_in = {
2128 17235
2130 mavlink_mission_item_reached_t packet1, packet2;
2131 memset(&packet1, 0, sizeof(packet1));
2132 packet1.seq = packet_in.seq;
2135 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2136 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2137 // cope with extensions
2138 memset(MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN);
2140 #endif
2141 memset(&packet2, 0, sizeof(packet2));
2142 mavlink_msg_mission_item_reached_encode(system_id, component_id, &msg, &packet1);
2143 mavlink_msg_mission_item_reached_decode(&msg, &packet2);
2144 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2146 memset(&packet2, 0, sizeof(packet2));
2147 mavlink_msg_mission_item_reached_pack(system_id, component_id, &msg , packet1.seq );
2148 mavlink_msg_mission_item_reached_decode(&msg, &packet2);
2149 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2151 memset(&packet2, 0, sizeof(packet2));
2152 mavlink_msg_mission_item_reached_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seq );
2153 mavlink_msg_mission_item_reached_decode(&msg, &packet2);
2154 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2156 memset(&packet2, 0, sizeof(packet2));
2157 mavlink_msg_to_send_buffer(buffer, &msg);
2158 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2159 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2161 mavlink_msg_mission_item_reached_decode(last_msg, &packet2);
2162 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2164 memset(&packet2, 0, sizeof(packet2));
2165 mavlink_msg_mission_item_reached_send(MAVLINK_COMM_1 , packet1.seq );
2166 mavlink_msg_mission_item_reached_decode(last_msg, &packet2);
2167 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2170 static void mavlink_test_mission_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
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_ACK >= 256) {
2175 return;
2177 #endif
2178 mavlink_message_t msg;
2179 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2180 uint16_t i;
2181 mavlink_mission_ack_t packet_in = {
2182 5,72,139,206
2184 mavlink_mission_ack_t packet1, packet2;
2185 memset(&packet1, 0, sizeof(packet1));
2186 packet1.target_system = packet_in.target_system;
2187 packet1.target_component = packet_in.target_component;
2188 packet1.type = packet_in.type;
2189 packet1.mission_type = packet_in.mission_type;
2192 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2193 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2194 // cope with extensions
2195 memset(MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN);
2197 #endif
2198 memset(&packet2, 0, sizeof(packet2));
2199 mavlink_msg_mission_ack_encode(system_id, component_id, &msg, &packet1);
2200 mavlink_msg_mission_ack_decode(&msg, &packet2);
2201 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2203 memset(&packet2, 0, sizeof(packet2));
2204 mavlink_msg_mission_ack_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.type , packet1.mission_type );
2205 mavlink_msg_mission_ack_decode(&msg, &packet2);
2206 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2208 memset(&packet2, 0, sizeof(packet2));
2209 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 );
2210 mavlink_msg_mission_ack_decode(&msg, &packet2);
2211 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2213 memset(&packet2, 0, sizeof(packet2));
2214 mavlink_msg_to_send_buffer(buffer, &msg);
2215 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2216 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2218 mavlink_msg_mission_ack_decode(last_msg, &packet2);
2219 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2221 memset(&packet2, 0, sizeof(packet2));
2222 mavlink_msg_mission_ack_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.type , packet1.mission_type );
2223 mavlink_msg_mission_ack_decode(last_msg, &packet2);
2224 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2227 static void mavlink_test_set_gps_global_origin(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2229 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2230 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2231 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN >= 256) {
2232 return;
2234 #endif
2235 mavlink_message_t msg;
2236 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2237 uint16_t i;
2238 mavlink_set_gps_global_origin_t packet_in = {
2239 963497464,963497672,963497880,41,93372036854776626ULL
2241 mavlink_set_gps_global_origin_t packet1, packet2;
2242 memset(&packet1, 0, sizeof(packet1));
2243 packet1.latitude = packet_in.latitude;
2244 packet1.longitude = packet_in.longitude;
2245 packet1.altitude = packet_in.altitude;
2246 packet1.target_system = packet_in.target_system;
2247 packet1.time_usec = packet_in.time_usec;
2250 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2251 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2252 // cope with extensions
2253 memset(MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN);
2255 #endif
2256 memset(&packet2, 0, sizeof(packet2));
2257 mavlink_msg_set_gps_global_origin_encode(system_id, component_id, &msg, &packet1);
2258 mavlink_msg_set_gps_global_origin_decode(&msg, &packet2);
2259 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2261 memset(&packet2, 0, sizeof(packet2));
2262 mavlink_msg_set_gps_global_origin_pack(system_id, component_id, &msg , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude , packet1.time_usec );
2263 mavlink_msg_set_gps_global_origin_decode(&msg, &packet2);
2264 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2266 memset(&packet2, 0, sizeof(packet2));
2267 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 );
2268 mavlink_msg_set_gps_global_origin_decode(&msg, &packet2);
2269 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2271 memset(&packet2, 0, sizeof(packet2));
2272 mavlink_msg_to_send_buffer(buffer, &msg);
2273 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2274 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2276 mavlink_msg_set_gps_global_origin_decode(last_msg, &packet2);
2277 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2279 memset(&packet2, 0, sizeof(packet2));
2280 mavlink_msg_set_gps_global_origin_send(MAVLINK_COMM_1 , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude , packet1.time_usec );
2281 mavlink_msg_set_gps_global_origin_decode(last_msg, &packet2);
2282 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2285 static void mavlink_test_gps_global_origin(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2287 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2288 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2289 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN >= 256) {
2290 return;
2292 #endif
2293 mavlink_message_t msg;
2294 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2295 uint16_t i;
2296 mavlink_gps_global_origin_t packet_in = {
2297 963497464,963497672,963497880,93372036854776563ULL
2299 mavlink_gps_global_origin_t packet1, packet2;
2300 memset(&packet1, 0, sizeof(packet1));
2301 packet1.latitude = packet_in.latitude;
2302 packet1.longitude = packet_in.longitude;
2303 packet1.altitude = packet_in.altitude;
2304 packet1.time_usec = packet_in.time_usec;
2307 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2308 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2309 // cope with extensions
2310 memset(MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN);
2312 #endif
2313 memset(&packet2, 0, sizeof(packet2));
2314 mavlink_msg_gps_global_origin_encode(system_id, component_id, &msg, &packet1);
2315 mavlink_msg_gps_global_origin_decode(&msg, &packet2);
2316 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2318 memset(&packet2, 0, sizeof(packet2));
2319 mavlink_msg_gps_global_origin_pack(system_id, component_id, &msg , packet1.latitude , packet1.longitude , packet1.altitude , packet1.time_usec );
2320 mavlink_msg_gps_global_origin_decode(&msg, &packet2);
2321 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2323 memset(&packet2, 0, sizeof(packet2));
2324 mavlink_msg_gps_global_origin_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.latitude , packet1.longitude , packet1.altitude , packet1.time_usec );
2325 mavlink_msg_gps_global_origin_decode(&msg, &packet2);
2326 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2328 memset(&packet2, 0, sizeof(packet2));
2329 mavlink_msg_to_send_buffer(buffer, &msg);
2330 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2331 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2333 mavlink_msg_gps_global_origin_decode(last_msg, &packet2);
2334 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2336 memset(&packet2, 0, sizeof(packet2));
2337 mavlink_msg_gps_global_origin_send(MAVLINK_COMM_1 , packet1.latitude , packet1.longitude , packet1.altitude , packet1.time_usec );
2338 mavlink_msg_gps_global_origin_decode(last_msg, &packet2);
2339 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2342 static void mavlink_test_param_map_rc(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2344 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2345 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2346 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_MAP_RC >= 256) {
2347 return;
2349 #endif
2350 mavlink_message_t msg;
2351 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2352 uint16_t i;
2353 mavlink_param_map_rc_t packet_in = {
2354 17.0,45.0,73.0,101.0,18067,187,254,"UVWXYZABCDEFGHI",113
2356 mavlink_param_map_rc_t packet1, packet2;
2357 memset(&packet1, 0, sizeof(packet1));
2358 packet1.param_value0 = packet_in.param_value0;
2359 packet1.scale = packet_in.scale;
2360 packet1.param_value_min = packet_in.param_value_min;
2361 packet1.param_value_max = packet_in.param_value_max;
2362 packet1.param_index = packet_in.param_index;
2363 packet1.target_system = packet_in.target_system;
2364 packet1.target_component = packet_in.target_component;
2365 packet1.parameter_rc_channel_index = packet_in.parameter_rc_channel_index;
2367 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
2369 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2370 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2371 // cope with extensions
2372 memset(MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN);
2374 #endif
2375 memset(&packet2, 0, sizeof(packet2));
2376 mavlink_msg_param_map_rc_encode(system_id, component_id, &msg, &packet1);
2377 mavlink_msg_param_map_rc_decode(&msg, &packet2);
2378 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2380 memset(&packet2, 0, sizeof(packet2));
2381 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 );
2382 mavlink_msg_param_map_rc_decode(&msg, &packet2);
2383 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2385 memset(&packet2, 0, sizeof(packet2));
2386 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 );
2387 mavlink_msg_param_map_rc_decode(&msg, &packet2);
2388 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2390 memset(&packet2, 0, sizeof(packet2));
2391 mavlink_msg_to_send_buffer(buffer, &msg);
2392 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2393 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2395 mavlink_msg_param_map_rc_decode(last_msg, &packet2);
2396 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2398 memset(&packet2, 0, sizeof(packet2));
2399 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 );
2400 mavlink_msg_param_map_rc_decode(last_msg, &packet2);
2401 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2404 static void mavlink_test_mission_request_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2406 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2407 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2408 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_REQUEST_INT >= 256) {
2409 return;
2411 #endif
2412 mavlink_message_t msg;
2413 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2414 uint16_t i;
2415 mavlink_mission_request_int_t packet_in = {
2416 17235,139,206,17
2418 mavlink_mission_request_int_t packet1, packet2;
2419 memset(&packet1, 0, sizeof(packet1));
2420 packet1.seq = packet_in.seq;
2421 packet1.target_system = packet_in.target_system;
2422 packet1.target_component = packet_in.target_component;
2423 packet1.mission_type = packet_in.mission_type;
2426 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2427 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2428 // cope with extensions
2429 memset(MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN);
2431 #endif
2432 memset(&packet2, 0, sizeof(packet2));
2433 mavlink_msg_mission_request_int_encode(system_id, component_id, &msg, &packet1);
2434 mavlink_msg_mission_request_int_decode(&msg, &packet2);
2435 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2437 memset(&packet2, 0, sizeof(packet2));
2438 mavlink_msg_mission_request_int_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.mission_type );
2439 mavlink_msg_mission_request_int_decode(&msg, &packet2);
2440 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2442 memset(&packet2, 0, sizeof(packet2));
2443 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 );
2444 mavlink_msg_mission_request_int_decode(&msg, &packet2);
2445 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2447 memset(&packet2, 0, sizeof(packet2));
2448 mavlink_msg_to_send_buffer(buffer, &msg);
2449 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2450 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2452 mavlink_msg_mission_request_int_decode(last_msg, &packet2);
2453 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2455 memset(&packet2, 0, sizeof(packet2));
2456 mavlink_msg_mission_request_int_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seq , packet1.mission_type );
2457 mavlink_msg_mission_request_int_decode(last_msg, &packet2);
2458 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2461 static void mavlink_test_mission_changed(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2463 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2464 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2465 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_CHANGED >= 256) {
2466 return;
2468 #endif
2469 mavlink_message_t msg;
2470 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2471 uint16_t i;
2472 mavlink_mission_changed_t packet_in = {
2473 17235,17339,17,84,151
2475 mavlink_mission_changed_t packet1, packet2;
2476 memset(&packet1, 0, sizeof(packet1));
2477 packet1.start_index = packet_in.start_index;
2478 packet1.end_index = packet_in.end_index;
2479 packet1.origin_sysid = packet_in.origin_sysid;
2480 packet1.origin_compid = packet_in.origin_compid;
2481 packet1.mission_type = packet_in.mission_type;
2484 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2485 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2486 // cope with extensions
2487 memset(MAVLINK_MSG_ID_MISSION_CHANGED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_CHANGED_MIN_LEN);
2489 #endif
2490 memset(&packet2, 0, sizeof(packet2));
2491 mavlink_msg_mission_changed_encode(system_id, component_id, &msg, &packet1);
2492 mavlink_msg_mission_changed_decode(&msg, &packet2);
2493 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2495 memset(&packet2, 0, sizeof(packet2));
2496 mavlink_msg_mission_changed_pack(system_id, component_id, &msg , packet1.start_index , packet1.end_index , packet1.origin_sysid , packet1.origin_compid , packet1.mission_type );
2497 mavlink_msg_mission_changed_decode(&msg, &packet2);
2498 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2500 memset(&packet2, 0, sizeof(packet2));
2501 mavlink_msg_mission_changed_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.start_index , packet1.end_index , packet1.origin_sysid , packet1.origin_compid , packet1.mission_type );
2502 mavlink_msg_mission_changed_decode(&msg, &packet2);
2503 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2505 memset(&packet2, 0, sizeof(packet2));
2506 mavlink_msg_to_send_buffer(buffer, &msg);
2507 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2508 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2510 mavlink_msg_mission_changed_decode(last_msg, &packet2);
2511 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2513 memset(&packet2, 0, sizeof(packet2));
2514 mavlink_msg_mission_changed_send(MAVLINK_COMM_1 , packet1.start_index , packet1.end_index , packet1.origin_sysid , packet1.origin_compid , packet1.mission_type );
2515 mavlink_msg_mission_changed_decode(last_msg, &packet2);
2516 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2519 static void mavlink_test_safety_set_allowed_area(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2521 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2522 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2523 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA >= 256) {
2524 return;
2526 #endif
2527 mavlink_message_t msg;
2528 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2529 uint16_t i;
2530 mavlink_safety_set_allowed_area_t packet_in = {
2531 17.0,45.0,73.0,101.0,129.0,157.0,77,144,211
2533 mavlink_safety_set_allowed_area_t packet1, packet2;
2534 memset(&packet1, 0, sizeof(packet1));
2535 packet1.p1x = packet_in.p1x;
2536 packet1.p1y = packet_in.p1y;
2537 packet1.p1z = packet_in.p1z;
2538 packet1.p2x = packet_in.p2x;
2539 packet1.p2y = packet_in.p2y;
2540 packet1.p2z = packet_in.p2z;
2541 packet1.target_system = packet_in.target_system;
2542 packet1.target_component = packet_in.target_component;
2543 packet1.frame = packet_in.frame;
2546 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2547 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2548 // cope with extensions
2549 memset(MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN);
2551 #endif
2552 memset(&packet2, 0, sizeof(packet2));
2553 mavlink_msg_safety_set_allowed_area_encode(system_id, component_id, &msg, &packet1);
2554 mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2);
2555 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2557 memset(&packet2, 0, sizeof(packet2));
2558 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 );
2559 mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2);
2560 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2562 memset(&packet2, 0, sizeof(packet2));
2563 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 );
2564 mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2);
2565 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2567 memset(&packet2, 0, sizeof(packet2));
2568 mavlink_msg_to_send_buffer(buffer, &msg);
2569 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2570 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2572 mavlink_msg_safety_set_allowed_area_decode(last_msg, &packet2);
2573 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2575 memset(&packet2, 0, sizeof(packet2));
2576 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 );
2577 mavlink_msg_safety_set_allowed_area_decode(last_msg, &packet2);
2578 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2581 static void mavlink_test_safety_allowed_area(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2583 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2584 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2585 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA >= 256) {
2586 return;
2588 #endif
2589 mavlink_message_t msg;
2590 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2591 uint16_t i;
2592 mavlink_safety_allowed_area_t packet_in = {
2593 17.0,45.0,73.0,101.0,129.0,157.0,77
2595 mavlink_safety_allowed_area_t packet1, packet2;
2596 memset(&packet1, 0, sizeof(packet1));
2597 packet1.p1x = packet_in.p1x;
2598 packet1.p1y = packet_in.p1y;
2599 packet1.p1z = packet_in.p1z;
2600 packet1.p2x = packet_in.p2x;
2601 packet1.p2y = packet_in.p2y;
2602 packet1.p2z = packet_in.p2z;
2603 packet1.frame = packet_in.frame;
2606 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2607 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2608 // cope with extensions
2609 memset(MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN);
2611 #endif
2612 memset(&packet2, 0, sizeof(packet2));
2613 mavlink_msg_safety_allowed_area_encode(system_id, component_id, &msg, &packet1);
2614 mavlink_msg_safety_allowed_area_decode(&msg, &packet2);
2615 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2617 memset(&packet2, 0, sizeof(packet2));
2618 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 );
2619 mavlink_msg_safety_allowed_area_decode(&msg, &packet2);
2620 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2622 memset(&packet2, 0, sizeof(packet2));
2623 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 );
2624 mavlink_msg_safety_allowed_area_decode(&msg, &packet2);
2625 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2627 memset(&packet2, 0, sizeof(packet2));
2628 mavlink_msg_to_send_buffer(buffer, &msg);
2629 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2630 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2632 mavlink_msg_safety_allowed_area_decode(last_msg, &packet2);
2633 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2635 memset(&packet2, 0, sizeof(packet2));
2636 mavlink_msg_safety_allowed_area_send(MAVLINK_COMM_1 , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z );
2637 mavlink_msg_safety_allowed_area_decode(last_msg, &packet2);
2638 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2641 static void mavlink_test_attitude_quaternion_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2643 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2644 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2645 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV >= 256) {
2646 return;
2648 #endif
2649 mavlink_message_t msg;
2650 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2651 uint16_t i;
2652 mavlink_attitude_quaternion_cov_t packet_in = {
2653 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 }
2655 mavlink_attitude_quaternion_cov_t packet1, packet2;
2656 memset(&packet1, 0, sizeof(packet1));
2657 packet1.time_usec = packet_in.time_usec;
2658 packet1.rollspeed = packet_in.rollspeed;
2659 packet1.pitchspeed = packet_in.pitchspeed;
2660 packet1.yawspeed = packet_in.yawspeed;
2662 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
2663 mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*9);
2665 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2666 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2667 // cope with extensions
2668 memset(MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN);
2670 #endif
2671 memset(&packet2, 0, sizeof(packet2));
2672 mavlink_msg_attitude_quaternion_cov_encode(system_id, component_id, &msg, &packet1);
2673 mavlink_msg_attitude_quaternion_cov_decode(&msg, &packet2);
2674 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2676 memset(&packet2, 0, sizeof(packet2));
2677 mavlink_msg_attitude_quaternion_cov_pack(system_id, component_id, &msg , packet1.time_usec , packet1.q , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.covariance );
2678 mavlink_msg_attitude_quaternion_cov_decode(&msg, &packet2);
2679 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2681 memset(&packet2, 0, sizeof(packet2));
2682 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 );
2683 mavlink_msg_attitude_quaternion_cov_decode(&msg, &packet2);
2684 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2686 memset(&packet2, 0, sizeof(packet2));
2687 mavlink_msg_to_send_buffer(buffer, &msg);
2688 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2689 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2691 mavlink_msg_attitude_quaternion_cov_decode(last_msg, &packet2);
2692 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2694 memset(&packet2, 0, sizeof(packet2));
2695 mavlink_msg_attitude_quaternion_cov_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.q , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.covariance );
2696 mavlink_msg_attitude_quaternion_cov_decode(last_msg, &packet2);
2697 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2700 static void mavlink_test_nav_controller_output(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2702 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2703 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2704 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT >= 256) {
2705 return;
2707 #endif
2708 mavlink_message_t msg;
2709 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2710 uint16_t i;
2711 mavlink_nav_controller_output_t packet_in = {
2712 17.0,45.0,73.0,101.0,129.0,18275,18379,18483
2714 mavlink_nav_controller_output_t packet1, packet2;
2715 memset(&packet1, 0, sizeof(packet1));
2716 packet1.nav_roll = packet_in.nav_roll;
2717 packet1.nav_pitch = packet_in.nav_pitch;
2718 packet1.alt_error = packet_in.alt_error;
2719 packet1.aspd_error = packet_in.aspd_error;
2720 packet1.xtrack_error = packet_in.xtrack_error;
2721 packet1.nav_bearing = packet_in.nav_bearing;
2722 packet1.target_bearing = packet_in.target_bearing;
2723 packet1.wp_dist = packet_in.wp_dist;
2726 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2727 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2728 // cope with extensions
2729 memset(MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN);
2731 #endif
2732 memset(&packet2, 0, sizeof(packet2));
2733 mavlink_msg_nav_controller_output_encode(system_id, component_id, &msg, &packet1);
2734 mavlink_msg_nav_controller_output_decode(&msg, &packet2);
2735 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2737 memset(&packet2, 0, sizeof(packet2));
2738 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 );
2739 mavlink_msg_nav_controller_output_decode(&msg, &packet2);
2740 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2742 memset(&packet2, 0, sizeof(packet2));
2743 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 );
2744 mavlink_msg_nav_controller_output_decode(&msg, &packet2);
2745 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2747 memset(&packet2, 0, sizeof(packet2));
2748 mavlink_msg_to_send_buffer(buffer, &msg);
2749 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2750 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2752 mavlink_msg_nav_controller_output_decode(last_msg, &packet2);
2753 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2755 memset(&packet2, 0, sizeof(packet2));
2756 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 );
2757 mavlink_msg_nav_controller_output_decode(last_msg, &packet2);
2758 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2761 static void mavlink_test_global_position_int_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2763 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2764 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2765 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV >= 256) {
2766 return;
2768 #endif
2769 mavlink_message_t msg;
2770 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2771 uint16_t i;
2772 mavlink_global_position_int_cov_t packet_in = {
2773 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
2775 mavlink_global_position_int_cov_t packet1, packet2;
2776 memset(&packet1, 0, sizeof(packet1));
2777 packet1.time_usec = packet_in.time_usec;
2778 packet1.lat = packet_in.lat;
2779 packet1.lon = packet_in.lon;
2780 packet1.alt = packet_in.alt;
2781 packet1.relative_alt = packet_in.relative_alt;
2782 packet1.vx = packet_in.vx;
2783 packet1.vy = packet_in.vy;
2784 packet1.vz = packet_in.vz;
2785 packet1.estimator_type = packet_in.estimator_type;
2787 mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*36);
2789 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2790 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2791 // cope with extensions
2792 memset(MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN);
2794 #endif
2795 memset(&packet2, 0, sizeof(packet2));
2796 mavlink_msg_global_position_int_cov_encode(system_id, component_id, &msg, &packet1);
2797 mavlink_msg_global_position_int_cov_decode(&msg, &packet2);
2798 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2800 memset(&packet2, 0, sizeof(packet2));
2801 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 );
2802 mavlink_msg_global_position_int_cov_decode(&msg, &packet2);
2803 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2805 memset(&packet2, 0, sizeof(packet2));
2806 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 );
2807 mavlink_msg_global_position_int_cov_decode(&msg, &packet2);
2808 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2810 memset(&packet2, 0, sizeof(packet2));
2811 mavlink_msg_to_send_buffer(buffer, &msg);
2812 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2813 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2815 mavlink_msg_global_position_int_cov_decode(last_msg, &packet2);
2816 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2818 memset(&packet2, 0, sizeof(packet2));
2819 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 );
2820 mavlink_msg_global_position_int_cov_decode(last_msg, &packet2);
2821 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2824 static void mavlink_test_local_position_ned_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2826 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2827 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2828 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV >= 256) {
2829 return;
2831 #endif
2832 mavlink_message_t msg;
2833 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2834 uint16_t i;
2835 mavlink_local_position_ned_cov_t packet_in = {
2836 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
2838 mavlink_local_position_ned_cov_t packet1, packet2;
2839 memset(&packet1, 0, sizeof(packet1));
2840 packet1.time_usec = packet_in.time_usec;
2841 packet1.x = packet_in.x;
2842 packet1.y = packet_in.y;
2843 packet1.z = packet_in.z;
2844 packet1.vx = packet_in.vx;
2845 packet1.vy = packet_in.vy;
2846 packet1.vz = packet_in.vz;
2847 packet1.ax = packet_in.ax;
2848 packet1.ay = packet_in.ay;
2849 packet1.az = packet_in.az;
2850 packet1.estimator_type = packet_in.estimator_type;
2852 mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*45);
2854 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2855 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2856 // cope with extensions
2857 memset(MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN);
2859 #endif
2860 memset(&packet2, 0, sizeof(packet2));
2861 mavlink_msg_local_position_ned_cov_encode(system_id, component_id, &msg, &packet1);
2862 mavlink_msg_local_position_ned_cov_decode(&msg, &packet2);
2863 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2865 memset(&packet2, 0, sizeof(packet2));
2866 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 );
2867 mavlink_msg_local_position_ned_cov_decode(&msg, &packet2);
2868 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2870 memset(&packet2, 0, sizeof(packet2));
2871 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 );
2872 mavlink_msg_local_position_ned_cov_decode(&msg, &packet2);
2873 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2875 memset(&packet2, 0, sizeof(packet2));
2876 mavlink_msg_to_send_buffer(buffer, &msg);
2877 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2878 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2880 mavlink_msg_local_position_ned_cov_decode(last_msg, &packet2);
2881 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2883 memset(&packet2, 0, sizeof(packet2));
2884 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 );
2885 mavlink_msg_local_position_ned_cov_decode(last_msg, &packet2);
2886 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2889 static void mavlink_test_rc_channels(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2891 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2892 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2893 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RC_CHANNELS >= 256) {
2894 return;
2896 #endif
2897 mavlink_message_t msg;
2898 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2899 uint16_t i;
2900 mavlink_rc_channels_t packet_in = {
2901 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275,18379,18483,18587,18691,18795,18899,19003,19107,19211,125,192
2903 mavlink_rc_channels_t packet1, packet2;
2904 memset(&packet1, 0, sizeof(packet1));
2905 packet1.time_boot_ms = packet_in.time_boot_ms;
2906 packet1.chan1_raw = packet_in.chan1_raw;
2907 packet1.chan2_raw = packet_in.chan2_raw;
2908 packet1.chan3_raw = packet_in.chan3_raw;
2909 packet1.chan4_raw = packet_in.chan4_raw;
2910 packet1.chan5_raw = packet_in.chan5_raw;
2911 packet1.chan6_raw = packet_in.chan6_raw;
2912 packet1.chan7_raw = packet_in.chan7_raw;
2913 packet1.chan8_raw = packet_in.chan8_raw;
2914 packet1.chan9_raw = packet_in.chan9_raw;
2915 packet1.chan10_raw = packet_in.chan10_raw;
2916 packet1.chan11_raw = packet_in.chan11_raw;
2917 packet1.chan12_raw = packet_in.chan12_raw;
2918 packet1.chan13_raw = packet_in.chan13_raw;
2919 packet1.chan14_raw = packet_in.chan14_raw;
2920 packet1.chan15_raw = packet_in.chan15_raw;
2921 packet1.chan16_raw = packet_in.chan16_raw;
2922 packet1.chan17_raw = packet_in.chan17_raw;
2923 packet1.chan18_raw = packet_in.chan18_raw;
2924 packet1.chancount = packet_in.chancount;
2925 packet1.rssi = packet_in.rssi;
2928 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2929 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2930 // cope with extensions
2931 memset(MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN);
2933 #endif
2934 memset(&packet2, 0, sizeof(packet2));
2935 mavlink_msg_rc_channels_encode(system_id, component_id, &msg, &packet1);
2936 mavlink_msg_rc_channels_decode(&msg, &packet2);
2937 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2939 memset(&packet2, 0, sizeof(packet2));
2940 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 );
2941 mavlink_msg_rc_channels_decode(&msg, &packet2);
2942 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2944 memset(&packet2, 0, sizeof(packet2));
2945 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 );
2946 mavlink_msg_rc_channels_decode(&msg, &packet2);
2947 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2949 memset(&packet2, 0, sizeof(packet2));
2950 mavlink_msg_to_send_buffer(buffer, &msg);
2951 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2952 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2954 mavlink_msg_rc_channels_decode(last_msg, &packet2);
2955 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2957 memset(&packet2, 0, sizeof(packet2));
2958 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 );
2959 mavlink_msg_rc_channels_decode(last_msg, &packet2);
2960 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2963 static void mavlink_test_request_data_stream(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2965 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2966 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2967 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_REQUEST_DATA_STREAM >= 256) {
2968 return;
2970 #endif
2971 mavlink_message_t msg;
2972 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2973 uint16_t i;
2974 mavlink_request_data_stream_t packet_in = {
2975 17235,139,206,17,84
2977 mavlink_request_data_stream_t packet1, packet2;
2978 memset(&packet1, 0, sizeof(packet1));
2979 packet1.req_message_rate = packet_in.req_message_rate;
2980 packet1.target_system = packet_in.target_system;
2981 packet1.target_component = packet_in.target_component;
2982 packet1.req_stream_id = packet_in.req_stream_id;
2983 packet1.start_stop = packet_in.start_stop;
2986 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2987 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2988 // cope with extensions
2989 memset(MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN);
2991 #endif
2992 memset(&packet2, 0, sizeof(packet2));
2993 mavlink_msg_request_data_stream_encode(system_id, component_id, &msg, &packet1);
2994 mavlink_msg_request_data_stream_decode(&msg, &packet2);
2995 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
2997 memset(&packet2, 0, sizeof(packet2));
2998 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 );
2999 mavlink_msg_request_data_stream_decode(&msg, &packet2);
3000 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3002 memset(&packet2, 0, sizeof(packet2));
3003 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 );
3004 mavlink_msg_request_data_stream_decode(&msg, &packet2);
3005 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3007 memset(&packet2, 0, sizeof(packet2));
3008 mavlink_msg_to_send_buffer(buffer, &msg);
3009 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3010 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3012 mavlink_msg_request_data_stream_decode(last_msg, &packet2);
3013 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3015 memset(&packet2, 0, sizeof(packet2));
3016 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 );
3017 mavlink_msg_request_data_stream_decode(last_msg, &packet2);
3018 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3021 static void mavlink_test_data_stream(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3023 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3024 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3025 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DATA_STREAM >= 256) {
3026 return;
3028 #endif
3029 mavlink_message_t msg;
3030 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3031 uint16_t i;
3032 mavlink_data_stream_t packet_in = {
3033 17235,139,206
3035 mavlink_data_stream_t packet1, packet2;
3036 memset(&packet1, 0, sizeof(packet1));
3037 packet1.message_rate = packet_in.message_rate;
3038 packet1.stream_id = packet_in.stream_id;
3039 packet1.on_off = packet_in.on_off;
3042 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3043 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3044 // cope with extensions
3045 memset(MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN);
3047 #endif
3048 memset(&packet2, 0, sizeof(packet2));
3049 mavlink_msg_data_stream_encode(system_id, component_id, &msg, &packet1);
3050 mavlink_msg_data_stream_decode(&msg, &packet2);
3051 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3053 memset(&packet2, 0, sizeof(packet2));
3054 mavlink_msg_data_stream_pack(system_id, component_id, &msg , packet1.stream_id , packet1.message_rate , packet1.on_off );
3055 mavlink_msg_data_stream_decode(&msg, &packet2);
3056 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3058 memset(&packet2, 0, sizeof(packet2));
3059 mavlink_msg_data_stream_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.stream_id , packet1.message_rate , packet1.on_off );
3060 mavlink_msg_data_stream_decode(&msg, &packet2);
3061 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3063 memset(&packet2, 0, sizeof(packet2));
3064 mavlink_msg_to_send_buffer(buffer, &msg);
3065 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3066 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3068 mavlink_msg_data_stream_decode(last_msg, &packet2);
3069 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3071 memset(&packet2, 0, sizeof(packet2));
3072 mavlink_msg_data_stream_send(MAVLINK_COMM_1 , packet1.stream_id , packet1.message_rate , packet1.on_off );
3073 mavlink_msg_data_stream_decode(last_msg, &packet2);
3074 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3077 static void mavlink_test_manual_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3079 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3080 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3081 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MANUAL_CONTROL >= 256) {
3082 return;
3084 #endif
3085 mavlink_message_t msg;
3086 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3087 uint16_t i;
3088 mavlink_manual_control_t packet_in = {
3089 17235,17339,17443,17547,17651,163
3091 mavlink_manual_control_t packet1, packet2;
3092 memset(&packet1, 0, sizeof(packet1));
3093 packet1.x = packet_in.x;
3094 packet1.y = packet_in.y;
3095 packet1.z = packet_in.z;
3096 packet1.r = packet_in.r;
3097 packet1.buttons = packet_in.buttons;
3098 packet1.target = packet_in.target;
3101 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3102 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3103 // cope with extensions
3104 memset(MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN);
3106 #endif
3107 memset(&packet2, 0, sizeof(packet2));
3108 mavlink_msg_manual_control_encode(system_id, component_id, &msg, &packet1);
3109 mavlink_msg_manual_control_decode(&msg, &packet2);
3110 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3112 memset(&packet2, 0, sizeof(packet2));
3113 mavlink_msg_manual_control_pack(system_id, component_id, &msg , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons );
3114 mavlink_msg_manual_control_decode(&msg, &packet2);
3115 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3117 memset(&packet2, 0, sizeof(packet2));
3118 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 );
3119 mavlink_msg_manual_control_decode(&msg, &packet2);
3120 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3122 memset(&packet2, 0, sizeof(packet2));
3123 mavlink_msg_to_send_buffer(buffer, &msg);
3124 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3125 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3127 mavlink_msg_manual_control_decode(last_msg, &packet2);
3128 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3130 memset(&packet2, 0, sizeof(packet2));
3131 mavlink_msg_manual_control_send(MAVLINK_COMM_1 , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons );
3132 mavlink_msg_manual_control_decode(last_msg, &packet2);
3133 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3136 static void mavlink_test_rc_channels_override(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3138 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3139 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3140 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE >= 256) {
3141 return;
3143 #endif
3144 mavlink_message_t msg;
3145 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3146 uint16_t i;
3147 mavlink_rc_channels_override_t packet_in = {
3148 17235,17339,17443,17547,17651,17755,17859,17963,53,120,18171,18275,18379,18483,18587,18691,18795,18899,19003,19107
3150 mavlink_rc_channels_override_t packet1, packet2;
3151 memset(&packet1, 0, sizeof(packet1));
3152 packet1.chan1_raw = packet_in.chan1_raw;
3153 packet1.chan2_raw = packet_in.chan2_raw;
3154 packet1.chan3_raw = packet_in.chan3_raw;
3155 packet1.chan4_raw = packet_in.chan4_raw;
3156 packet1.chan5_raw = packet_in.chan5_raw;
3157 packet1.chan6_raw = packet_in.chan6_raw;
3158 packet1.chan7_raw = packet_in.chan7_raw;
3159 packet1.chan8_raw = packet_in.chan8_raw;
3160 packet1.target_system = packet_in.target_system;
3161 packet1.target_component = packet_in.target_component;
3162 packet1.chan9_raw = packet_in.chan9_raw;
3163 packet1.chan10_raw = packet_in.chan10_raw;
3164 packet1.chan11_raw = packet_in.chan11_raw;
3165 packet1.chan12_raw = packet_in.chan12_raw;
3166 packet1.chan13_raw = packet_in.chan13_raw;
3167 packet1.chan14_raw = packet_in.chan14_raw;
3168 packet1.chan15_raw = packet_in.chan15_raw;
3169 packet1.chan16_raw = packet_in.chan16_raw;
3170 packet1.chan17_raw = packet_in.chan17_raw;
3171 packet1.chan18_raw = packet_in.chan18_raw;
3174 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3175 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3176 // cope with extensions
3177 memset(MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN);
3179 #endif
3180 memset(&packet2, 0, sizeof(packet2));
3181 mavlink_msg_rc_channels_override_encode(system_id, component_id, &msg, &packet1);
3182 mavlink_msg_rc_channels_override_decode(&msg, &packet2);
3183 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3185 memset(&packet2, 0, sizeof(packet2));
3186 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 );
3187 mavlink_msg_rc_channels_override_decode(&msg, &packet2);
3188 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3190 memset(&packet2, 0, sizeof(packet2));
3191 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 );
3192 mavlink_msg_rc_channels_override_decode(&msg, &packet2);
3193 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3195 memset(&packet2, 0, sizeof(packet2));
3196 mavlink_msg_to_send_buffer(buffer, &msg);
3197 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3198 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3200 mavlink_msg_rc_channels_override_decode(last_msg, &packet2);
3201 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3203 memset(&packet2, 0, sizeof(packet2));
3204 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 );
3205 mavlink_msg_rc_channels_override_decode(last_msg, &packet2);
3206 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3209 static void mavlink_test_mission_item_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3211 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3212 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3213 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_ITEM_INT >= 256) {
3214 return;
3216 #endif
3217 mavlink_message_t msg;
3218 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3219 uint16_t i;
3220 mavlink_mission_item_int_t packet_in = {
3221 17.0,45.0,73.0,101.0,963498296,963498504,185.0,18691,18795,101,168,235,46,113,180
3223 mavlink_mission_item_int_t packet1, packet2;
3224 memset(&packet1, 0, sizeof(packet1));
3225 packet1.param1 = packet_in.param1;
3226 packet1.param2 = packet_in.param2;
3227 packet1.param3 = packet_in.param3;
3228 packet1.param4 = packet_in.param4;
3229 packet1.x = packet_in.x;
3230 packet1.y = packet_in.y;
3231 packet1.z = packet_in.z;
3232 packet1.seq = packet_in.seq;
3233 packet1.command = packet_in.command;
3234 packet1.target_system = packet_in.target_system;
3235 packet1.target_component = packet_in.target_component;
3236 packet1.frame = packet_in.frame;
3237 packet1.current = packet_in.current;
3238 packet1.autocontinue = packet_in.autocontinue;
3239 packet1.mission_type = packet_in.mission_type;
3242 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3243 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3244 // cope with extensions
3245 memset(MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN);
3247 #endif
3248 memset(&packet2, 0, sizeof(packet2));
3249 mavlink_msg_mission_item_int_encode(system_id, component_id, &msg, &packet1);
3250 mavlink_msg_mission_item_int_decode(&msg, &packet2);
3251 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3253 memset(&packet2, 0, sizeof(packet2));
3254 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 );
3255 mavlink_msg_mission_item_int_decode(&msg, &packet2);
3256 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3258 memset(&packet2, 0, sizeof(packet2));
3259 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 );
3260 mavlink_msg_mission_item_int_decode(&msg, &packet2);
3261 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3263 memset(&packet2, 0, sizeof(packet2));
3264 mavlink_msg_to_send_buffer(buffer, &msg);
3265 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3266 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3268 mavlink_msg_mission_item_int_decode(last_msg, &packet2);
3269 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3271 memset(&packet2, 0, sizeof(packet2));
3272 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 );
3273 mavlink_msg_mission_item_int_decode(last_msg, &packet2);
3274 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3277 static void mavlink_test_vfr_hud(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3279 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3280 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3281 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VFR_HUD >= 256) {
3282 return;
3284 #endif
3285 mavlink_message_t msg;
3286 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3287 uint16_t i;
3288 mavlink_vfr_hud_t packet_in = {
3289 17.0,45.0,73.0,101.0,18067,18171
3291 mavlink_vfr_hud_t packet1, packet2;
3292 memset(&packet1, 0, sizeof(packet1));
3293 packet1.airspeed = packet_in.airspeed;
3294 packet1.groundspeed = packet_in.groundspeed;
3295 packet1.alt = packet_in.alt;
3296 packet1.climb = packet_in.climb;
3297 packet1.heading = packet_in.heading;
3298 packet1.throttle = packet_in.throttle;
3301 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3302 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3303 // cope with extensions
3304 memset(MAVLINK_MSG_ID_VFR_HUD_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VFR_HUD_MIN_LEN);
3306 #endif
3307 memset(&packet2, 0, sizeof(packet2));
3308 mavlink_msg_vfr_hud_encode(system_id, component_id, &msg, &packet1);
3309 mavlink_msg_vfr_hud_decode(&msg, &packet2);
3310 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3312 memset(&packet2, 0, sizeof(packet2));
3313 mavlink_msg_vfr_hud_pack(system_id, component_id, &msg , packet1.airspeed , packet1.groundspeed , packet1.heading , packet1.throttle , packet1.alt , packet1.climb );
3314 mavlink_msg_vfr_hud_decode(&msg, &packet2);
3315 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3317 memset(&packet2, 0, sizeof(packet2));
3318 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 );
3319 mavlink_msg_vfr_hud_decode(&msg, &packet2);
3320 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3322 memset(&packet2, 0, sizeof(packet2));
3323 mavlink_msg_to_send_buffer(buffer, &msg);
3324 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3325 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3327 mavlink_msg_vfr_hud_decode(last_msg, &packet2);
3328 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3330 memset(&packet2, 0, sizeof(packet2));
3331 mavlink_msg_vfr_hud_send(MAVLINK_COMM_1 , packet1.airspeed , packet1.groundspeed , packet1.heading , packet1.throttle , packet1.alt , packet1.climb );
3332 mavlink_msg_vfr_hud_decode(last_msg, &packet2);
3333 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3336 static void mavlink_test_command_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3338 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3339 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3340 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMMAND_INT >= 256) {
3341 return;
3343 #endif
3344 mavlink_message_t msg;
3345 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3346 uint16_t i;
3347 mavlink_command_int_t packet_in = {
3348 17.0,45.0,73.0,101.0,963498296,963498504,185.0,18691,223,34,101,168,235
3350 mavlink_command_int_t packet1, packet2;
3351 memset(&packet1, 0, sizeof(packet1));
3352 packet1.param1 = packet_in.param1;
3353 packet1.param2 = packet_in.param2;
3354 packet1.param3 = packet_in.param3;
3355 packet1.param4 = packet_in.param4;
3356 packet1.x = packet_in.x;
3357 packet1.y = packet_in.y;
3358 packet1.z = packet_in.z;
3359 packet1.command = packet_in.command;
3360 packet1.target_system = packet_in.target_system;
3361 packet1.target_component = packet_in.target_component;
3362 packet1.frame = packet_in.frame;
3363 packet1.current = packet_in.current;
3364 packet1.autocontinue = packet_in.autocontinue;
3367 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3368 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3369 // cope with extensions
3370 memset(MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN);
3372 #endif
3373 memset(&packet2, 0, sizeof(packet2));
3374 mavlink_msg_command_int_encode(system_id, component_id, &msg, &packet1);
3375 mavlink_msg_command_int_decode(&msg, &packet2);
3376 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3378 memset(&packet2, 0, sizeof(packet2));
3379 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 );
3380 mavlink_msg_command_int_decode(&msg, &packet2);
3381 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3383 memset(&packet2, 0, sizeof(packet2));
3384 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 );
3385 mavlink_msg_command_int_decode(&msg, &packet2);
3386 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3388 memset(&packet2, 0, sizeof(packet2));
3389 mavlink_msg_to_send_buffer(buffer, &msg);
3390 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3391 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3393 mavlink_msg_command_int_decode(last_msg, &packet2);
3394 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3396 memset(&packet2, 0, sizeof(packet2));
3397 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 );
3398 mavlink_msg_command_int_decode(last_msg, &packet2);
3399 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3402 static void mavlink_test_command_long(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3404 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3405 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3406 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMMAND_LONG >= 256) {
3407 return;
3409 #endif
3410 mavlink_message_t msg;
3411 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3412 uint16_t i;
3413 mavlink_command_long_t packet_in = {
3414 17.0,45.0,73.0,101.0,129.0,157.0,185.0,18691,223,34,101
3416 mavlink_command_long_t packet1, packet2;
3417 memset(&packet1, 0, sizeof(packet1));
3418 packet1.param1 = packet_in.param1;
3419 packet1.param2 = packet_in.param2;
3420 packet1.param3 = packet_in.param3;
3421 packet1.param4 = packet_in.param4;
3422 packet1.param5 = packet_in.param5;
3423 packet1.param6 = packet_in.param6;
3424 packet1.param7 = packet_in.param7;
3425 packet1.command = packet_in.command;
3426 packet1.target_system = packet_in.target_system;
3427 packet1.target_component = packet_in.target_component;
3428 packet1.confirmation = packet_in.confirmation;
3431 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3432 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3433 // cope with extensions
3434 memset(MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN);
3436 #endif
3437 memset(&packet2, 0, sizeof(packet2));
3438 mavlink_msg_command_long_encode(system_id, component_id, &msg, &packet1);
3439 mavlink_msg_command_long_decode(&msg, &packet2);
3440 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3442 memset(&packet2, 0, sizeof(packet2));
3443 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 );
3444 mavlink_msg_command_long_decode(&msg, &packet2);
3445 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3447 memset(&packet2, 0, sizeof(packet2));
3448 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 );
3449 mavlink_msg_command_long_decode(&msg, &packet2);
3450 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3452 memset(&packet2, 0, sizeof(packet2));
3453 mavlink_msg_to_send_buffer(buffer, &msg);
3454 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3455 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3457 mavlink_msg_command_long_decode(last_msg, &packet2);
3458 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3460 memset(&packet2, 0, sizeof(packet2));
3461 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 );
3462 mavlink_msg_command_long_decode(last_msg, &packet2);
3463 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3466 static void mavlink_test_command_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3468 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3469 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3470 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMMAND_ACK >= 256) {
3471 return;
3473 #endif
3474 mavlink_message_t msg;
3475 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3476 uint16_t i;
3477 mavlink_command_ack_t packet_in = {
3478 17235,139,206,963497672,29,96
3480 mavlink_command_ack_t packet1, packet2;
3481 memset(&packet1, 0, sizeof(packet1));
3482 packet1.command = packet_in.command;
3483 packet1.result = packet_in.result;
3484 packet1.progress = packet_in.progress;
3485 packet1.result_param2 = packet_in.result_param2;
3486 packet1.target_system = packet_in.target_system;
3487 packet1.target_component = packet_in.target_component;
3490 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3491 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3492 // cope with extensions
3493 memset(MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN);
3495 #endif
3496 memset(&packet2, 0, sizeof(packet2));
3497 mavlink_msg_command_ack_encode(system_id, component_id, &msg, &packet1);
3498 mavlink_msg_command_ack_decode(&msg, &packet2);
3499 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3501 memset(&packet2, 0, sizeof(packet2));
3502 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 );
3503 mavlink_msg_command_ack_decode(&msg, &packet2);
3504 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3506 memset(&packet2, 0, sizeof(packet2));
3507 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 );
3508 mavlink_msg_command_ack_decode(&msg, &packet2);
3509 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3511 memset(&packet2, 0, sizeof(packet2));
3512 mavlink_msg_to_send_buffer(buffer, &msg);
3513 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3514 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3516 mavlink_msg_command_ack_decode(last_msg, &packet2);
3517 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3519 memset(&packet2, 0, sizeof(packet2));
3520 mavlink_msg_command_ack_send(MAVLINK_COMM_1 , packet1.command , packet1.result , packet1.progress , packet1.result_param2 , packet1.target_system , packet1.target_component );
3521 mavlink_msg_command_ack_decode(last_msg, &packet2);
3522 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3525 static void mavlink_test_command_cancel(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3527 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3528 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3529 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMMAND_CANCEL >= 256) {
3530 return;
3532 #endif
3533 mavlink_message_t msg;
3534 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3535 uint16_t i;
3536 mavlink_command_cancel_t packet_in = {
3537 17235,139,206
3539 mavlink_command_cancel_t packet1, packet2;
3540 memset(&packet1, 0, sizeof(packet1));
3541 packet1.command = packet_in.command;
3542 packet1.target_system = packet_in.target_system;
3543 packet1.target_component = packet_in.target_component;
3546 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3547 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3548 // cope with extensions
3549 memset(MAVLINK_MSG_ID_COMMAND_CANCEL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COMMAND_CANCEL_MIN_LEN);
3551 #endif
3552 memset(&packet2, 0, sizeof(packet2));
3553 mavlink_msg_command_cancel_encode(system_id, component_id, &msg, &packet1);
3554 mavlink_msg_command_cancel_decode(&msg, &packet2);
3555 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3557 memset(&packet2, 0, sizeof(packet2));
3558 mavlink_msg_command_cancel_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.command );
3559 mavlink_msg_command_cancel_decode(&msg, &packet2);
3560 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3562 memset(&packet2, 0, sizeof(packet2));
3563 mavlink_msg_command_cancel_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.command );
3564 mavlink_msg_command_cancel_decode(&msg, &packet2);
3565 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3567 memset(&packet2, 0, sizeof(packet2));
3568 mavlink_msg_to_send_buffer(buffer, &msg);
3569 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3570 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3572 mavlink_msg_command_cancel_decode(last_msg, &packet2);
3573 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3575 memset(&packet2, 0, sizeof(packet2));
3576 mavlink_msg_command_cancel_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.command );
3577 mavlink_msg_command_cancel_decode(last_msg, &packet2);
3578 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3581 static void mavlink_test_manual_setpoint(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3583 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3584 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3585 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MANUAL_SETPOINT >= 256) {
3586 return;
3588 #endif
3589 mavlink_message_t msg;
3590 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3591 uint16_t i;
3592 mavlink_manual_setpoint_t packet_in = {
3593 963497464,45.0,73.0,101.0,129.0,65,132
3595 mavlink_manual_setpoint_t packet1, packet2;
3596 memset(&packet1, 0, sizeof(packet1));
3597 packet1.time_boot_ms = packet_in.time_boot_ms;
3598 packet1.roll = packet_in.roll;
3599 packet1.pitch = packet_in.pitch;
3600 packet1.yaw = packet_in.yaw;
3601 packet1.thrust = packet_in.thrust;
3602 packet1.mode_switch = packet_in.mode_switch;
3603 packet1.manual_override_switch = packet_in.manual_override_switch;
3606 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3607 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3608 // cope with extensions
3609 memset(MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN);
3611 #endif
3612 memset(&packet2, 0, sizeof(packet2));
3613 mavlink_msg_manual_setpoint_encode(system_id, component_id, &msg, &packet1);
3614 mavlink_msg_manual_setpoint_decode(&msg, &packet2);
3615 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3617 memset(&packet2, 0, sizeof(packet2));
3618 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 );
3619 mavlink_msg_manual_setpoint_decode(&msg, &packet2);
3620 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3622 memset(&packet2, 0, sizeof(packet2));
3623 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 );
3624 mavlink_msg_manual_setpoint_decode(&msg, &packet2);
3625 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3627 memset(&packet2, 0, sizeof(packet2));
3628 mavlink_msg_to_send_buffer(buffer, &msg);
3629 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3630 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3632 mavlink_msg_manual_setpoint_decode(last_msg, &packet2);
3633 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3635 memset(&packet2, 0, sizeof(packet2));
3636 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 );
3637 mavlink_msg_manual_setpoint_decode(last_msg, &packet2);
3638 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3641 static void mavlink_test_set_attitude_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3643 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3644 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3645 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_ATTITUDE_TARGET >= 256) {
3646 return;
3648 #endif
3649 mavlink_message_t msg;
3650 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3651 uint16_t i;
3652 mavlink_set_attitude_target_t packet_in = {
3653 963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,241.0,113,180,247
3655 mavlink_set_attitude_target_t packet1, packet2;
3656 memset(&packet1, 0, sizeof(packet1));
3657 packet1.time_boot_ms = packet_in.time_boot_ms;
3658 packet1.body_roll_rate = packet_in.body_roll_rate;
3659 packet1.body_pitch_rate = packet_in.body_pitch_rate;
3660 packet1.body_yaw_rate = packet_in.body_yaw_rate;
3661 packet1.thrust = packet_in.thrust;
3662 packet1.target_system = packet_in.target_system;
3663 packet1.target_component = packet_in.target_component;
3664 packet1.type_mask = packet_in.type_mask;
3666 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
3668 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3669 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3670 // cope with extensions
3671 memset(MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN);
3673 #endif
3674 memset(&packet2, 0, sizeof(packet2));
3675 mavlink_msg_set_attitude_target_encode(system_id, component_id, &msg, &packet1);
3676 mavlink_msg_set_attitude_target_decode(&msg, &packet2);
3677 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3679 memset(&packet2, 0, sizeof(packet2));
3680 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 );
3681 mavlink_msg_set_attitude_target_decode(&msg, &packet2);
3682 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3684 memset(&packet2, 0, sizeof(packet2));
3685 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 );
3686 mavlink_msg_set_attitude_target_decode(&msg, &packet2);
3687 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3689 memset(&packet2, 0, sizeof(packet2));
3690 mavlink_msg_to_send_buffer(buffer, &msg);
3691 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3692 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3694 mavlink_msg_set_attitude_target_decode(last_msg, &packet2);
3695 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3697 memset(&packet2, 0, sizeof(packet2));
3698 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 );
3699 mavlink_msg_set_attitude_target_decode(last_msg, &packet2);
3700 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3703 static void mavlink_test_attitude_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
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_ATTITUDE_TARGET >= 256) {
3708 return;
3710 #endif
3711 mavlink_message_t msg;
3712 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3713 uint16_t i;
3714 mavlink_attitude_target_t packet_in = {
3715 963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,241.0,113
3717 mavlink_attitude_target_t packet1, packet2;
3718 memset(&packet1, 0, sizeof(packet1));
3719 packet1.time_boot_ms = packet_in.time_boot_ms;
3720 packet1.body_roll_rate = packet_in.body_roll_rate;
3721 packet1.body_pitch_rate = packet_in.body_pitch_rate;
3722 packet1.body_yaw_rate = packet_in.body_yaw_rate;
3723 packet1.thrust = packet_in.thrust;
3724 packet1.type_mask = packet_in.type_mask;
3726 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
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_ATTITUDE_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN);
3733 #endif
3734 memset(&packet2, 0, sizeof(packet2));
3735 mavlink_msg_attitude_target_encode(system_id, component_id, &msg, &packet1);
3736 mavlink_msg_attitude_target_decode(&msg, &packet2);
3737 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3739 memset(&packet2, 0, sizeof(packet2));
3740 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 );
3741 mavlink_msg_attitude_target_decode(&msg, &packet2);
3742 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3744 memset(&packet2, 0, sizeof(packet2));
3745 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 );
3746 mavlink_msg_attitude_target_decode(&msg, &packet2);
3747 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
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]);
3754 mavlink_msg_attitude_target_decode(last_msg, &packet2);
3755 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3757 memset(&packet2, 0, sizeof(packet2));
3758 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 );
3759 mavlink_msg_attitude_target_decode(last_msg, &packet2);
3760 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3763 static void mavlink_test_set_position_target_local_ned(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3765 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3766 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3767 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED >= 256) {
3768 return;
3770 #endif
3771 mavlink_message_t msg;
3772 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3773 uint16_t i;
3774 mavlink_set_position_target_local_ned_t packet_in = {
3775 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
3777 mavlink_set_position_target_local_ned_t packet1, packet2;
3778 memset(&packet1, 0, sizeof(packet1));
3779 packet1.time_boot_ms = packet_in.time_boot_ms;
3780 packet1.x = packet_in.x;
3781 packet1.y = packet_in.y;
3782 packet1.z = packet_in.z;
3783 packet1.vx = packet_in.vx;
3784 packet1.vy = packet_in.vy;
3785 packet1.vz = packet_in.vz;
3786 packet1.afx = packet_in.afx;
3787 packet1.afy = packet_in.afy;
3788 packet1.afz = packet_in.afz;
3789 packet1.yaw = packet_in.yaw;
3790 packet1.yaw_rate = packet_in.yaw_rate;
3791 packet1.type_mask = packet_in.type_mask;
3792 packet1.target_system = packet_in.target_system;
3793 packet1.target_component = packet_in.target_component;
3794 packet1.coordinate_frame = packet_in.coordinate_frame;
3797 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3798 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3799 // cope with extensions
3800 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);
3802 #endif
3803 memset(&packet2, 0, sizeof(packet2));
3804 mavlink_msg_set_position_target_local_ned_encode(system_id, component_id, &msg, &packet1);
3805 mavlink_msg_set_position_target_local_ned_decode(&msg, &packet2);
3806 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3808 memset(&packet2, 0, sizeof(packet2));
3809 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 );
3810 mavlink_msg_set_position_target_local_ned_decode(&msg, &packet2);
3811 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3813 memset(&packet2, 0, sizeof(packet2));
3814 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 );
3815 mavlink_msg_set_position_target_local_ned_decode(&msg, &packet2);
3816 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3818 memset(&packet2, 0, sizeof(packet2));
3819 mavlink_msg_to_send_buffer(buffer, &msg);
3820 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3821 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3823 mavlink_msg_set_position_target_local_ned_decode(last_msg, &packet2);
3824 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3826 memset(&packet2, 0, sizeof(packet2));
3827 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 );
3828 mavlink_msg_set_position_target_local_ned_decode(last_msg, &packet2);
3829 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3832 static void mavlink_test_position_target_local_ned(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3834 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3835 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3836 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED >= 256) {
3837 return;
3839 #endif
3840 mavlink_message_t msg;
3841 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3842 uint16_t i;
3843 mavlink_position_target_local_ned_t packet_in = {
3844 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
3846 mavlink_position_target_local_ned_t packet1, packet2;
3847 memset(&packet1, 0, sizeof(packet1));
3848 packet1.time_boot_ms = packet_in.time_boot_ms;
3849 packet1.x = packet_in.x;
3850 packet1.y = packet_in.y;
3851 packet1.z = packet_in.z;
3852 packet1.vx = packet_in.vx;
3853 packet1.vy = packet_in.vy;
3854 packet1.vz = packet_in.vz;
3855 packet1.afx = packet_in.afx;
3856 packet1.afy = packet_in.afy;
3857 packet1.afz = packet_in.afz;
3858 packet1.yaw = packet_in.yaw;
3859 packet1.yaw_rate = packet_in.yaw_rate;
3860 packet1.type_mask = packet_in.type_mask;
3861 packet1.coordinate_frame = packet_in.coordinate_frame;
3864 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3865 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3866 // cope with extensions
3867 memset(MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN);
3869 #endif
3870 memset(&packet2, 0, sizeof(packet2));
3871 mavlink_msg_position_target_local_ned_encode(system_id, component_id, &msg, &packet1);
3872 mavlink_msg_position_target_local_ned_decode(&msg, &packet2);
3873 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3875 memset(&packet2, 0, sizeof(packet2));
3876 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 );
3877 mavlink_msg_position_target_local_ned_decode(&msg, &packet2);
3878 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3880 memset(&packet2, 0, sizeof(packet2));
3881 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 );
3882 mavlink_msg_position_target_local_ned_decode(&msg, &packet2);
3883 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3885 memset(&packet2, 0, sizeof(packet2));
3886 mavlink_msg_to_send_buffer(buffer, &msg);
3887 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3888 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3890 mavlink_msg_position_target_local_ned_decode(last_msg, &packet2);
3891 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3893 memset(&packet2, 0, sizeof(packet2));
3894 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 );
3895 mavlink_msg_position_target_local_ned_decode(last_msg, &packet2);
3896 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3899 static void mavlink_test_set_position_target_global_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3901 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3902 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3903 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT >= 256) {
3904 return;
3906 #endif
3907 mavlink_message_t msg;
3908 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3909 uint16_t i;
3910 mavlink_set_position_target_global_int_t packet_in = {
3911 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
3913 mavlink_set_position_target_global_int_t packet1, packet2;
3914 memset(&packet1, 0, sizeof(packet1));
3915 packet1.time_boot_ms = packet_in.time_boot_ms;
3916 packet1.lat_int = packet_in.lat_int;
3917 packet1.lon_int = packet_in.lon_int;
3918 packet1.alt = packet_in.alt;
3919 packet1.vx = packet_in.vx;
3920 packet1.vy = packet_in.vy;
3921 packet1.vz = packet_in.vz;
3922 packet1.afx = packet_in.afx;
3923 packet1.afy = packet_in.afy;
3924 packet1.afz = packet_in.afz;
3925 packet1.yaw = packet_in.yaw;
3926 packet1.yaw_rate = packet_in.yaw_rate;
3927 packet1.type_mask = packet_in.type_mask;
3928 packet1.target_system = packet_in.target_system;
3929 packet1.target_component = packet_in.target_component;
3930 packet1.coordinate_frame = packet_in.coordinate_frame;
3933 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3934 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3935 // cope with extensions
3936 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);
3938 #endif
3939 memset(&packet2, 0, sizeof(packet2));
3940 mavlink_msg_set_position_target_global_int_encode(system_id, component_id, &msg, &packet1);
3941 mavlink_msg_set_position_target_global_int_decode(&msg, &packet2);
3942 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3944 memset(&packet2, 0, sizeof(packet2));
3945 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 );
3946 mavlink_msg_set_position_target_global_int_decode(&msg, &packet2);
3947 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3949 memset(&packet2, 0, sizeof(packet2));
3950 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 );
3951 mavlink_msg_set_position_target_global_int_decode(&msg, &packet2);
3952 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3954 memset(&packet2, 0, sizeof(packet2));
3955 mavlink_msg_to_send_buffer(buffer, &msg);
3956 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3957 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3959 mavlink_msg_set_position_target_global_int_decode(last_msg, &packet2);
3960 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3962 memset(&packet2, 0, sizeof(packet2));
3963 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 );
3964 mavlink_msg_set_position_target_global_int_decode(last_msg, &packet2);
3965 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
3968 static void mavlink_test_position_target_global_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3970 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3971 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3972 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT >= 256) {
3973 return;
3975 #endif
3976 mavlink_message_t msg;
3977 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3978 uint16_t i;
3979 mavlink_position_target_global_int_t packet_in = {
3980 963497464,963497672,963497880,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27
3982 mavlink_position_target_global_int_t packet1, packet2;
3983 memset(&packet1, 0, sizeof(packet1));
3984 packet1.time_boot_ms = packet_in.time_boot_ms;
3985 packet1.lat_int = packet_in.lat_int;
3986 packet1.lon_int = packet_in.lon_int;
3987 packet1.alt = packet_in.alt;
3988 packet1.vx = packet_in.vx;
3989 packet1.vy = packet_in.vy;
3990 packet1.vz = packet_in.vz;
3991 packet1.afx = packet_in.afx;
3992 packet1.afy = packet_in.afy;
3993 packet1.afz = packet_in.afz;
3994 packet1.yaw = packet_in.yaw;
3995 packet1.yaw_rate = packet_in.yaw_rate;
3996 packet1.type_mask = packet_in.type_mask;
3997 packet1.coordinate_frame = packet_in.coordinate_frame;
4000 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4001 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4002 // cope with extensions
4003 memset(MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN);
4005 #endif
4006 memset(&packet2, 0, sizeof(packet2));
4007 mavlink_msg_position_target_global_int_encode(system_id, component_id, &msg, &packet1);
4008 mavlink_msg_position_target_global_int_decode(&msg, &packet2);
4009 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4011 memset(&packet2, 0, sizeof(packet2));
4012 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 );
4013 mavlink_msg_position_target_global_int_decode(&msg, &packet2);
4014 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4016 memset(&packet2, 0, sizeof(packet2));
4017 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 );
4018 mavlink_msg_position_target_global_int_decode(&msg, &packet2);
4019 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4021 memset(&packet2, 0, sizeof(packet2));
4022 mavlink_msg_to_send_buffer(buffer, &msg);
4023 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4024 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4026 mavlink_msg_position_target_global_int_decode(last_msg, &packet2);
4027 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4029 memset(&packet2, 0, sizeof(packet2));
4030 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 );
4031 mavlink_msg_position_target_global_int_decode(last_msg, &packet2);
4032 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4035 static void mavlink_test_local_position_ned_system_global_offset(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4037 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4038 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4039 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET >= 256) {
4040 return;
4042 #endif
4043 mavlink_message_t msg;
4044 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4045 uint16_t i;
4046 mavlink_local_position_ned_system_global_offset_t packet_in = {
4047 963497464,45.0,73.0,101.0,129.0,157.0,185.0
4049 mavlink_local_position_ned_system_global_offset_t packet1, packet2;
4050 memset(&packet1, 0, sizeof(packet1));
4051 packet1.time_boot_ms = packet_in.time_boot_ms;
4052 packet1.x = packet_in.x;
4053 packet1.y = packet_in.y;
4054 packet1.z = packet_in.z;
4055 packet1.roll = packet_in.roll;
4056 packet1.pitch = packet_in.pitch;
4057 packet1.yaw = packet_in.yaw;
4060 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4061 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4062 // cope with extensions
4063 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);
4065 #endif
4066 memset(&packet2, 0, sizeof(packet2));
4067 mavlink_msg_local_position_ned_system_global_offset_encode(system_id, component_id, &msg, &packet1);
4068 mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2);
4069 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4071 memset(&packet2, 0, sizeof(packet2));
4072 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 );
4073 mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2);
4074 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4076 memset(&packet2, 0, sizeof(packet2));
4077 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 );
4078 mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2);
4079 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4081 memset(&packet2, 0, sizeof(packet2));
4082 mavlink_msg_to_send_buffer(buffer, &msg);
4083 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4084 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4086 mavlink_msg_local_position_ned_system_global_offset_decode(last_msg, &packet2);
4087 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4089 memset(&packet2, 0, sizeof(packet2));
4090 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 );
4091 mavlink_msg_local_position_ned_system_global_offset_decode(last_msg, &packet2);
4092 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4095 static void mavlink_test_hil_state(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4097 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4098 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4099 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_STATE >= 256) {
4100 return;
4102 #endif
4103 mavlink_message_t msg;
4104 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4105 uint16_t i;
4106 mavlink_hil_state_t packet_in = {
4107 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,963499128,963499336,963499544,19523,19627,19731,19835,19939,20043
4109 mavlink_hil_state_t packet1, packet2;
4110 memset(&packet1, 0, sizeof(packet1));
4111 packet1.time_usec = packet_in.time_usec;
4112 packet1.roll = packet_in.roll;
4113 packet1.pitch = packet_in.pitch;
4114 packet1.yaw = packet_in.yaw;
4115 packet1.rollspeed = packet_in.rollspeed;
4116 packet1.pitchspeed = packet_in.pitchspeed;
4117 packet1.yawspeed = packet_in.yawspeed;
4118 packet1.lat = packet_in.lat;
4119 packet1.lon = packet_in.lon;
4120 packet1.alt = packet_in.alt;
4121 packet1.vx = packet_in.vx;
4122 packet1.vy = packet_in.vy;
4123 packet1.vz = packet_in.vz;
4124 packet1.xacc = packet_in.xacc;
4125 packet1.yacc = packet_in.yacc;
4126 packet1.zacc = packet_in.zacc;
4129 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4130 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4131 // cope with extensions
4132 memset(MAVLINK_MSG_ID_HIL_STATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_STATE_MIN_LEN);
4134 #endif
4135 memset(&packet2, 0, sizeof(packet2));
4136 mavlink_msg_hil_state_encode(system_id, component_id, &msg, &packet1);
4137 mavlink_msg_hil_state_decode(&msg, &packet2);
4138 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4140 memset(&packet2, 0, sizeof(packet2));
4141 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 );
4142 mavlink_msg_hil_state_decode(&msg, &packet2);
4143 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4145 memset(&packet2, 0, sizeof(packet2));
4146 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 );
4147 mavlink_msg_hil_state_decode(&msg, &packet2);
4148 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4150 memset(&packet2, 0, sizeof(packet2));
4151 mavlink_msg_to_send_buffer(buffer, &msg);
4152 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4153 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4155 mavlink_msg_hil_state_decode(last_msg, &packet2);
4156 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4158 memset(&packet2, 0, sizeof(packet2));
4159 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 );
4160 mavlink_msg_hil_state_decode(last_msg, &packet2);
4161 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4164 static void mavlink_test_hil_controls(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4166 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4167 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4168 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_CONTROLS >= 256) {
4169 return;
4171 #endif
4172 mavlink_message_t msg;
4173 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4174 uint16_t i;
4175 mavlink_hil_controls_t packet_in = {
4176 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,125,192
4178 mavlink_hil_controls_t packet1, packet2;
4179 memset(&packet1, 0, sizeof(packet1));
4180 packet1.time_usec = packet_in.time_usec;
4181 packet1.roll_ailerons = packet_in.roll_ailerons;
4182 packet1.pitch_elevator = packet_in.pitch_elevator;
4183 packet1.yaw_rudder = packet_in.yaw_rudder;
4184 packet1.throttle = packet_in.throttle;
4185 packet1.aux1 = packet_in.aux1;
4186 packet1.aux2 = packet_in.aux2;
4187 packet1.aux3 = packet_in.aux3;
4188 packet1.aux4 = packet_in.aux4;
4189 packet1.mode = packet_in.mode;
4190 packet1.nav_mode = packet_in.nav_mode;
4193 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4194 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4195 // cope with extensions
4196 memset(MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN);
4198 #endif
4199 memset(&packet2, 0, sizeof(packet2));
4200 mavlink_msg_hil_controls_encode(system_id, component_id, &msg, &packet1);
4201 mavlink_msg_hil_controls_decode(&msg, &packet2);
4202 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4204 memset(&packet2, 0, sizeof(packet2));
4205 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 );
4206 mavlink_msg_hil_controls_decode(&msg, &packet2);
4207 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4209 memset(&packet2, 0, sizeof(packet2));
4210 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 );
4211 mavlink_msg_hil_controls_decode(&msg, &packet2);
4212 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4214 memset(&packet2, 0, sizeof(packet2));
4215 mavlink_msg_to_send_buffer(buffer, &msg);
4216 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4217 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4219 mavlink_msg_hil_controls_decode(last_msg, &packet2);
4220 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4222 memset(&packet2, 0, sizeof(packet2));
4223 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 );
4224 mavlink_msg_hil_controls_decode(last_msg, &packet2);
4225 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4228 static void mavlink_test_hil_rc_inputs_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4230 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4231 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4232 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW >= 256) {
4233 return;
4235 #endif
4236 mavlink_message_t msg;
4237 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4238 uint16_t i;
4239 mavlink_hil_rc_inputs_raw_t packet_in = {
4240 93372036854775807ULL,17651,17755,17859,17963,18067,18171,18275,18379,18483,18587,18691,18795,101
4242 mavlink_hil_rc_inputs_raw_t packet1, packet2;
4243 memset(&packet1, 0, sizeof(packet1));
4244 packet1.time_usec = packet_in.time_usec;
4245 packet1.chan1_raw = packet_in.chan1_raw;
4246 packet1.chan2_raw = packet_in.chan2_raw;
4247 packet1.chan3_raw = packet_in.chan3_raw;
4248 packet1.chan4_raw = packet_in.chan4_raw;
4249 packet1.chan5_raw = packet_in.chan5_raw;
4250 packet1.chan6_raw = packet_in.chan6_raw;
4251 packet1.chan7_raw = packet_in.chan7_raw;
4252 packet1.chan8_raw = packet_in.chan8_raw;
4253 packet1.chan9_raw = packet_in.chan9_raw;
4254 packet1.chan10_raw = packet_in.chan10_raw;
4255 packet1.chan11_raw = packet_in.chan11_raw;
4256 packet1.chan12_raw = packet_in.chan12_raw;
4257 packet1.rssi = packet_in.rssi;
4260 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4261 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4262 // cope with extensions
4263 memset(MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN);
4265 #endif
4266 memset(&packet2, 0, sizeof(packet2));
4267 mavlink_msg_hil_rc_inputs_raw_encode(system_id, component_id, &msg, &packet1);
4268 mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2);
4269 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4271 memset(&packet2, 0, sizeof(packet2));
4272 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 );
4273 mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2);
4274 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4276 memset(&packet2, 0, sizeof(packet2));
4277 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 );
4278 mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2);
4279 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4281 memset(&packet2, 0, sizeof(packet2));
4282 mavlink_msg_to_send_buffer(buffer, &msg);
4283 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4284 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4286 mavlink_msg_hil_rc_inputs_raw_decode(last_msg, &packet2);
4287 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4289 memset(&packet2, 0, sizeof(packet2));
4290 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 );
4291 mavlink_msg_hil_rc_inputs_raw_decode(last_msg, &packet2);
4292 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4295 static void mavlink_test_hil_actuator_controls(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4297 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4298 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4299 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS >= 256) {
4300 return;
4302 #endif
4303 mavlink_message_t msg;
4304 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4305 uint16_t i;
4306 mavlink_hil_actuator_controls_t packet_in = {
4307 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
4309 mavlink_hil_actuator_controls_t packet1, packet2;
4310 memset(&packet1, 0, sizeof(packet1));
4311 packet1.time_usec = packet_in.time_usec;
4312 packet1.flags = packet_in.flags;
4313 packet1.mode = packet_in.mode;
4315 mav_array_memcpy(packet1.controls, packet_in.controls, sizeof(float)*16);
4317 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4318 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4319 // cope with extensions
4320 memset(MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_MIN_LEN);
4322 #endif
4323 memset(&packet2, 0, sizeof(packet2));
4324 mavlink_msg_hil_actuator_controls_encode(system_id, component_id, &msg, &packet1);
4325 mavlink_msg_hil_actuator_controls_decode(&msg, &packet2);
4326 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4328 memset(&packet2, 0, sizeof(packet2));
4329 mavlink_msg_hil_actuator_controls_pack(system_id, component_id, &msg , packet1.time_usec , packet1.controls , packet1.mode , packet1.flags );
4330 mavlink_msg_hil_actuator_controls_decode(&msg, &packet2);
4331 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4333 memset(&packet2, 0, sizeof(packet2));
4334 mavlink_msg_hil_actuator_controls_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.controls , packet1.mode , packet1.flags );
4335 mavlink_msg_hil_actuator_controls_decode(&msg, &packet2);
4336 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4338 memset(&packet2, 0, sizeof(packet2));
4339 mavlink_msg_to_send_buffer(buffer, &msg);
4340 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4341 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4343 mavlink_msg_hil_actuator_controls_decode(last_msg, &packet2);
4344 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4346 memset(&packet2, 0, sizeof(packet2));
4347 mavlink_msg_hil_actuator_controls_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.controls , packet1.mode , packet1.flags );
4348 mavlink_msg_hil_actuator_controls_decode(last_msg, &packet2);
4349 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4352 static void mavlink_test_optical_flow(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4354 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4355 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4356 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPTICAL_FLOW >= 256) {
4357 return;
4359 #endif
4360 mavlink_message_t msg;
4361 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4362 uint16_t i;
4363 mavlink_optical_flow_t packet_in = {
4364 93372036854775807ULL,73.0,101.0,129.0,18275,18379,77,144,199.0,227.0
4366 mavlink_optical_flow_t packet1, packet2;
4367 memset(&packet1, 0, sizeof(packet1));
4368 packet1.time_usec = packet_in.time_usec;
4369 packet1.flow_comp_m_x = packet_in.flow_comp_m_x;
4370 packet1.flow_comp_m_y = packet_in.flow_comp_m_y;
4371 packet1.ground_distance = packet_in.ground_distance;
4372 packet1.flow_x = packet_in.flow_x;
4373 packet1.flow_y = packet_in.flow_y;
4374 packet1.sensor_id = packet_in.sensor_id;
4375 packet1.quality = packet_in.quality;
4376 packet1.flow_rate_x = packet_in.flow_rate_x;
4377 packet1.flow_rate_y = packet_in.flow_rate_y;
4380 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4381 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4382 // cope with extensions
4383 memset(MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN);
4385 #endif
4386 memset(&packet2, 0, sizeof(packet2));
4387 mavlink_msg_optical_flow_encode(system_id, component_id, &msg, &packet1);
4388 mavlink_msg_optical_flow_decode(&msg, &packet2);
4389 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4391 memset(&packet2, 0, sizeof(packet2));
4392 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 );
4393 mavlink_msg_optical_flow_decode(&msg, &packet2);
4394 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4396 memset(&packet2, 0, sizeof(packet2));
4397 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 );
4398 mavlink_msg_optical_flow_decode(&msg, &packet2);
4399 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4401 memset(&packet2, 0, sizeof(packet2));
4402 mavlink_msg_to_send_buffer(buffer, &msg);
4403 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4404 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4406 mavlink_msg_optical_flow_decode(last_msg, &packet2);
4407 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4409 memset(&packet2, 0, sizeof(packet2));
4410 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 );
4411 mavlink_msg_optical_flow_decode(last_msg, &packet2);
4412 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4415 static void mavlink_test_global_vision_position_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4417 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4418 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4419 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE >= 256) {
4420 return;
4422 #endif
4423 mavlink_message_t msg;
4424 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4425 uint16_t i;
4426 mavlink_global_vision_position_estimate_t packet_in = {
4427 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
4429 mavlink_global_vision_position_estimate_t packet1, packet2;
4430 memset(&packet1, 0, sizeof(packet1));
4431 packet1.usec = packet_in.usec;
4432 packet1.x = packet_in.x;
4433 packet1.y = packet_in.y;
4434 packet1.z = packet_in.z;
4435 packet1.roll = packet_in.roll;
4436 packet1.pitch = packet_in.pitch;
4437 packet1.yaw = packet_in.yaw;
4438 packet1.reset_counter = packet_in.reset_counter;
4440 mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*21);
4442 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4443 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4444 // cope with extensions
4445 memset(MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN);
4447 #endif
4448 memset(&packet2, 0, sizeof(packet2));
4449 mavlink_msg_global_vision_position_estimate_encode(system_id, component_id, &msg, &packet1);
4450 mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2);
4451 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4453 memset(&packet2, 0, sizeof(packet2));
4454 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 );
4455 mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2);
4456 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4458 memset(&packet2, 0, sizeof(packet2));
4459 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 );
4460 mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2);
4461 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4463 memset(&packet2, 0, sizeof(packet2));
4464 mavlink_msg_to_send_buffer(buffer, &msg);
4465 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4466 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4468 mavlink_msg_global_vision_position_estimate_decode(last_msg, &packet2);
4469 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4471 memset(&packet2, 0, sizeof(packet2));
4472 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 );
4473 mavlink_msg_global_vision_position_estimate_decode(last_msg, &packet2);
4474 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4477 static void mavlink_test_vision_position_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4479 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4480 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4481 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE >= 256) {
4482 return;
4484 #endif
4485 mavlink_message_t msg;
4486 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4487 uint16_t i;
4488 mavlink_vision_position_estimate_t packet_in = {
4489 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
4491 mavlink_vision_position_estimate_t packet1, packet2;
4492 memset(&packet1, 0, sizeof(packet1));
4493 packet1.usec = packet_in.usec;
4494 packet1.x = packet_in.x;
4495 packet1.y = packet_in.y;
4496 packet1.z = packet_in.z;
4497 packet1.roll = packet_in.roll;
4498 packet1.pitch = packet_in.pitch;
4499 packet1.yaw = packet_in.yaw;
4500 packet1.reset_counter = packet_in.reset_counter;
4502 mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*21);
4504 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4505 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4506 // cope with extensions
4507 memset(MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN);
4509 #endif
4510 memset(&packet2, 0, sizeof(packet2));
4511 mavlink_msg_vision_position_estimate_encode(system_id, component_id, &msg, &packet1);
4512 mavlink_msg_vision_position_estimate_decode(&msg, &packet2);
4513 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4515 memset(&packet2, 0, sizeof(packet2));
4516 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 );
4517 mavlink_msg_vision_position_estimate_decode(&msg, &packet2);
4518 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4520 memset(&packet2, 0, sizeof(packet2));
4521 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 );
4522 mavlink_msg_vision_position_estimate_decode(&msg, &packet2);
4523 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4525 memset(&packet2, 0, sizeof(packet2));
4526 mavlink_msg_to_send_buffer(buffer, &msg);
4527 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4528 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4530 mavlink_msg_vision_position_estimate_decode(last_msg, &packet2);
4531 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4533 memset(&packet2, 0, sizeof(packet2));
4534 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 );
4535 mavlink_msg_vision_position_estimate_decode(last_msg, &packet2);
4536 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4539 static void mavlink_test_vision_speed_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4541 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4542 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4543 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE >= 256) {
4544 return;
4546 #endif
4547 mavlink_message_t msg;
4548 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4549 uint16_t i;
4550 mavlink_vision_speed_estimate_t packet_in = {
4551 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
4553 mavlink_vision_speed_estimate_t packet1, packet2;
4554 memset(&packet1, 0, sizeof(packet1));
4555 packet1.usec = packet_in.usec;
4556 packet1.x = packet_in.x;
4557 packet1.y = packet_in.y;
4558 packet1.z = packet_in.z;
4559 packet1.reset_counter = packet_in.reset_counter;
4561 mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*9);
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_VISION_SPEED_ESTIMATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN);
4568 #endif
4569 memset(&packet2, 0, sizeof(packet2));
4570 mavlink_msg_vision_speed_estimate_encode(system_id, component_id, &msg, &packet1);
4571 mavlink_msg_vision_speed_estimate_decode(&msg, &packet2);
4572 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4574 memset(&packet2, 0, sizeof(packet2));
4575 mavlink_msg_vision_speed_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.covariance , packet1.reset_counter );
4576 mavlink_msg_vision_speed_estimate_decode(&msg, &packet2);
4577 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4579 memset(&packet2, 0, sizeof(packet2));
4580 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 );
4581 mavlink_msg_vision_speed_estimate_decode(&msg, &packet2);
4582 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
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]);
4589 mavlink_msg_vision_speed_estimate_decode(last_msg, &packet2);
4590 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4592 memset(&packet2, 0, sizeof(packet2));
4593 mavlink_msg_vision_speed_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.covariance , packet1.reset_counter );
4594 mavlink_msg_vision_speed_estimate_decode(last_msg, &packet2);
4595 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4598 static void mavlink_test_vicon_position_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4600 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4601 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4602 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE >= 256) {
4603 return;
4605 #endif
4606 mavlink_message_t msg;
4607 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4608 uint16_t i;
4609 mavlink_vicon_position_estimate_t packet_in = {
4610 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 }
4612 mavlink_vicon_position_estimate_t packet1, packet2;
4613 memset(&packet1, 0, sizeof(packet1));
4614 packet1.usec = packet_in.usec;
4615 packet1.x = packet_in.x;
4616 packet1.y = packet_in.y;
4617 packet1.z = packet_in.z;
4618 packet1.roll = packet_in.roll;
4619 packet1.pitch = packet_in.pitch;
4620 packet1.yaw = packet_in.yaw;
4622 mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*21);
4624 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4625 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4626 // cope with extensions
4627 memset(MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN);
4629 #endif
4630 memset(&packet2, 0, sizeof(packet2));
4631 mavlink_msg_vicon_position_estimate_encode(system_id, component_id, &msg, &packet1);
4632 mavlink_msg_vicon_position_estimate_decode(&msg, &packet2);
4633 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4635 memset(&packet2, 0, sizeof(packet2));
4636 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 );
4637 mavlink_msg_vicon_position_estimate_decode(&msg, &packet2);
4638 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4640 memset(&packet2, 0, sizeof(packet2));
4641 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 );
4642 mavlink_msg_vicon_position_estimate_decode(&msg, &packet2);
4643 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4645 memset(&packet2, 0, sizeof(packet2));
4646 mavlink_msg_to_send_buffer(buffer, &msg);
4647 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4648 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4650 mavlink_msg_vicon_position_estimate_decode(last_msg, &packet2);
4651 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4653 memset(&packet2, 0, sizeof(packet2));
4654 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 );
4655 mavlink_msg_vicon_position_estimate_decode(last_msg, &packet2);
4656 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4659 static void mavlink_test_highres_imu(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4661 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4662 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4663 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIGHRES_IMU >= 256) {
4664 return;
4666 #endif
4667 mavlink_message_t msg;
4668 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4669 uint16_t i;
4670 mavlink_highres_imu_t packet_in = {
4671 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
4673 mavlink_highres_imu_t packet1, packet2;
4674 memset(&packet1, 0, sizeof(packet1));
4675 packet1.time_usec = packet_in.time_usec;
4676 packet1.xacc = packet_in.xacc;
4677 packet1.yacc = packet_in.yacc;
4678 packet1.zacc = packet_in.zacc;
4679 packet1.xgyro = packet_in.xgyro;
4680 packet1.ygyro = packet_in.ygyro;
4681 packet1.zgyro = packet_in.zgyro;
4682 packet1.xmag = packet_in.xmag;
4683 packet1.ymag = packet_in.ymag;
4684 packet1.zmag = packet_in.zmag;
4685 packet1.abs_pressure = packet_in.abs_pressure;
4686 packet1.diff_pressure = packet_in.diff_pressure;
4687 packet1.pressure_alt = packet_in.pressure_alt;
4688 packet1.temperature = packet_in.temperature;
4689 packet1.fields_updated = packet_in.fields_updated;
4690 packet1.id = packet_in.id;
4693 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4694 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4695 // cope with extensions
4696 memset(MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN);
4698 #endif
4699 memset(&packet2, 0, sizeof(packet2));
4700 mavlink_msg_highres_imu_encode(system_id, component_id, &msg, &packet1);
4701 mavlink_msg_highres_imu_decode(&msg, &packet2);
4702 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4704 memset(&packet2, 0, sizeof(packet2));
4705 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 );
4706 mavlink_msg_highres_imu_decode(&msg, &packet2);
4707 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4709 memset(&packet2, 0, sizeof(packet2));
4710 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 );
4711 mavlink_msg_highres_imu_decode(&msg, &packet2);
4712 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4714 memset(&packet2, 0, sizeof(packet2));
4715 mavlink_msg_to_send_buffer(buffer, &msg);
4716 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4717 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4719 mavlink_msg_highres_imu_decode(last_msg, &packet2);
4720 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4722 memset(&packet2, 0, sizeof(packet2));
4723 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 );
4724 mavlink_msg_highres_imu_decode(last_msg, &packet2);
4725 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4728 static void mavlink_test_optical_flow_rad(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4730 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4731 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4732 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPTICAL_FLOW_RAD >= 256) {
4733 return;
4735 #endif
4736 mavlink_message_t msg;
4737 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4738 uint16_t i;
4739 mavlink_optical_flow_rad_t packet_in = {
4740 93372036854775807ULL,963497880,101.0,129.0,157.0,185.0,213.0,963499128,269.0,19315,3,70
4742 mavlink_optical_flow_rad_t packet1, packet2;
4743 memset(&packet1, 0, sizeof(packet1));
4744 packet1.time_usec = packet_in.time_usec;
4745 packet1.integration_time_us = packet_in.integration_time_us;
4746 packet1.integrated_x = packet_in.integrated_x;
4747 packet1.integrated_y = packet_in.integrated_y;
4748 packet1.integrated_xgyro = packet_in.integrated_xgyro;
4749 packet1.integrated_ygyro = packet_in.integrated_ygyro;
4750 packet1.integrated_zgyro = packet_in.integrated_zgyro;
4751 packet1.time_delta_distance_us = packet_in.time_delta_distance_us;
4752 packet1.distance = packet_in.distance;
4753 packet1.temperature = packet_in.temperature;
4754 packet1.sensor_id = packet_in.sensor_id;
4755 packet1.quality = packet_in.quality;
4758 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4759 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4760 // cope with extensions
4761 memset(MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN);
4763 #endif
4764 memset(&packet2, 0, sizeof(packet2));
4765 mavlink_msg_optical_flow_rad_encode(system_id, component_id, &msg, &packet1);
4766 mavlink_msg_optical_flow_rad_decode(&msg, &packet2);
4767 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4769 memset(&packet2, 0, sizeof(packet2));
4770 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 );
4771 mavlink_msg_optical_flow_rad_decode(&msg, &packet2);
4772 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4774 memset(&packet2, 0, sizeof(packet2));
4775 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 );
4776 mavlink_msg_optical_flow_rad_decode(&msg, &packet2);
4777 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4779 memset(&packet2, 0, sizeof(packet2));
4780 mavlink_msg_to_send_buffer(buffer, &msg);
4781 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4782 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4784 mavlink_msg_optical_flow_rad_decode(last_msg, &packet2);
4785 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4787 memset(&packet2, 0, sizeof(packet2));
4788 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 );
4789 mavlink_msg_optical_flow_rad_decode(last_msg, &packet2);
4790 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4793 static void mavlink_test_hil_sensor(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4795 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4796 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4797 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_SENSOR >= 256) {
4798 return;
4800 #endif
4801 mavlink_message_t msg;
4802 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4803 uint16_t i;
4804 mavlink_hil_sensor_t packet_in = {
4805 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
4807 mavlink_hil_sensor_t packet1, packet2;
4808 memset(&packet1, 0, sizeof(packet1));
4809 packet1.time_usec = packet_in.time_usec;
4810 packet1.xacc = packet_in.xacc;
4811 packet1.yacc = packet_in.yacc;
4812 packet1.zacc = packet_in.zacc;
4813 packet1.xgyro = packet_in.xgyro;
4814 packet1.ygyro = packet_in.ygyro;
4815 packet1.zgyro = packet_in.zgyro;
4816 packet1.xmag = packet_in.xmag;
4817 packet1.ymag = packet_in.ymag;
4818 packet1.zmag = packet_in.zmag;
4819 packet1.abs_pressure = packet_in.abs_pressure;
4820 packet1.diff_pressure = packet_in.diff_pressure;
4821 packet1.pressure_alt = packet_in.pressure_alt;
4822 packet1.temperature = packet_in.temperature;
4823 packet1.fields_updated = packet_in.fields_updated;
4824 packet1.id = packet_in.id;
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_HIL_SENSOR_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN);
4832 #endif
4833 memset(&packet2, 0, sizeof(packet2));
4834 mavlink_msg_hil_sensor_encode(system_id, component_id, &msg, &packet1);
4835 mavlink_msg_hil_sensor_decode(&msg, &packet2);
4836 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4838 memset(&packet2, 0, sizeof(packet2));
4839 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 );
4840 mavlink_msg_hil_sensor_decode(&msg, &packet2);
4841 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4843 memset(&packet2, 0, sizeof(packet2));
4844 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 );
4845 mavlink_msg_hil_sensor_decode(&msg, &packet2);
4846 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
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]);
4853 mavlink_msg_hil_sensor_decode(last_msg, &packet2);
4854 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4856 memset(&packet2, 0, sizeof(packet2));
4857 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 );
4858 mavlink_msg_hil_sensor_decode(last_msg, &packet2);
4859 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4862 static void mavlink_test_sim_state(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4864 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4865 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4866 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SIM_STATE >= 256) {
4867 return;
4869 #endif
4870 mavlink_message_t msg;
4871 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4872 uint16_t i;
4873 mavlink_sim_state_t packet_in = {
4874 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
4876 mavlink_sim_state_t packet1, packet2;
4877 memset(&packet1, 0, sizeof(packet1));
4878 packet1.q1 = packet_in.q1;
4879 packet1.q2 = packet_in.q2;
4880 packet1.q3 = packet_in.q3;
4881 packet1.q4 = packet_in.q4;
4882 packet1.roll = packet_in.roll;
4883 packet1.pitch = packet_in.pitch;
4884 packet1.yaw = packet_in.yaw;
4885 packet1.xacc = packet_in.xacc;
4886 packet1.yacc = packet_in.yacc;
4887 packet1.zacc = packet_in.zacc;
4888 packet1.xgyro = packet_in.xgyro;
4889 packet1.ygyro = packet_in.ygyro;
4890 packet1.zgyro = packet_in.zgyro;
4891 packet1.lat = packet_in.lat;
4892 packet1.lon = packet_in.lon;
4893 packet1.alt = packet_in.alt;
4894 packet1.std_dev_horz = packet_in.std_dev_horz;
4895 packet1.std_dev_vert = packet_in.std_dev_vert;
4896 packet1.vn = packet_in.vn;
4897 packet1.ve = packet_in.ve;
4898 packet1.vd = packet_in.vd;
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_SIM_STATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SIM_STATE_MIN_LEN);
4906 #endif
4907 memset(&packet2, 0, sizeof(packet2));
4908 mavlink_msg_sim_state_encode(system_id, component_id, &msg, &packet1);
4909 mavlink_msg_sim_state_decode(&msg, &packet2);
4910 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4912 memset(&packet2, 0, sizeof(packet2));
4913 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 );
4914 mavlink_msg_sim_state_decode(&msg, &packet2);
4915 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4917 memset(&packet2, 0, sizeof(packet2));
4918 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 );
4919 mavlink_msg_sim_state_decode(&msg, &packet2);
4920 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
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]);
4927 mavlink_msg_sim_state_decode(last_msg, &packet2);
4928 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4930 memset(&packet2, 0, sizeof(packet2));
4931 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 );
4932 mavlink_msg_sim_state_decode(last_msg, &packet2);
4933 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4936 static void mavlink_test_radio_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4938 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4939 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4940 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RADIO_STATUS >= 256) {
4941 return;
4943 #endif
4944 mavlink_message_t msg;
4945 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4946 uint16_t i;
4947 mavlink_radio_status_t packet_in = {
4948 17235,17339,17,84,151,218,29
4950 mavlink_radio_status_t packet1, packet2;
4951 memset(&packet1, 0, sizeof(packet1));
4952 packet1.rxerrors = packet_in.rxerrors;
4953 packet1.fixed = packet_in.fixed;
4954 packet1.rssi = packet_in.rssi;
4955 packet1.remrssi = packet_in.remrssi;
4956 packet1.txbuf = packet_in.txbuf;
4957 packet1.noise = packet_in.noise;
4958 packet1.remnoise = packet_in.remnoise;
4961 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4962 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4963 // cope with extensions
4964 memset(MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN);
4966 #endif
4967 memset(&packet2, 0, sizeof(packet2));
4968 mavlink_msg_radio_status_encode(system_id, component_id, &msg, &packet1);
4969 mavlink_msg_radio_status_decode(&msg, &packet2);
4970 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4972 memset(&packet2, 0, sizeof(packet2));
4973 mavlink_msg_radio_status_pack(system_id, component_id, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
4974 mavlink_msg_radio_status_decode(&msg, &packet2);
4975 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4977 memset(&packet2, 0, sizeof(packet2));
4978 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 );
4979 mavlink_msg_radio_status_decode(&msg, &packet2);
4980 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4982 memset(&packet2, 0, sizeof(packet2));
4983 mavlink_msg_to_send_buffer(buffer, &msg);
4984 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4985 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4987 mavlink_msg_radio_status_decode(last_msg, &packet2);
4988 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4990 memset(&packet2, 0, sizeof(packet2));
4991 mavlink_msg_radio_status_send(MAVLINK_COMM_1 , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
4992 mavlink_msg_radio_status_decode(last_msg, &packet2);
4993 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
4996 static void mavlink_test_file_transfer_protocol(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4998 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4999 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5000 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL >= 256) {
5001 return;
5003 #endif
5004 mavlink_message_t msg;
5005 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5006 uint16_t i;
5007 mavlink_file_transfer_protocol_t packet_in = {
5008 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 }
5010 mavlink_file_transfer_protocol_t packet1, packet2;
5011 memset(&packet1, 0, sizeof(packet1));
5012 packet1.target_network = packet_in.target_network;
5013 packet1.target_system = packet_in.target_system;
5014 packet1.target_component = packet_in.target_component;
5016 mav_array_memcpy(packet1.payload, packet_in.payload, sizeof(uint8_t)*251);
5018 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5019 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5020 // cope with extensions
5021 memset(MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN);
5023 #endif
5024 memset(&packet2, 0, sizeof(packet2));
5025 mavlink_msg_file_transfer_protocol_encode(system_id, component_id, &msg, &packet1);
5026 mavlink_msg_file_transfer_protocol_decode(&msg, &packet2);
5027 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5029 memset(&packet2, 0, sizeof(packet2));
5030 mavlink_msg_file_transfer_protocol_pack(system_id, component_id, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.payload );
5031 mavlink_msg_file_transfer_protocol_decode(&msg, &packet2);
5032 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5034 memset(&packet2, 0, sizeof(packet2));
5035 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 );
5036 mavlink_msg_file_transfer_protocol_decode(&msg, &packet2);
5037 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5039 memset(&packet2, 0, sizeof(packet2));
5040 mavlink_msg_to_send_buffer(buffer, &msg);
5041 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5042 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5044 mavlink_msg_file_transfer_protocol_decode(last_msg, &packet2);
5045 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5047 memset(&packet2, 0, sizeof(packet2));
5048 mavlink_msg_file_transfer_protocol_send(MAVLINK_COMM_1 , packet1.target_network , packet1.target_system , packet1.target_component , packet1.payload );
5049 mavlink_msg_file_transfer_protocol_decode(last_msg, &packet2);
5050 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5053 static void mavlink_test_timesync(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5055 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5056 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5057 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TIMESYNC >= 256) {
5058 return;
5060 #endif
5061 mavlink_message_t msg;
5062 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5063 uint16_t i;
5064 mavlink_timesync_t packet_in = {
5065 93372036854775807LL,93372036854776311LL
5067 mavlink_timesync_t packet1, packet2;
5068 memset(&packet1, 0, sizeof(packet1));
5069 packet1.tc1 = packet_in.tc1;
5070 packet1.ts1 = packet_in.ts1;
5073 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5074 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5075 // cope with extensions
5076 memset(MAVLINK_MSG_ID_TIMESYNC_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TIMESYNC_MIN_LEN);
5078 #endif
5079 memset(&packet2, 0, sizeof(packet2));
5080 mavlink_msg_timesync_encode(system_id, component_id, &msg, &packet1);
5081 mavlink_msg_timesync_decode(&msg, &packet2);
5082 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5084 memset(&packet2, 0, sizeof(packet2));
5085 mavlink_msg_timesync_pack(system_id, component_id, &msg , packet1.tc1 , packet1.ts1 );
5086 mavlink_msg_timesync_decode(&msg, &packet2);
5087 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5089 memset(&packet2, 0, sizeof(packet2));
5090 mavlink_msg_timesync_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.tc1 , packet1.ts1 );
5091 mavlink_msg_timesync_decode(&msg, &packet2);
5092 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5094 memset(&packet2, 0, sizeof(packet2));
5095 mavlink_msg_to_send_buffer(buffer, &msg);
5096 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5097 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5099 mavlink_msg_timesync_decode(last_msg, &packet2);
5100 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5102 memset(&packet2, 0, sizeof(packet2));
5103 mavlink_msg_timesync_send(MAVLINK_COMM_1 , packet1.tc1 , packet1.ts1 );
5104 mavlink_msg_timesync_decode(last_msg, &packet2);
5105 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5108 static void mavlink_test_camera_trigger(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5110 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5111 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5112 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_TRIGGER >= 256) {
5113 return;
5115 #endif
5116 mavlink_message_t msg;
5117 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5118 uint16_t i;
5119 mavlink_camera_trigger_t packet_in = {
5120 93372036854775807ULL,963497880
5122 mavlink_camera_trigger_t packet1, packet2;
5123 memset(&packet1, 0, sizeof(packet1));
5124 packet1.time_usec = packet_in.time_usec;
5125 packet1.seq = packet_in.seq;
5128 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5129 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5130 // cope with extensions
5131 memset(MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN);
5133 #endif
5134 memset(&packet2, 0, sizeof(packet2));
5135 mavlink_msg_camera_trigger_encode(system_id, component_id, &msg, &packet1);
5136 mavlink_msg_camera_trigger_decode(&msg, &packet2);
5137 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5139 memset(&packet2, 0, sizeof(packet2));
5140 mavlink_msg_camera_trigger_pack(system_id, component_id, &msg , packet1.time_usec , packet1.seq );
5141 mavlink_msg_camera_trigger_decode(&msg, &packet2);
5142 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5144 memset(&packet2, 0, sizeof(packet2));
5145 mavlink_msg_camera_trigger_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.seq );
5146 mavlink_msg_camera_trigger_decode(&msg, &packet2);
5147 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5149 memset(&packet2, 0, sizeof(packet2));
5150 mavlink_msg_to_send_buffer(buffer, &msg);
5151 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5152 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5154 mavlink_msg_camera_trigger_decode(last_msg, &packet2);
5155 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5157 memset(&packet2, 0, sizeof(packet2));
5158 mavlink_msg_camera_trigger_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.seq );
5159 mavlink_msg_camera_trigger_decode(last_msg, &packet2);
5160 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5163 static void mavlink_test_hil_gps(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5165 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5166 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5167 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_GPS >= 256) {
5168 return;
5170 #endif
5171 mavlink_message_t msg;
5172 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5173 uint16_t i;
5174 mavlink_hil_gps_t packet_in = {
5175 93372036854775807ULL,963497880,963498088,963498296,18275,18379,18483,18587,18691,18795,18899,235,46,113,19159
5177 mavlink_hil_gps_t packet1, packet2;
5178 memset(&packet1, 0, sizeof(packet1));
5179 packet1.time_usec = packet_in.time_usec;
5180 packet1.lat = packet_in.lat;
5181 packet1.lon = packet_in.lon;
5182 packet1.alt = packet_in.alt;
5183 packet1.eph = packet_in.eph;
5184 packet1.epv = packet_in.epv;
5185 packet1.vel = packet_in.vel;
5186 packet1.vn = packet_in.vn;
5187 packet1.ve = packet_in.ve;
5188 packet1.vd = packet_in.vd;
5189 packet1.cog = packet_in.cog;
5190 packet1.fix_type = packet_in.fix_type;
5191 packet1.satellites_visible = packet_in.satellites_visible;
5192 packet1.id = packet_in.id;
5193 packet1.yaw = packet_in.yaw;
5196 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5197 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5198 // cope with extensions
5199 memset(MAVLINK_MSG_ID_HIL_GPS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_GPS_MIN_LEN);
5201 #endif
5202 memset(&packet2, 0, sizeof(packet2));
5203 mavlink_msg_hil_gps_encode(system_id, component_id, &msg, &packet1);
5204 mavlink_msg_hil_gps_decode(&msg, &packet2);
5205 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5207 memset(&packet2, 0, sizeof(packet2));
5208 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 );
5209 mavlink_msg_hil_gps_decode(&msg, &packet2);
5210 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5212 memset(&packet2, 0, sizeof(packet2));
5213 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 );
5214 mavlink_msg_hil_gps_decode(&msg, &packet2);
5215 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5217 memset(&packet2, 0, sizeof(packet2));
5218 mavlink_msg_to_send_buffer(buffer, &msg);
5219 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5220 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5222 mavlink_msg_hil_gps_decode(last_msg, &packet2);
5223 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5225 memset(&packet2, 0, sizeof(packet2));
5226 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 );
5227 mavlink_msg_hil_gps_decode(last_msg, &packet2);
5228 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5231 static void mavlink_test_hil_optical_flow(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
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_HIL_OPTICAL_FLOW >= 256) {
5236 return;
5238 #endif
5239 mavlink_message_t msg;
5240 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5241 uint16_t i;
5242 mavlink_hil_optical_flow_t packet_in = {
5243 93372036854775807ULL,963497880,101.0,129.0,157.0,185.0,213.0,963499128,269.0,19315,3,70
5245 mavlink_hil_optical_flow_t packet1, packet2;
5246 memset(&packet1, 0, sizeof(packet1));
5247 packet1.time_usec = packet_in.time_usec;
5248 packet1.integration_time_us = packet_in.integration_time_us;
5249 packet1.integrated_x = packet_in.integrated_x;
5250 packet1.integrated_y = packet_in.integrated_y;
5251 packet1.integrated_xgyro = packet_in.integrated_xgyro;
5252 packet1.integrated_ygyro = packet_in.integrated_ygyro;
5253 packet1.integrated_zgyro = packet_in.integrated_zgyro;
5254 packet1.time_delta_distance_us = packet_in.time_delta_distance_us;
5255 packet1.distance = packet_in.distance;
5256 packet1.temperature = packet_in.temperature;
5257 packet1.sensor_id = packet_in.sensor_id;
5258 packet1.quality = packet_in.quality;
5261 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5262 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5263 // cope with extensions
5264 memset(MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN);
5266 #endif
5267 memset(&packet2, 0, sizeof(packet2));
5268 mavlink_msg_hil_optical_flow_encode(system_id, component_id, &msg, &packet1);
5269 mavlink_msg_hil_optical_flow_decode(&msg, &packet2);
5270 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5272 memset(&packet2, 0, sizeof(packet2));
5273 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 );
5274 mavlink_msg_hil_optical_flow_decode(&msg, &packet2);
5275 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5277 memset(&packet2, 0, sizeof(packet2));
5278 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 );
5279 mavlink_msg_hil_optical_flow_decode(&msg, &packet2);
5280 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5282 memset(&packet2, 0, sizeof(packet2));
5283 mavlink_msg_to_send_buffer(buffer, &msg);
5284 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5285 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5287 mavlink_msg_hil_optical_flow_decode(last_msg, &packet2);
5288 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5290 memset(&packet2, 0, sizeof(packet2));
5291 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 );
5292 mavlink_msg_hil_optical_flow_decode(last_msg, &packet2);
5293 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5296 static void mavlink_test_hil_state_quaternion(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5298 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5299 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5300 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_STATE_QUATERNION >= 256) {
5301 return;
5303 #endif
5304 mavlink_message_t msg;
5305 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5306 uint16_t i;
5307 mavlink_hil_state_quaternion_t packet_in = {
5308 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
5310 mavlink_hil_state_quaternion_t packet1, packet2;
5311 memset(&packet1, 0, sizeof(packet1));
5312 packet1.time_usec = packet_in.time_usec;
5313 packet1.rollspeed = packet_in.rollspeed;
5314 packet1.pitchspeed = packet_in.pitchspeed;
5315 packet1.yawspeed = packet_in.yawspeed;
5316 packet1.lat = packet_in.lat;
5317 packet1.lon = packet_in.lon;
5318 packet1.alt = packet_in.alt;
5319 packet1.vx = packet_in.vx;
5320 packet1.vy = packet_in.vy;
5321 packet1.vz = packet_in.vz;
5322 packet1.ind_airspeed = packet_in.ind_airspeed;
5323 packet1.true_airspeed = packet_in.true_airspeed;
5324 packet1.xacc = packet_in.xacc;
5325 packet1.yacc = packet_in.yacc;
5326 packet1.zacc = packet_in.zacc;
5328 mav_array_memcpy(packet1.attitude_quaternion, packet_in.attitude_quaternion, sizeof(float)*4);
5330 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5331 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5332 // cope with extensions
5333 memset(MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN);
5335 #endif
5336 memset(&packet2, 0, sizeof(packet2));
5337 mavlink_msg_hil_state_quaternion_encode(system_id, component_id, &msg, &packet1);
5338 mavlink_msg_hil_state_quaternion_decode(&msg, &packet2);
5339 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5341 memset(&packet2, 0, sizeof(packet2));
5342 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 );
5343 mavlink_msg_hil_state_quaternion_decode(&msg, &packet2);
5344 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5346 memset(&packet2, 0, sizeof(packet2));
5347 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 );
5348 mavlink_msg_hil_state_quaternion_decode(&msg, &packet2);
5349 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5351 memset(&packet2, 0, sizeof(packet2));
5352 mavlink_msg_to_send_buffer(buffer, &msg);
5353 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5354 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5356 mavlink_msg_hil_state_quaternion_decode(last_msg, &packet2);
5357 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5359 memset(&packet2, 0, sizeof(packet2));
5360 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 );
5361 mavlink_msg_hil_state_quaternion_decode(last_msg, &packet2);
5362 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5365 static void mavlink_test_scaled_imu2(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5367 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5368 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5369 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_IMU2 >= 256) {
5370 return;
5372 #endif
5373 mavlink_message_t msg;
5374 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5375 uint16_t i;
5376 mavlink_scaled_imu2_t packet_in = {
5377 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275,18379
5379 mavlink_scaled_imu2_t packet1, packet2;
5380 memset(&packet1, 0, sizeof(packet1));
5381 packet1.time_boot_ms = packet_in.time_boot_ms;
5382 packet1.xacc = packet_in.xacc;
5383 packet1.yacc = packet_in.yacc;
5384 packet1.zacc = packet_in.zacc;
5385 packet1.xgyro = packet_in.xgyro;
5386 packet1.ygyro = packet_in.ygyro;
5387 packet1.zgyro = packet_in.zgyro;
5388 packet1.xmag = packet_in.xmag;
5389 packet1.ymag = packet_in.ymag;
5390 packet1.zmag = packet_in.zmag;
5391 packet1.temperature = packet_in.temperature;
5394 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5395 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5396 // cope with extensions
5397 memset(MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN);
5399 #endif
5400 memset(&packet2, 0, sizeof(packet2));
5401 mavlink_msg_scaled_imu2_encode(system_id, component_id, &msg, &packet1);
5402 mavlink_msg_scaled_imu2_decode(&msg, &packet2);
5403 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5405 memset(&packet2, 0, sizeof(packet2));
5406 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 );
5407 mavlink_msg_scaled_imu2_decode(&msg, &packet2);
5408 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5410 memset(&packet2, 0, sizeof(packet2));
5411 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 );
5412 mavlink_msg_scaled_imu2_decode(&msg, &packet2);
5413 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5415 memset(&packet2, 0, sizeof(packet2));
5416 mavlink_msg_to_send_buffer(buffer, &msg);
5417 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5418 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5420 mavlink_msg_scaled_imu2_decode(last_msg, &packet2);
5421 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5423 memset(&packet2, 0, sizeof(packet2));
5424 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 );
5425 mavlink_msg_scaled_imu2_decode(last_msg, &packet2);
5426 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5429 static void mavlink_test_log_request_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5431 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5432 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5433 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_REQUEST_LIST >= 256) {
5434 return;
5436 #endif
5437 mavlink_message_t msg;
5438 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5439 uint16_t i;
5440 mavlink_log_request_list_t packet_in = {
5441 17235,17339,17,84
5443 mavlink_log_request_list_t packet1, packet2;
5444 memset(&packet1, 0, sizeof(packet1));
5445 packet1.start = packet_in.start;
5446 packet1.end = packet_in.end;
5447 packet1.target_system = packet_in.target_system;
5448 packet1.target_component = packet_in.target_component;
5451 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5452 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5453 // cope with extensions
5454 memset(MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN);
5456 #endif
5457 memset(&packet2, 0, sizeof(packet2));
5458 mavlink_msg_log_request_list_encode(system_id, component_id, &msg, &packet1);
5459 mavlink_msg_log_request_list_decode(&msg, &packet2);
5460 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5462 memset(&packet2, 0, sizeof(packet2));
5463 mavlink_msg_log_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.start , packet1.end );
5464 mavlink_msg_log_request_list_decode(&msg, &packet2);
5465 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5467 memset(&packet2, 0, sizeof(packet2));
5468 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 );
5469 mavlink_msg_log_request_list_decode(&msg, &packet2);
5470 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5472 memset(&packet2, 0, sizeof(packet2));
5473 mavlink_msg_to_send_buffer(buffer, &msg);
5474 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5475 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5477 mavlink_msg_log_request_list_decode(last_msg, &packet2);
5478 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5480 memset(&packet2, 0, sizeof(packet2));
5481 mavlink_msg_log_request_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.start , packet1.end );
5482 mavlink_msg_log_request_list_decode(last_msg, &packet2);
5483 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5486 static void mavlink_test_log_entry(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5488 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5489 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5490 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_ENTRY >= 256) {
5491 return;
5493 #endif
5494 mavlink_message_t msg;
5495 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5496 uint16_t i;
5497 mavlink_log_entry_t packet_in = {
5498 963497464,963497672,17651,17755,17859
5500 mavlink_log_entry_t packet1, packet2;
5501 memset(&packet1, 0, sizeof(packet1));
5502 packet1.time_utc = packet_in.time_utc;
5503 packet1.size = packet_in.size;
5504 packet1.id = packet_in.id;
5505 packet1.num_logs = packet_in.num_logs;
5506 packet1.last_log_num = packet_in.last_log_num;
5509 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5510 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5511 // cope with extensions
5512 memset(MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN);
5514 #endif
5515 memset(&packet2, 0, sizeof(packet2));
5516 mavlink_msg_log_entry_encode(system_id, component_id, &msg, &packet1);
5517 mavlink_msg_log_entry_decode(&msg, &packet2);
5518 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5520 memset(&packet2, 0, sizeof(packet2));
5521 mavlink_msg_log_entry_pack(system_id, component_id, &msg , packet1.id , packet1.num_logs , packet1.last_log_num , packet1.time_utc , packet1.size );
5522 mavlink_msg_log_entry_decode(&msg, &packet2);
5523 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5525 memset(&packet2, 0, sizeof(packet2));
5526 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 );
5527 mavlink_msg_log_entry_decode(&msg, &packet2);
5528 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5530 memset(&packet2, 0, sizeof(packet2));
5531 mavlink_msg_to_send_buffer(buffer, &msg);
5532 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5533 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5535 mavlink_msg_log_entry_decode(last_msg, &packet2);
5536 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5538 memset(&packet2, 0, sizeof(packet2));
5539 mavlink_msg_log_entry_send(MAVLINK_COMM_1 , packet1.id , packet1.num_logs , packet1.last_log_num , packet1.time_utc , packet1.size );
5540 mavlink_msg_log_entry_decode(last_msg, &packet2);
5541 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5544 static void mavlink_test_log_request_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5546 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5547 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5548 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_REQUEST_DATA >= 256) {
5549 return;
5551 #endif
5552 mavlink_message_t msg;
5553 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5554 uint16_t i;
5555 mavlink_log_request_data_t packet_in = {
5556 963497464,963497672,17651,163,230
5558 mavlink_log_request_data_t packet1, packet2;
5559 memset(&packet1, 0, sizeof(packet1));
5560 packet1.ofs = packet_in.ofs;
5561 packet1.count = packet_in.count;
5562 packet1.id = packet_in.id;
5563 packet1.target_system = packet_in.target_system;
5564 packet1.target_component = packet_in.target_component;
5567 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5568 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5569 // cope with extensions
5570 memset(MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN);
5572 #endif
5573 memset(&packet2, 0, sizeof(packet2));
5574 mavlink_msg_log_request_data_encode(system_id, component_id, &msg, &packet1);
5575 mavlink_msg_log_request_data_decode(&msg, &packet2);
5576 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5578 memset(&packet2, 0, sizeof(packet2));
5579 mavlink_msg_log_request_data_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id , packet1.ofs , packet1.count );
5580 mavlink_msg_log_request_data_decode(&msg, &packet2);
5581 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5583 memset(&packet2, 0, sizeof(packet2));
5584 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 );
5585 mavlink_msg_log_request_data_decode(&msg, &packet2);
5586 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5588 memset(&packet2, 0, sizeof(packet2));
5589 mavlink_msg_to_send_buffer(buffer, &msg);
5590 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5591 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5593 mavlink_msg_log_request_data_decode(last_msg, &packet2);
5594 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5596 memset(&packet2, 0, sizeof(packet2));
5597 mavlink_msg_log_request_data_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.id , packet1.ofs , packet1.count );
5598 mavlink_msg_log_request_data_decode(last_msg, &packet2);
5599 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5602 static void mavlink_test_log_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5604 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5605 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5606 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_DATA >= 256) {
5607 return;
5609 #endif
5610 mavlink_message_t msg;
5611 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5612 uint16_t i;
5613 mavlink_log_data_t packet_in = {
5614 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 }
5616 mavlink_log_data_t packet1, packet2;
5617 memset(&packet1, 0, sizeof(packet1));
5618 packet1.ofs = packet_in.ofs;
5619 packet1.id = packet_in.id;
5620 packet1.count = packet_in.count;
5622 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*90);
5624 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5625 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5626 // cope with extensions
5627 memset(MAVLINK_MSG_ID_LOG_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_DATA_MIN_LEN);
5629 #endif
5630 memset(&packet2, 0, sizeof(packet2));
5631 mavlink_msg_log_data_encode(system_id, component_id, &msg, &packet1);
5632 mavlink_msg_log_data_decode(&msg, &packet2);
5633 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5635 memset(&packet2, 0, sizeof(packet2));
5636 mavlink_msg_log_data_pack(system_id, component_id, &msg , packet1.id , packet1.ofs , packet1.count , packet1.data );
5637 mavlink_msg_log_data_decode(&msg, &packet2);
5638 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5640 memset(&packet2, 0, sizeof(packet2));
5641 mavlink_msg_log_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.ofs , packet1.count , packet1.data );
5642 mavlink_msg_log_data_decode(&msg, &packet2);
5643 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5645 memset(&packet2, 0, sizeof(packet2));
5646 mavlink_msg_to_send_buffer(buffer, &msg);
5647 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5648 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5650 mavlink_msg_log_data_decode(last_msg, &packet2);
5651 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5653 memset(&packet2, 0, sizeof(packet2));
5654 mavlink_msg_log_data_send(MAVLINK_COMM_1 , packet1.id , packet1.ofs , packet1.count , packet1.data );
5655 mavlink_msg_log_data_decode(last_msg, &packet2);
5656 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5659 static void mavlink_test_log_erase(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5661 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5662 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5663 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_ERASE >= 256) {
5664 return;
5666 #endif
5667 mavlink_message_t msg;
5668 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5669 uint16_t i;
5670 mavlink_log_erase_t packet_in = {
5671 5,72
5673 mavlink_log_erase_t packet1, packet2;
5674 memset(&packet1, 0, sizeof(packet1));
5675 packet1.target_system = packet_in.target_system;
5676 packet1.target_component = packet_in.target_component;
5679 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5680 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5681 // cope with extensions
5682 memset(MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN);
5684 #endif
5685 memset(&packet2, 0, sizeof(packet2));
5686 mavlink_msg_log_erase_encode(system_id, component_id, &msg, &packet1);
5687 mavlink_msg_log_erase_decode(&msg, &packet2);
5688 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5690 memset(&packet2, 0, sizeof(packet2));
5691 mavlink_msg_log_erase_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
5692 mavlink_msg_log_erase_decode(&msg, &packet2);
5693 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5695 memset(&packet2, 0, sizeof(packet2));
5696 mavlink_msg_log_erase_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
5697 mavlink_msg_log_erase_decode(&msg, &packet2);
5698 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5700 memset(&packet2, 0, sizeof(packet2));
5701 mavlink_msg_to_send_buffer(buffer, &msg);
5702 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5703 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5705 mavlink_msg_log_erase_decode(last_msg, &packet2);
5706 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5708 memset(&packet2, 0, sizeof(packet2));
5709 mavlink_msg_log_erase_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
5710 mavlink_msg_log_erase_decode(last_msg, &packet2);
5711 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5714 static void mavlink_test_log_request_end(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5716 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5717 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5718 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_REQUEST_END >= 256) {
5719 return;
5721 #endif
5722 mavlink_message_t msg;
5723 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5724 uint16_t i;
5725 mavlink_log_request_end_t packet_in = {
5726 5,72
5728 mavlink_log_request_end_t packet1, packet2;
5729 memset(&packet1, 0, sizeof(packet1));
5730 packet1.target_system = packet_in.target_system;
5731 packet1.target_component = packet_in.target_component;
5734 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5735 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5736 // cope with extensions
5737 memset(MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN);
5739 #endif
5740 memset(&packet2, 0, sizeof(packet2));
5741 mavlink_msg_log_request_end_encode(system_id, component_id, &msg, &packet1);
5742 mavlink_msg_log_request_end_decode(&msg, &packet2);
5743 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5745 memset(&packet2, 0, sizeof(packet2));
5746 mavlink_msg_log_request_end_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
5747 mavlink_msg_log_request_end_decode(&msg, &packet2);
5748 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5750 memset(&packet2, 0, sizeof(packet2));
5751 mavlink_msg_log_request_end_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
5752 mavlink_msg_log_request_end_decode(&msg, &packet2);
5753 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5755 memset(&packet2, 0, sizeof(packet2));
5756 mavlink_msg_to_send_buffer(buffer, &msg);
5757 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5758 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5760 mavlink_msg_log_request_end_decode(last_msg, &packet2);
5761 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5763 memset(&packet2, 0, sizeof(packet2));
5764 mavlink_msg_log_request_end_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
5765 mavlink_msg_log_request_end_decode(last_msg, &packet2);
5766 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5769 static void mavlink_test_gps_inject_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5771 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5772 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5773 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_INJECT_DATA >= 256) {
5774 return;
5776 #endif
5777 mavlink_message_t msg;
5778 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5779 uint16_t i;
5780 mavlink_gps_inject_data_t packet_in = {
5781 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 }
5783 mavlink_gps_inject_data_t packet1, packet2;
5784 memset(&packet1, 0, sizeof(packet1));
5785 packet1.target_system = packet_in.target_system;
5786 packet1.target_component = packet_in.target_component;
5787 packet1.len = packet_in.len;
5789 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*110);
5791 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5792 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5793 // cope with extensions
5794 memset(MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN);
5796 #endif
5797 memset(&packet2, 0, sizeof(packet2));
5798 mavlink_msg_gps_inject_data_encode(system_id, component_id, &msg, &packet1);
5799 mavlink_msg_gps_inject_data_decode(&msg, &packet2);
5800 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5802 memset(&packet2, 0, sizeof(packet2));
5803 mavlink_msg_gps_inject_data_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.len , packet1.data );
5804 mavlink_msg_gps_inject_data_decode(&msg, &packet2);
5805 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5807 memset(&packet2, 0, sizeof(packet2));
5808 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 );
5809 mavlink_msg_gps_inject_data_decode(&msg, &packet2);
5810 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5812 memset(&packet2, 0, sizeof(packet2));
5813 mavlink_msg_to_send_buffer(buffer, &msg);
5814 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5815 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5817 mavlink_msg_gps_inject_data_decode(last_msg, &packet2);
5818 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5820 memset(&packet2, 0, sizeof(packet2));
5821 mavlink_msg_gps_inject_data_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.len , packet1.data );
5822 mavlink_msg_gps_inject_data_decode(last_msg, &packet2);
5823 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5826 static void mavlink_test_gps2_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
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_GPS2_RAW >= 256) {
5831 return;
5833 #endif
5834 mavlink_message_t msg;
5835 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5836 uint16_t i;
5837 mavlink_gps2_raw_t packet_in = {
5838 93372036854775807ULL,963497880,963498088,963498296,963498504,18483,18587,18691,18795,101,168,235,19055
5840 mavlink_gps2_raw_t packet1, packet2;
5841 memset(&packet1, 0, sizeof(packet1));
5842 packet1.time_usec = packet_in.time_usec;
5843 packet1.lat = packet_in.lat;
5844 packet1.lon = packet_in.lon;
5845 packet1.alt = packet_in.alt;
5846 packet1.dgps_age = packet_in.dgps_age;
5847 packet1.eph = packet_in.eph;
5848 packet1.epv = packet_in.epv;
5849 packet1.vel = packet_in.vel;
5850 packet1.cog = packet_in.cog;
5851 packet1.fix_type = packet_in.fix_type;
5852 packet1.satellites_visible = packet_in.satellites_visible;
5853 packet1.dgps_numch = packet_in.dgps_numch;
5854 packet1.yaw = packet_in.yaw;
5857 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5858 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5859 // cope with extensions
5860 memset(MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN);
5862 #endif
5863 memset(&packet2, 0, sizeof(packet2));
5864 mavlink_msg_gps2_raw_encode(system_id, component_id, &msg, &packet1);
5865 mavlink_msg_gps2_raw_decode(&msg, &packet2);
5866 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5868 memset(&packet2, 0, sizeof(packet2));
5869 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 );
5870 mavlink_msg_gps2_raw_decode(&msg, &packet2);
5871 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5873 memset(&packet2, 0, sizeof(packet2));
5874 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 );
5875 mavlink_msg_gps2_raw_decode(&msg, &packet2);
5876 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5878 memset(&packet2, 0, sizeof(packet2));
5879 mavlink_msg_to_send_buffer(buffer, &msg);
5880 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5881 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5883 mavlink_msg_gps2_raw_decode(last_msg, &packet2);
5884 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5886 memset(&packet2, 0, sizeof(packet2));
5887 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 );
5888 mavlink_msg_gps2_raw_decode(last_msg, &packet2);
5889 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5892 static void mavlink_test_power_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5894 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5895 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5896 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_POWER_STATUS >= 256) {
5897 return;
5899 #endif
5900 mavlink_message_t msg;
5901 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5902 uint16_t i;
5903 mavlink_power_status_t packet_in = {
5904 17235,17339,17443
5906 mavlink_power_status_t packet1, packet2;
5907 memset(&packet1, 0, sizeof(packet1));
5908 packet1.Vcc = packet_in.Vcc;
5909 packet1.Vservo = packet_in.Vservo;
5910 packet1.flags = packet_in.flags;
5913 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5914 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5915 // cope with extensions
5916 memset(MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN);
5918 #endif
5919 memset(&packet2, 0, sizeof(packet2));
5920 mavlink_msg_power_status_encode(system_id, component_id, &msg, &packet1);
5921 mavlink_msg_power_status_decode(&msg, &packet2);
5922 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5924 memset(&packet2, 0, sizeof(packet2));
5925 mavlink_msg_power_status_pack(system_id, component_id, &msg , packet1.Vcc , packet1.Vservo , packet1.flags );
5926 mavlink_msg_power_status_decode(&msg, &packet2);
5927 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5929 memset(&packet2, 0, sizeof(packet2));
5930 mavlink_msg_power_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.Vcc , packet1.Vservo , packet1.flags );
5931 mavlink_msg_power_status_decode(&msg, &packet2);
5932 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5934 memset(&packet2, 0, sizeof(packet2));
5935 mavlink_msg_to_send_buffer(buffer, &msg);
5936 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5937 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5939 mavlink_msg_power_status_decode(last_msg, &packet2);
5940 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5942 memset(&packet2, 0, sizeof(packet2));
5943 mavlink_msg_power_status_send(MAVLINK_COMM_1 , packet1.Vcc , packet1.Vservo , packet1.flags );
5944 mavlink_msg_power_status_decode(last_msg, &packet2);
5945 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5948 static void mavlink_test_serial_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5950 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5951 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5952 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERIAL_CONTROL >= 256) {
5953 return;
5955 #endif
5956 mavlink_message_t msg;
5957 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5958 uint16_t i;
5959 mavlink_serial_control_t packet_in = {
5960 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 }
5962 mavlink_serial_control_t packet1, packet2;
5963 memset(&packet1, 0, sizeof(packet1));
5964 packet1.baudrate = packet_in.baudrate;
5965 packet1.timeout = packet_in.timeout;
5966 packet1.device = packet_in.device;
5967 packet1.flags = packet_in.flags;
5968 packet1.count = packet_in.count;
5970 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*70);
5972 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5973 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5974 // cope with extensions
5975 memset(MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN);
5977 #endif
5978 memset(&packet2, 0, sizeof(packet2));
5979 mavlink_msg_serial_control_encode(system_id, component_id, &msg, &packet1);
5980 mavlink_msg_serial_control_decode(&msg, &packet2);
5981 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5983 memset(&packet2, 0, sizeof(packet2));
5984 mavlink_msg_serial_control_pack(system_id, component_id, &msg , packet1.device , packet1.flags , packet1.timeout , packet1.baudrate , packet1.count , packet1.data );
5985 mavlink_msg_serial_control_decode(&msg, &packet2);
5986 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5988 memset(&packet2, 0, sizeof(packet2));
5989 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 );
5990 mavlink_msg_serial_control_decode(&msg, &packet2);
5991 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
5993 memset(&packet2, 0, sizeof(packet2));
5994 mavlink_msg_to_send_buffer(buffer, &msg);
5995 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5996 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5998 mavlink_msg_serial_control_decode(last_msg, &packet2);
5999 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6001 memset(&packet2, 0, sizeof(packet2));
6002 mavlink_msg_serial_control_send(MAVLINK_COMM_1 , packet1.device , packet1.flags , packet1.timeout , packet1.baudrate , packet1.count , packet1.data );
6003 mavlink_msg_serial_control_decode(last_msg, &packet2);
6004 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6007 static void mavlink_test_gps_rtk(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6009 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6010 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6011 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_RTK >= 256) {
6012 return;
6014 #endif
6015 mavlink_message_t msg;
6016 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6017 uint16_t i;
6018 mavlink_gps_rtk_t packet_in = {
6019 963497464,963497672,963497880,963498088,963498296,963498504,963498712,18691,223,34,101,168,235
6021 mavlink_gps_rtk_t packet1, packet2;
6022 memset(&packet1, 0, sizeof(packet1));
6023 packet1.time_last_baseline_ms = packet_in.time_last_baseline_ms;
6024 packet1.tow = packet_in.tow;
6025 packet1.baseline_a_mm = packet_in.baseline_a_mm;
6026 packet1.baseline_b_mm = packet_in.baseline_b_mm;
6027 packet1.baseline_c_mm = packet_in.baseline_c_mm;
6028 packet1.accuracy = packet_in.accuracy;
6029 packet1.iar_num_hypotheses = packet_in.iar_num_hypotheses;
6030 packet1.wn = packet_in.wn;
6031 packet1.rtk_receiver_id = packet_in.rtk_receiver_id;
6032 packet1.rtk_health = packet_in.rtk_health;
6033 packet1.rtk_rate = packet_in.rtk_rate;
6034 packet1.nsats = packet_in.nsats;
6035 packet1.baseline_coords_type = packet_in.baseline_coords_type;
6038 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6039 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6040 // cope with extensions
6041 memset(MAVLINK_MSG_ID_GPS_RTK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_RTK_MIN_LEN);
6043 #endif
6044 memset(&packet2, 0, sizeof(packet2));
6045 mavlink_msg_gps_rtk_encode(system_id, component_id, &msg, &packet1);
6046 mavlink_msg_gps_rtk_decode(&msg, &packet2);
6047 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6049 memset(&packet2, 0, sizeof(packet2));
6050 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 );
6051 mavlink_msg_gps_rtk_decode(&msg, &packet2);
6052 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6054 memset(&packet2, 0, sizeof(packet2));
6055 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 );
6056 mavlink_msg_gps_rtk_decode(&msg, &packet2);
6057 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6059 memset(&packet2, 0, sizeof(packet2));
6060 mavlink_msg_to_send_buffer(buffer, &msg);
6061 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6062 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6064 mavlink_msg_gps_rtk_decode(last_msg, &packet2);
6065 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6067 memset(&packet2, 0, sizeof(packet2));
6068 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 );
6069 mavlink_msg_gps_rtk_decode(last_msg, &packet2);
6070 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6073 static void mavlink_test_gps2_rtk(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6075 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6076 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6077 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS2_RTK >= 256) {
6078 return;
6080 #endif
6081 mavlink_message_t msg;
6082 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6083 uint16_t i;
6084 mavlink_gps2_rtk_t packet_in = {
6085 963497464,963497672,963497880,963498088,963498296,963498504,963498712,18691,223,34,101,168,235
6087 mavlink_gps2_rtk_t packet1, packet2;
6088 memset(&packet1, 0, sizeof(packet1));
6089 packet1.time_last_baseline_ms = packet_in.time_last_baseline_ms;
6090 packet1.tow = packet_in.tow;
6091 packet1.baseline_a_mm = packet_in.baseline_a_mm;
6092 packet1.baseline_b_mm = packet_in.baseline_b_mm;
6093 packet1.baseline_c_mm = packet_in.baseline_c_mm;
6094 packet1.accuracy = packet_in.accuracy;
6095 packet1.iar_num_hypotheses = packet_in.iar_num_hypotheses;
6096 packet1.wn = packet_in.wn;
6097 packet1.rtk_receiver_id = packet_in.rtk_receiver_id;
6098 packet1.rtk_health = packet_in.rtk_health;
6099 packet1.rtk_rate = packet_in.rtk_rate;
6100 packet1.nsats = packet_in.nsats;
6101 packet1.baseline_coords_type = packet_in.baseline_coords_type;
6104 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6105 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6106 // cope with extensions
6107 memset(MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN);
6109 #endif
6110 memset(&packet2, 0, sizeof(packet2));
6111 mavlink_msg_gps2_rtk_encode(system_id, component_id, &msg, &packet1);
6112 mavlink_msg_gps2_rtk_decode(&msg, &packet2);
6113 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6115 memset(&packet2, 0, sizeof(packet2));
6116 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 );
6117 mavlink_msg_gps2_rtk_decode(&msg, &packet2);
6118 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6120 memset(&packet2, 0, sizeof(packet2));
6121 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 );
6122 mavlink_msg_gps2_rtk_decode(&msg, &packet2);
6123 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6125 memset(&packet2, 0, sizeof(packet2));
6126 mavlink_msg_to_send_buffer(buffer, &msg);
6127 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6128 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6130 mavlink_msg_gps2_rtk_decode(last_msg, &packet2);
6131 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6133 memset(&packet2, 0, sizeof(packet2));
6134 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 );
6135 mavlink_msg_gps2_rtk_decode(last_msg, &packet2);
6136 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6139 static void mavlink_test_scaled_imu3(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6141 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6142 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6143 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_IMU3 >= 256) {
6144 return;
6146 #endif
6147 mavlink_message_t msg;
6148 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6149 uint16_t i;
6150 mavlink_scaled_imu3_t packet_in = {
6151 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275,18379
6153 mavlink_scaled_imu3_t packet1, packet2;
6154 memset(&packet1, 0, sizeof(packet1));
6155 packet1.time_boot_ms = packet_in.time_boot_ms;
6156 packet1.xacc = packet_in.xacc;
6157 packet1.yacc = packet_in.yacc;
6158 packet1.zacc = packet_in.zacc;
6159 packet1.xgyro = packet_in.xgyro;
6160 packet1.ygyro = packet_in.ygyro;
6161 packet1.zgyro = packet_in.zgyro;
6162 packet1.xmag = packet_in.xmag;
6163 packet1.ymag = packet_in.ymag;
6164 packet1.zmag = packet_in.zmag;
6165 packet1.temperature = packet_in.temperature;
6168 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6169 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6170 // cope with extensions
6171 memset(MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN);
6173 #endif
6174 memset(&packet2, 0, sizeof(packet2));
6175 mavlink_msg_scaled_imu3_encode(system_id, component_id, &msg, &packet1);
6176 mavlink_msg_scaled_imu3_decode(&msg, &packet2);
6177 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6179 memset(&packet2, 0, sizeof(packet2));
6180 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 );
6181 mavlink_msg_scaled_imu3_decode(&msg, &packet2);
6182 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6184 memset(&packet2, 0, sizeof(packet2));
6185 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 );
6186 mavlink_msg_scaled_imu3_decode(&msg, &packet2);
6187 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6189 memset(&packet2, 0, sizeof(packet2));
6190 mavlink_msg_to_send_buffer(buffer, &msg);
6191 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6192 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6194 mavlink_msg_scaled_imu3_decode(last_msg, &packet2);
6195 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6197 memset(&packet2, 0, sizeof(packet2));
6198 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 );
6199 mavlink_msg_scaled_imu3_decode(last_msg, &packet2);
6200 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6203 static void mavlink_test_data_transmission_handshake(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6205 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6206 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6207 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE >= 256) {
6208 return;
6210 #endif
6211 mavlink_message_t msg;
6212 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6213 uint16_t i;
6214 mavlink_data_transmission_handshake_t packet_in = {
6215 963497464,17443,17547,17651,163,230,41
6217 mavlink_data_transmission_handshake_t packet1, packet2;
6218 memset(&packet1, 0, sizeof(packet1));
6219 packet1.size = packet_in.size;
6220 packet1.width = packet_in.width;
6221 packet1.height = packet_in.height;
6222 packet1.packets = packet_in.packets;
6223 packet1.type = packet_in.type;
6224 packet1.payload = packet_in.payload;
6225 packet1.jpg_quality = packet_in.jpg_quality;
6228 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6229 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6230 // cope with extensions
6231 memset(MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN);
6233 #endif
6234 memset(&packet2, 0, sizeof(packet2));
6235 mavlink_msg_data_transmission_handshake_encode(system_id, component_id, &msg, &packet1);
6236 mavlink_msg_data_transmission_handshake_decode(&msg, &packet2);
6237 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6239 memset(&packet2, 0, sizeof(packet2));
6240 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 );
6241 mavlink_msg_data_transmission_handshake_decode(&msg, &packet2);
6242 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6244 memset(&packet2, 0, sizeof(packet2));
6245 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 );
6246 mavlink_msg_data_transmission_handshake_decode(&msg, &packet2);
6247 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6249 memset(&packet2, 0, sizeof(packet2));
6250 mavlink_msg_to_send_buffer(buffer, &msg);
6251 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6252 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6254 mavlink_msg_data_transmission_handshake_decode(last_msg, &packet2);
6255 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6257 memset(&packet2, 0, sizeof(packet2));
6258 mavlink_msg_data_transmission_handshake_send(MAVLINK_COMM_1 , packet1.type , packet1.size , packet1.width , packet1.height , packet1.packets , packet1.payload , packet1.jpg_quality );
6259 mavlink_msg_data_transmission_handshake_decode(last_msg, &packet2);
6260 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6263 static void mavlink_test_encapsulated_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6265 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6266 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6267 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ENCAPSULATED_DATA >= 256) {
6268 return;
6270 #endif
6271 mavlink_message_t msg;
6272 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6273 uint16_t i;
6274 mavlink_encapsulated_data_t packet_in = {
6275 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 }
6277 mavlink_encapsulated_data_t packet1, packet2;
6278 memset(&packet1, 0, sizeof(packet1));
6279 packet1.seqnr = packet_in.seqnr;
6281 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*253);
6283 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6284 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6285 // cope with extensions
6286 memset(MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN);
6288 #endif
6289 memset(&packet2, 0, sizeof(packet2));
6290 mavlink_msg_encapsulated_data_encode(system_id, component_id, &msg, &packet1);
6291 mavlink_msg_encapsulated_data_decode(&msg, &packet2);
6292 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6294 memset(&packet2, 0, sizeof(packet2));
6295 mavlink_msg_encapsulated_data_pack(system_id, component_id, &msg , packet1.seqnr , packet1.data );
6296 mavlink_msg_encapsulated_data_decode(&msg, &packet2);
6297 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6299 memset(&packet2, 0, sizeof(packet2));
6300 mavlink_msg_encapsulated_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seqnr , packet1.data );
6301 mavlink_msg_encapsulated_data_decode(&msg, &packet2);
6302 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6304 memset(&packet2, 0, sizeof(packet2));
6305 mavlink_msg_to_send_buffer(buffer, &msg);
6306 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6307 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6309 mavlink_msg_encapsulated_data_decode(last_msg, &packet2);
6310 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6312 memset(&packet2, 0, sizeof(packet2));
6313 mavlink_msg_encapsulated_data_send(MAVLINK_COMM_1 , packet1.seqnr , packet1.data );
6314 mavlink_msg_encapsulated_data_decode(last_msg, &packet2);
6315 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6318 static void mavlink_test_distance_sensor(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6320 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6321 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6322 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DISTANCE_SENSOR >= 256) {
6323 return;
6325 #endif
6326 mavlink_message_t msg;
6327 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6328 uint16_t i;
6329 mavlink_distance_sensor_t packet_in = {
6330 963497464,17443,17547,17651,163,230,41,108,115.0,143.0,{ 171.0, 172.0, 173.0, 174.0 },247
6332 mavlink_distance_sensor_t packet1, packet2;
6333 memset(&packet1, 0, sizeof(packet1));
6334 packet1.time_boot_ms = packet_in.time_boot_ms;
6335 packet1.min_distance = packet_in.min_distance;
6336 packet1.max_distance = packet_in.max_distance;
6337 packet1.current_distance = packet_in.current_distance;
6338 packet1.type = packet_in.type;
6339 packet1.id = packet_in.id;
6340 packet1.orientation = packet_in.orientation;
6341 packet1.covariance = packet_in.covariance;
6342 packet1.horizontal_fov = packet_in.horizontal_fov;
6343 packet1.vertical_fov = packet_in.vertical_fov;
6344 packet1.signal_quality = packet_in.signal_quality;
6346 mav_array_memcpy(packet1.quaternion, packet_in.quaternion, sizeof(float)*4);
6348 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6349 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6350 // cope with extensions
6351 memset(MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN);
6353 #endif
6354 memset(&packet2, 0, sizeof(packet2));
6355 mavlink_msg_distance_sensor_encode(system_id, component_id, &msg, &packet1);
6356 mavlink_msg_distance_sensor_decode(&msg, &packet2);
6357 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6359 memset(&packet2, 0, sizeof(packet2));
6360 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 );
6361 mavlink_msg_distance_sensor_decode(&msg, &packet2);
6362 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6364 memset(&packet2, 0, sizeof(packet2));
6365 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 );
6366 mavlink_msg_distance_sensor_decode(&msg, &packet2);
6367 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6369 memset(&packet2, 0, sizeof(packet2));
6370 mavlink_msg_to_send_buffer(buffer, &msg);
6371 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6372 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6374 mavlink_msg_distance_sensor_decode(last_msg, &packet2);
6375 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6377 memset(&packet2, 0, sizeof(packet2));
6378 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 );
6379 mavlink_msg_distance_sensor_decode(last_msg, &packet2);
6380 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6383 static void mavlink_test_terrain_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6385 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6386 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6387 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TERRAIN_REQUEST >= 256) {
6388 return;
6390 #endif
6391 mavlink_message_t msg;
6392 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6393 uint16_t i;
6394 mavlink_terrain_request_t packet_in = {
6395 93372036854775807ULL,963497880,963498088,18067
6397 mavlink_terrain_request_t packet1, packet2;
6398 memset(&packet1, 0, sizeof(packet1));
6399 packet1.mask = packet_in.mask;
6400 packet1.lat = packet_in.lat;
6401 packet1.lon = packet_in.lon;
6402 packet1.grid_spacing = packet_in.grid_spacing;
6405 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6406 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6407 // cope with extensions
6408 memset(MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN);
6410 #endif
6411 memset(&packet2, 0, sizeof(packet2));
6412 mavlink_msg_terrain_request_encode(system_id, component_id, &msg, &packet1);
6413 mavlink_msg_terrain_request_decode(&msg, &packet2);
6414 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6416 memset(&packet2, 0, sizeof(packet2));
6417 mavlink_msg_terrain_request_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.mask );
6418 mavlink_msg_terrain_request_decode(&msg, &packet2);
6419 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6421 memset(&packet2, 0, sizeof(packet2));
6422 mavlink_msg_terrain_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.mask );
6423 mavlink_msg_terrain_request_decode(&msg, &packet2);
6424 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6426 memset(&packet2, 0, sizeof(packet2));
6427 mavlink_msg_to_send_buffer(buffer, &msg);
6428 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6429 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6431 mavlink_msg_terrain_request_decode(last_msg, &packet2);
6432 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6434 memset(&packet2, 0, sizeof(packet2));
6435 mavlink_msg_terrain_request_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.mask );
6436 mavlink_msg_terrain_request_decode(last_msg, &packet2);
6437 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6440 static void mavlink_test_terrain_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6442 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6443 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6444 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TERRAIN_DATA >= 256) {
6445 return;
6447 #endif
6448 mavlink_message_t msg;
6449 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6450 uint16_t i;
6451 mavlink_terrain_data_t packet_in = {
6452 963497464,963497672,17651,{ 17755, 17756, 17757, 17758, 17759, 17760, 17761, 17762, 17763, 17764, 17765, 17766, 17767, 17768, 17769, 17770 },3
6454 mavlink_terrain_data_t packet1, packet2;
6455 memset(&packet1, 0, sizeof(packet1));
6456 packet1.lat = packet_in.lat;
6457 packet1.lon = packet_in.lon;
6458 packet1.grid_spacing = packet_in.grid_spacing;
6459 packet1.gridbit = packet_in.gridbit;
6461 mav_array_memcpy(packet1.data, packet_in.data, sizeof(int16_t)*16);
6463 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6464 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6465 // cope with extensions
6466 memset(MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN);
6468 #endif
6469 memset(&packet2, 0, sizeof(packet2));
6470 mavlink_msg_terrain_data_encode(system_id, component_id, &msg, &packet1);
6471 mavlink_msg_terrain_data_decode(&msg, &packet2);
6472 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6474 memset(&packet2, 0, sizeof(packet2));
6475 mavlink_msg_terrain_data_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.gridbit , packet1.data );
6476 mavlink_msg_terrain_data_decode(&msg, &packet2);
6477 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6479 memset(&packet2, 0, sizeof(packet2));
6480 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 );
6481 mavlink_msg_terrain_data_decode(&msg, &packet2);
6482 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6484 memset(&packet2, 0, sizeof(packet2));
6485 mavlink_msg_to_send_buffer(buffer, &msg);
6486 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6487 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6489 mavlink_msg_terrain_data_decode(last_msg, &packet2);
6490 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6492 memset(&packet2, 0, sizeof(packet2));
6493 mavlink_msg_terrain_data_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.gridbit , packet1.data );
6494 mavlink_msg_terrain_data_decode(last_msg, &packet2);
6495 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6498 static void mavlink_test_terrain_check(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6500 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6501 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6502 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TERRAIN_CHECK >= 256) {
6503 return;
6505 #endif
6506 mavlink_message_t msg;
6507 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6508 uint16_t i;
6509 mavlink_terrain_check_t packet_in = {
6510 963497464,963497672
6512 mavlink_terrain_check_t packet1, packet2;
6513 memset(&packet1, 0, sizeof(packet1));
6514 packet1.lat = packet_in.lat;
6515 packet1.lon = packet_in.lon;
6518 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6519 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6520 // cope with extensions
6521 memset(MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN);
6523 #endif
6524 memset(&packet2, 0, sizeof(packet2));
6525 mavlink_msg_terrain_check_encode(system_id, component_id, &msg, &packet1);
6526 mavlink_msg_terrain_check_decode(&msg, &packet2);
6527 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6529 memset(&packet2, 0, sizeof(packet2));
6530 mavlink_msg_terrain_check_pack(system_id, component_id, &msg , packet1.lat , packet1.lon );
6531 mavlink_msg_terrain_check_decode(&msg, &packet2);
6532 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6534 memset(&packet2, 0, sizeof(packet2));
6535 mavlink_msg_terrain_check_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon );
6536 mavlink_msg_terrain_check_decode(&msg, &packet2);
6537 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6539 memset(&packet2, 0, sizeof(packet2));
6540 mavlink_msg_to_send_buffer(buffer, &msg);
6541 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6542 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6544 mavlink_msg_terrain_check_decode(last_msg, &packet2);
6545 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6547 memset(&packet2, 0, sizeof(packet2));
6548 mavlink_msg_terrain_check_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon );
6549 mavlink_msg_terrain_check_decode(last_msg, &packet2);
6550 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6553 static void mavlink_test_terrain_report(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6555 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6556 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6557 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TERRAIN_REPORT >= 256) {
6558 return;
6560 #endif
6561 mavlink_message_t msg;
6562 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6563 uint16_t i;
6564 mavlink_terrain_report_t packet_in = {
6565 963497464,963497672,73.0,101.0,18067,18171,18275
6567 mavlink_terrain_report_t packet1, packet2;
6568 memset(&packet1, 0, sizeof(packet1));
6569 packet1.lat = packet_in.lat;
6570 packet1.lon = packet_in.lon;
6571 packet1.terrain_height = packet_in.terrain_height;
6572 packet1.current_height = packet_in.current_height;
6573 packet1.spacing = packet_in.spacing;
6574 packet1.pending = packet_in.pending;
6575 packet1.loaded = packet_in.loaded;
6578 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6579 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6580 // cope with extensions
6581 memset(MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN);
6583 #endif
6584 memset(&packet2, 0, sizeof(packet2));
6585 mavlink_msg_terrain_report_encode(system_id, component_id, &msg, &packet1);
6586 mavlink_msg_terrain_report_decode(&msg, &packet2);
6587 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6589 memset(&packet2, 0, sizeof(packet2));
6590 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 );
6591 mavlink_msg_terrain_report_decode(&msg, &packet2);
6592 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6594 memset(&packet2, 0, sizeof(packet2));
6595 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 );
6596 mavlink_msg_terrain_report_decode(&msg, &packet2);
6597 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6599 memset(&packet2, 0, sizeof(packet2));
6600 mavlink_msg_to_send_buffer(buffer, &msg);
6601 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6602 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6604 mavlink_msg_terrain_report_decode(last_msg, &packet2);
6605 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6607 memset(&packet2, 0, sizeof(packet2));
6608 mavlink_msg_terrain_report_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon , packet1.spacing , packet1.terrain_height , packet1.current_height , packet1.pending , packet1.loaded );
6609 mavlink_msg_terrain_report_decode(last_msg, &packet2);
6610 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6613 static void mavlink_test_scaled_pressure2(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6615 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6616 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6617 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_PRESSURE2 >= 256) {
6618 return;
6620 #endif
6621 mavlink_message_t msg;
6622 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6623 uint16_t i;
6624 mavlink_scaled_pressure2_t packet_in = {
6625 963497464,45.0,73.0,17859,17963
6627 mavlink_scaled_pressure2_t packet1, packet2;
6628 memset(&packet1, 0, sizeof(packet1));
6629 packet1.time_boot_ms = packet_in.time_boot_ms;
6630 packet1.press_abs = packet_in.press_abs;
6631 packet1.press_diff = packet_in.press_diff;
6632 packet1.temperature = packet_in.temperature;
6633 packet1.temperature_press_diff = packet_in.temperature_press_diff;
6636 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6637 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6638 // cope with extensions
6639 memset(MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN);
6641 #endif
6642 memset(&packet2, 0, sizeof(packet2));
6643 mavlink_msg_scaled_pressure2_encode(system_id, component_id, &msg, &packet1);
6644 mavlink_msg_scaled_pressure2_decode(&msg, &packet2);
6645 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6647 memset(&packet2, 0, sizeof(packet2));
6648 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 );
6649 mavlink_msg_scaled_pressure2_decode(&msg, &packet2);
6650 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6652 memset(&packet2, 0, sizeof(packet2));
6653 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 );
6654 mavlink_msg_scaled_pressure2_decode(&msg, &packet2);
6655 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6657 memset(&packet2, 0, sizeof(packet2));
6658 mavlink_msg_to_send_buffer(buffer, &msg);
6659 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6660 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6662 mavlink_msg_scaled_pressure2_decode(last_msg, &packet2);
6663 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6665 memset(&packet2, 0, sizeof(packet2));
6666 mavlink_msg_scaled_pressure2_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature , packet1.temperature_press_diff );
6667 mavlink_msg_scaled_pressure2_decode(last_msg, &packet2);
6668 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6671 static void mavlink_test_att_pos_mocap(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6673 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6674 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6675 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATT_POS_MOCAP >= 256) {
6676 return;
6678 #endif
6679 mavlink_message_t msg;
6680 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6681 uint16_t i;
6682 mavlink_att_pos_mocap_t packet_in = {
6683 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 }
6685 mavlink_att_pos_mocap_t packet1, packet2;
6686 memset(&packet1, 0, sizeof(packet1));
6687 packet1.time_usec = packet_in.time_usec;
6688 packet1.x = packet_in.x;
6689 packet1.y = packet_in.y;
6690 packet1.z = packet_in.z;
6692 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
6693 mav_array_memcpy(packet1.covariance, packet_in.covariance, sizeof(float)*21);
6695 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6696 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6697 // cope with extensions
6698 memset(MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN);
6700 #endif
6701 memset(&packet2, 0, sizeof(packet2));
6702 mavlink_msg_att_pos_mocap_encode(system_id, component_id, &msg, &packet1);
6703 mavlink_msg_att_pos_mocap_decode(&msg, &packet2);
6704 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6706 memset(&packet2, 0, sizeof(packet2));
6707 mavlink_msg_att_pos_mocap_pack(system_id, component_id, &msg , packet1.time_usec , packet1.q , packet1.x , packet1.y , packet1.z , packet1.covariance );
6708 mavlink_msg_att_pos_mocap_decode(&msg, &packet2);
6709 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6711 memset(&packet2, 0, sizeof(packet2));
6712 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 );
6713 mavlink_msg_att_pos_mocap_decode(&msg, &packet2);
6714 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6716 memset(&packet2, 0, sizeof(packet2));
6717 mavlink_msg_to_send_buffer(buffer, &msg);
6718 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6719 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6721 mavlink_msg_att_pos_mocap_decode(last_msg, &packet2);
6722 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6724 memset(&packet2, 0, sizeof(packet2));
6725 mavlink_msg_att_pos_mocap_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.q , packet1.x , packet1.y , packet1.z , packet1.covariance );
6726 mavlink_msg_att_pos_mocap_decode(last_msg, &packet2);
6727 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6730 static void mavlink_test_set_actuator_control_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6732 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6733 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6734 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET >= 256) {
6735 return;
6737 #endif
6738 mavlink_message_t msg;
6739 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6740 uint16_t i;
6741 mavlink_set_actuator_control_target_t packet_in = {
6742 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0, 77.0, 78.0, 79.0, 80.0 },125,192,3
6744 mavlink_set_actuator_control_target_t packet1, packet2;
6745 memset(&packet1, 0, sizeof(packet1));
6746 packet1.time_usec = packet_in.time_usec;
6747 packet1.group_mlx = packet_in.group_mlx;
6748 packet1.target_system = packet_in.target_system;
6749 packet1.target_component = packet_in.target_component;
6751 mav_array_memcpy(packet1.controls, packet_in.controls, sizeof(float)*8);
6753 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6754 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6755 // cope with extensions
6756 memset(MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN);
6758 #endif
6759 memset(&packet2, 0, sizeof(packet2));
6760 mavlink_msg_set_actuator_control_target_encode(system_id, component_id, &msg, &packet1);
6761 mavlink_msg_set_actuator_control_target_decode(&msg, &packet2);
6762 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6764 memset(&packet2, 0, sizeof(packet2));
6765 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 );
6766 mavlink_msg_set_actuator_control_target_decode(&msg, &packet2);
6767 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6769 memset(&packet2, 0, sizeof(packet2));
6770 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 );
6771 mavlink_msg_set_actuator_control_target_decode(&msg, &packet2);
6772 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6774 memset(&packet2, 0, sizeof(packet2));
6775 mavlink_msg_to_send_buffer(buffer, &msg);
6776 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6777 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6779 mavlink_msg_set_actuator_control_target_decode(last_msg, &packet2);
6780 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6782 memset(&packet2, 0, sizeof(packet2));
6783 mavlink_msg_set_actuator_control_target_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.group_mlx , packet1.target_system , packet1.target_component , packet1.controls );
6784 mavlink_msg_set_actuator_control_target_decode(last_msg, &packet2);
6785 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6788 static void mavlink_test_actuator_control_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6790 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6791 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6792 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET >= 256) {
6793 return;
6795 #endif
6796 mavlink_message_t msg;
6797 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6798 uint16_t i;
6799 mavlink_actuator_control_target_t packet_in = {
6800 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0, 77.0, 78.0, 79.0, 80.0 },125
6802 mavlink_actuator_control_target_t packet1, packet2;
6803 memset(&packet1, 0, sizeof(packet1));
6804 packet1.time_usec = packet_in.time_usec;
6805 packet1.group_mlx = packet_in.group_mlx;
6807 mav_array_memcpy(packet1.controls, packet_in.controls, sizeof(float)*8);
6809 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6810 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6811 // cope with extensions
6812 memset(MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN);
6814 #endif
6815 memset(&packet2, 0, sizeof(packet2));
6816 mavlink_msg_actuator_control_target_encode(system_id, component_id, &msg, &packet1);
6817 mavlink_msg_actuator_control_target_decode(&msg, &packet2);
6818 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6820 memset(&packet2, 0, sizeof(packet2));
6821 mavlink_msg_actuator_control_target_pack(system_id, component_id, &msg , packet1.time_usec , packet1.group_mlx , packet1.controls );
6822 mavlink_msg_actuator_control_target_decode(&msg, &packet2);
6823 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6825 memset(&packet2, 0, sizeof(packet2));
6826 mavlink_msg_actuator_control_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.group_mlx , packet1.controls );
6827 mavlink_msg_actuator_control_target_decode(&msg, &packet2);
6828 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6830 memset(&packet2, 0, sizeof(packet2));
6831 mavlink_msg_to_send_buffer(buffer, &msg);
6832 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6833 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6835 mavlink_msg_actuator_control_target_decode(last_msg, &packet2);
6836 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6838 memset(&packet2, 0, sizeof(packet2));
6839 mavlink_msg_actuator_control_target_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.group_mlx , packet1.controls );
6840 mavlink_msg_actuator_control_target_decode(last_msg, &packet2);
6841 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6844 static void mavlink_test_altitude(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6846 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6847 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6848 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ALTITUDE >= 256) {
6849 return;
6851 #endif
6852 mavlink_message_t msg;
6853 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6854 uint16_t i;
6855 mavlink_altitude_t packet_in = {
6856 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0
6858 mavlink_altitude_t packet1, packet2;
6859 memset(&packet1, 0, sizeof(packet1));
6860 packet1.time_usec = packet_in.time_usec;
6861 packet1.altitude_monotonic = packet_in.altitude_monotonic;
6862 packet1.altitude_amsl = packet_in.altitude_amsl;
6863 packet1.altitude_local = packet_in.altitude_local;
6864 packet1.altitude_relative = packet_in.altitude_relative;
6865 packet1.altitude_terrain = packet_in.altitude_terrain;
6866 packet1.bottom_clearance = packet_in.bottom_clearance;
6869 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6870 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6871 // cope with extensions
6872 memset(MAVLINK_MSG_ID_ALTITUDE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ALTITUDE_MIN_LEN);
6874 #endif
6875 memset(&packet2, 0, sizeof(packet2));
6876 mavlink_msg_altitude_encode(system_id, component_id, &msg, &packet1);
6877 mavlink_msg_altitude_decode(&msg, &packet2);
6878 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6880 memset(&packet2, 0, sizeof(packet2));
6881 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 );
6882 mavlink_msg_altitude_decode(&msg, &packet2);
6883 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6885 memset(&packet2, 0, sizeof(packet2));
6886 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 );
6887 mavlink_msg_altitude_decode(&msg, &packet2);
6888 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6890 memset(&packet2, 0, sizeof(packet2));
6891 mavlink_msg_to_send_buffer(buffer, &msg);
6892 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6893 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6895 mavlink_msg_altitude_decode(last_msg, &packet2);
6896 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6898 memset(&packet2, 0, sizeof(packet2));
6899 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 );
6900 mavlink_msg_altitude_decode(last_msg, &packet2);
6901 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6904 static void mavlink_test_resource_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6906 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6907 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6908 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RESOURCE_REQUEST >= 256) {
6909 return;
6911 #endif
6912 mavlink_message_t msg;
6913 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6914 uint16_t i;
6915 mavlink_resource_request_t packet_in = {
6916 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 }
6918 mavlink_resource_request_t packet1, packet2;
6919 memset(&packet1, 0, sizeof(packet1));
6920 packet1.request_id = packet_in.request_id;
6921 packet1.uri_type = packet_in.uri_type;
6922 packet1.transfer_type = packet_in.transfer_type;
6924 mav_array_memcpy(packet1.uri, packet_in.uri, sizeof(uint8_t)*120);
6925 mav_array_memcpy(packet1.storage, packet_in.storage, sizeof(uint8_t)*120);
6927 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6928 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6929 // cope with extensions
6930 memset(MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN);
6932 #endif
6933 memset(&packet2, 0, sizeof(packet2));
6934 mavlink_msg_resource_request_encode(system_id, component_id, &msg, &packet1);
6935 mavlink_msg_resource_request_decode(&msg, &packet2);
6936 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6938 memset(&packet2, 0, sizeof(packet2));
6939 mavlink_msg_resource_request_pack(system_id, component_id, &msg , packet1.request_id , packet1.uri_type , packet1.uri , packet1.transfer_type , packet1.storage );
6940 mavlink_msg_resource_request_decode(&msg, &packet2);
6941 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6943 memset(&packet2, 0, sizeof(packet2));
6944 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 );
6945 mavlink_msg_resource_request_decode(&msg, &packet2);
6946 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6948 memset(&packet2, 0, sizeof(packet2));
6949 mavlink_msg_to_send_buffer(buffer, &msg);
6950 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6951 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6953 mavlink_msg_resource_request_decode(last_msg, &packet2);
6954 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6956 memset(&packet2, 0, sizeof(packet2));
6957 mavlink_msg_resource_request_send(MAVLINK_COMM_1 , packet1.request_id , packet1.uri_type , packet1.uri , packet1.transfer_type , packet1.storage );
6958 mavlink_msg_resource_request_decode(last_msg, &packet2);
6959 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6962 static void mavlink_test_scaled_pressure3(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6964 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6965 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6966 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_PRESSURE3 >= 256) {
6967 return;
6969 #endif
6970 mavlink_message_t msg;
6971 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6972 uint16_t i;
6973 mavlink_scaled_pressure3_t packet_in = {
6974 963497464,45.0,73.0,17859,17963
6976 mavlink_scaled_pressure3_t packet1, packet2;
6977 memset(&packet1, 0, sizeof(packet1));
6978 packet1.time_boot_ms = packet_in.time_boot_ms;
6979 packet1.press_abs = packet_in.press_abs;
6980 packet1.press_diff = packet_in.press_diff;
6981 packet1.temperature = packet_in.temperature;
6982 packet1.temperature_press_diff = packet_in.temperature_press_diff;
6985 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6986 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6987 // cope with extensions
6988 memset(MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN);
6990 #endif
6991 memset(&packet2, 0, sizeof(packet2));
6992 mavlink_msg_scaled_pressure3_encode(system_id, component_id, &msg, &packet1);
6993 mavlink_msg_scaled_pressure3_decode(&msg, &packet2);
6994 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
6996 memset(&packet2, 0, sizeof(packet2));
6997 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 );
6998 mavlink_msg_scaled_pressure3_decode(&msg, &packet2);
6999 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7001 memset(&packet2, 0, sizeof(packet2));
7002 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 );
7003 mavlink_msg_scaled_pressure3_decode(&msg, &packet2);
7004 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7006 memset(&packet2, 0, sizeof(packet2));
7007 mavlink_msg_to_send_buffer(buffer, &msg);
7008 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7009 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7011 mavlink_msg_scaled_pressure3_decode(last_msg, &packet2);
7012 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7014 memset(&packet2, 0, sizeof(packet2));
7015 mavlink_msg_scaled_pressure3_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature , packet1.temperature_press_diff );
7016 mavlink_msg_scaled_pressure3_decode(last_msg, &packet2);
7017 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7020 static void mavlink_test_follow_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7022 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7023 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7024 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FOLLOW_TARGET >= 256) {
7025 return;
7027 #endif
7028 mavlink_message_t msg;
7029 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7030 uint16_t i;
7031 mavlink_follow_target_t packet_in = {
7032 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
7034 mavlink_follow_target_t packet1, packet2;
7035 memset(&packet1, 0, sizeof(packet1));
7036 packet1.timestamp = packet_in.timestamp;
7037 packet1.custom_state = packet_in.custom_state;
7038 packet1.lat = packet_in.lat;
7039 packet1.lon = packet_in.lon;
7040 packet1.alt = packet_in.alt;
7041 packet1.est_capabilities = packet_in.est_capabilities;
7043 mav_array_memcpy(packet1.vel, packet_in.vel, sizeof(float)*3);
7044 mav_array_memcpy(packet1.acc, packet_in.acc, sizeof(float)*3);
7045 mav_array_memcpy(packet1.attitude_q, packet_in.attitude_q, sizeof(float)*4);
7046 mav_array_memcpy(packet1.rates, packet_in.rates, sizeof(float)*3);
7047 mav_array_memcpy(packet1.position_cov, packet_in.position_cov, sizeof(float)*3);
7049 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7050 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7051 // cope with extensions
7052 memset(MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN);
7054 #endif
7055 memset(&packet2, 0, sizeof(packet2));
7056 mavlink_msg_follow_target_encode(system_id, component_id, &msg, &packet1);
7057 mavlink_msg_follow_target_decode(&msg, &packet2);
7058 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7060 memset(&packet2, 0, sizeof(packet2));
7061 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 );
7062 mavlink_msg_follow_target_decode(&msg, &packet2);
7063 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7065 memset(&packet2, 0, sizeof(packet2));
7066 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 );
7067 mavlink_msg_follow_target_decode(&msg, &packet2);
7068 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7070 memset(&packet2, 0, sizeof(packet2));
7071 mavlink_msg_to_send_buffer(buffer, &msg);
7072 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7073 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7075 mavlink_msg_follow_target_decode(last_msg, &packet2);
7076 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7078 memset(&packet2, 0, sizeof(packet2));
7079 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 );
7080 mavlink_msg_follow_target_decode(last_msg, &packet2);
7081 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7084 static void mavlink_test_control_system_state(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7086 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7087 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7088 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE >= 256) {
7089 return;
7091 #endif
7092 mavlink_message_t msg;
7093 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7094 uint16_t i;
7095 mavlink_control_system_state_t packet_in = {
7096 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
7098 mavlink_control_system_state_t packet1, packet2;
7099 memset(&packet1, 0, sizeof(packet1));
7100 packet1.time_usec = packet_in.time_usec;
7101 packet1.x_acc = packet_in.x_acc;
7102 packet1.y_acc = packet_in.y_acc;
7103 packet1.z_acc = packet_in.z_acc;
7104 packet1.x_vel = packet_in.x_vel;
7105 packet1.y_vel = packet_in.y_vel;
7106 packet1.z_vel = packet_in.z_vel;
7107 packet1.x_pos = packet_in.x_pos;
7108 packet1.y_pos = packet_in.y_pos;
7109 packet1.z_pos = packet_in.z_pos;
7110 packet1.airspeed = packet_in.airspeed;
7111 packet1.roll_rate = packet_in.roll_rate;
7112 packet1.pitch_rate = packet_in.pitch_rate;
7113 packet1.yaw_rate = packet_in.yaw_rate;
7115 mav_array_memcpy(packet1.vel_variance, packet_in.vel_variance, sizeof(float)*3);
7116 mav_array_memcpy(packet1.pos_variance, packet_in.pos_variance, sizeof(float)*3);
7117 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
7119 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7120 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7121 // cope with extensions
7122 memset(MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN);
7124 #endif
7125 memset(&packet2, 0, sizeof(packet2));
7126 mavlink_msg_control_system_state_encode(system_id, component_id, &msg, &packet1);
7127 mavlink_msg_control_system_state_decode(&msg, &packet2);
7128 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7130 memset(&packet2, 0, sizeof(packet2));
7131 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 );
7132 mavlink_msg_control_system_state_decode(&msg, &packet2);
7133 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7135 memset(&packet2, 0, sizeof(packet2));
7136 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 );
7137 mavlink_msg_control_system_state_decode(&msg, &packet2);
7138 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7140 memset(&packet2, 0, sizeof(packet2));
7141 mavlink_msg_to_send_buffer(buffer, &msg);
7142 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7143 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7145 mavlink_msg_control_system_state_decode(last_msg, &packet2);
7146 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7148 memset(&packet2, 0, sizeof(packet2));
7149 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 );
7150 mavlink_msg_control_system_state_decode(last_msg, &packet2);
7151 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7154 static void mavlink_test_battery_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7156 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7157 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7158 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_BATTERY_STATUS >= 256) {
7159 return;
7161 #endif
7162 mavlink_message_t msg;
7163 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7164 uint16_t i;
7165 mavlink_battery_status_t packet_in = {
7166 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
7168 mavlink_battery_status_t packet1, packet2;
7169 memset(&packet1, 0, sizeof(packet1));
7170 packet1.current_consumed = packet_in.current_consumed;
7171 packet1.energy_consumed = packet_in.energy_consumed;
7172 packet1.temperature = packet_in.temperature;
7173 packet1.current_battery = packet_in.current_battery;
7174 packet1.id = packet_in.id;
7175 packet1.battery_function = packet_in.battery_function;
7176 packet1.type = packet_in.type;
7177 packet1.battery_remaining = packet_in.battery_remaining;
7178 packet1.time_remaining = packet_in.time_remaining;
7179 packet1.charge_state = packet_in.charge_state;
7180 packet1.mode = packet_in.mode;
7181 packet1.fault_bitmask = packet_in.fault_bitmask;
7183 mav_array_memcpy(packet1.voltages, packet_in.voltages, sizeof(uint16_t)*10);
7184 mav_array_memcpy(packet1.voltages_ext, packet_in.voltages_ext, sizeof(uint16_t)*4);
7186 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7187 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7188 // cope with extensions
7189 memset(MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN);
7191 #endif
7192 memset(&packet2, 0, sizeof(packet2));
7193 mavlink_msg_battery_status_encode(system_id, component_id, &msg, &packet1);
7194 mavlink_msg_battery_status_decode(&msg, &packet2);
7195 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7197 memset(&packet2, 0, sizeof(packet2));
7198 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 );
7199 mavlink_msg_battery_status_decode(&msg, &packet2);
7200 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7202 memset(&packet2, 0, sizeof(packet2));
7203 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 );
7204 mavlink_msg_battery_status_decode(&msg, &packet2);
7205 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7207 memset(&packet2, 0, sizeof(packet2));
7208 mavlink_msg_to_send_buffer(buffer, &msg);
7209 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7210 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7212 mavlink_msg_battery_status_decode(last_msg, &packet2);
7213 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7215 memset(&packet2, 0, sizeof(packet2));
7216 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 );
7217 mavlink_msg_battery_status_decode(last_msg, &packet2);
7218 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7221 static void mavlink_test_autopilot_version(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7223 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7224 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7225 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AUTOPILOT_VERSION >= 256) {
7226 return;
7228 #endif
7229 mavlink_message_t msg;
7230 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7231 uint16_t i;
7232 mavlink_autopilot_version_t packet_in = {
7233 93372036854775807ULL,93372036854776311ULL,963498296,963498504,963498712,963498920,18899,19003,{ 113, 114, 115, 116, 117, 118, 119, 120 },{ 137, 138, 139, 140, 141, 142, 143, 144 },{ 161, 162, 163, 164, 165, 166, 167, 168 },{ 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202 }
7235 mavlink_autopilot_version_t packet1, packet2;
7236 memset(&packet1, 0, sizeof(packet1));
7237 packet1.capabilities = packet_in.capabilities;
7238 packet1.uid = packet_in.uid;
7239 packet1.flight_sw_version = packet_in.flight_sw_version;
7240 packet1.middleware_sw_version = packet_in.middleware_sw_version;
7241 packet1.os_sw_version = packet_in.os_sw_version;
7242 packet1.board_version = packet_in.board_version;
7243 packet1.vendor_id = packet_in.vendor_id;
7244 packet1.product_id = packet_in.product_id;
7246 mav_array_memcpy(packet1.flight_custom_version, packet_in.flight_custom_version, sizeof(uint8_t)*8);
7247 mav_array_memcpy(packet1.middleware_custom_version, packet_in.middleware_custom_version, sizeof(uint8_t)*8);
7248 mav_array_memcpy(packet1.os_custom_version, packet_in.os_custom_version, sizeof(uint8_t)*8);
7249 mav_array_memcpy(packet1.uid2, packet_in.uid2, sizeof(uint8_t)*18);
7251 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7252 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7253 // cope with extensions
7254 memset(MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN);
7256 #endif
7257 memset(&packet2, 0, sizeof(packet2));
7258 mavlink_msg_autopilot_version_encode(system_id, component_id, &msg, &packet1);
7259 mavlink_msg_autopilot_version_decode(&msg, &packet2);
7260 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7262 memset(&packet2, 0, sizeof(packet2));
7263 mavlink_msg_autopilot_version_pack(system_id, component_id, &msg , packet1.capabilities , packet1.flight_sw_version , packet1.middleware_sw_version , packet1.os_sw_version , packet1.board_version , packet1.flight_custom_version , packet1.middleware_custom_version , packet1.os_custom_version , packet1.vendor_id , packet1.product_id , packet1.uid , packet1.uid2 );
7264 mavlink_msg_autopilot_version_decode(&msg, &packet2);
7265 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7267 memset(&packet2, 0, sizeof(packet2));
7268 mavlink_msg_autopilot_version_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.capabilities , packet1.flight_sw_version , packet1.middleware_sw_version , packet1.os_sw_version , packet1.board_version , packet1.flight_custom_version , packet1.middleware_custom_version , packet1.os_custom_version , packet1.vendor_id , packet1.product_id , packet1.uid , packet1.uid2 );
7269 mavlink_msg_autopilot_version_decode(&msg, &packet2);
7270 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7272 memset(&packet2, 0, sizeof(packet2));
7273 mavlink_msg_to_send_buffer(buffer, &msg);
7274 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7275 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7277 mavlink_msg_autopilot_version_decode(last_msg, &packet2);
7278 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7280 memset(&packet2, 0, sizeof(packet2));
7281 mavlink_msg_autopilot_version_send(MAVLINK_COMM_1 , packet1.capabilities , packet1.flight_sw_version , packet1.middleware_sw_version , packet1.os_sw_version , packet1.board_version , packet1.flight_custom_version , packet1.middleware_custom_version , packet1.os_custom_version , packet1.vendor_id , packet1.product_id , packet1.uid , packet1.uid2 );
7282 mavlink_msg_autopilot_version_decode(last_msg, &packet2);
7283 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7286 static void mavlink_test_landing_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7288 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7289 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7290 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LANDING_TARGET >= 256) {
7291 return;
7293 #endif
7294 mavlink_message_t msg;
7295 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7296 uint16_t i;
7297 mavlink_landing_target_t packet_in = {
7298 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
7300 mavlink_landing_target_t packet1, packet2;
7301 memset(&packet1, 0, sizeof(packet1));
7302 packet1.time_usec = packet_in.time_usec;
7303 packet1.angle_x = packet_in.angle_x;
7304 packet1.angle_y = packet_in.angle_y;
7305 packet1.distance = packet_in.distance;
7306 packet1.size_x = packet_in.size_x;
7307 packet1.size_y = packet_in.size_y;
7308 packet1.target_num = packet_in.target_num;
7309 packet1.frame = packet_in.frame;
7310 packet1.x = packet_in.x;
7311 packet1.y = packet_in.y;
7312 packet1.z = packet_in.z;
7313 packet1.type = packet_in.type;
7314 packet1.position_valid = packet_in.position_valid;
7316 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
7318 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7319 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7320 // cope with extensions
7321 memset(MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN);
7323 #endif
7324 memset(&packet2, 0, sizeof(packet2));
7325 mavlink_msg_landing_target_encode(system_id, component_id, &msg, &packet1);
7326 mavlink_msg_landing_target_decode(&msg, &packet2);
7327 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7329 memset(&packet2, 0, sizeof(packet2));
7330 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 );
7331 mavlink_msg_landing_target_decode(&msg, &packet2);
7332 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7334 memset(&packet2, 0, sizeof(packet2));
7335 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 );
7336 mavlink_msg_landing_target_decode(&msg, &packet2);
7337 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7339 memset(&packet2, 0, sizeof(packet2));
7340 mavlink_msg_to_send_buffer(buffer, &msg);
7341 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7342 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7344 mavlink_msg_landing_target_decode(last_msg, &packet2);
7345 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7347 memset(&packet2, 0, sizeof(packet2));
7348 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 );
7349 mavlink_msg_landing_target_decode(last_msg, &packet2);
7350 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7353 static void mavlink_test_fence_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7355 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7356 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7357 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FENCE_STATUS >= 256) {
7358 return;
7360 #endif
7361 mavlink_message_t msg;
7362 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7363 uint16_t i;
7364 mavlink_fence_status_t packet_in = {
7365 963497464,17443,151,218,29
7367 mavlink_fence_status_t packet1, packet2;
7368 memset(&packet1, 0, sizeof(packet1));
7369 packet1.breach_time = packet_in.breach_time;
7370 packet1.breach_count = packet_in.breach_count;
7371 packet1.breach_status = packet_in.breach_status;
7372 packet1.breach_type = packet_in.breach_type;
7373 packet1.breach_mitigation = packet_in.breach_mitigation;
7376 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7377 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7378 // cope with extensions
7379 memset(MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN);
7381 #endif
7382 memset(&packet2, 0, sizeof(packet2));
7383 mavlink_msg_fence_status_encode(system_id, component_id, &msg, &packet1);
7384 mavlink_msg_fence_status_decode(&msg, &packet2);
7385 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7387 memset(&packet2, 0, sizeof(packet2));
7388 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 );
7389 mavlink_msg_fence_status_decode(&msg, &packet2);
7390 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7392 memset(&packet2, 0, sizeof(packet2));
7393 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 );
7394 mavlink_msg_fence_status_decode(&msg, &packet2);
7395 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7397 memset(&packet2, 0, sizeof(packet2));
7398 mavlink_msg_to_send_buffer(buffer, &msg);
7399 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7400 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7402 mavlink_msg_fence_status_decode(last_msg, &packet2);
7403 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7405 memset(&packet2, 0, sizeof(packet2));
7406 mavlink_msg_fence_status_send(MAVLINK_COMM_1 , packet1.breach_status , packet1.breach_count , packet1.breach_type , packet1.breach_time , packet1.breach_mitigation );
7407 mavlink_msg_fence_status_decode(last_msg, &packet2);
7408 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7411 static void mavlink_test_mag_cal_report(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7413 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7414 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7415 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MAG_CAL_REPORT >= 256) {
7416 return;
7418 #endif
7419 mavlink_message_t msg;
7420 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7421 uint16_t i;
7422 mavlink_mag_cal_report_t packet_in = {
7423 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
7425 mavlink_mag_cal_report_t packet1, packet2;
7426 memset(&packet1, 0, sizeof(packet1));
7427 packet1.fitness = packet_in.fitness;
7428 packet1.ofs_x = packet_in.ofs_x;
7429 packet1.ofs_y = packet_in.ofs_y;
7430 packet1.ofs_z = packet_in.ofs_z;
7431 packet1.diag_x = packet_in.diag_x;
7432 packet1.diag_y = packet_in.diag_y;
7433 packet1.diag_z = packet_in.diag_z;
7434 packet1.offdiag_x = packet_in.offdiag_x;
7435 packet1.offdiag_y = packet_in.offdiag_y;
7436 packet1.offdiag_z = packet_in.offdiag_z;
7437 packet1.compass_id = packet_in.compass_id;
7438 packet1.cal_mask = packet_in.cal_mask;
7439 packet1.cal_status = packet_in.cal_status;
7440 packet1.autosaved = packet_in.autosaved;
7441 packet1.orientation_confidence = packet_in.orientation_confidence;
7442 packet1.old_orientation = packet_in.old_orientation;
7443 packet1.new_orientation = packet_in.new_orientation;
7444 packet1.scale_factor = packet_in.scale_factor;
7447 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7448 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7449 // cope with extensions
7450 memset(MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN);
7452 #endif
7453 memset(&packet2, 0, sizeof(packet2));
7454 mavlink_msg_mag_cal_report_encode(system_id, component_id, &msg, &packet1);
7455 mavlink_msg_mag_cal_report_decode(&msg, &packet2);
7456 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7458 memset(&packet2, 0, sizeof(packet2));
7459 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 );
7460 mavlink_msg_mag_cal_report_decode(&msg, &packet2);
7461 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7463 memset(&packet2, 0, sizeof(packet2));
7464 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 );
7465 mavlink_msg_mag_cal_report_decode(&msg, &packet2);
7466 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7468 memset(&packet2, 0, sizeof(packet2));
7469 mavlink_msg_to_send_buffer(buffer, &msg);
7470 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7471 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7473 mavlink_msg_mag_cal_report_decode(last_msg, &packet2);
7474 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7476 memset(&packet2, 0, sizeof(packet2));
7477 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 );
7478 mavlink_msg_mag_cal_report_decode(last_msg, &packet2);
7479 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7482 static void mavlink_test_efi_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7484 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7485 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7486 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_EFI_STATUS >= 256) {
7487 return;
7489 #endif
7490 mavlink_message_t msg;
7491 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7492 uint16_t i;
7493 mavlink_efi_status_t packet_in = {
7494 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
7496 mavlink_efi_status_t packet1, packet2;
7497 memset(&packet1, 0, sizeof(packet1));
7498 packet1.ecu_index = packet_in.ecu_index;
7499 packet1.rpm = packet_in.rpm;
7500 packet1.fuel_consumed = packet_in.fuel_consumed;
7501 packet1.fuel_flow = packet_in.fuel_flow;
7502 packet1.engine_load = packet_in.engine_load;
7503 packet1.throttle_position = packet_in.throttle_position;
7504 packet1.spark_dwell_time = packet_in.spark_dwell_time;
7505 packet1.barometric_pressure = packet_in.barometric_pressure;
7506 packet1.intake_manifold_pressure = packet_in.intake_manifold_pressure;
7507 packet1.intake_manifold_temperature = packet_in.intake_manifold_temperature;
7508 packet1.cylinder_head_temperature = packet_in.cylinder_head_temperature;
7509 packet1.ignition_timing = packet_in.ignition_timing;
7510 packet1.injection_time = packet_in.injection_time;
7511 packet1.exhaust_gas_temperature = packet_in.exhaust_gas_temperature;
7512 packet1.throttle_out = packet_in.throttle_out;
7513 packet1.pt_compensation = packet_in.pt_compensation;
7514 packet1.health = packet_in.health;
7517 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7518 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7519 // cope with extensions
7520 memset(MAVLINK_MSG_ID_EFI_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_EFI_STATUS_MIN_LEN);
7522 #endif
7523 memset(&packet2, 0, sizeof(packet2));
7524 mavlink_msg_efi_status_encode(system_id, component_id, &msg, &packet1);
7525 mavlink_msg_efi_status_decode(&msg, &packet2);
7526 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7528 memset(&packet2, 0, sizeof(packet2));
7529 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 );
7530 mavlink_msg_efi_status_decode(&msg, &packet2);
7531 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7533 memset(&packet2, 0, sizeof(packet2));
7534 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 );
7535 mavlink_msg_efi_status_decode(&msg, &packet2);
7536 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7538 memset(&packet2, 0, sizeof(packet2));
7539 mavlink_msg_to_send_buffer(buffer, &msg);
7540 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7541 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7543 mavlink_msg_efi_status_decode(last_msg, &packet2);
7544 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7546 memset(&packet2, 0, sizeof(packet2));
7547 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 );
7548 mavlink_msg_efi_status_decode(last_msg, &packet2);
7549 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7552 static void mavlink_test_estimator_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7554 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7555 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7556 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ESTIMATOR_STATUS >= 256) {
7557 return;
7559 #endif
7560 mavlink_message_t msg;
7561 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7562 uint16_t i;
7563 mavlink_estimator_status_t packet_in = {
7564 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,19315
7566 mavlink_estimator_status_t packet1, packet2;
7567 memset(&packet1, 0, sizeof(packet1));
7568 packet1.time_usec = packet_in.time_usec;
7569 packet1.vel_ratio = packet_in.vel_ratio;
7570 packet1.pos_horiz_ratio = packet_in.pos_horiz_ratio;
7571 packet1.pos_vert_ratio = packet_in.pos_vert_ratio;
7572 packet1.mag_ratio = packet_in.mag_ratio;
7573 packet1.hagl_ratio = packet_in.hagl_ratio;
7574 packet1.tas_ratio = packet_in.tas_ratio;
7575 packet1.pos_horiz_accuracy = packet_in.pos_horiz_accuracy;
7576 packet1.pos_vert_accuracy = packet_in.pos_vert_accuracy;
7577 packet1.flags = packet_in.flags;
7580 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7581 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7582 // cope with extensions
7583 memset(MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN);
7585 #endif
7586 memset(&packet2, 0, sizeof(packet2));
7587 mavlink_msg_estimator_status_encode(system_id, component_id, &msg, &packet1);
7588 mavlink_msg_estimator_status_decode(&msg, &packet2);
7589 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7591 memset(&packet2, 0, sizeof(packet2));
7592 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 );
7593 mavlink_msg_estimator_status_decode(&msg, &packet2);
7594 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7596 memset(&packet2, 0, sizeof(packet2));
7597 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 );
7598 mavlink_msg_estimator_status_decode(&msg, &packet2);
7599 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7601 memset(&packet2, 0, sizeof(packet2));
7602 mavlink_msg_to_send_buffer(buffer, &msg);
7603 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7604 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7606 mavlink_msg_estimator_status_decode(last_msg, &packet2);
7607 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7609 memset(&packet2, 0, sizeof(packet2));
7610 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 );
7611 mavlink_msg_estimator_status_decode(last_msg, &packet2);
7612 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7615 static void mavlink_test_wind_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7617 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7618 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7619 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_WIND_COV >= 256) {
7620 return;
7622 #endif
7623 mavlink_message_t msg;
7624 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7625 uint16_t i;
7626 mavlink_wind_cov_t packet_in = {
7627 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0
7629 mavlink_wind_cov_t packet1, packet2;
7630 memset(&packet1, 0, sizeof(packet1));
7631 packet1.time_usec = packet_in.time_usec;
7632 packet1.wind_x = packet_in.wind_x;
7633 packet1.wind_y = packet_in.wind_y;
7634 packet1.wind_z = packet_in.wind_z;
7635 packet1.var_horiz = packet_in.var_horiz;
7636 packet1.var_vert = packet_in.var_vert;
7637 packet1.wind_alt = packet_in.wind_alt;
7638 packet1.horiz_accuracy = packet_in.horiz_accuracy;
7639 packet1.vert_accuracy = packet_in.vert_accuracy;
7642 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7643 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7644 // cope with extensions
7645 memset(MAVLINK_MSG_ID_WIND_COV_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_WIND_COV_MIN_LEN);
7647 #endif
7648 memset(&packet2, 0, sizeof(packet2));
7649 mavlink_msg_wind_cov_encode(system_id, component_id, &msg, &packet1);
7650 mavlink_msg_wind_cov_decode(&msg, &packet2);
7651 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7653 memset(&packet2, 0, sizeof(packet2));
7654 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 );
7655 mavlink_msg_wind_cov_decode(&msg, &packet2);
7656 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7658 memset(&packet2, 0, sizeof(packet2));
7659 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 );
7660 mavlink_msg_wind_cov_decode(&msg, &packet2);
7661 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7663 memset(&packet2, 0, sizeof(packet2));
7664 mavlink_msg_to_send_buffer(buffer, &msg);
7665 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7666 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7668 mavlink_msg_wind_cov_decode(last_msg, &packet2);
7669 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7671 memset(&packet2, 0, sizeof(packet2));
7672 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 );
7673 mavlink_msg_wind_cov_decode(last_msg, &packet2);
7674 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7677 static void mavlink_test_gps_input(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7679 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7680 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7681 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_INPUT >= 256) {
7682 return;
7684 #endif
7685 mavlink_message_t msg;
7686 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7687 uint16_t i;
7688 mavlink_gps_input_t packet_in = {
7689 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
7691 mavlink_gps_input_t packet1, packet2;
7692 memset(&packet1, 0, sizeof(packet1));
7693 packet1.time_usec = packet_in.time_usec;
7694 packet1.time_week_ms = packet_in.time_week_ms;
7695 packet1.lat = packet_in.lat;
7696 packet1.lon = packet_in.lon;
7697 packet1.alt = packet_in.alt;
7698 packet1.hdop = packet_in.hdop;
7699 packet1.vdop = packet_in.vdop;
7700 packet1.vn = packet_in.vn;
7701 packet1.ve = packet_in.ve;
7702 packet1.vd = packet_in.vd;
7703 packet1.speed_accuracy = packet_in.speed_accuracy;
7704 packet1.horiz_accuracy = packet_in.horiz_accuracy;
7705 packet1.vert_accuracy = packet_in.vert_accuracy;
7706 packet1.ignore_flags = packet_in.ignore_flags;
7707 packet1.time_week = packet_in.time_week;
7708 packet1.gps_id = packet_in.gps_id;
7709 packet1.fix_type = packet_in.fix_type;
7710 packet1.satellites_visible = packet_in.satellites_visible;
7711 packet1.yaw = packet_in.yaw;
7714 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7715 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7716 // cope with extensions
7717 memset(MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN);
7719 #endif
7720 memset(&packet2, 0, sizeof(packet2));
7721 mavlink_msg_gps_input_encode(system_id, component_id, &msg, &packet1);
7722 mavlink_msg_gps_input_decode(&msg, &packet2);
7723 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7725 memset(&packet2, 0, sizeof(packet2));
7726 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 );
7727 mavlink_msg_gps_input_decode(&msg, &packet2);
7728 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7730 memset(&packet2, 0, sizeof(packet2));
7731 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 );
7732 mavlink_msg_gps_input_decode(&msg, &packet2);
7733 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7735 memset(&packet2, 0, sizeof(packet2));
7736 mavlink_msg_to_send_buffer(buffer, &msg);
7737 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7738 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7740 mavlink_msg_gps_input_decode(last_msg, &packet2);
7741 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7743 memset(&packet2, 0, sizeof(packet2));
7744 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 );
7745 mavlink_msg_gps_input_decode(last_msg, &packet2);
7746 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7749 static void mavlink_test_gps_rtcm_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7751 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7752 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7753 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_RTCM_DATA >= 256) {
7754 return;
7756 #endif
7757 mavlink_message_t msg;
7758 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7759 uint16_t i;
7760 mavlink_gps_rtcm_data_t packet_in = {
7761 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 }
7763 mavlink_gps_rtcm_data_t packet1, packet2;
7764 memset(&packet1, 0, sizeof(packet1));
7765 packet1.flags = packet_in.flags;
7766 packet1.len = packet_in.len;
7768 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*180);
7770 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7771 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7772 // cope with extensions
7773 memset(MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN);
7775 #endif
7776 memset(&packet2, 0, sizeof(packet2));
7777 mavlink_msg_gps_rtcm_data_encode(system_id, component_id, &msg, &packet1);
7778 mavlink_msg_gps_rtcm_data_decode(&msg, &packet2);
7779 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7781 memset(&packet2, 0, sizeof(packet2));
7782 mavlink_msg_gps_rtcm_data_pack(system_id, component_id, &msg , packet1.flags , packet1.len , packet1.data );
7783 mavlink_msg_gps_rtcm_data_decode(&msg, &packet2);
7784 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7786 memset(&packet2, 0, sizeof(packet2));
7787 mavlink_msg_gps_rtcm_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.flags , packet1.len , packet1.data );
7788 mavlink_msg_gps_rtcm_data_decode(&msg, &packet2);
7789 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7791 memset(&packet2, 0, sizeof(packet2));
7792 mavlink_msg_to_send_buffer(buffer, &msg);
7793 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7794 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7796 mavlink_msg_gps_rtcm_data_decode(last_msg, &packet2);
7797 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7799 memset(&packet2, 0, sizeof(packet2));
7800 mavlink_msg_gps_rtcm_data_send(MAVLINK_COMM_1 , packet1.flags , packet1.len , packet1.data );
7801 mavlink_msg_gps_rtcm_data_decode(last_msg, &packet2);
7802 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7805 static void mavlink_test_high_latency(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7807 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7808 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7809 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIGH_LATENCY >= 256) {
7810 return;
7812 #endif
7813 mavlink_message_t msg;
7814 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7815 uint16_t i;
7816 mavlink_high_latency_t packet_in = {
7817 963497464,963497672,963497880,17859,17963,18067,18171,18275,18379,18483,211,22,89,156,223,34,101,168,235,46,113,180,247,58
7819 mavlink_high_latency_t packet1, packet2;
7820 memset(&packet1, 0, sizeof(packet1));
7821 packet1.custom_mode = packet_in.custom_mode;
7822 packet1.latitude = packet_in.latitude;
7823 packet1.longitude = packet_in.longitude;
7824 packet1.roll = packet_in.roll;
7825 packet1.pitch = packet_in.pitch;
7826 packet1.heading = packet_in.heading;
7827 packet1.heading_sp = packet_in.heading_sp;
7828 packet1.altitude_amsl = packet_in.altitude_amsl;
7829 packet1.altitude_sp = packet_in.altitude_sp;
7830 packet1.wp_distance = packet_in.wp_distance;
7831 packet1.base_mode = packet_in.base_mode;
7832 packet1.landed_state = packet_in.landed_state;
7833 packet1.throttle = packet_in.throttle;
7834 packet1.airspeed = packet_in.airspeed;
7835 packet1.airspeed_sp = packet_in.airspeed_sp;
7836 packet1.groundspeed = packet_in.groundspeed;
7837 packet1.climb_rate = packet_in.climb_rate;
7838 packet1.gps_nsat = packet_in.gps_nsat;
7839 packet1.gps_fix_type = packet_in.gps_fix_type;
7840 packet1.battery_remaining = packet_in.battery_remaining;
7841 packet1.temperature = packet_in.temperature;
7842 packet1.temperature_air = packet_in.temperature_air;
7843 packet1.failsafe = packet_in.failsafe;
7844 packet1.wp_num = packet_in.wp_num;
7847 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7848 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7849 // cope with extensions
7850 memset(MAVLINK_MSG_ID_HIGH_LATENCY_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIGH_LATENCY_MIN_LEN);
7852 #endif
7853 memset(&packet2, 0, sizeof(packet2));
7854 mavlink_msg_high_latency_encode(system_id, component_id, &msg, &packet1);
7855 mavlink_msg_high_latency_decode(&msg, &packet2);
7856 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7858 memset(&packet2, 0, sizeof(packet2));
7859 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 );
7860 mavlink_msg_high_latency_decode(&msg, &packet2);
7861 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7863 memset(&packet2, 0, sizeof(packet2));
7864 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 );
7865 mavlink_msg_high_latency_decode(&msg, &packet2);
7866 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7868 memset(&packet2, 0, sizeof(packet2));
7869 mavlink_msg_to_send_buffer(buffer, &msg);
7870 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7871 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7873 mavlink_msg_high_latency_decode(last_msg, &packet2);
7874 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7876 memset(&packet2, 0, sizeof(packet2));
7877 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 );
7878 mavlink_msg_high_latency_decode(last_msg, &packet2);
7879 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7882 static void mavlink_test_high_latency2(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7884 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7885 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7886 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIGH_LATENCY2 >= 256) {
7887 return;
7889 #endif
7890 mavlink_message_t msg;
7891 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7892 uint16_t i;
7893 mavlink_high_latency2_t packet_in = {
7894 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
7896 mavlink_high_latency2_t packet1, packet2;
7897 memset(&packet1, 0, sizeof(packet1));
7898 packet1.timestamp = packet_in.timestamp;
7899 packet1.latitude = packet_in.latitude;
7900 packet1.longitude = packet_in.longitude;
7901 packet1.custom_mode = packet_in.custom_mode;
7902 packet1.altitude = packet_in.altitude;
7903 packet1.target_altitude = packet_in.target_altitude;
7904 packet1.target_distance = packet_in.target_distance;
7905 packet1.wp_num = packet_in.wp_num;
7906 packet1.failure_flags = packet_in.failure_flags;
7907 packet1.type = packet_in.type;
7908 packet1.autopilot = packet_in.autopilot;
7909 packet1.heading = packet_in.heading;
7910 packet1.target_heading = packet_in.target_heading;
7911 packet1.throttle = packet_in.throttle;
7912 packet1.airspeed = packet_in.airspeed;
7913 packet1.airspeed_sp = packet_in.airspeed_sp;
7914 packet1.groundspeed = packet_in.groundspeed;
7915 packet1.windspeed = packet_in.windspeed;
7916 packet1.wind_heading = packet_in.wind_heading;
7917 packet1.eph = packet_in.eph;
7918 packet1.epv = packet_in.epv;
7919 packet1.temperature_air = packet_in.temperature_air;
7920 packet1.climb_rate = packet_in.climb_rate;
7921 packet1.battery = packet_in.battery;
7922 packet1.custom0 = packet_in.custom0;
7923 packet1.custom1 = packet_in.custom1;
7924 packet1.custom2 = packet_in.custom2;
7927 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7928 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7929 // cope with extensions
7930 memset(MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN);
7932 #endif
7933 memset(&packet2, 0, sizeof(packet2));
7934 mavlink_msg_high_latency2_encode(system_id, component_id, &msg, &packet1);
7935 mavlink_msg_high_latency2_decode(&msg, &packet2);
7936 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7938 memset(&packet2, 0, sizeof(packet2));
7939 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 );
7940 mavlink_msg_high_latency2_decode(&msg, &packet2);
7941 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7943 memset(&packet2, 0, sizeof(packet2));
7944 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 );
7945 mavlink_msg_high_latency2_decode(&msg, &packet2);
7946 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7948 memset(&packet2, 0, sizeof(packet2));
7949 mavlink_msg_to_send_buffer(buffer, &msg);
7950 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7951 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7953 mavlink_msg_high_latency2_decode(last_msg, &packet2);
7954 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7956 memset(&packet2, 0, sizeof(packet2));
7957 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 );
7958 mavlink_msg_high_latency2_decode(last_msg, &packet2);
7959 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7962 static void mavlink_test_vibration(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7964 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7965 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7966 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VIBRATION >= 256) {
7967 return;
7969 #endif
7970 mavlink_message_t msg;
7971 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7972 uint16_t i;
7973 mavlink_vibration_t packet_in = {
7974 93372036854775807ULL,73.0,101.0,129.0,963498504,963498712,963498920
7976 mavlink_vibration_t packet1, packet2;
7977 memset(&packet1, 0, sizeof(packet1));
7978 packet1.time_usec = packet_in.time_usec;
7979 packet1.vibration_x = packet_in.vibration_x;
7980 packet1.vibration_y = packet_in.vibration_y;
7981 packet1.vibration_z = packet_in.vibration_z;
7982 packet1.clipping_0 = packet_in.clipping_0;
7983 packet1.clipping_1 = packet_in.clipping_1;
7984 packet1.clipping_2 = packet_in.clipping_2;
7987 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7988 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7989 // cope with extensions
7990 memset(MAVLINK_MSG_ID_VIBRATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VIBRATION_MIN_LEN);
7992 #endif
7993 memset(&packet2, 0, sizeof(packet2));
7994 mavlink_msg_vibration_encode(system_id, component_id, &msg, &packet1);
7995 mavlink_msg_vibration_decode(&msg, &packet2);
7996 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
7998 memset(&packet2, 0, sizeof(packet2));
7999 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 );
8000 mavlink_msg_vibration_decode(&msg, &packet2);
8001 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8003 memset(&packet2, 0, sizeof(packet2));
8004 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 );
8005 mavlink_msg_vibration_decode(&msg, &packet2);
8006 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8008 memset(&packet2, 0, sizeof(packet2));
8009 mavlink_msg_to_send_buffer(buffer, &msg);
8010 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8011 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8013 mavlink_msg_vibration_decode(last_msg, &packet2);
8014 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8016 memset(&packet2, 0, sizeof(packet2));
8017 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 );
8018 mavlink_msg_vibration_decode(last_msg, &packet2);
8019 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8022 static void mavlink_test_home_position(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8024 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8025 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8026 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HOME_POSITION >= 256) {
8027 return;
8029 #endif
8030 mavlink_message_t msg;
8031 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8032 uint16_t i;
8033 mavlink_home_position_t packet_in = {
8034 963497464,963497672,963497880,101.0,129.0,157.0,{ 185.0, 186.0, 187.0, 188.0 },297.0,325.0,353.0,93372036854779083ULL
8036 mavlink_home_position_t packet1, packet2;
8037 memset(&packet1, 0, sizeof(packet1));
8038 packet1.latitude = packet_in.latitude;
8039 packet1.longitude = packet_in.longitude;
8040 packet1.altitude = packet_in.altitude;
8041 packet1.x = packet_in.x;
8042 packet1.y = packet_in.y;
8043 packet1.z = packet_in.z;
8044 packet1.approach_x = packet_in.approach_x;
8045 packet1.approach_y = packet_in.approach_y;
8046 packet1.approach_z = packet_in.approach_z;
8047 packet1.time_usec = packet_in.time_usec;
8049 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
8051 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8052 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8053 // cope with extensions
8054 memset(MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN);
8056 #endif
8057 memset(&packet2, 0, sizeof(packet2));
8058 mavlink_msg_home_position_encode(system_id, component_id, &msg, &packet1);
8059 mavlink_msg_home_position_decode(&msg, &packet2);
8060 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8062 memset(&packet2, 0, sizeof(packet2));
8063 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 );
8064 mavlink_msg_home_position_decode(&msg, &packet2);
8065 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8067 memset(&packet2, 0, sizeof(packet2));
8068 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 );
8069 mavlink_msg_home_position_decode(&msg, &packet2);
8070 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8072 memset(&packet2, 0, sizeof(packet2));
8073 mavlink_msg_to_send_buffer(buffer, &msg);
8074 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8075 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8077 mavlink_msg_home_position_decode(last_msg, &packet2);
8078 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8080 memset(&packet2, 0, sizeof(packet2));
8081 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 );
8082 mavlink_msg_home_position_decode(last_msg, &packet2);
8083 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8086 static void mavlink_test_set_home_position(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8088 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8089 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8090 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_HOME_POSITION >= 256) {
8091 return;
8093 #endif
8094 mavlink_message_t msg;
8095 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8096 uint16_t i;
8097 mavlink_set_home_position_t packet_in = {
8098 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
8100 mavlink_set_home_position_t packet1, packet2;
8101 memset(&packet1, 0, sizeof(packet1));
8102 packet1.latitude = packet_in.latitude;
8103 packet1.longitude = packet_in.longitude;
8104 packet1.altitude = packet_in.altitude;
8105 packet1.x = packet_in.x;
8106 packet1.y = packet_in.y;
8107 packet1.z = packet_in.z;
8108 packet1.approach_x = packet_in.approach_x;
8109 packet1.approach_y = packet_in.approach_y;
8110 packet1.approach_z = packet_in.approach_z;
8111 packet1.target_system = packet_in.target_system;
8112 packet1.time_usec = packet_in.time_usec;
8114 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
8116 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8117 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8118 // cope with extensions
8119 memset(MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN);
8121 #endif
8122 memset(&packet2, 0, sizeof(packet2));
8123 mavlink_msg_set_home_position_encode(system_id, component_id, &msg, &packet1);
8124 mavlink_msg_set_home_position_decode(&msg, &packet2);
8125 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8127 memset(&packet2, 0, sizeof(packet2));
8128 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 );
8129 mavlink_msg_set_home_position_decode(&msg, &packet2);
8130 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8132 memset(&packet2, 0, sizeof(packet2));
8133 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 );
8134 mavlink_msg_set_home_position_decode(&msg, &packet2);
8135 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8137 memset(&packet2, 0, sizeof(packet2));
8138 mavlink_msg_to_send_buffer(buffer, &msg);
8139 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8140 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8142 mavlink_msg_set_home_position_decode(last_msg, &packet2);
8143 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8145 memset(&packet2, 0, sizeof(packet2));
8146 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 );
8147 mavlink_msg_set_home_position_decode(last_msg, &packet2);
8148 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8151 static void mavlink_test_message_interval(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8153 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8154 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8155 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MESSAGE_INTERVAL >= 256) {
8156 return;
8158 #endif
8159 mavlink_message_t msg;
8160 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8161 uint16_t i;
8162 mavlink_message_interval_t packet_in = {
8163 963497464,17443
8165 mavlink_message_interval_t packet1, packet2;
8166 memset(&packet1, 0, sizeof(packet1));
8167 packet1.interval_us = packet_in.interval_us;
8168 packet1.message_id = packet_in.message_id;
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_MESSAGE_INTERVAL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN);
8176 #endif
8177 memset(&packet2, 0, sizeof(packet2));
8178 mavlink_msg_message_interval_encode(system_id, component_id, &msg, &packet1);
8179 mavlink_msg_message_interval_decode(&msg, &packet2);
8180 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8182 memset(&packet2, 0, sizeof(packet2));
8183 mavlink_msg_message_interval_pack(system_id, component_id, &msg , packet1.message_id , packet1.interval_us );
8184 mavlink_msg_message_interval_decode(&msg, &packet2);
8185 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8187 memset(&packet2, 0, sizeof(packet2));
8188 mavlink_msg_message_interval_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.message_id , packet1.interval_us );
8189 mavlink_msg_message_interval_decode(&msg, &packet2);
8190 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
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]);
8197 mavlink_msg_message_interval_decode(last_msg, &packet2);
8198 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8200 memset(&packet2, 0, sizeof(packet2));
8201 mavlink_msg_message_interval_send(MAVLINK_COMM_1 , packet1.message_id , packet1.interval_us );
8202 mavlink_msg_message_interval_decode(last_msg, &packet2);
8203 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8206 static void mavlink_test_extended_sys_state(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8208 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8209 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8210 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_EXTENDED_SYS_STATE >= 256) {
8211 return;
8213 #endif
8214 mavlink_message_t msg;
8215 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8216 uint16_t i;
8217 mavlink_extended_sys_state_t packet_in = {
8218 5,72
8220 mavlink_extended_sys_state_t packet1, packet2;
8221 memset(&packet1, 0, sizeof(packet1));
8222 packet1.vtol_state = packet_in.vtol_state;
8223 packet1.landed_state = packet_in.landed_state;
8226 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8227 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8228 // cope with extensions
8229 memset(MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN);
8231 #endif
8232 memset(&packet2, 0, sizeof(packet2));
8233 mavlink_msg_extended_sys_state_encode(system_id, component_id, &msg, &packet1);
8234 mavlink_msg_extended_sys_state_decode(&msg, &packet2);
8235 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8237 memset(&packet2, 0, sizeof(packet2));
8238 mavlink_msg_extended_sys_state_pack(system_id, component_id, &msg , packet1.vtol_state , packet1.landed_state );
8239 mavlink_msg_extended_sys_state_decode(&msg, &packet2);
8240 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8242 memset(&packet2, 0, sizeof(packet2));
8243 mavlink_msg_extended_sys_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.vtol_state , packet1.landed_state );
8244 mavlink_msg_extended_sys_state_decode(&msg, &packet2);
8245 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8247 memset(&packet2, 0, sizeof(packet2));
8248 mavlink_msg_to_send_buffer(buffer, &msg);
8249 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8250 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8252 mavlink_msg_extended_sys_state_decode(last_msg, &packet2);
8253 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8255 memset(&packet2, 0, sizeof(packet2));
8256 mavlink_msg_extended_sys_state_send(MAVLINK_COMM_1 , packet1.vtol_state , packet1.landed_state );
8257 mavlink_msg_extended_sys_state_decode(last_msg, &packet2);
8258 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8261 static void mavlink_test_adsb_vehicle(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8263 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8264 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8265 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ADSB_VEHICLE >= 256) {
8266 return;
8268 #endif
8269 mavlink_message_t msg;
8270 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8271 uint16_t i;
8272 mavlink_adsb_vehicle_t packet_in = {
8273 963497464,963497672,963497880,963498088,18067,18171,18275,18379,18483,211,"BCDEFGHI",113,180
8275 mavlink_adsb_vehicle_t packet1, packet2;
8276 memset(&packet1, 0, sizeof(packet1));
8277 packet1.ICAO_address = packet_in.ICAO_address;
8278 packet1.lat = packet_in.lat;
8279 packet1.lon = packet_in.lon;
8280 packet1.altitude = packet_in.altitude;
8281 packet1.heading = packet_in.heading;
8282 packet1.hor_velocity = packet_in.hor_velocity;
8283 packet1.ver_velocity = packet_in.ver_velocity;
8284 packet1.flags = packet_in.flags;
8285 packet1.squawk = packet_in.squawk;
8286 packet1.altitude_type = packet_in.altitude_type;
8287 packet1.emitter_type = packet_in.emitter_type;
8288 packet1.tslc = packet_in.tslc;
8290 mav_array_memcpy(packet1.callsign, packet_in.callsign, sizeof(char)*9);
8292 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8293 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8294 // cope with extensions
8295 memset(MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN);
8297 #endif
8298 memset(&packet2, 0, sizeof(packet2));
8299 mavlink_msg_adsb_vehicle_encode(system_id, component_id, &msg, &packet1);
8300 mavlink_msg_adsb_vehicle_decode(&msg, &packet2);
8301 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8303 memset(&packet2, 0, sizeof(packet2));
8304 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 );
8305 mavlink_msg_adsb_vehicle_decode(&msg, &packet2);
8306 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8308 memset(&packet2, 0, sizeof(packet2));
8309 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 );
8310 mavlink_msg_adsb_vehicle_decode(&msg, &packet2);
8311 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8313 memset(&packet2, 0, sizeof(packet2));
8314 mavlink_msg_to_send_buffer(buffer, &msg);
8315 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8316 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8318 mavlink_msg_adsb_vehicle_decode(last_msg, &packet2);
8319 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8321 memset(&packet2, 0, sizeof(packet2));
8322 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 );
8323 mavlink_msg_adsb_vehicle_decode(last_msg, &packet2);
8324 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8327 static void mavlink_test_collision(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8329 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8330 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8331 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COLLISION >= 256) {
8332 return;
8334 #endif
8335 mavlink_message_t msg;
8336 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8337 uint16_t i;
8338 mavlink_collision_t packet_in = {
8339 963497464,45.0,73.0,101.0,53,120,187
8341 mavlink_collision_t packet1, packet2;
8342 memset(&packet1, 0, sizeof(packet1));
8343 packet1.id = packet_in.id;
8344 packet1.time_to_minimum_delta = packet_in.time_to_minimum_delta;
8345 packet1.altitude_minimum_delta = packet_in.altitude_minimum_delta;
8346 packet1.horizontal_minimum_delta = packet_in.horizontal_minimum_delta;
8347 packet1.src = packet_in.src;
8348 packet1.action = packet_in.action;
8349 packet1.threat_level = packet_in.threat_level;
8352 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8353 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8354 // cope with extensions
8355 memset(MAVLINK_MSG_ID_COLLISION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COLLISION_MIN_LEN);
8357 #endif
8358 memset(&packet2, 0, sizeof(packet2));
8359 mavlink_msg_collision_encode(system_id, component_id, &msg, &packet1);
8360 mavlink_msg_collision_decode(&msg, &packet2);
8361 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8363 memset(&packet2, 0, sizeof(packet2));
8364 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 );
8365 mavlink_msg_collision_decode(&msg, &packet2);
8366 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8368 memset(&packet2, 0, sizeof(packet2));
8369 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 );
8370 mavlink_msg_collision_decode(&msg, &packet2);
8371 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8373 memset(&packet2, 0, sizeof(packet2));
8374 mavlink_msg_to_send_buffer(buffer, &msg);
8375 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8376 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8378 mavlink_msg_collision_decode(last_msg, &packet2);
8379 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8381 memset(&packet2, 0, sizeof(packet2));
8382 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 );
8383 mavlink_msg_collision_decode(last_msg, &packet2);
8384 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8387 static void mavlink_test_v2_extension(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8389 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8390 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8391 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_V2_EXTENSION >= 256) {
8392 return;
8394 #endif
8395 mavlink_message_t msg;
8396 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8397 uint16_t i;
8398 mavlink_v2_extension_t packet_in = {
8399 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 }
8401 mavlink_v2_extension_t packet1, packet2;
8402 memset(&packet1, 0, sizeof(packet1));
8403 packet1.message_type = packet_in.message_type;
8404 packet1.target_network = packet_in.target_network;
8405 packet1.target_system = packet_in.target_system;
8406 packet1.target_component = packet_in.target_component;
8408 mav_array_memcpy(packet1.payload, packet_in.payload, sizeof(uint8_t)*249);
8410 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8411 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8412 // cope with extensions
8413 memset(MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN);
8415 #endif
8416 memset(&packet2, 0, sizeof(packet2));
8417 mavlink_msg_v2_extension_encode(system_id, component_id, &msg, &packet1);
8418 mavlink_msg_v2_extension_decode(&msg, &packet2);
8419 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8421 memset(&packet2, 0, sizeof(packet2));
8422 mavlink_msg_v2_extension_pack(system_id, component_id, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.message_type , packet1.payload );
8423 mavlink_msg_v2_extension_decode(&msg, &packet2);
8424 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8426 memset(&packet2, 0, sizeof(packet2));
8427 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 );
8428 mavlink_msg_v2_extension_decode(&msg, &packet2);
8429 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8431 memset(&packet2, 0, sizeof(packet2));
8432 mavlink_msg_to_send_buffer(buffer, &msg);
8433 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8434 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8436 mavlink_msg_v2_extension_decode(last_msg, &packet2);
8437 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8439 memset(&packet2, 0, sizeof(packet2));
8440 mavlink_msg_v2_extension_send(MAVLINK_COMM_1 , packet1.target_network , packet1.target_system , packet1.target_component , packet1.message_type , packet1.payload );
8441 mavlink_msg_v2_extension_decode(last_msg, &packet2);
8442 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8445 static void mavlink_test_memory_vect(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8447 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8448 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8449 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MEMORY_VECT >= 256) {
8450 return;
8452 #endif
8453 mavlink_message_t msg;
8454 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8455 uint16_t i;
8456 mavlink_memory_vect_t packet_in = {
8457 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 }
8459 mavlink_memory_vect_t packet1, packet2;
8460 memset(&packet1, 0, sizeof(packet1));
8461 packet1.address = packet_in.address;
8462 packet1.ver = packet_in.ver;
8463 packet1.type = packet_in.type;
8465 mav_array_memcpy(packet1.value, packet_in.value, sizeof(int8_t)*32);
8467 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8468 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8469 // cope with extensions
8470 memset(MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN);
8472 #endif
8473 memset(&packet2, 0, sizeof(packet2));
8474 mavlink_msg_memory_vect_encode(system_id, component_id, &msg, &packet1);
8475 mavlink_msg_memory_vect_decode(&msg, &packet2);
8476 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8478 memset(&packet2, 0, sizeof(packet2));
8479 mavlink_msg_memory_vect_pack(system_id, component_id, &msg , packet1.address , packet1.ver , packet1.type , packet1.value );
8480 mavlink_msg_memory_vect_decode(&msg, &packet2);
8481 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8483 memset(&packet2, 0, sizeof(packet2));
8484 mavlink_msg_memory_vect_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.address , packet1.ver , packet1.type , packet1.value );
8485 mavlink_msg_memory_vect_decode(&msg, &packet2);
8486 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8488 memset(&packet2, 0, sizeof(packet2));
8489 mavlink_msg_to_send_buffer(buffer, &msg);
8490 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8491 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8493 mavlink_msg_memory_vect_decode(last_msg, &packet2);
8494 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8496 memset(&packet2, 0, sizeof(packet2));
8497 mavlink_msg_memory_vect_send(MAVLINK_COMM_1 , packet1.address , packet1.ver , packet1.type , packet1.value );
8498 mavlink_msg_memory_vect_decode(last_msg, &packet2);
8499 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8502 static void mavlink_test_debug_vect(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8504 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8505 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8506 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DEBUG_VECT >= 256) {
8507 return;
8509 #endif
8510 mavlink_message_t msg;
8511 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8512 uint16_t i;
8513 mavlink_debug_vect_t packet_in = {
8514 93372036854775807ULL,73.0,101.0,129.0,"UVWXYZABC"
8516 mavlink_debug_vect_t packet1, packet2;
8517 memset(&packet1, 0, sizeof(packet1));
8518 packet1.time_usec = packet_in.time_usec;
8519 packet1.x = packet_in.x;
8520 packet1.y = packet_in.y;
8521 packet1.z = packet_in.z;
8523 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*10);
8525 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8526 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8527 // cope with extensions
8528 memset(MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN);
8530 #endif
8531 memset(&packet2, 0, sizeof(packet2));
8532 mavlink_msg_debug_vect_encode(system_id, component_id, &msg, &packet1);
8533 mavlink_msg_debug_vect_decode(&msg, &packet2);
8534 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8536 memset(&packet2, 0, sizeof(packet2));
8537 mavlink_msg_debug_vect_pack(system_id, component_id, &msg , packet1.name , packet1.time_usec , packet1.x , packet1.y , packet1.z );
8538 mavlink_msg_debug_vect_decode(&msg, &packet2);
8539 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8541 memset(&packet2, 0, sizeof(packet2));
8542 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 );
8543 mavlink_msg_debug_vect_decode(&msg, &packet2);
8544 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8546 memset(&packet2, 0, sizeof(packet2));
8547 mavlink_msg_to_send_buffer(buffer, &msg);
8548 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8549 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8551 mavlink_msg_debug_vect_decode(last_msg, &packet2);
8552 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8554 memset(&packet2, 0, sizeof(packet2));
8555 mavlink_msg_debug_vect_send(MAVLINK_COMM_1 , packet1.name , packet1.time_usec , packet1.x , packet1.y , packet1.z );
8556 mavlink_msg_debug_vect_decode(last_msg, &packet2);
8557 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8560 static void mavlink_test_named_value_float(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8562 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8563 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8564 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_NAMED_VALUE_FLOAT >= 256) {
8565 return;
8567 #endif
8568 mavlink_message_t msg;
8569 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8570 uint16_t i;
8571 mavlink_named_value_float_t packet_in = {
8572 963497464,45.0,"IJKLMNOPQ"
8574 mavlink_named_value_float_t packet1, packet2;
8575 memset(&packet1, 0, sizeof(packet1));
8576 packet1.time_boot_ms = packet_in.time_boot_ms;
8577 packet1.value = packet_in.value;
8579 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*10);
8581 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8582 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8583 // cope with extensions
8584 memset(MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN);
8586 #endif
8587 memset(&packet2, 0, sizeof(packet2));
8588 mavlink_msg_named_value_float_encode(system_id, component_id, &msg, &packet1);
8589 mavlink_msg_named_value_float_decode(&msg, &packet2);
8590 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8592 memset(&packet2, 0, sizeof(packet2));
8593 mavlink_msg_named_value_float_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.name , packet1.value );
8594 mavlink_msg_named_value_float_decode(&msg, &packet2);
8595 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8597 memset(&packet2, 0, sizeof(packet2));
8598 mavlink_msg_named_value_float_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.name , packet1.value );
8599 mavlink_msg_named_value_float_decode(&msg, &packet2);
8600 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8602 memset(&packet2, 0, sizeof(packet2));
8603 mavlink_msg_to_send_buffer(buffer, &msg);
8604 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8605 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8607 mavlink_msg_named_value_float_decode(last_msg, &packet2);
8608 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8610 memset(&packet2, 0, sizeof(packet2));
8611 mavlink_msg_named_value_float_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.name , packet1.value );
8612 mavlink_msg_named_value_float_decode(last_msg, &packet2);
8613 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8616 static void mavlink_test_named_value_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8618 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8619 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8620 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_NAMED_VALUE_INT >= 256) {
8621 return;
8623 #endif
8624 mavlink_message_t msg;
8625 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8626 uint16_t i;
8627 mavlink_named_value_int_t packet_in = {
8628 963497464,963497672,"IJKLMNOPQ"
8630 mavlink_named_value_int_t packet1, packet2;
8631 memset(&packet1, 0, sizeof(packet1));
8632 packet1.time_boot_ms = packet_in.time_boot_ms;
8633 packet1.value = packet_in.value;
8635 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*10);
8637 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8638 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8639 // cope with extensions
8640 memset(MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN);
8642 #endif
8643 memset(&packet2, 0, sizeof(packet2));
8644 mavlink_msg_named_value_int_encode(system_id, component_id, &msg, &packet1);
8645 mavlink_msg_named_value_int_decode(&msg, &packet2);
8646 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8648 memset(&packet2, 0, sizeof(packet2));
8649 mavlink_msg_named_value_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.name , packet1.value );
8650 mavlink_msg_named_value_int_decode(&msg, &packet2);
8651 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8653 memset(&packet2, 0, sizeof(packet2));
8654 mavlink_msg_named_value_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.name , packet1.value );
8655 mavlink_msg_named_value_int_decode(&msg, &packet2);
8656 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8658 memset(&packet2, 0, sizeof(packet2));
8659 mavlink_msg_to_send_buffer(buffer, &msg);
8660 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8661 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8663 mavlink_msg_named_value_int_decode(last_msg, &packet2);
8664 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8666 memset(&packet2, 0, sizeof(packet2));
8667 mavlink_msg_named_value_int_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.name , packet1.value );
8668 mavlink_msg_named_value_int_decode(last_msg, &packet2);
8669 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8672 static void mavlink_test_statustext(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8674 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8675 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8676 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_STATUSTEXT >= 256) {
8677 return;
8679 #endif
8680 mavlink_message_t msg;
8681 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8682 uint16_t i;
8683 mavlink_statustext_t packet_in = {
8684 5,"BCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX",19887,228
8686 mavlink_statustext_t packet1, packet2;
8687 memset(&packet1, 0, sizeof(packet1));
8688 packet1.severity = packet_in.severity;
8689 packet1.id = packet_in.id;
8690 packet1.chunk_seq = packet_in.chunk_seq;
8692 mav_array_memcpy(packet1.text, packet_in.text, sizeof(char)*50);
8694 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8695 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8696 // cope with extensions
8697 memset(MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN);
8699 #endif
8700 memset(&packet2, 0, sizeof(packet2));
8701 mavlink_msg_statustext_encode(system_id, component_id, &msg, &packet1);
8702 mavlink_msg_statustext_decode(&msg, &packet2);
8703 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8705 memset(&packet2, 0, sizeof(packet2));
8706 mavlink_msg_statustext_pack(system_id, component_id, &msg , packet1.severity , packet1.text , packet1.id , packet1.chunk_seq );
8707 mavlink_msg_statustext_decode(&msg, &packet2);
8708 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8710 memset(&packet2, 0, sizeof(packet2));
8711 mavlink_msg_statustext_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.severity , packet1.text , packet1.id , packet1.chunk_seq );
8712 mavlink_msg_statustext_decode(&msg, &packet2);
8713 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8715 memset(&packet2, 0, sizeof(packet2));
8716 mavlink_msg_to_send_buffer(buffer, &msg);
8717 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8718 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8720 mavlink_msg_statustext_decode(last_msg, &packet2);
8721 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8723 memset(&packet2, 0, sizeof(packet2));
8724 mavlink_msg_statustext_send(MAVLINK_COMM_1 , packet1.severity , packet1.text , packet1.id , packet1.chunk_seq );
8725 mavlink_msg_statustext_decode(last_msg, &packet2);
8726 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8729 static void mavlink_test_debug(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8731 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8732 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8733 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DEBUG >= 256) {
8734 return;
8736 #endif
8737 mavlink_message_t msg;
8738 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8739 uint16_t i;
8740 mavlink_debug_t packet_in = {
8741 963497464,45.0,29
8743 mavlink_debug_t packet1, packet2;
8744 memset(&packet1, 0, sizeof(packet1));
8745 packet1.time_boot_ms = packet_in.time_boot_ms;
8746 packet1.value = packet_in.value;
8747 packet1.ind = packet_in.ind;
8750 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8751 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8752 // cope with extensions
8753 memset(MAVLINK_MSG_ID_DEBUG_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DEBUG_MIN_LEN);
8755 #endif
8756 memset(&packet2, 0, sizeof(packet2));
8757 mavlink_msg_debug_encode(system_id, component_id, &msg, &packet1);
8758 mavlink_msg_debug_decode(&msg, &packet2);
8759 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8761 memset(&packet2, 0, sizeof(packet2));
8762 mavlink_msg_debug_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.ind , packet1.value );
8763 mavlink_msg_debug_decode(&msg, &packet2);
8764 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8766 memset(&packet2, 0, sizeof(packet2));
8767 mavlink_msg_debug_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.ind , packet1.value );
8768 mavlink_msg_debug_decode(&msg, &packet2);
8769 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8771 memset(&packet2, 0, sizeof(packet2));
8772 mavlink_msg_to_send_buffer(buffer, &msg);
8773 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8774 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8776 mavlink_msg_debug_decode(last_msg, &packet2);
8777 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8779 memset(&packet2, 0, sizeof(packet2));
8780 mavlink_msg_debug_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.ind , packet1.value );
8781 mavlink_msg_debug_decode(last_msg, &packet2);
8782 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8785 static void mavlink_test_setup_signing(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8787 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8788 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8789 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SETUP_SIGNING >= 256) {
8790 return;
8792 #endif
8793 mavlink_message_t msg;
8794 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8795 uint16_t i;
8796 mavlink_setup_signing_t packet_in = {
8797 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 }
8799 mavlink_setup_signing_t packet1, packet2;
8800 memset(&packet1, 0, sizeof(packet1));
8801 packet1.initial_timestamp = packet_in.initial_timestamp;
8802 packet1.target_system = packet_in.target_system;
8803 packet1.target_component = packet_in.target_component;
8805 mav_array_memcpy(packet1.secret_key, packet_in.secret_key, sizeof(uint8_t)*32);
8807 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8808 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8809 // cope with extensions
8810 memset(MAVLINK_MSG_ID_SETUP_SIGNING_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SETUP_SIGNING_MIN_LEN);
8812 #endif
8813 memset(&packet2, 0, sizeof(packet2));
8814 mavlink_msg_setup_signing_encode(system_id, component_id, &msg, &packet1);
8815 mavlink_msg_setup_signing_decode(&msg, &packet2);
8816 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8818 memset(&packet2, 0, sizeof(packet2));
8819 mavlink_msg_setup_signing_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.secret_key , packet1.initial_timestamp );
8820 mavlink_msg_setup_signing_decode(&msg, &packet2);
8821 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8823 memset(&packet2, 0, sizeof(packet2));
8824 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 );
8825 mavlink_msg_setup_signing_decode(&msg, &packet2);
8826 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8828 memset(&packet2, 0, sizeof(packet2));
8829 mavlink_msg_to_send_buffer(buffer, &msg);
8830 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8831 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8833 mavlink_msg_setup_signing_decode(last_msg, &packet2);
8834 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8836 memset(&packet2, 0, sizeof(packet2));
8837 mavlink_msg_setup_signing_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.secret_key , packet1.initial_timestamp );
8838 mavlink_msg_setup_signing_decode(last_msg, &packet2);
8839 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8842 static void mavlink_test_button_change(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8844 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8845 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8846 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_BUTTON_CHANGE >= 256) {
8847 return;
8849 #endif
8850 mavlink_message_t msg;
8851 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8852 uint16_t i;
8853 mavlink_button_change_t packet_in = {
8854 963497464,963497672,29
8856 mavlink_button_change_t packet1, packet2;
8857 memset(&packet1, 0, sizeof(packet1));
8858 packet1.time_boot_ms = packet_in.time_boot_ms;
8859 packet1.last_change_ms = packet_in.last_change_ms;
8860 packet1.state = packet_in.state;
8863 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8864 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8865 // cope with extensions
8866 memset(MAVLINK_MSG_ID_BUTTON_CHANGE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_BUTTON_CHANGE_MIN_LEN);
8868 #endif
8869 memset(&packet2, 0, sizeof(packet2));
8870 mavlink_msg_button_change_encode(system_id, component_id, &msg, &packet1);
8871 mavlink_msg_button_change_decode(&msg, &packet2);
8872 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8874 memset(&packet2, 0, sizeof(packet2));
8875 mavlink_msg_button_change_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.last_change_ms , packet1.state );
8876 mavlink_msg_button_change_decode(&msg, &packet2);
8877 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8879 memset(&packet2, 0, sizeof(packet2));
8880 mavlink_msg_button_change_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.last_change_ms , packet1.state );
8881 mavlink_msg_button_change_decode(&msg, &packet2);
8882 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8884 memset(&packet2, 0, sizeof(packet2));
8885 mavlink_msg_to_send_buffer(buffer, &msg);
8886 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8887 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8889 mavlink_msg_button_change_decode(last_msg, &packet2);
8890 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8892 memset(&packet2, 0, sizeof(packet2));
8893 mavlink_msg_button_change_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.last_change_ms , packet1.state );
8894 mavlink_msg_button_change_decode(last_msg, &packet2);
8895 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8898 static void mavlink_test_play_tune(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8900 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8901 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8902 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PLAY_TUNE >= 256) {
8903 return;
8905 #endif
8906 mavlink_message_t msg;
8907 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8908 uint16_t i;
8909 mavlink_play_tune_t packet_in = {
8910 5,72,"CDEFGHIJKLMNOPQRSTUVWXYZABCDE","GHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVW"
8912 mavlink_play_tune_t packet1, packet2;
8913 memset(&packet1, 0, sizeof(packet1));
8914 packet1.target_system = packet_in.target_system;
8915 packet1.target_component = packet_in.target_component;
8917 mav_array_memcpy(packet1.tune, packet_in.tune, sizeof(char)*30);
8918 mav_array_memcpy(packet1.tune2, packet_in.tune2, sizeof(char)*200);
8920 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8921 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8922 // cope with extensions
8923 memset(MAVLINK_MSG_ID_PLAY_TUNE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PLAY_TUNE_MIN_LEN);
8925 #endif
8926 memset(&packet2, 0, sizeof(packet2));
8927 mavlink_msg_play_tune_encode(system_id, component_id, &msg, &packet1);
8928 mavlink_msg_play_tune_decode(&msg, &packet2);
8929 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8931 memset(&packet2, 0, sizeof(packet2));
8932 mavlink_msg_play_tune_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.tune , packet1.tune2 );
8933 mavlink_msg_play_tune_decode(&msg, &packet2);
8934 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8936 memset(&packet2, 0, sizeof(packet2));
8937 mavlink_msg_play_tune_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.tune , packet1.tune2 );
8938 mavlink_msg_play_tune_decode(&msg, &packet2);
8939 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8941 memset(&packet2, 0, sizeof(packet2));
8942 mavlink_msg_to_send_buffer(buffer, &msg);
8943 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8944 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8946 mavlink_msg_play_tune_decode(last_msg, &packet2);
8947 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8949 memset(&packet2, 0, sizeof(packet2));
8950 mavlink_msg_play_tune_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.tune , packet1.tune2 );
8951 mavlink_msg_play_tune_decode(last_msg, &packet2);
8952 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8955 static void mavlink_test_camera_information(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8957 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8958 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8959 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_INFORMATION >= 256) {
8960 return;
8962 #endif
8963 mavlink_message_t msg;
8964 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8965 uint16_t i;
8966 mavlink_camera_information_t packet_in = {
8967 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"
8969 mavlink_camera_information_t packet1, packet2;
8970 memset(&packet1, 0, sizeof(packet1));
8971 packet1.time_boot_ms = packet_in.time_boot_ms;
8972 packet1.firmware_version = packet_in.firmware_version;
8973 packet1.focal_length = packet_in.focal_length;
8974 packet1.sensor_size_h = packet_in.sensor_size_h;
8975 packet1.sensor_size_v = packet_in.sensor_size_v;
8976 packet1.flags = packet_in.flags;
8977 packet1.resolution_h = packet_in.resolution_h;
8978 packet1.resolution_v = packet_in.resolution_v;
8979 packet1.cam_definition_version = packet_in.cam_definition_version;
8980 packet1.lens_id = packet_in.lens_id;
8982 mav_array_memcpy(packet1.vendor_name, packet_in.vendor_name, sizeof(uint8_t)*32);
8983 mav_array_memcpy(packet1.model_name, packet_in.model_name, sizeof(uint8_t)*32);
8984 mav_array_memcpy(packet1.cam_definition_uri, packet_in.cam_definition_uri, sizeof(char)*140);
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_CAMERA_INFORMATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_INFORMATION_MIN_LEN);
8991 #endif
8992 memset(&packet2, 0, sizeof(packet2));
8993 mavlink_msg_camera_information_encode(system_id, component_id, &msg, &packet1);
8994 mavlink_msg_camera_information_decode(&msg, &packet2);
8995 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
8997 memset(&packet2, 0, sizeof(packet2));
8998 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 );
8999 mavlink_msg_camera_information_decode(&msg, &packet2);
9000 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9002 memset(&packet2, 0, sizeof(packet2));
9003 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 );
9004 mavlink_msg_camera_information_decode(&msg, &packet2);
9005 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
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]);
9012 mavlink_msg_camera_information_decode(last_msg, &packet2);
9013 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9015 memset(&packet2, 0, sizeof(packet2));
9016 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 );
9017 mavlink_msg_camera_information_decode(last_msg, &packet2);
9018 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9021 static void mavlink_test_camera_settings(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9023 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9024 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9025 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_SETTINGS >= 256) {
9026 return;
9028 #endif
9029 mavlink_message_t msg;
9030 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9031 uint16_t i;
9032 mavlink_camera_settings_t packet_in = {
9033 963497464,17,52.0,80.0
9035 mavlink_camera_settings_t packet1, packet2;
9036 memset(&packet1, 0, sizeof(packet1));
9037 packet1.time_boot_ms = packet_in.time_boot_ms;
9038 packet1.mode_id = packet_in.mode_id;
9039 packet1.zoomLevel = packet_in.zoomLevel;
9040 packet1.focusLevel = packet_in.focusLevel;
9043 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9044 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9045 // cope with extensions
9046 memset(MAVLINK_MSG_ID_CAMERA_SETTINGS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_SETTINGS_MIN_LEN);
9048 #endif
9049 memset(&packet2, 0, sizeof(packet2));
9050 mavlink_msg_camera_settings_encode(system_id, component_id, &msg, &packet1);
9051 mavlink_msg_camera_settings_decode(&msg, &packet2);
9052 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9054 memset(&packet2, 0, sizeof(packet2));
9055 mavlink_msg_camera_settings_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.mode_id , packet1.zoomLevel , packet1.focusLevel );
9056 mavlink_msg_camera_settings_decode(&msg, &packet2);
9057 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9059 memset(&packet2, 0, sizeof(packet2));
9060 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 );
9061 mavlink_msg_camera_settings_decode(&msg, &packet2);
9062 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9064 memset(&packet2, 0, sizeof(packet2));
9065 mavlink_msg_to_send_buffer(buffer, &msg);
9066 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9067 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9069 mavlink_msg_camera_settings_decode(last_msg, &packet2);
9070 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9072 memset(&packet2, 0, sizeof(packet2));
9073 mavlink_msg_camera_settings_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.mode_id , packet1.zoomLevel , packet1.focusLevel );
9074 mavlink_msg_camera_settings_decode(last_msg, &packet2);
9075 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9078 static void mavlink_test_storage_information(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9080 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9081 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9082 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_STORAGE_INFORMATION >= 256) {
9083 return;
9085 #endif
9086 mavlink_message_t msg;
9087 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9088 uint16_t i;
9089 mavlink_storage_information_t packet_in = {
9090 963497464,45.0,73.0,101.0,129.0,157.0,77,144,211,22,"CDEFGHIJKLMNOPQRSTUVWXYZABCDEFG"
9092 mavlink_storage_information_t packet1, packet2;
9093 memset(&packet1, 0, sizeof(packet1));
9094 packet1.time_boot_ms = packet_in.time_boot_ms;
9095 packet1.total_capacity = packet_in.total_capacity;
9096 packet1.used_capacity = packet_in.used_capacity;
9097 packet1.available_capacity = packet_in.available_capacity;
9098 packet1.read_speed = packet_in.read_speed;
9099 packet1.write_speed = packet_in.write_speed;
9100 packet1.storage_id = packet_in.storage_id;
9101 packet1.storage_count = packet_in.storage_count;
9102 packet1.status = packet_in.status;
9103 packet1.type = packet_in.type;
9105 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*32);
9107 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9108 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9109 // cope with extensions
9110 memset(MAVLINK_MSG_ID_STORAGE_INFORMATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_STORAGE_INFORMATION_MIN_LEN);
9112 #endif
9113 memset(&packet2, 0, sizeof(packet2));
9114 mavlink_msg_storage_information_encode(system_id, component_id, &msg, &packet1);
9115 mavlink_msg_storage_information_decode(&msg, &packet2);
9116 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9118 memset(&packet2, 0, sizeof(packet2));
9119 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 );
9120 mavlink_msg_storage_information_decode(&msg, &packet2);
9121 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9123 memset(&packet2, 0, sizeof(packet2));
9124 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 );
9125 mavlink_msg_storage_information_decode(&msg, &packet2);
9126 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9128 memset(&packet2, 0, sizeof(packet2));
9129 mavlink_msg_to_send_buffer(buffer, &msg);
9130 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9131 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9133 mavlink_msg_storage_information_decode(last_msg, &packet2);
9134 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9136 memset(&packet2, 0, sizeof(packet2));
9137 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 );
9138 mavlink_msg_storage_information_decode(last_msg, &packet2);
9139 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9142 static void mavlink_test_camera_capture_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9144 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9145 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9146 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS >= 256) {
9147 return;
9149 #endif
9150 mavlink_message_t msg;
9151 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9152 uint16_t i;
9153 mavlink_camera_capture_status_t packet_in = {
9154 963497464,45.0,963497880,101.0,53,120,963498400
9156 mavlink_camera_capture_status_t packet1, packet2;
9157 memset(&packet1, 0, sizeof(packet1));
9158 packet1.time_boot_ms = packet_in.time_boot_ms;
9159 packet1.image_interval = packet_in.image_interval;
9160 packet1.recording_time_ms = packet_in.recording_time_ms;
9161 packet1.available_capacity = packet_in.available_capacity;
9162 packet1.image_status = packet_in.image_status;
9163 packet1.video_status = packet_in.video_status;
9164 packet1.image_count = packet_in.image_count;
9167 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9168 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9169 // cope with extensions
9170 memset(MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN);
9172 #endif
9173 memset(&packet2, 0, sizeof(packet2));
9174 mavlink_msg_camera_capture_status_encode(system_id, component_id, &msg, &packet1);
9175 mavlink_msg_camera_capture_status_decode(&msg, &packet2);
9176 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9178 memset(&packet2, 0, sizeof(packet2));
9179 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 );
9180 mavlink_msg_camera_capture_status_decode(&msg, &packet2);
9181 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9183 memset(&packet2, 0, sizeof(packet2));
9184 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 );
9185 mavlink_msg_camera_capture_status_decode(&msg, &packet2);
9186 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9188 memset(&packet2, 0, sizeof(packet2));
9189 mavlink_msg_to_send_buffer(buffer, &msg);
9190 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9191 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9193 mavlink_msg_camera_capture_status_decode(last_msg, &packet2);
9194 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9196 memset(&packet2, 0, sizeof(packet2));
9197 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 );
9198 mavlink_msg_camera_capture_status_decode(last_msg, &packet2);
9199 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9202 static void mavlink_test_camera_image_captured(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9204 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9205 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9206 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED >= 256) {
9207 return;
9209 #endif
9210 mavlink_message_t msg;
9211 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9212 uint16_t i;
9213 mavlink_camera_image_captured_t packet_in = {
9214 93372036854775807ULL,963497880,963498088,963498296,963498504,963498712,{ 213.0, 214.0, 215.0, 216.0 },963499752,149,216,"YZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRST"
9216 mavlink_camera_image_captured_t packet1, packet2;
9217 memset(&packet1, 0, sizeof(packet1));
9218 packet1.time_utc = packet_in.time_utc;
9219 packet1.time_boot_ms = packet_in.time_boot_ms;
9220 packet1.lat = packet_in.lat;
9221 packet1.lon = packet_in.lon;
9222 packet1.alt = packet_in.alt;
9223 packet1.relative_alt = packet_in.relative_alt;
9224 packet1.image_index = packet_in.image_index;
9225 packet1.camera_id = packet_in.camera_id;
9226 packet1.capture_result = packet_in.capture_result;
9228 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
9229 mav_array_memcpy(packet1.file_url, packet_in.file_url, sizeof(char)*205);
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_CAMERA_IMAGE_CAPTURED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN);
9236 #endif
9237 memset(&packet2, 0, sizeof(packet2));
9238 mavlink_msg_camera_image_captured_encode(system_id, component_id, &msg, &packet1);
9239 mavlink_msg_camera_image_captured_decode(&msg, &packet2);
9240 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9242 memset(&packet2, 0, sizeof(packet2));
9243 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 );
9244 mavlink_msg_camera_image_captured_decode(&msg, &packet2);
9245 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9247 memset(&packet2, 0, sizeof(packet2));
9248 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 );
9249 mavlink_msg_camera_image_captured_decode(&msg, &packet2);
9250 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
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]);
9257 mavlink_msg_camera_image_captured_decode(last_msg, &packet2);
9258 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9260 memset(&packet2, 0, sizeof(packet2));
9261 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 );
9262 mavlink_msg_camera_image_captured_decode(last_msg, &packet2);
9263 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9266 static void mavlink_test_flight_information(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9268 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9269 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9270 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FLIGHT_INFORMATION >= 256) {
9271 return;
9273 #endif
9274 mavlink_message_t msg;
9275 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9276 uint16_t i;
9277 mavlink_flight_information_t packet_in = {
9278 93372036854775807ULL,93372036854776311ULL,93372036854776815ULL,963498712
9280 mavlink_flight_information_t packet1, packet2;
9281 memset(&packet1, 0, sizeof(packet1));
9282 packet1.arming_time_utc = packet_in.arming_time_utc;
9283 packet1.takeoff_time_utc = packet_in.takeoff_time_utc;
9284 packet1.flight_uuid = packet_in.flight_uuid;
9285 packet1.time_boot_ms = packet_in.time_boot_ms;
9288 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9289 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9290 // cope with extensions
9291 memset(MAVLINK_MSG_ID_FLIGHT_INFORMATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FLIGHT_INFORMATION_MIN_LEN);
9293 #endif
9294 memset(&packet2, 0, sizeof(packet2));
9295 mavlink_msg_flight_information_encode(system_id, component_id, &msg, &packet1);
9296 mavlink_msg_flight_information_decode(&msg, &packet2);
9297 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9299 memset(&packet2, 0, sizeof(packet2));
9300 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 );
9301 mavlink_msg_flight_information_decode(&msg, &packet2);
9302 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9304 memset(&packet2, 0, sizeof(packet2));
9305 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 );
9306 mavlink_msg_flight_information_decode(&msg, &packet2);
9307 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9309 memset(&packet2, 0, sizeof(packet2));
9310 mavlink_msg_to_send_buffer(buffer, &msg);
9311 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9312 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9314 mavlink_msg_flight_information_decode(last_msg, &packet2);
9315 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9317 memset(&packet2, 0, sizeof(packet2));
9318 mavlink_msg_flight_information_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.arming_time_utc , packet1.takeoff_time_utc , packet1.flight_uuid );
9319 mavlink_msg_flight_information_decode(last_msg, &packet2);
9320 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9323 static void mavlink_test_mount_orientation(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9325 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9326 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9327 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MOUNT_ORIENTATION >= 256) {
9328 return;
9330 #endif
9331 mavlink_message_t msg;
9332 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9333 uint16_t i;
9334 mavlink_mount_orientation_t packet_in = {
9335 963497464,45.0,73.0,101.0,129.0
9337 mavlink_mount_orientation_t packet1, packet2;
9338 memset(&packet1, 0, sizeof(packet1));
9339 packet1.time_boot_ms = packet_in.time_boot_ms;
9340 packet1.roll = packet_in.roll;
9341 packet1.pitch = packet_in.pitch;
9342 packet1.yaw = packet_in.yaw;
9343 packet1.yaw_absolute = packet_in.yaw_absolute;
9346 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9347 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9348 // cope with extensions
9349 memset(MAVLINK_MSG_ID_MOUNT_ORIENTATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MOUNT_ORIENTATION_MIN_LEN);
9351 #endif
9352 memset(&packet2, 0, sizeof(packet2));
9353 mavlink_msg_mount_orientation_encode(system_id, component_id, &msg, &packet1);
9354 mavlink_msg_mount_orientation_decode(&msg, &packet2);
9355 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9357 memset(&packet2, 0, sizeof(packet2));
9358 mavlink_msg_mount_orientation_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.yaw_absolute );
9359 mavlink_msg_mount_orientation_decode(&msg, &packet2);
9360 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9362 memset(&packet2, 0, sizeof(packet2));
9363 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 );
9364 mavlink_msg_mount_orientation_decode(&msg, &packet2);
9365 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9367 memset(&packet2, 0, sizeof(packet2));
9368 mavlink_msg_to_send_buffer(buffer, &msg);
9369 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9370 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9372 mavlink_msg_mount_orientation_decode(last_msg, &packet2);
9373 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9375 memset(&packet2, 0, sizeof(packet2));
9376 mavlink_msg_mount_orientation_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.yaw_absolute );
9377 mavlink_msg_mount_orientation_decode(last_msg, &packet2);
9378 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9381 static void mavlink_test_logging_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9383 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9384 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9385 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOGGING_DATA >= 256) {
9386 return;
9388 #endif
9389 mavlink_message_t msg;
9390 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9391 uint16_t i;
9392 mavlink_logging_data_t packet_in = {
9393 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 }
9395 mavlink_logging_data_t packet1, packet2;
9396 memset(&packet1, 0, sizeof(packet1));
9397 packet1.sequence = packet_in.sequence;
9398 packet1.target_system = packet_in.target_system;
9399 packet1.target_component = packet_in.target_component;
9400 packet1.length = packet_in.length;
9401 packet1.first_message_offset = packet_in.first_message_offset;
9403 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*249);
9405 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9406 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9407 // cope with extensions
9408 memset(MAVLINK_MSG_ID_LOGGING_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOGGING_DATA_MIN_LEN);
9410 #endif
9411 memset(&packet2, 0, sizeof(packet2));
9412 mavlink_msg_logging_data_encode(system_id, component_id, &msg, &packet1);
9413 mavlink_msg_logging_data_decode(&msg, &packet2);
9414 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9416 memset(&packet2, 0, sizeof(packet2));
9417 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 );
9418 mavlink_msg_logging_data_decode(&msg, &packet2);
9419 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9421 memset(&packet2, 0, sizeof(packet2));
9422 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 );
9423 mavlink_msg_logging_data_decode(&msg, &packet2);
9424 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9426 memset(&packet2, 0, sizeof(packet2));
9427 mavlink_msg_to_send_buffer(buffer, &msg);
9428 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9429 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9431 mavlink_msg_logging_data_decode(last_msg, &packet2);
9432 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9434 memset(&packet2, 0, sizeof(packet2));
9435 mavlink_msg_logging_data_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.sequence , packet1.length , packet1.first_message_offset , packet1.data );
9436 mavlink_msg_logging_data_decode(last_msg, &packet2);
9437 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9440 static void mavlink_test_logging_data_acked(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9442 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9443 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9444 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOGGING_DATA_ACKED >= 256) {
9445 return;
9447 #endif
9448 mavlink_message_t msg;
9449 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9450 uint16_t i;
9451 mavlink_logging_data_acked_t packet_in = {
9452 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 }
9454 mavlink_logging_data_acked_t packet1, packet2;
9455 memset(&packet1, 0, sizeof(packet1));
9456 packet1.sequence = packet_in.sequence;
9457 packet1.target_system = packet_in.target_system;
9458 packet1.target_component = packet_in.target_component;
9459 packet1.length = packet_in.length;
9460 packet1.first_message_offset = packet_in.first_message_offset;
9462 mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*249);
9464 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9465 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9466 // cope with extensions
9467 memset(MAVLINK_MSG_ID_LOGGING_DATA_ACKED_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOGGING_DATA_ACKED_MIN_LEN);
9469 #endif
9470 memset(&packet2, 0, sizeof(packet2));
9471 mavlink_msg_logging_data_acked_encode(system_id, component_id, &msg, &packet1);
9472 mavlink_msg_logging_data_acked_decode(&msg, &packet2);
9473 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9475 memset(&packet2, 0, sizeof(packet2));
9476 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 );
9477 mavlink_msg_logging_data_acked_decode(&msg, &packet2);
9478 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9480 memset(&packet2, 0, sizeof(packet2));
9481 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 );
9482 mavlink_msg_logging_data_acked_decode(&msg, &packet2);
9483 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9485 memset(&packet2, 0, sizeof(packet2));
9486 mavlink_msg_to_send_buffer(buffer, &msg);
9487 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9488 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9490 mavlink_msg_logging_data_acked_decode(last_msg, &packet2);
9491 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9493 memset(&packet2, 0, sizeof(packet2));
9494 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 );
9495 mavlink_msg_logging_data_acked_decode(last_msg, &packet2);
9496 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9499 static void mavlink_test_logging_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9501 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9502 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9503 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOGGING_ACK >= 256) {
9504 return;
9506 #endif
9507 mavlink_message_t msg;
9508 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9509 uint16_t i;
9510 mavlink_logging_ack_t packet_in = {
9511 17235,139,206
9513 mavlink_logging_ack_t packet1, packet2;
9514 memset(&packet1, 0, sizeof(packet1));
9515 packet1.sequence = packet_in.sequence;
9516 packet1.target_system = packet_in.target_system;
9517 packet1.target_component = packet_in.target_component;
9520 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9521 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9522 // cope with extensions
9523 memset(MAVLINK_MSG_ID_LOGGING_ACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LOGGING_ACK_MIN_LEN);
9525 #endif
9526 memset(&packet2, 0, sizeof(packet2));
9527 mavlink_msg_logging_ack_encode(system_id, component_id, &msg, &packet1);
9528 mavlink_msg_logging_ack_decode(&msg, &packet2);
9529 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9531 memset(&packet2, 0, sizeof(packet2));
9532 mavlink_msg_logging_ack_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.sequence );
9533 mavlink_msg_logging_ack_decode(&msg, &packet2);
9534 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9536 memset(&packet2, 0, sizeof(packet2));
9537 mavlink_msg_logging_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.sequence );
9538 mavlink_msg_logging_ack_decode(&msg, &packet2);
9539 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9541 memset(&packet2, 0, sizeof(packet2));
9542 mavlink_msg_to_send_buffer(buffer, &msg);
9543 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9544 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9546 mavlink_msg_logging_ack_decode(last_msg, &packet2);
9547 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9549 memset(&packet2, 0, sizeof(packet2));
9550 mavlink_msg_logging_ack_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.sequence );
9551 mavlink_msg_logging_ack_decode(last_msg, &packet2);
9552 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9555 static void mavlink_test_video_stream_information(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9557 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9558 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9559 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION >= 256) {
9560 return;
9562 #endif
9563 mavlink_message_t msg;
9564 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9565 uint16_t i;
9566 mavlink_video_stream_information_t packet_in = {
9567 17.0,963497672,17651,17755,17859,17963,18067,187,254,65,"VWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ","BCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCD"
9569 mavlink_video_stream_information_t packet1, packet2;
9570 memset(&packet1, 0, sizeof(packet1));
9571 packet1.framerate = packet_in.framerate;
9572 packet1.bitrate = packet_in.bitrate;
9573 packet1.flags = packet_in.flags;
9574 packet1.resolution_h = packet_in.resolution_h;
9575 packet1.resolution_v = packet_in.resolution_v;
9576 packet1.rotation = packet_in.rotation;
9577 packet1.hfov = packet_in.hfov;
9578 packet1.stream_id = packet_in.stream_id;
9579 packet1.count = packet_in.count;
9580 packet1.type = packet_in.type;
9582 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*32);
9583 mav_array_memcpy(packet1.uri, packet_in.uri, sizeof(char)*160);
9585 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9586 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9587 // cope with extensions
9588 memset(MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_MIN_LEN);
9590 #endif
9591 memset(&packet2, 0, sizeof(packet2));
9592 mavlink_msg_video_stream_information_encode(system_id, component_id, &msg, &packet1);
9593 mavlink_msg_video_stream_information_decode(&msg, &packet2);
9594 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9596 memset(&packet2, 0, sizeof(packet2));
9597 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 );
9598 mavlink_msg_video_stream_information_decode(&msg, &packet2);
9599 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9601 memset(&packet2, 0, sizeof(packet2));
9602 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 );
9603 mavlink_msg_video_stream_information_decode(&msg, &packet2);
9604 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9606 memset(&packet2, 0, sizeof(packet2));
9607 mavlink_msg_to_send_buffer(buffer, &msg);
9608 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9609 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9611 mavlink_msg_video_stream_information_decode(last_msg, &packet2);
9612 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9614 memset(&packet2, 0, sizeof(packet2));
9615 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 );
9616 mavlink_msg_video_stream_information_decode(last_msg, &packet2);
9617 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9620 static void mavlink_test_video_stream_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9622 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9623 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9624 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VIDEO_STREAM_STATUS >= 256) {
9625 return;
9627 #endif
9628 mavlink_message_t msg;
9629 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9630 uint16_t i;
9631 mavlink_video_stream_status_t packet_in = {
9632 17.0,963497672,17651,17755,17859,17963,18067,187
9634 mavlink_video_stream_status_t packet1, packet2;
9635 memset(&packet1, 0, sizeof(packet1));
9636 packet1.framerate = packet_in.framerate;
9637 packet1.bitrate = packet_in.bitrate;
9638 packet1.flags = packet_in.flags;
9639 packet1.resolution_h = packet_in.resolution_h;
9640 packet1.resolution_v = packet_in.resolution_v;
9641 packet1.rotation = packet_in.rotation;
9642 packet1.hfov = packet_in.hfov;
9643 packet1.stream_id = packet_in.stream_id;
9646 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9647 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9648 // cope with extensions
9649 memset(MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_MIN_LEN);
9651 #endif
9652 memset(&packet2, 0, sizeof(packet2));
9653 mavlink_msg_video_stream_status_encode(system_id, component_id, &msg, &packet1);
9654 mavlink_msg_video_stream_status_decode(&msg, &packet2);
9655 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9657 memset(&packet2, 0, sizeof(packet2));
9658 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 );
9659 mavlink_msg_video_stream_status_decode(&msg, &packet2);
9660 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9662 memset(&packet2, 0, sizeof(packet2));
9663 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 );
9664 mavlink_msg_video_stream_status_decode(&msg, &packet2);
9665 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9667 memset(&packet2, 0, sizeof(packet2));
9668 mavlink_msg_to_send_buffer(buffer, &msg);
9669 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9670 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9672 mavlink_msg_video_stream_status_decode(last_msg, &packet2);
9673 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9675 memset(&packet2, 0, sizeof(packet2));
9676 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 );
9677 mavlink_msg_video_stream_status_decode(last_msg, &packet2);
9678 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9681 static void mavlink_test_camera_fov_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9683 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9684 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9685 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_FOV_STATUS >= 256) {
9686 return;
9688 #endif
9689 mavlink_message_t msg;
9690 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9691 uint16_t i;
9692 mavlink_camera_fov_status_t packet_in = {
9693 963497464,963497672,963497880,963498088,963498296,963498504,963498712,{ 213.0, 214.0, 215.0, 216.0 },325.0,353.0
9695 mavlink_camera_fov_status_t packet1, packet2;
9696 memset(&packet1, 0, sizeof(packet1));
9697 packet1.time_boot_ms = packet_in.time_boot_ms;
9698 packet1.lat_camera = packet_in.lat_camera;
9699 packet1.lon_camera = packet_in.lon_camera;
9700 packet1.alt_camera = packet_in.alt_camera;
9701 packet1.lat_image = packet_in.lat_image;
9702 packet1.lon_image = packet_in.lon_image;
9703 packet1.alt_image = packet_in.alt_image;
9704 packet1.hfov = packet_in.hfov;
9705 packet1.vfov = packet_in.vfov;
9707 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
9709 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9710 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9711 // cope with extensions
9712 memset(MAVLINK_MSG_ID_CAMERA_FOV_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_FOV_STATUS_MIN_LEN);
9714 #endif
9715 memset(&packet2, 0, sizeof(packet2));
9716 mavlink_msg_camera_fov_status_encode(system_id, component_id, &msg, &packet1);
9717 mavlink_msg_camera_fov_status_decode(&msg, &packet2);
9718 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9720 memset(&packet2, 0, sizeof(packet2));
9721 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 );
9722 mavlink_msg_camera_fov_status_decode(&msg, &packet2);
9723 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9725 memset(&packet2, 0, sizeof(packet2));
9726 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 );
9727 mavlink_msg_camera_fov_status_decode(&msg, &packet2);
9728 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9730 memset(&packet2, 0, sizeof(packet2));
9731 mavlink_msg_to_send_buffer(buffer, &msg);
9732 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9733 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9735 mavlink_msg_camera_fov_status_decode(last_msg, &packet2);
9736 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9738 memset(&packet2, 0, sizeof(packet2));
9739 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 );
9740 mavlink_msg_camera_fov_status_decode(last_msg, &packet2);
9741 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9744 static void mavlink_test_camera_tracking_image_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9746 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9747 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9748 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS >= 256) {
9749 return;
9751 #endif
9752 mavlink_message_t msg;
9753 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9754 uint16_t i;
9755 mavlink_camera_tracking_image_status_t packet_in = {
9756 17.0,45.0,73.0,101.0,129.0,157.0,185.0,89,156,223
9758 mavlink_camera_tracking_image_status_t packet1, packet2;
9759 memset(&packet1, 0, sizeof(packet1));
9760 packet1.point_x = packet_in.point_x;
9761 packet1.point_y = packet_in.point_y;
9762 packet1.radius = packet_in.radius;
9763 packet1.rec_top_x = packet_in.rec_top_x;
9764 packet1.rec_top_y = packet_in.rec_top_y;
9765 packet1.rec_bottom_x = packet_in.rec_bottom_x;
9766 packet1.rec_bottom_y = packet_in.rec_bottom_y;
9767 packet1.tracking_status = packet_in.tracking_status;
9768 packet1.tracking_mode = packet_in.tracking_mode;
9769 packet1.target_data = packet_in.target_data;
9772 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9773 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9774 // cope with extensions
9775 memset(MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_MIN_LEN);
9777 #endif
9778 memset(&packet2, 0, sizeof(packet2));
9779 mavlink_msg_camera_tracking_image_status_encode(system_id, component_id, &msg, &packet1);
9780 mavlink_msg_camera_tracking_image_status_decode(&msg, &packet2);
9781 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9783 memset(&packet2, 0, sizeof(packet2));
9784 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 );
9785 mavlink_msg_camera_tracking_image_status_decode(&msg, &packet2);
9786 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9788 memset(&packet2, 0, sizeof(packet2));
9789 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 );
9790 mavlink_msg_camera_tracking_image_status_decode(&msg, &packet2);
9791 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9793 memset(&packet2, 0, sizeof(packet2));
9794 mavlink_msg_to_send_buffer(buffer, &msg);
9795 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9796 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9798 mavlink_msg_camera_tracking_image_status_decode(last_msg, &packet2);
9799 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9801 memset(&packet2, 0, sizeof(packet2));
9802 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 );
9803 mavlink_msg_camera_tracking_image_status_decode(last_msg, &packet2);
9804 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9807 static void mavlink_test_camera_tracking_geo_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9809 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9810 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9811 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_TRACKING_GEO_STATUS >= 256) {
9812 return;
9814 #endif
9815 mavlink_message_t msg;
9816 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9817 uint16_t i;
9818 mavlink_camera_tracking_geo_status_t packet_in = {
9819 963497464,963497672,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,149
9821 mavlink_camera_tracking_geo_status_t packet1, packet2;
9822 memset(&packet1, 0, sizeof(packet1));
9823 packet1.lat = packet_in.lat;
9824 packet1.lon = packet_in.lon;
9825 packet1.alt = packet_in.alt;
9826 packet1.h_acc = packet_in.h_acc;
9827 packet1.v_acc = packet_in.v_acc;
9828 packet1.vel_n = packet_in.vel_n;
9829 packet1.vel_e = packet_in.vel_e;
9830 packet1.vel_d = packet_in.vel_d;
9831 packet1.vel_acc = packet_in.vel_acc;
9832 packet1.dist = packet_in.dist;
9833 packet1.hdg = packet_in.hdg;
9834 packet1.hdg_acc = packet_in.hdg_acc;
9835 packet1.tracking_status = packet_in.tracking_status;
9838 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9839 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9840 // cope with extensions
9841 memset(MAVLINK_MSG_ID_CAMERA_TRACKING_GEO_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_TRACKING_GEO_STATUS_MIN_LEN);
9843 #endif
9844 memset(&packet2, 0, sizeof(packet2));
9845 mavlink_msg_camera_tracking_geo_status_encode(system_id, component_id, &msg, &packet1);
9846 mavlink_msg_camera_tracking_geo_status_decode(&msg, &packet2);
9847 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9849 memset(&packet2, 0, sizeof(packet2));
9850 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 );
9851 mavlink_msg_camera_tracking_geo_status_decode(&msg, &packet2);
9852 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9854 memset(&packet2, 0, sizeof(packet2));
9855 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 );
9856 mavlink_msg_camera_tracking_geo_status_decode(&msg, &packet2);
9857 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9859 memset(&packet2, 0, sizeof(packet2));
9860 mavlink_msg_to_send_buffer(buffer, &msg);
9861 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9862 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9864 mavlink_msg_camera_tracking_geo_status_decode(last_msg, &packet2);
9865 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9867 memset(&packet2, 0, sizeof(packet2));
9868 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 );
9869 mavlink_msg_camera_tracking_geo_status_decode(last_msg, &packet2);
9870 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9873 static void mavlink_test_gimbal_manager_information(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9875 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9876 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9877 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION >= 256) {
9878 return;
9880 #endif
9881 mavlink_message_t msg;
9882 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9883 uint16_t i;
9884 mavlink_gimbal_manager_information_t packet_in = {
9885 963497464,963497672,73.0,101.0,129.0,157.0,185.0,213.0,101
9887 mavlink_gimbal_manager_information_t packet1, packet2;
9888 memset(&packet1, 0, sizeof(packet1));
9889 packet1.time_boot_ms = packet_in.time_boot_ms;
9890 packet1.cap_flags = packet_in.cap_flags;
9891 packet1.roll_min = packet_in.roll_min;
9892 packet1.roll_max = packet_in.roll_max;
9893 packet1.pitch_min = packet_in.pitch_min;
9894 packet1.pitch_max = packet_in.pitch_max;
9895 packet1.yaw_min = packet_in.yaw_min;
9896 packet1.yaw_max = packet_in.yaw_max;
9897 packet1.gimbal_device_id = packet_in.gimbal_device_id;
9900 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9901 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9902 // cope with extensions
9903 memset(MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_MIN_LEN);
9905 #endif
9906 memset(&packet2, 0, sizeof(packet2));
9907 mavlink_msg_gimbal_manager_information_encode(system_id, component_id, &msg, &packet1);
9908 mavlink_msg_gimbal_manager_information_decode(&msg, &packet2);
9909 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9911 memset(&packet2, 0, sizeof(packet2));
9912 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 );
9913 mavlink_msg_gimbal_manager_information_decode(&msg, &packet2);
9914 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9916 memset(&packet2, 0, sizeof(packet2));
9917 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 );
9918 mavlink_msg_gimbal_manager_information_decode(&msg, &packet2);
9919 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9921 memset(&packet2, 0, sizeof(packet2));
9922 mavlink_msg_to_send_buffer(buffer, &msg);
9923 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9924 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9926 mavlink_msg_gimbal_manager_information_decode(last_msg, &packet2);
9927 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9929 memset(&packet2, 0, sizeof(packet2));
9930 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 );
9931 mavlink_msg_gimbal_manager_information_decode(last_msg, &packet2);
9932 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9935 static void mavlink_test_gimbal_manager_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9937 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9938 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9939 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_MANAGER_STATUS >= 256) {
9940 return;
9942 #endif
9943 mavlink_message_t msg;
9944 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9945 uint16_t i;
9946 mavlink_gimbal_manager_status_t packet_in = {
9947 963497464,963497672,29,96,163,230,41
9949 mavlink_gimbal_manager_status_t packet1, packet2;
9950 memset(&packet1, 0, sizeof(packet1));
9951 packet1.time_boot_ms = packet_in.time_boot_ms;
9952 packet1.flags = packet_in.flags;
9953 packet1.gimbal_device_id = packet_in.gimbal_device_id;
9954 packet1.primary_control_sysid = packet_in.primary_control_sysid;
9955 packet1.primary_control_compid = packet_in.primary_control_compid;
9956 packet1.secondary_control_sysid = packet_in.secondary_control_sysid;
9957 packet1.secondary_control_compid = packet_in.secondary_control_compid;
9960 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9961 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9962 // cope with extensions
9963 memset(MAVLINK_MSG_ID_GIMBAL_MANAGER_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_MANAGER_STATUS_MIN_LEN);
9965 #endif
9966 memset(&packet2, 0, sizeof(packet2));
9967 mavlink_msg_gimbal_manager_status_encode(system_id, component_id, &msg, &packet1);
9968 mavlink_msg_gimbal_manager_status_decode(&msg, &packet2);
9969 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9971 memset(&packet2, 0, sizeof(packet2));
9972 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 );
9973 mavlink_msg_gimbal_manager_status_decode(&msg, &packet2);
9974 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9976 memset(&packet2, 0, sizeof(packet2));
9977 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 );
9978 mavlink_msg_gimbal_manager_status_decode(&msg, &packet2);
9979 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9981 memset(&packet2, 0, sizeof(packet2));
9982 mavlink_msg_to_send_buffer(buffer, &msg);
9983 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9984 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9986 mavlink_msg_gimbal_manager_status_decode(last_msg, &packet2);
9987 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9989 memset(&packet2, 0, sizeof(packet2));
9990 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 );
9991 mavlink_msg_gimbal_manager_status_decode(last_msg, &packet2);
9992 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
9995 static void mavlink_test_gimbal_manager_set_attitude(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9997 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9998 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9999 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_ATTITUDE >= 256) {
10000 return;
10002 #endif
10003 mavlink_message_t msg;
10004 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10005 uint16_t i;
10006 mavlink_gimbal_manager_set_attitude_t packet_in = {
10007 963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,101,168,235
10009 mavlink_gimbal_manager_set_attitude_t packet1, packet2;
10010 memset(&packet1, 0, sizeof(packet1));
10011 packet1.flags = packet_in.flags;
10012 packet1.angular_velocity_x = packet_in.angular_velocity_x;
10013 packet1.angular_velocity_y = packet_in.angular_velocity_y;
10014 packet1.angular_velocity_z = packet_in.angular_velocity_z;
10015 packet1.target_system = packet_in.target_system;
10016 packet1.target_component = packet_in.target_component;
10017 packet1.gimbal_device_id = packet_in.gimbal_device_id;
10019 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
10021 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10022 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10023 // cope with extensions
10024 memset(MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_ATTITUDE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_ATTITUDE_MIN_LEN);
10026 #endif
10027 memset(&packet2, 0, sizeof(packet2));
10028 mavlink_msg_gimbal_manager_set_attitude_encode(system_id, component_id, &msg, &packet1);
10029 mavlink_msg_gimbal_manager_set_attitude_decode(&msg, &packet2);
10030 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10032 memset(&packet2, 0, sizeof(packet2));
10033 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 );
10034 mavlink_msg_gimbal_manager_set_attitude_decode(&msg, &packet2);
10035 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10037 memset(&packet2, 0, sizeof(packet2));
10038 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 );
10039 mavlink_msg_gimbal_manager_set_attitude_decode(&msg, &packet2);
10040 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10042 memset(&packet2, 0, sizeof(packet2));
10043 mavlink_msg_to_send_buffer(buffer, &msg);
10044 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10045 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10047 mavlink_msg_gimbal_manager_set_attitude_decode(last_msg, &packet2);
10048 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10050 memset(&packet2, 0, sizeof(packet2));
10051 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 );
10052 mavlink_msg_gimbal_manager_set_attitude_decode(last_msg, &packet2);
10053 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10056 static void mavlink_test_gimbal_device_information(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10058 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10059 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10060 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION >= 256) {
10061 return;
10063 #endif
10064 mavlink_message_t msg;
10065 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10066 uint16_t i;
10067 mavlink_gimbal_device_information_t packet_in = {
10068 93372036854775807ULL,963497880,963498088,963498296,157.0,185.0,213.0,241.0,269.0,297.0,19523,19627,"WXYZABCDEFGHIJKLMNOPQRSTUVWXYZA","CDEFGHIJKLMNOPQRSTUVWXYZABCDEFG","IJKLMNOPQRSTUVWXYZABCDEFGHIJKLM"
10070 mavlink_gimbal_device_information_t packet1, packet2;
10071 memset(&packet1, 0, sizeof(packet1));
10072 packet1.uid = packet_in.uid;
10073 packet1.time_boot_ms = packet_in.time_boot_ms;
10074 packet1.firmware_version = packet_in.firmware_version;
10075 packet1.hardware_version = packet_in.hardware_version;
10076 packet1.roll_min = packet_in.roll_min;
10077 packet1.roll_max = packet_in.roll_max;
10078 packet1.pitch_min = packet_in.pitch_min;
10079 packet1.pitch_max = packet_in.pitch_max;
10080 packet1.yaw_min = packet_in.yaw_min;
10081 packet1.yaw_max = packet_in.yaw_max;
10082 packet1.cap_flags = packet_in.cap_flags;
10083 packet1.custom_cap_flags = packet_in.custom_cap_flags;
10085 mav_array_memcpy(packet1.vendor_name, packet_in.vendor_name, sizeof(char)*32);
10086 mav_array_memcpy(packet1.model_name, packet_in.model_name, sizeof(char)*32);
10087 mav_array_memcpy(packet1.custom_name, packet_in.custom_name, sizeof(char)*32);
10089 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10090 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10091 // cope with extensions
10092 memset(MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN);
10094 #endif
10095 memset(&packet2, 0, sizeof(packet2));
10096 mavlink_msg_gimbal_device_information_encode(system_id, component_id, &msg, &packet1);
10097 mavlink_msg_gimbal_device_information_decode(&msg, &packet2);
10098 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10100 memset(&packet2, 0, sizeof(packet2));
10101 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 );
10102 mavlink_msg_gimbal_device_information_decode(&msg, &packet2);
10103 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10105 memset(&packet2, 0, sizeof(packet2));
10106 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 );
10107 mavlink_msg_gimbal_device_information_decode(&msg, &packet2);
10108 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10110 memset(&packet2, 0, sizeof(packet2));
10111 mavlink_msg_to_send_buffer(buffer, &msg);
10112 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10113 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10115 mavlink_msg_gimbal_device_information_decode(last_msg, &packet2);
10116 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10118 memset(&packet2, 0, sizeof(packet2));
10119 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 );
10120 mavlink_msg_gimbal_device_information_decode(last_msg, &packet2);
10121 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10124 static void mavlink_test_gimbal_device_set_attitude(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10126 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10127 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10128 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE >= 256) {
10129 return;
10131 #endif
10132 mavlink_message_t msg;
10133 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10134 uint16_t i;
10135 mavlink_gimbal_device_set_attitude_t packet_in = {
10136 { 17.0, 18.0, 19.0, 20.0 },129.0,157.0,185.0,18691,223,34
10138 mavlink_gimbal_device_set_attitude_t packet1, packet2;
10139 memset(&packet1, 0, sizeof(packet1));
10140 packet1.angular_velocity_x = packet_in.angular_velocity_x;
10141 packet1.angular_velocity_y = packet_in.angular_velocity_y;
10142 packet1.angular_velocity_z = packet_in.angular_velocity_z;
10143 packet1.flags = packet_in.flags;
10144 packet1.target_system = packet_in.target_system;
10145 packet1.target_component = packet_in.target_component;
10147 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
10149 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10150 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10151 // cope with extensions
10152 memset(MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_MIN_LEN);
10154 #endif
10155 memset(&packet2, 0, sizeof(packet2));
10156 mavlink_msg_gimbal_device_set_attitude_encode(system_id, component_id, &msg, &packet1);
10157 mavlink_msg_gimbal_device_set_attitude_decode(&msg, &packet2);
10158 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10160 memset(&packet2, 0, sizeof(packet2));
10161 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 );
10162 mavlink_msg_gimbal_device_set_attitude_decode(&msg, &packet2);
10163 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10165 memset(&packet2, 0, sizeof(packet2));
10166 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 );
10167 mavlink_msg_gimbal_device_set_attitude_decode(&msg, &packet2);
10168 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10170 memset(&packet2, 0, sizeof(packet2));
10171 mavlink_msg_to_send_buffer(buffer, &msg);
10172 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10173 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10175 mavlink_msg_gimbal_device_set_attitude_decode(last_msg, &packet2);
10176 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10178 memset(&packet2, 0, sizeof(packet2));
10179 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 );
10180 mavlink_msg_gimbal_device_set_attitude_decode(last_msg, &packet2);
10181 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10184 static void mavlink_test_gimbal_device_attitude_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
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_GIMBAL_DEVICE_ATTITUDE_STATUS >= 256) {
10189 return;
10191 #endif
10192 mavlink_message_t msg;
10193 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10194 uint16_t i;
10195 mavlink_gimbal_device_attitude_status_t packet_in = {
10196 963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,963499128,19107,247,58
10198 mavlink_gimbal_device_attitude_status_t packet1, packet2;
10199 memset(&packet1, 0, sizeof(packet1));
10200 packet1.time_boot_ms = packet_in.time_boot_ms;
10201 packet1.angular_velocity_x = packet_in.angular_velocity_x;
10202 packet1.angular_velocity_y = packet_in.angular_velocity_y;
10203 packet1.angular_velocity_z = packet_in.angular_velocity_z;
10204 packet1.failure_flags = packet_in.failure_flags;
10205 packet1.flags = packet_in.flags;
10206 packet1.target_system = packet_in.target_system;
10207 packet1.target_component = packet_in.target_component;
10209 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
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_GIMBAL_DEVICE_ATTITUDE_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_MIN_LEN);
10216 #endif
10217 memset(&packet2, 0, sizeof(packet2));
10218 mavlink_msg_gimbal_device_attitude_status_encode(system_id, component_id, &msg, &packet1);
10219 mavlink_msg_gimbal_device_attitude_status_decode(&msg, &packet2);
10220 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10222 memset(&packet2, 0, sizeof(packet2));
10223 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 );
10224 mavlink_msg_gimbal_device_attitude_status_decode(&msg, &packet2);
10225 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10227 memset(&packet2, 0, sizeof(packet2));
10228 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 );
10229 mavlink_msg_gimbal_device_attitude_status_decode(&msg, &packet2);
10230 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
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]);
10237 mavlink_msg_gimbal_device_attitude_status_decode(last_msg, &packet2);
10238 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10240 memset(&packet2, 0, sizeof(packet2));
10241 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 );
10242 mavlink_msg_gimbal_device_attitude_status_decode(last_msg, &packet2);
10243 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10246 static void mavlink_test_autopilot_state_for_gimbal_device(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10248 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10249 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10250 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE >= 256) {
10251 return;
10253 #endif
10254 mavlink_message_t msg;
10255 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10256 uint16_t i;
10257 mavlink_autopilot_state_for_gimbal_device_t packet_in = {
10258 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0 },963498712,213.0,241.0,269.0,963499544,325.0,19731,27,94,161
10260 mavlink_autopilot_state_for_gimbal_device_t packet1, packet2;
10261 memset(&packet1, 0, sizeof(packet1));
10262 packet1.time_boot_us = packet_in.time_boot_us;
10263 packet1.q_estimated_delay_us = packet_in.q_estimated_delay_us;
10264 packet1.vx = packet_in.vx;
10265 packet1.vy = packet_in.vy;
10266 packet1.vz = packet_in.vz;
10267 packet1.v_estimated_delay_us = packet_in.v_estimated_delay_us;
10268 packet1.feed_forward_angular_velocity_z = packet_in.feed_forward_angular_velocity_z;
10269 packet1.estimator_status = packet_in.estimator_status;
10270 packet1.target_system = packet_in.target_system;
10271 packet1.target_component = packet_in.target_component;
10272 packet1.landed_state = packet_in.landed_state;
10274 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
10276 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10277 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10278 // cope with extensions
10279 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);
10281 #endif
10282 memset(&packet2, 0, sizeof(packet2));
10283 mavlink_msg_autopilot_state_for_gimbal_device_encode(system_id, component_id, &msg, &packet1);
10284 mavlink_msg_autopilot_state_for_gimbal_device_decode(&msg, &packet2);
10285 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10287 memset(&packet2, 0, sizeof(packet2));
10288 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 );
10289 mavlink_msg_autopilot_state_for_gimbal_device_decode(&msg, &packet2);
10290 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10292 memset(&packet2, 0, sizeof(packet2));
10293 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 );
10294 mavlink_msg_autopilot_state_for_gimbal_device_decode(&msg, &packet2);
10295 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10297 memset(&packet2, 0, sizeof(packet2));
10298 mavlink_msg_to_send_buffer(buffer, &msg);
10299 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10300 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10302 mavlink_msg_autopilot_state_for_gimbal_device_decode(last_msg, &packet2);
10303 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10305 memset(&packet2, 0, sizeof(packet2));
10306 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 );
10307 mavlink_msg_autopilot_state_for_gimbal_device_decode(last_msg, &packet2);
10308 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10311 static void mavlink_test_gimbal_manager_set_pitchyaw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10313 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10314 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10315 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_PITCHYAW >= 256) {
10316 return;
10318 #endif
10319 mavlink_message_t msg;
10320 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10321 uint16_t i;
10322 mavlink_gimbal_manager_set_pitchyaw_t packet_in = {
10323 963497464,45.0,73.0,101.0,129.0,65,132,199
10325 mavlink_gimbal_manager_set_pitchyaw_t packet1, packet2;
10326 memset(&packet1, 0, sizeof(packet1));
10327 packet1.flags = packet_in.flags;
10328 packet1.pitch = packet_in.pitch;
10329 packet1.yaw = packet_in.yaw;
10330 packet1.pitch_rate = packet_in.pitch_rate;
10331 packet1.yaw_rate = packet_in.yaw_rate;
10332 packet1.target_system = packet_in.target_system;
10333 packet1.target_component = packet_in.target_component;
10334 packet1.gimbal_device_id = packet_in.gimbal_device_id;
10337 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10338 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10339 // cope with extensions
10340 memset(MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_PITCHYAW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_PITCHYAW_MIN_LEN);
10342 #endif
10343 memset(&packet2, 0, sizeof(packet2));
10344 mavlink_msg_gimbal_manager_set_pitchyaw_encode(system_id, component_id, &msg, &packet1);
10345 mavlink_msg_gimbal_manager_set_pitchyaw_decode(&msg, &packet2);
10346 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10348 memset(&packet2, 0, sizeof(packet2));
10349 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 );
10350 mavlink_msg_gimbal_manager_set_pitchyaw_decode(&msg, &packet2);
10351 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10353 memset(&packet2, 0, sizeof(packet2));
10354 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 );
10355 mavlink_msg_gimbal_manager_set_pitchyaw_decode(&msg, &packet2);
10356 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10358 memset(&packet2, 0, sizeof(packet2));
10359 mavlink_msg_to_send_buffer(buffer, &msg);
10360 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10361 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10363 mavlink_msg_gimbal_manager_set_pitchyaw_decode(last_msg, &packet2);
10364 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10366 memset(&packet2, 0, sizeof(packet2));
10367 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 );
10368 mavlink_msg_gimbal_manager_set_pitchyaw_decode(last_msg, &packet2);
10369 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10372 static void mavlink_test_gimbal_manager_set_manual_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10374 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10375 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10376 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_MANUAL_CONTROL >= 256) {
10377 return;
10379 #endif
10380 mavlink_message_t msg;
10381 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10382 uint16_t i;
10383 mavlink_gimbal_manager_set_manual_control_t packet_in = {
10384 963497464,45.0,73.0,101.0,129.0,65,132,199
10386 mavlink_gimbal_manager_set_manual_control_t packet1, packet2;
10387 memset(&packet1, 0, sizeof(packet1));
10388 packet1.flags = packet_in.flags;
10389 packet1.pitch = packet_in.pitch;
10390 packet1.yaw = packet_in.yaw;
10391 packet1.pitch_rate = packet_in.pitch_rate;
10392 packet1.yaw_rate = packet_in.yaw_rate;
10393 packet1.target_system = packet_in.target_system;
10394 packet1.target_component = packet_in.target_component;
10395 packet1.gimbal_device_id = packet_in.gimbal_device_id;
10398 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10399 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10400 // cope with extensions
10401 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);
10403 #endif
10404 memset(&packet2, 0, sizeof(packet2));
10405 mavlink_msg_gimbal_manager_set_manual_control_encode(system_id, component_id, &msg, &packet1);
10406 mavlink_msg_gimbal_manager_set_manual_control_decode(&msg, &packet2);
10407 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10409 memset(&packet2, 0, sizeof(packet2));
10410 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 );
10411 mavlink_msg_gimbal_manager_set_manual_control_decode(&msg, &packet2);
10412 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10414 memset(&packet2, 0, sizeof(packet2));
10415 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 );
10416 mavlink_msg_gimbal_manager_set_manual_control_decode(&msg, &packet2);
10417 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10419 memset(&packet2, 0, sizeof(packet2));
10420 mavlink_msg_to_send_buffer(buffer, &msg);
10421 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10422 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10424 mavlink_msg_gimbal_manager_set_manual_control_decode(last_msg, &packet2);
10425 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10427 memset(&packet2, 0, sizeof(packet2));
10428 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 );
10429 mavlink_msg_gimbal_manager_set_manual_control_decode(last_msg, &packet2);
10430 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10433 static void mavlink_test_esc_info(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10435 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10436 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10437 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ESC_INFO >= 256) {
10438 return;
10440 #endif
10441 mavlink_message_t msg;
10442 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10443 uint16_t i;
10444 mavlink_esc_info_t packet_in = {
10445 93372036854775807ULL,{ 963497880, 963497881, 963497882, 963497883 },18483,{ 18587, 18588, 18589, 18590 },235,46,113,180,{ 247, 248, 249, 250 }
10447 mavlink_esc_info_t packet1, packet2;
10448 memset(&packet1, 0, sizeof(packet1));
10449 packet1.time_usec = packet_in.time_usec;
10450 packet1.counter = packet_in.counter;
10451 packet1.index = packet_in.index;
10452 packet1.count = packet_in.count;
10453 packet1.connection_type = packet_in.connection_type;
10454 packet1.info = packet_in.info;
10456 mav_array_memcpy(packet1.error_count, packet_in.error_count, sizeof(uint32_t)*4);
10457 mav_array_memcpy(packet1.failure_flags, packet_in.failure_flags, sizeof(uint16_t)*4);
10458 mav_array_memcpy(packet1.temperature, packet_in.temperature, sizeof(uint8_t)*4);
10460 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10461 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10462 // cope with extensions
10463 memset(MAVLINK_MSG_ID_ESC_INFO_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ESC_INFO_MIN_LEN);
10465 #endif
10466 memset(&packet2, 0, sizeof(packet2));
10467 mavlink_msg_esc_info_encode(system_id, component_id, &msg, &packet1);
10468 mavlink_msg_esc_info_decode(&msg, &packet2);
10469 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10471 memset(&packet2, 0, sizeof(packet2));
10472 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 );
10473 mavlink_msg_esc_info_decode(&msg, &packet2);
10474 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10476 memset(&packet2, 0, sizeof(packet2));
10477 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 );
10478 mavlink_msg_esc_info_decode(&msg, &packet2);
10479 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10481 memset(&packet2, 0, sizeof(packet2));
10482 mavlink_msg_to_send_buffer(buffer, &msg);
10483 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10484 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10486 mavlink_msg_esc_info_decode(last_msg, &packet2);
10487 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10489 memset(&packet2, 0, sizeof(packet2));
10490 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 );
10491 mavlink_msg_esc_info_decode(last_msg, &packet2);
10492 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10495 static void mavlink_test_esc_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10497 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10498 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10499 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ESC_STATUS >= 256) {
10500 return;
10502 #endif
10503 mavlink_message_t msg;
10504 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10505 uint16_t i;
10506 mavlink_esc_status_t packet_in = {
10507 93372036854775807ULL,{ 963497880, 963497881, 963497882, 963497883 },{ 185.0, 186.0, 187.0, 188.0 },{ 297.0, 298.0, 299.0, 300.0 },173
10509 mavlink_esc_status_t packet1, packet2;
10510 memset(&packet1, 0, sizeof(packet1));
10511 packet1.time_usec = packet_in.time_usec;
10512 packet1.index = packet_in.index;
10514 mav_array_memcpy(packet1.rpm, packet_in.rpm, sizeof(int32_t)*4);
10515 mav_array_memcpy(packet1.voltage, packet_in.voltage, sizeof(float)*4);
10516 mav_array_memcpy(packet1.current, packet_in.current, sizeof(float)*4);
10518 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10519 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10520 // cope with extensions
10521 memset(MAVLINK_MSG_ID_ESC_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ESC_STATUS_MIN_LEN);
10523 #endif
10524 memset(&packet2, 0, sizeof(packet2));
10525 mavlink_msg_esc_status_encode(system_id, component_id, &msg, &packet1);
10526 mavlink_msg_esc_status_decode(&msg, &packet2);
10527 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10529 memset(&packet2, 0, sizeof(packet2));
10530 mavlink_msg_esc_status_pack(system_id, component_id, &msg , packet1.index , packet1.time_usec , packet1.rpm , packet1.voltage , packet1.current );
10531 mavlink_msg_esc_status_decode(&msg, &packet2);
10532 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10534 memset(&packet2, 0, sizeof(packet2));
10535 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 );
10536 mavlink_msg_esc_status_decode(&msg, &packet2);
10537 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10539 memset(&packet2, 0, sizeof(packet2));
10540 mavlink_msg_to_send_buffer(buffer, &msg);
10541 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10542 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10544 mavlink_msg_esc_status_decode(last_msg, &packet2);
10545 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10547 memset(&packet2, 0, sizeof(packet2));
10548 mavlink_msg_esc_status_send(MAVLINK_COMM_1 , packet1.index , packet1.time_usec , packet1.rpm , packet1.voltage , packet1.current );
10549 mavlink_msg_esc_status_decode(last_msg, &packet2);
10550 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10553 static void mavlink_test_wifi_config_ap(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10555 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10556 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10557 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_WIFI_CONFIG_AP >= 256) {
10558 return;
10560 #endif
10561 mavlink_message_t msg;
10562 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10563 uint16_t i;
10564 mavlink_wifi_config_ap_t packet_in = {
10565 "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDE","GHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQ",37,104
10567 mavlink_wifi_config_ap_t packet1, packet2;
10568 memset(&packet1, 0, sizeof(packet1));
10569 packet1.mode = packet_in.mode;
10570 packet1.response = packet_in.response;
10572 mav_array_memcpy(packet1.ssid, packet_in.ssid, sizeof(char)*32);
10573 mav_array_memcpy(packet1.password, packet_in.password, sizeof(char)*64);
10575 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10576 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10577 // cope with extensions
10578 memset(MAVLINK_MSG_ID_WIFI_CONFIG_AP_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_WIFI_CONFIG_AP_MIN_LEN);
10580 #endif
10581 memset(&packet2, 0, sizeof(packet2));
10582 mavlink_msg_wifi_config_ap_encode(system_id, component_id, &msg, &packet1);
10583 mavlink_msg_wifi_config_ap_decode(&msg, &packet2);
10584 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10586 memset(&packet2, 0, sizeof(packet2));
10587 mavlink_msg_wifi_config_ap_pack(system_id, component_id, &msg , packet1.ssid , packet1.password , packet1.mode , packet1.response );
10588 mavlink_msg_wifi_config_ap_decode(&msg, &packet2);
10589 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10591 memset(&packet2, 0, sizeof(packet2));
10592 mavlink_msg_wifi_config_ap_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.ssid , packet1.password , packet1.mode , packet1.response );
10593 mavlink_msg_wifi_config_ap_decode(&msg, &packet2);
10594 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10596 memset(&packet2, 0, sizeof(packet2));
10597 mavlink_msg_to_send_buffer(buffer, &msg);
10598 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10599 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10601 mavlink_msg_wifi_config_ap_decode(last_msg, &packet2);
10602 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10604 memset(&packet2, 0, sizeof(packet2));
10605 mavlink_msg_wifi_config_ap_send(MAVLINK_COMM_1 , packet1.ssid , packet1.password , packet1.mode , packet1.response );
10606 mavlink_msg_wifi_config_ap_decode(last_msg, &packet2);
10607 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10610 static void mavlink_test_ais_vessel(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10612 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10613 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10614 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AIS_VESSEL >= 256) {
10615 return;
10617 #endif
10618 mavlink_message_t msg;
10619 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10620 uint16_t i;
10621 mavlink_ais_vessel_t packet_in = {
10622 963497464,963497672,963497880,17859,17963,18067,18171,18275,18379,18483,211,22,89,156,223,"FGHIJK","MNOPQRSTUVWXYZABCDE"
10624 mavlink_ais_vessel_t packet1, packet2;
10625 memset(&packet1, 0, sizeof(packet1));
10626 packet1.MMSI = packet_in.MMSI;
10627 packet1.lat = packet_in.lat;
10628 packet1.lon = packet_in.lon;
10629 packet1.COG = packet_in.COG;
10630 packet1.heading = packet_in.heading;
10631 packet1.velocity = packet_in.velocity;
10632 packet1.dimension_bow = packet_in.dimension_bow;
10633 packet1.dimension_stern = packet_in.dimension_stern;
10634 packet1.tslc = packet_in.tslc;
10635 packet1.flags = packet_in.flags;
10636 packet1.turn_rate = packet_in.turn_rate;
10637 packet1.navigational_status = packet_in.navigational_status;
10638 packet1.type = packet_in.type;
10639 packet1.dimension_port = packet_in.dimension_port;
10640 packet1.dimension_starboard = packet_in.dimension_starboard;
10642 mav_array_memcpy(packet1.callsign, packet_in.callsign, sizeof(char)*7);
10643 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*20);
10645 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10646 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10647 // cope with extensions
10648 memset(MAVLINK_MSG_ID_AIS_VESSEL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AIS_VESSEL_MIN_LEN);
10650 #endif
10651 memset(&packet2, 0, sizeof(packet2));
10652 mavlink_msg_ais_vessel_encode(system_id, component_id, &msg, &packet1);
10653 mavlink_msg_ais_vessel_decode(&msg, &packet2);
10654 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10656 memset(&packet2, 0, sizeof(packet2));
10657 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 );
10658 mavlink_msg_ais_vessel_decode(&msg, &packet2);
10659 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10661 memset(&packet2, 0, sizeof(packet2));
10662 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 );
10663 mavlink_msg_ais_vessel_decode(&msg, &packet2);
10664 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10666 memset(&packet2, 0, sizeof(packet2));
10667 mavlink_msg_to_send_buffer(buffer, &msg);
10668 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10669 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10671 mavlink_msg_ais_vessel_decode(last_msg, &packet2);
10672 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10674 memset(&packet2, 0, sizeof(packet2));
10675 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 );
10676 mavlink_msg_ais_vessel_decode(last_msg, &packet2);
10677 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10680 static void mavlink_test_uavcan_node_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10682 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10683 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10684 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_UAVCAN_NODE_STATUS >= 256) {
10685 return;
10687 #endif
10688 mavlink_message_t msg;
10689 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10690 uint16_t i;
10691 mavlink_uavcan_node_status_t packet_in = {
10692 93372036854775807ULL,963497880,17859,175,242,53
10694 mavlink_uavcan_node_status_t packet1, packet2;
10695 memset(&packet1, 0, sizeof(packet1));
10696 packet1.time_usec = packet_in.time_usec;
10697 packet1.uptime_sec = packet_in.uptime_sec;
10698 packet1.vendor_specific_status_code = packet_in.vendor_specific_status_code;
10699 packet1.health = packet_in.health;
10700 packet1.mode = packet_in.mode;
10701 packet1.sub_mode = packet_in.sub_mode;
10704 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10705 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10706 // cope with extensions
10707 memset(MAVLINK_MSG_ID_UAVCAN_NODE_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_UAVCAN_NODE_STATUS_MIN_LEN);
10709 #endif
10710 memset(&packet2, 0, sizeof(packet2));
10711 mavlink_msg_uavcan_node_status_encode(system_id, component_id, &msg, &packet1);
10712 mavlink_msg_uavcan_node_status_decode(&msg, &packet2);
10713 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10715 memset(&packet2, 0, sizeof(packet2));
10716 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 );
10717 mavlink_msg_uavcan_node_status_decode(&msg, &packet2);
10718 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10720 memset(&packet2, 0, sizeof(packet2));
10721 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 );
10722 mavlink_msg_uavcan_node_status_decode(&msg, &packet2);
10723 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10725 memset(&packet2, 0, sizeof(packet2));
10726 mavlink_msg_to_send_buffer(buffer, &msg);
10727 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10728 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10730 mavlink_msg_uavcan_node_status_decode(last_msg, &packet2);
10731 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10733 memset(&packet2, 0, sizeof(packet2));
10734 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 );
10735 mavlink_msg_uavcan_node_status_decode(last_msg, &packet2);
10736 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10739 static void mavlink_test_uavcan_node_info(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10741 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10742 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10743 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_UAVCAN_NODE_INFO >= 256) {
10744 return;
10746 #endif
10747 mavlink_message_t msg;
10748 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10749 uint16_t i;
10750 mavlink_uavcan_node_info_t packet_in = {
10751 93372036854775807ULL,963497880,963498088,"QRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQ",37,104,{ 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186 },219,30
10753 mavlink_uavcan_node_info_t packet1, packet2;
10754 memset(&packet1, 0, sizeof(packet1));
10755 packet1.time_usec = packet_in.time_usec;
10756 packet1.uptime_sec = packet_in.uptime_sec;
10757 packet1.sw_vcs_commit = packet_in.sw_vcs_commit;
10758 packet1.hw_version_major = packet_in.hw_version_major;
10759 packet1.hw_version_minor = packet_in.hw_version_minor;
10760 packet1.sw_version_major = packet_in.sw_version_major;
10761 packet1.sw_version_minor = packet_in.sw_version_minor;
10763 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*80);
10764 mav_array_memcpy(packet1.hw_unique_id, packet_in.hw_unique_id, sizeof(uint8_t)*16);
10766 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10767 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10768 // cope with extensions
10769 memset(MAVLINK_MSG_ID_UAVCAN_NODE_INFO_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_UAVCAN_NODE_INFO_MIN_LEN);
10771 #endif
10772 memset(&packet2, 0, sizeof(packet2));
10773 mavlink_msg_uavcan_node_info_encode(system_id, component_id, &msg, &packet1);
10774 mavlink_msg_uavcan_node_info_decode(&msg, &packet2);
10775 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10777 memset(&packet2, 0, sizeof(packet2));
10778 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 );
10779 mavlink_msg_uavcan_node_info_decode(&msg, &packet2);
10780 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10782 memset(&packet2, 0, sizeof(packet2));
10783 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 );
10784 mavlink_msg_uavcan_node_info_decode(&msg, &packet2);
10785 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10787 memset(&packet2, 0, sizeof(packet2));
10788 mavlink_msg_to_send_buffer(buffer, &msg);
10789 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10790 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10792 mavlink_msg_uavcan_node_info_decode(last_msg, &packet2);
10793 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10795 memset(&packet2, 0, sizeof(packet2));
10796 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 );
10797 mavlink_msg_uavcan_node_info_decode(last_msg, &packet2);
10798 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10801 static void mavlink_test_param_ext_request_read(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
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_PARAM_EXT_REQUEST_READ >= 256) {
10806 return;
10808 #endif
10809 mavlink_message_t msg;
10810 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10811 uint16_t i;
10812 mavlink_param_ext_request_read_t packet_in = {
10813 17235,139,206,"EFGHIJKLMNOPQRS"
10815 mavlink_param_ext_request_read_t packet1, packet2;
10816 memset(&packet1, 0, sizeof(packet1));
10817 packet1.param_index = packet_in.param_index;
10818 packet1.target_system = packet_in.target_system;
10819 packet1.target_component = packet_in.target_component;
10821 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
10823 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10824 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10825 // cope with extensions
10826 memset(MAVLINK_MSG_ID_PARAM_EXT_REQUEST_READ_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_EXT_REQUEST_READ_MIN_LEN);
10828 #endif
10829 memset(&packet2, 0, sizeof(packet2));
10830 mavlink_msg_param_ext_request_read_encode(system_id, component_id, &msg, &packet1);
10831 mavlink_msg_param_ext_request_read_decode(&msg, &packet2);
10832 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10834 memset(&packet2, 0, sizeof(packet2));
10835 mavlink_msg_param_ext_request_read_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index );
10836 mavlink_msg_param_ext_request_read_decode(&msg, &packet2);
10837 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10839 memset(&packet2, 0, sizeof(packet2));
10840 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 );
10841 mavlink_msg_param_ext_request_read_decode(&msg, &packet2);
10842 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10844 memset(&packet2, 0, sizeof(packet2));
10845 mavlink_msg_to_send_buffer(buffer, &msg);
10846 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10847 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10849 mavlink_msg_param_ext_request_read_decode(last_msg, &packet2);
10850 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10852 memset(&packet2, 0, sizeof(packet2));
10853 mavlink_msg_param_ext_request_read_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index );
10854 mavlink_msg_param_ext_request_read_decode(last_msg, &packet2);
10855 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10858 static void mavlink_test_param_ext_request_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10860 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10861 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10862 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_EXT_REQUEST_LIST >= 256) {
10863 return;
10865 #endif
10866 mavlink_message_t msg;
10867 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10868 uint16_t i;
10869 mavlink_param_ext_request_list_t packet_in = {
10870 5,72
10872 mavlink_param_ext_request_list_t packet1, packet2;
10873 memset(&packet1, 0, sizeof(packet1));
10874 packet1.target_system = packet_in.target_system;
10875 packet1.target_component = packet_in.target_component;
10878 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10879 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10880 // cope with extensions
10881 memset(MAVLINK_MSG_ID_PARAM_EXT_REQUEST_LIST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_EXT_REQUEST_LIST_MIN_LEN);
10883 #endif
10884 memset(&packet2, 0, sizeof(packet2));
10885 mavlink_msg_param_ext_request_list_encode(system_id, component_id, &msg, &packet1);
10886 mavlink_msg_param_ext_request_list_decode(&msg, &packet2);
10887 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10889 memset(&packet2, 0, sizeof(packet2));
10890 mavlink_msg_param_ext_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
10891 mavlink_msg_param_ext_request_list_decode(&msg, &packet2);
10892 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10894 memset(&packet2, 0, sizeof(packet2));
10895 mavlink_msg_param_ext_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
10896 mavlink_msg_param_ext_request_list_decode(&msg, &packet2);
10897 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10899 memset(&packet2, 0, sizeof(packet2));
10900 mavlink_msg_to_send_buffer(buffer, &msg);
10901 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10902 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10904 mavlink_msg_param_ext_request_list_decode(last_msg, &packet2);
10905 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10907 memset(&packet2, 0, sizeof(packet2));
10908 mavlink_msg_param_ext_request_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
10909 mavlink_msg_param_ext_request_list_decode(last_msg, &packet2);
10910 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10913 static void mavlink_test_param_ext_value(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10915 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10916 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10917 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_EXT_VALUE >= 256) {
10918 return;
10920 #endif
10921 mavlink_message_t msg;
10922 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10923 uint16_t i;
10924 mavlink_param_ext_value_t packet_in = {
10925 17235,17339,"EFGHIJKLMNOPQRS","UVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQ",193
10927 mavlink_param_ext_value_t packet1, packet2;
10928 memset(&packet1, 0, sizeof(packet1));
10929 packet1.param_count = packet_in.param_count;
10930 packet1.param_index = packet_in.param_index;
10931 packet1.param_type = packet_in.param_type;
10933 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
10934 mav_array_memcpy(packet1.param_value, packet_in.param_value, sizeof(char)*128);
10936 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10937 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10938 // cope with extensions
10939 memset(MAVLINK_MSG_ID_PARAM_EXT_VALUE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_EXT_VALUE_MIN_LEN);
10941 #endif
10942 memset(&packet2, 0, sizeof(packet2));
10943 mavlink_msg_param_ext_value_encode(system_id, component_id, &msg, &packet1);
10944 mavlink_msg_param_ext_value_decode(&msg, &packet2);
10945 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10947 memset(&packet2, 0, sizeof(packet2));
10948 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 );
10949 mavlink_msg_param_ext_value_decode(&msg, &packet2);
10950 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10952 memset(&packet2, 0, sizeof(packet2));
10953 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 );
10954 mavlink_msg_param_ext_value_decode(&msg, &packet2);
10955 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10957 memset(&packet2, 0, sizeof(packet2));
10958 mavlink_msg_to_send_buffer(buffer, &msg);
10959 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10960 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10962 mavlink_msg_param_ext_value_decode(last_msg, &packet2);
10963 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10965 memset(&packet2, 0, sizeof(packet2));
10966 mavlink_msg_param_ext_value_send(MAVLINK_COMM_1 , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_count , packet1.param_index );
10967 mavlink_msg_param_ext_value_decode(last_msg, &packet2);
10968 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
10971 static void mavlink_test_param_ext_set(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10973 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10974 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10975 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_EXT_SET >= 256) {
10976 return;
10978 #endif
10979 mavlink_message_t msg;
10980 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10981 uint16_t i;
10982 mavlink_param_ext_set_t packet_in = {
10983 5,72,"CDEFGHIJKLMNOPQ","STUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNO",59
10985 mavlink_param_ext_set_t packet1, packet2;
10986 memset(&packet1, 0, sizeof(packet1));
10987 packet1.target_system = packet_in.target_system;
10988 packet1.target_component = packet_in.target_component;
10989 packet1.param_type = packet_in.param_type;
10991 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
10992 mav_array_memcpy(packet1.param_value, packet_in.param_value, sizeof(char)*128);
10994 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10995 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10996 // cope with extensions
10997 memset(MAVLINK_MSG_ID_PARAM_EXT_SET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_EXT_SET_MIN_LEN);
10999 #endif
11000 memset(&packet2, 0, sizeof(packet2));
11001 mavlink_msg_param_ext_set_encode(system_id, component_id, &msg, &packet1);
11002 mavlink_msg_param_ext_set_decode(&msg, &packet2);
11003 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11005 memset(&packet2, 0, sizeof(packet2));
11006 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 );
11007 mavlink_msg_param_ext_set_decode(&msg, &packet2);
11008 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11010 memset(&packet2, 0, sizeof(packet2));
11011 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 );
11012 mavlink_msg_param_ext_set_decode(&msg, &packet2);
11013 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11015 memset(&packet2, 0, sizeof(packet2));
11016 mavlink_msg_to_send_buffer(buffer, &msg);
11017 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11018 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11020 mavlink_msg_param_ext_set_decode(last_msg, &packet2);
11021 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11023 memset(&packet2, 0, sizeof(packet2));
11024 mavlink_msg_param_ext_set_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type );
11025 mavlink_msg_param_ext_set_decode(last_msg, &packet2);
11026 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11029 static void mavlink_test_param_ext_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11031 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11032 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11033 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_EXT_ACK >= 256) {
11034 return;
11036 #endif
11037 mavlink_message_t msg;
11038 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11039 uint16_t i;
11040 mavlink_param_ext_ack_t packet_in = {
11041 "ABCDEFGHIJKLMNO","QRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM",181,248
11043 mavlink_param_ext_ack_t packet1, packet2;
11044 memset(&packet1, 0, sizeof(packet1));
11045 packet1.param_type = packet_in.param_type;
11046 packet1.param_result = packet_in.param_result;
11048 mav_array_memcpy(packet1.param_id, packet_in.param_id, sizeof(char)*16);
11049 mav_array_memcpy(packet1.param_value, packet_in.param_value, sizeof(char)*128);
11051 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11052 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11053 // cope with extensions
11054 memset(MAVLINK_MSG_ID_PARAM_EXT_ACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PARAM_EXT_ACK_MIN_LEN);
11056 #endif
11057 memset(&packet2, 0, sizeof(packet2));
11058 mavlink_msg_param_ext_ack_encode(system_id, component_id, &msg, &packet1);
11059 mavlink_msg_param_ext_ack_decode(&msg, &packet2);
11060 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11062 memset(&packet2, 0, sizeof(packet2));
11063 mavlink_msg_param_ext_ack_pack(system_id, component_id, &msg , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_result );
11064 mavlink_msg_param_ext_ack_decode(&msg, &packet2);
11065 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11067 memset(&packet2, 0, sizeof(packet2));
11068 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 );
11069 mavlink_msg_param_ext_ack_decode(&msg, &packet2);
11070 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11072 memset(&packet2, 0, sizeof(packet2));
11073 mavlink_msg_to_send_buffer(buffer, &msg);
11074 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11075 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11077 mavlink_msg_param_ext_ack_decode(last_msg, &packet2);
11078 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11080 memset(&packet2, 0, sizeof(packet2));
11081 mavlink_msg_param_ext_ack_send(MAVLINK_COMM_1 , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_result );
11082 mavlink_msg_param_ext_ack_decode(last_msg, &packet2);
11083 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11086 static void mavlink_test_obstacle_distance(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11088 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11089 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11090 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OBSTACLE_DISTANCE >= 256) {
11091 return;
11093 #endif
11094 mavlink_message_t msg;
11095 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11096 uint16_t i;
11097 mavlink_obstacle_distance_t packet_in = {
11098 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
11100 mavlink_obstacle_distance_t packet1, packet2;
11101 memset(&packet1, 0, sizeof(packet1));
11102 packet1.time_usec = packet_in.time_usec;
11103 packet1.min_distance = packet_in.min_distance;
11104 packet1.max_distance = packet_in.max_distance;
11105 packet1.sensor_type = packet_in.sensor_type;
11106 packet1.increment = packet_in.increment;
11107 packet1.increment_f = packet_in.increment_f;
11108 packet1.angle_offset = packet_in.angle_offset;
11109 packet1.frame = packet_in.frame;
11111 mav_array_memcpy(packet1.distances, packet_in.distances, sizeof(uint16_t)*72);
11113 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11114 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11115 // cope with extensions
11116 memset(MAVLINK_MSG_ID_OBSTACLE_DISTANCE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_OBSTACLE_DISTANCE_MIN_LEN);
11118 #endif
11119 memset(&packet2, 0, sizeof(packet2));
11120 mavlink_msg_obstacle_distance_encode(system_id, component_id, &msg, &packet1);
11121 mavlink_msg_obstacle_distance_decode(&msg, &packet2);
11122 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11124 memset(&packet2, 0, sizeof(packet2));
11125 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 );
11126 mavlink_msg_obstacle_distance_decode(&msg, &packet2);
11127 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11129 memset(&packet2, 0, sizeof(packet2));
11130 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 );
11131 mavlink_msg_obstacle_distance_decode(&msg, &packet2);
11132 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11134 memset(&packet2, 0, sizeof(packet2));
11135 mavlink_msg_to_send_buffer(buffer, &msg);
11136 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11137 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11139 mavlink_msg_obstacle_distance_decode(last_msg, &packet2);
11140 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11142 memset(&packet2, 0, sizeof(packet2));
11143 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 );
11144 mavlink_msg_obstacle_distance_decode(last_msg, &packet2);
11145 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11148 static void mavlink_test_odometry(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11150 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11151 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11152 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ODOMETRY >= 256) {
11153 return;
11155 #endif
11156 mavlink_message_t msg;
11157 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11158 uint16_t i;
11159 mavlink_odometry_t packet_in = {
11160 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
11162 mavlink_odometry_t packet1, packet2;
11163 memset(&packet1, 0, sizeof(packet1));
11164 packet1.time_usec = packet_in.time_usec;
11165 packet1.x = packet_in.x;
11166 packet1.y = packet_in.y;
11167 packet1.z = packet_in.z;
11168 packet1.vx = packet_in.vx;
11169 packet1.vy = packet_in.vy;
11170 packet1.vz = packet_in.vz;
11171 packet1.rollspeed = packet_in.rollspeed;
11172 packet1.pitchspeed = packet_in.pitchspeed;
11173 packet1.yawspeed = packet_in.yawspeed;
11174 packet1.frame_id = packet_in.frame_id;
11175 packet1.child_frame_id = packet_in.child_frame_id;
11176 packet1.reset_counter = packet_in.reset_counter;
11177 packet1.estimator_type = packet_in.estimator_type;
11179 mav_array_memcpy(packet1.q, packet_in.q, sizeof(float)*4);
11180 mav_array_memcpy(packet1.pose_covariance, packet_in.pose_covariance, sizeof(float)*21);
11181 mav_array_memcpy(packet1.velocity_covariance, packet_in.velocity_covariance, sizeof(float)*21);
11183 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11184 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11185 // cope with extensions
11186 memset(MAVLINK_MSG_ID_ODOMETRY_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ODOMETRY_MIN_LEN);
11188 #endif
11189 memset(&packet2, 0, sizeof(packet2));
11190 mavlink_msg_odometry_encode(system_id, component_id, &msg, &packet1);
11191 mavlink_msg_odometry_decode(&msg, &packet2);
11192 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11194 memset(&packet2, 0, sizeof(packet2));
11195 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 );
11196 mavlink_msg_odometry_decode(&msg, &packet2);
11197 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11199 memset(&packet2, 0, sizeof(packet2));
11200 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 );
11201 mavlink_msg_odometry_decode(&msg, &packet2);
11202 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11204 memset(&packet2, 0, sizeof(packet2));
11205 mavlink_msg_to_send_buffer(buffer, &msg);
11206 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11207 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11209 mavlink_msg_odometry_decode(last_msg, &packet2);
11210 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11212 memset(&packet2, 0, sizeof(packet2));
11213 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 );
11214 mavlink_msg_odometry_decode(last_msg, &packet2);
11215 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11218 static void mavlink_test_trajectory_representation_waypoints(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11220 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11221 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11222 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS >= 256) {
11223 return;
11225 #endif
11226 mavlink_message_t msg;
11227 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11228 uint16_t i;
11229 mavlink_trajectory_representation_waypoints_t packet_in = {
11230 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
11232 mavlink_trajectory_representation_waypoints_t packet1, packet2;
11233 memset(&packet1, 0, sizeof(packet1));
11234 packet1.time_usec = packet_in.time_usec;
11235 packet1.valid_points = packet_in.valid_points;
11237 mav_array_memcpy(packet1.pos_x, packet_in.pos_x, sizeof(float)*5);
11238 mav_array_memcpy(packet1.pos_y, packet_in.pos_y, sizeof(float)*5);
11239 mav_array_memcpy(packet1.pos_z, packet_in.pos_z, sizeof(float)*5);
11240 mav_array_memcpy(packet1.vel_x, packet_in.vel_x, sizeof(float)*5);
11241 mav_array_memcpy(packet1.vel_y, packet_in.vel_y, sizeof(float)*5);
11242 mav_array_memcpy(packet1.vel_z, packet_in.vel_z, sizeof(float)*5);
11243 mav_array_memcpy(packet1.acc_x, packet_in.acc_x, sizeof(float)*5);
11244 mav_array_memcpy(packet1.acc_y, packet_in.acc_y, sizeof(float)*5);
11245 mav_array_memcpy(packet1.acc_z, packet_in.acc_z, sizeof(float)*5);
11246 mav_array_memcpy(packet1.pos_yaw, packet_in.pos_yaw, sizeof(float)*5);
11247 mav_array_memcpy(packet1.vel_yaw, packet_in.vel_yaw, sizeof(float)*5);
11248 mav_array_memcpy(packet1.command, packet_in.command, sizeof(uint16_t)*5);
11250 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11251 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11252 // cope with extensions
11253 memset(MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN);
11255 #endif
11256 memset(&packet2, 0, sizeof(packet2));
11257 mavlink_msg_trajectory_representation_waypoints_encode(system_id, component_id, &msg, &packet1);
11258 mavlink_msg_trajectory_representation_waypoints_decode(&msg, &packet2);
11259 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11261 memset(&packet2, 0, sizeof(packet2));
11262 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 );
11263 mavlink_msg_trajectory_representation_waypoints_decode(&msg, &packet2);
11264 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11266 memset(&packet2, 0, sizeof(packet2));
11267 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 );
11268 mavlink_msg_trajectory_representation_waypoints_decode(&msg, &packet2);
11269 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11271 memset(&packet2, 0, sizeof(packet2));
11272 mavlink_msg_to_send_buffer(buffer, &msg);
11273 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11274 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11276 mavlink_msg_trajectory_representation_waypoints_decode(last_msg, &packet2);
11277 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11279 memset(&packet2, 0, sizeof(packet2));
11280 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 );
11281 mavlink_msg_trajectory_representation_waypoints_decode(last_msg, &packet2);
11282 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11285 static void mavlink_test_trajectory_representation_bezier(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11287 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11288 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11289 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER >= 256) {
11290 return;
11292 #endif
11293 mavlink_message_t msg;
11294 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11295 uint16_t i;
11296 mavlink_trajectory_representation_bezier_t packet_in = {
11297 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
11299 mavlink_trajectory_representation_bezier_t packet1, packet2;
11300 memset(&packet1, 0, sizeof(packet1));
11301 packet1.time_usec = packet_in.time_usec;
11302 packet1.valid_points = packet_in.valid_points;
11304 mav_array_memcpy(packet1.pos_x, packet_in.pos_x, sizeof(float)*5);
11305 mav_array_memcpy(packet1.pos_y, packet_in.pos_y, sizeof(float)*5);
11306 mav_array_memcpy(packet1.pos_z, packet_in.pos_z, sizeof(float)*5);
11307 mav_array_memcpy(packet1.delta, packet_in.delta, sizeof(float)*5);
11308 mav_array_memcpy(packet1.pos_yaw, packet_in.pos_yaw, sizeof(float)*5);
11310 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11311 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11312 // cope with extensions
11313 memset(MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_MIN_LEN);
11315 #endif
11316 memset(&packet2, 0, sizeof(packet2));
11317 mavlink_msg_trajectory_representation_bezier_encode(system_id, component_id, &msg, &packet1);
11318 mavlink_msg_trajectory_representation_bezier_decode(&msg, &packet2);
11319 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11321 memset(&packet2, 0, sizeof(packet2));
11322 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 );
11323 mavlink_msg_trajectory_representation_bezier_decode(&msg, &packet2);
11324 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11326 memset(&packet2, 0, sizeof(packet2));
11327 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 );
11328 mavlink_msg_trajectory_representation_bezier_decode(&msg, &packet2);
11329 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11331 memset(&packet2, 0, sizeof(packet2));
11332 mavlink_msg_to_send_buffer(buffer, &msg);
11333 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11334 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11336 mavlink_msg_trajectory_representation_bezier_decode(last_msg, &packet2);
11337 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11339 memset(&packet2, 0, sizeof(packet2));
11340 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 );
11341 mavlink_msg_trajectory_representation_bezier_decode(last_msg, &packet2);
11342 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11345 static void mavlink_test_cellular_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11347 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11348 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11349 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CELLULAR_STATUS >= 256) {
11350 return;
11352 #endif
11353 mavlink_message_t msg;
11354 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11355 uint16_t i;
11356 mavlink_cellular_status_t packet_in = {
11357 17235,17339,17443,151,218,29,96
11359 mavlink_cellular_status_t packet1, packet2;
11360 memset(&packet1, 0, sizeof(packet1));
11361 packet1.mcc = packet_in.mcc;
11362 packet1.mnc = packet_in.mnc;
11363 packet1.lac = packet_in.lac;
11364 packet1.status = packet_in.status;
11365 packet1.failure_reason = packet_in.failure_reason;
11366 packet1.type = packet_in.type;
11367 packet1.quality = packet_in.quality;
11370 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11371 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11372 // cope with extensions
11373 memset(MAVLINK_MSG_ID_CELLULAR_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CELLULAR_STATUS_MIN_LEN);
11375 #endif
11376 memset(&packet2, 0, sizeof(packet2));
11377 mavlink_msg_cellular_status_encode(system_id, component_id, &msg, &packet1);
11378 mavlink_msg_cellular_status_decode(&msg, &packet2);
11379 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11381 memset(&packet2, 0, sizeof(packet2));
11382 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 );
11383 mavlink_msg_cellular_status_decode(&msg, &packet2);
11384 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11386 memset(&packet2, 0, sizeof(packet2));
11387 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 );
11388 mavlink_msg_cellular_status_decode(&msg, &packet2);
11389 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11391 memset(&packet2, 0, sizeof(packet2));
11392 mavlink_msg_to_send_buffer(buffer, &msg);
11393 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11394 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11396 mavlink_msg_cellular_status_decode(last_msg, &packet2);
11397 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11399 memset(&packet2, 0, sizeof(packet2));
11400 mavlink_msg_cellular_status_send(MAVLINK_COMM_1 , packet1.status , packet1.failure_reason , packet1.type , packet1.quality , packet1.mcc , packet1.mnc , packet1.lac );
11401 mavlink_msg_cellular_status_decode(last_msg, &packet2);
11402 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11405 static void mavlink_test_isbd_link_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11407 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11408 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11409 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ISBD_LINK_STATUS >= 256) {
11410 return;
11412 #endif
11413 mavlink_message_t msg;
11414 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11415 uint16_t i;
11416 mavlink_isbd_link_status_t packet_in = {
11417 93372036854775807ULL,93372036854776311ULL,18067,18171,65,132,199,10
11419 mavlink_isbd_link_status_t packet1, packet2;
11420 memset(&packet1, 0, sizeof(packet1));
11421 packet1.timestamp = packet_in.timestamp;
11422 packet1.last_heartbeat = packet_in.last_heartbeat;
11423 packet1.failed_sessions = packet_in.failed_sessions;
11424 packet1.successful_sessions = packet_in.successful_sessions;
11425 packet1.signal_quality = packet_in.signal_quality;
11426 packet1.ring_pending = packet_in.ring_pending;
11427 packet1.tx_session_pending = packet_in.tx_session_pending;
11428 packet1.rx_session_pending = packet_in.rx_session_pending;
11431 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11432 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11433 // cope with extensions
11434 memset(MAVLINK_MSG_ID_ISBD_LINK_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ISBD_LINK_STATUS_MIN_LEN);
11436 #endif
11437 memset(&packet2, 0, sizeof(packet2));
11438 mavlink_msg_isbd_link_status_encode(system_id, component_id, &msg, &packet1);
11439 mavlink_msg_isbd_link_status_decode(&msg, &packet2);
11440 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11442 memset(&packet2, 0, sizeof(packet2));
11443 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 );
11444 mavlink_msg_isbd_link_status_decode(&msg, &packet2);
11445 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11447 memset(&packet2, 0, sizeof(packet2));
11448 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 );
11449 mavlink_msg_isbd_link_status_decode(&msg, &packet2);
11450 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11452 memset(&packet2, 0, sizeof(packet2));
11453 mavlink_msg_to_send_buffer(buffer, &msg);
11454 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11455 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11457 mavlink_msg_isbd_link_status_decode(last_msg, &packet2);
11458 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11460 memset(&packet2, 0, sizeof(packet2));
11461 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 );
11462 mavlink_msg_isbd_link_status_decode(last_msg, &packet2);
11463 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11466 static void mavlink_test_cellular_config(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11468 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11469 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11470 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CELLULAR_CONFIG >= 256) {
11471 return;
11473 #endif
11474 mavlink_message_t msg;
11475 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11476 uint16_t i;
11477 mavlink_cellular_config_t packet_in = {
11478 5,72,"CDEFGHIJKLMNOPQ","STUVWXYZABCDEFG","IJKLMNOPQRSTUVWXYZABCDEFGHIJKLM","OPQRSTUVWXYZABC",123,190
11480 mavlink_cellular_config_t packet1, packet2;
11481 memset(&packet1, 0, sizeof(packet1));
11482 packet1.enable_lte = packet_in.enable_lte;
11483 packet1.enable_pin = packet_in.enable_pin;
11484 packet1.roaming = packet_in.roaming;
11485 packet1.response = packet_in.response;
11487 mav_array_memcpy(packet1.pin, packet_in.pin, sizeof(char)*16);
11488 mav_array_memcpy(packet1.new_pin, packet_in.new_pin, sizeof(char)*16);
11489 mav_array_memcpy(packet1.apn, packet_in.apn, sizeof(char)*32);
11490 mav_array_memcpy(packet1.puk, packet_in.puk, sizeof(char)*16);
11492 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11493 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11494 // cope with extensions
11495 memset(MAVLINK_MSG_ID_CELLULAR_CONFIG_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CELLULAR_CONFIG_MIN_LEN);
11497 #endif
11498 memset(&packet2, 0, sizeof(packet2));
11499 mavlink_msg_cellular_config_encode(system_id, component_id, &msg, &packet1);
11500 mavlink_msg_cellular_config_decode(&msg, &packet2);
11501 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11503 memset(&packet2, 0, sizeof(packet2));
11504 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 );
11505 mavlink_msg_cellular_config_decode(&msg, &packet2);
11506 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11508 memset(&packet2, 0, sizeof(packet2));
11509 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 );
11510 mavlink_msg_cellular_config_decode(&msg, &packet2);
11511 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11513 memset(&packet2, 0, sizeof(packet2));
11514 mavlink_msg_to_send_buffer(buffer, &msg);
11515 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11516 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11518 mavlink_msg_cellular_config_decode(last_msg, &packet2);
11519 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11521 memset(&packet2, 0, sizeof(packet2));
11522 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 );
11523 mavlink_msg_cellular_config_decode(last_msg, &packet2);
11524 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11527 static void mavlink_test_raw_rpm(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11529 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11530 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11531 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RAW_RPM >= 256) {
11532 return;
11534 #endif
11535 mavlink_message_t msg;
11536 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11537 uint16_t i;
11538 mavlink_raw_rpm_t packet_in = {
11539 17.0,17
11541 mavlink_raw_rpm_t packet1, packet2;
11542 memset(&packet1, 0, sizeof(packet1));
11543 packet1.frequency = packet_in.frequency;
11544 packet1.index = packet_in.index;
11547 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11548 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11549 // cope with extensions
11550 memset(MAVLINK_MSG_ID_RAW_RPM_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RAW_RPM_MIN_LEN);
11552 #endif
11553 memset(&packet2, 0, sizeof(packet2));
11554 mavlink_msg_raw_rpm_encode(system_id, component_id, &msg, &packet1);
11555 mavlink_msg_raw_rpm_decode(&msg, &packet2);
11556 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11558 memset(&packet2, 0, sizeof(packet2));
11559 mavlink_msg_raw_rpm_pack(system_id, component_id, &msg , packet1.index , packet1.frequency );
11560 mavlink_msg_raw_rpm_decode(&msg, &packet2);
11561 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11563 memset(&packet2, 0, sizeof(packet2));
11564 mavlink_msg_raw_rpm_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.index , packet1.frequency );
11565 mavlink_msg_raw_rpm_decode(&msg, &packet2);
11566 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11568 memset(&packet2, 0, sizeof(packet2));
11569 mavlink_msg_to_send_buffer(buffer, &msg);
11570 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11571 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11573 mavlink_msg_raw_rpm_decode(last_msg, &packet2);
11574 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11576 memset(&packet2, 0, sizeof(packet2));
11577 mavlink_msg_raw_rpm_send(MAVLINK_COMM_1 , packet1.index , packet1.frequency );
11578 mavlink_msg_raw_rpm_decode(last_msg, &packet2);
11579 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11582 static void mavlink_test_utm_global_position(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11584 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11585 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11586 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_UTM_GLOBAL_POSITION >= 256) {
11587 return;
11589 #endif
11590 mavlink_message_t msg;
11591 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11592 uint16_t i;
11593 mavlink_utm_global_position_t packet_in = {
11594 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
11596 mavlink_utm_global_position_t packet1, packet2;
11597 memset(&packet1, 0, sizeof(packet1));
11598 packet1.time = packet_in.time;
11599 packet1.lat = packet_in.lat;
11600 packet1.lon = packet_in.lon;
11601 packet1.alt = packet_in.alt;
11602 packet1.relative_alt = packet_in.relative_alt;
11603 packet1.next_lat = packet_in.next_lat;
11604 packet1.next_lon = packet_in.next_lon;
11605 packet1.next_alt = packet_in.next_alt;
11606 packet1.vx = packet_in.vx;
11607 packet1.vy = packet_in.vy;
11608 packet1.vz = packet_in.vz;
11609 packet1.h_acc = packet_in.h_acc;
11610 packet1.v_acc = packet_in.v_acc;
11611 packet1.vel_acc = packet_in.vel_acc;
11612 packet1.update_rate = packet_in.update_rate;
11613 packet1.flight_state = packet_in.flight_state;
11614 packet1.flags = packet_in.flags;
11616 mav_array_memcpy(packet1.uas_id, packet_in.uas_id, sizeof(uint8_t)*18);
11618 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11619 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11620 // cope with extensions
11621 memset(MAVLINK_MSG_ID_UTM_GLOBAL_POSITION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_UTM_GLOBAL_POSITION_MIN_LEN);
11623 #endif
11624 memset(&packet2, 0, sizeof(packet2));
11625 mavlink_msg_utm_global_position_encode(system_id, component_id, &msg, &packet1);
11626 mavlink_msg_utm_global_position_decode(&msg, &packet2);
11627 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11629 memset(&packet2, 0, sizeof(packet2));
11630 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 );
11631 mavlink_msg_utm_global_position_decode(&msg, &packet2);
11632 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11634 memset(&packet2, 0, sizeof(packet2));
11635 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 );
11636 mavlink_msg_utm_global_position_decode(&msg, &packet2);
11637 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11639 memset(&packet2, 0, sizeof(packet2));
11640 mavlink_msg_to_send_buffer(buffer, &msg);
11641 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11642 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11644 mavlink_msg_utm_global_position_decode(last_msg, &packet2);
11645 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11647 memset(&packet2, 0, sizeof(packet2));
11648 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 );
11649 mavlink_msg_utm_global_position_decode(last_msg, &packet2);
11650 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11653 static void mavlink_test_debug_float_array(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11655 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11656 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11657 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY >= 256) {
11658 return;
11660 #endif
11661 mavlink_message_t msg;
11662 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11663 uint16_t i;
11664 mavlink_debug_float_array_t packet_in = {
11665 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 }
11667 mavlink_debug_float_array_t packet1, packet2;
11668 memset(&packet1, 0, sizeof(packet1));
11669 packet1.time_usec = packet_in.time_usec;
11670 packet1.array_id = packet_in.array_id;
11672 mav_array_memcpy(packet1.name, packet_in.name, sizeof(char)*10);
11673 mav_array_memcpy(packet1.data, packet_in.data, sizeof(float)*58);
11675 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11676 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11677 // cope with extensions
11678 memset(MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY_MIN_LEN);
11680 #endif
11681 memset(&packet2, 0, sizeof(packet2));
11682 mavlink_msg_debug_float_array_encode(system_id, component_id, &msg, &packet1);
11683 mavlink_msg_debug_float_array_decode(&msg, &packet2);
11684 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11686 memset(&packet2, 0, sizeof(packet2));
11687 mavlink_msg_debug_float_array_pack(system_id, component_id, &msg , packet1.time_usec , packet1.name , packet1.array_id , packet1.data );
11688 mavlink_msg_debug_float_array_decode(&msg, &packet2);
11689 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11691 memset(&packet2, 0, sizeof(packet2));
11692 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 );
11693 mavlink_msg_debug_float_array_decode(&msg, &packet2);
11694 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11696 memset(&packet2, 0, sizeof(packet2));
11697 mavlink_msg_to_send_buffer(buffer, &msg);
11698 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11699 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11701 mavlink_msg_debug_float_array_decode(last_msg, &packet2);
11702 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11704 memset(&packet2, 0, sizeof(packet2));
11705 mavlink_msg_debug_float_array_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.name , packet1.array_id , packet1.data );
11706 mavlink_msg_debug_float_array_decode(last_msg, &packet2);
11707 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11710 static void mavlink_test_orbit_execution_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11712 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11713 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11714 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS >= 256) {
11715 return;
11717 #endif
11718 mavlink_message_t msg;
11719 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11720 uint16_t i;
11721 mavlink_orbit_execution_status_t packet_in = {
11722 93372036854775807ULL,73.0,963498088,963498296,157.0,77
11724 mavlink_orbit_execution_status_t packet1, packet2;
11725 memset(&packet1, 0, sizeof(packet1));
11726 packet1.time_usec = packet_in.time_usec;
11727 packet1.radius = packet_in.radius;
11728 packet1.x = packet_in.x;
11729 packet1.y = packet_in.y;
11730 packet1.z = packet_in.z;
11731 packet1.frame = packet_in.frame;
11734 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11735 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11736 // cope with extensions
11737 memset(MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_MIN_LEN);
11739 #endif
11740 memset(&packet2, 0, sizeof(packet2));
11741 mavlink_msg_orbit_execution_status_encode(system_id, component_id, &msg, &packet1);
11742 mavlink_msg_orbit_execution_status_decode(&msg, &packet2);
11743 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11745 memset(&packet2, 0, sizeof(packet2));
11746 mavlink_msg_orbit_execution_status_pack(system_id, component_id, &msg , packet1.time_usec , packet1.radius , packet1.frame , packet1.x , packet1.y , packet1.z );
11747 mavlink_msg_orbit_execution_status_decode(&msg, &packet2);
11748 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11750 memset(&packet2, 0, sizeof(packet2));
11751 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 );
11752 mavlink_msg_orbit_execution_status_decode(&msg, &packet2);
11753 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11755 memset(&packet2, 0, sizeof(packet2));
11756 mavlink_msg_to_send_buffer(buffer, &msg);
11757 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11758 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11760 mavlink_msg_orbit_execution_status_decode(last_msg, &packet2);
11761 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11763 memset(&packet2, 0, sizeof(packet2));
11764 mavlink_msg_orbit_execution_status_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.radius , packet1.frame , packet1.x , packet1.y , packet1.z );
11765 mavlink_msg_orbit_execution_status_decode(last_msg, &packet2);
11766 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11769 static void mavlink_test_smart_battery_info(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11771 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11772 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11773 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SMART_BATTERY_INFO >= 256) {
11774 return;
11776 #endif
11777 mavlink_message_t msg;
11778 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11779 uint16_t i;
11780 mavlink_smart_battery_info_t packet_in = {
11781 963497464,963497672,17651,17755,17859,17963,18067,187,254,65,"VWXYZABCDEFGHIJ","LMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGH"
11783 mavlink_smart_battery_info_t packet1, packet2;
11784 memset(&packet1, 0, sizeof(packet1));
11785 packet1.capacity_full_specification = packet_in.capacity_full_specification;
11786 packet1.capacity_full = packet_in.capacity_full;
11787 packet1.cycle_count = packet_in.cycle_count;
11788 packet1.weight = packet_in.weight;
11789 packet1.discharge_minimum_voltage = packet_in.discharge_minimum_voltage;
11790 packet1.charging_minimum_voltage = packet_in.charging_minimum_voltage;
11791 packet1.resting_minimum_voltage = packet_in.resting_minimum_voltage;
11792 packet1.id = packet_in.id;
11793 packet1.battery_function = packet_in.battery_function;
11794 packet1.type = packet_in.type;
11796 mav_array_memcpy(packet1.serial_number, packet_in.serial_number, sizeof(char)*16);
11797 mav_array_memcpy(packet1.device_name, packet_in.device_name, sizeof(char)*50);
11799 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11800 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11801 // cope with extensions
11802 memset(MAVLINK_MSG_ID_SMART_BATTERY_INFO_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SMART_BATTERY_INFO_MIN_LEN);
11804 #endif
11805 memset(&packet2, 0, sizeof(packet2));
11806 mavlink_msg_smart_battery_info_encode(system_id, component_id, &msg, &packet1);
11807 mavlink_msg_smart_battery_info_decode(&msg, &packet2);
11808 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11810 memset(&packet2, 0, sizeof(packet2));
11811 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 );
11812 mavlink_msg_smart_battery_info_decode(&msg, &packet2);
11813 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11815 memset(&packet2, 0, sizeof(packet2));
11816 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 );
11817 mavlink_msg_smart_battery_info_decode(&msg, &packet2);
11818 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11820 memset(&packet2, 0, sizeof(packet2));
11821 mavlink_msg_to_send_buffer(buffer, &msg);
11822 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11823 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11825 mavlink_msg_smart_battery_info_decode(last_msg, &packet2);
11826 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11828 memset(&packet2, 0, sizeof(packet2));
11829 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 );
11830 mavlink_msg_smart_battery_info_decode(last_msg, &packet2);
11831 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11834 static void mavlink_test_generator_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11836 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11837 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11838 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GENERATOR_STATUS >= 256) {
11839 return;
11841 #endif
11842 mavlink_message_t msg;
11843 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11844 uint16_t i;
11845 mavlink_generator_status_t packet_in = {
11846 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,963498920,963499128,19107,19211,19315
11848 mavlink_generator_status_t packet1, packet2;
11849 memset(&packet1, 0, sizeof(packet1));
11850 packet1.status = packet_in.status;
11851 packet1.battery_current = packet_in.battery_current;
11852 packet1.load_current = packet_in.load_current;
11853 packet1.power_generated = packet_in.power_generated;
11854 packet1.bus_voltage = packet_in.bus_voltage;
11855 packet1.bat_current_setpoint = packet_in.bat_current_setpoint;
11856 packet1.runtime = packet_in.runtime;
11857 packet1.time_until_maintenance = packet_in.time_until_maintenance;
11858 packet1.generator_speed = packet_in.generator_speed;
11859 packet1.rectifier_temperature = packet_in.rectifier_temperature;
11860 packet1.generator_temperature = packet_in.generator_temperature;
11863 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11864 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11865 // cope with extensions
11866 memset(MAVLINK_MSG_ID_GENERATOR_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GENERATOR_STATUS_MIN_LEN);
11868 #endif
11869 memset(&packet2, 0, sizeof(packet2));
11870 mavlink_msg_generator_status_encode(system_id, component_id, &msg, &packet1);
11871 mavlink_msg_generator_status_decode(&msg, &packet2);
11872 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11874 memset(&packet2, 0, sizeof(packet2));
11875 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 );
11876 mavlink_msg_generator_status_decode(&msg, &packet2);
11877 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11879 memset(&packet2, 0, sizeof(packet2));
11880 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 );
11881 mavlink_msg_generator_status_decode(&msg, &packet2);
11882 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11884 memset(&packet2, 0, sizeof(packet2));
11885 mavlink_msg_to_send_buffer(buffer, &msg);
11886 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11887 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11889 mavlink_msg_generator_status_decode(last_msg, &packet2);
11890 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11892 memset(&packet2, 0, sizeof(packet2));
11893 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 );
11894 mavlink_msg_generator_status_decode(last_msg, &packet2);
11895 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11898 static void mavlink_test_actuator_output_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11900 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11901 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11902 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS >= 256) {
11903 return;
11905 #endif
11906 mavlink_message_t msg;
11907 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11908 uint16_t i;
11909 mavlink_actuator_output_status_t packet_in = {
11910 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 }
11912 mavlink_actuator_output_status_t packet1, packet2;
11913 memset(&packet1, 0, sizeof(packet1));
11914 packet1.time_usec = packet_in.time_usec;
11915 packet1.active = packet_in.active;
11917 mav_array_memcpy(packet1.actuator, packet_in.actuator, sizeof(float)*32);
11919 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11920 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11921 // cope with extensions
11922 memset(MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS_MIN_LEN);
11924 #endif
11925 memset(&packet2, 0, sizeof(packet2));
11926 mavlink_msg_actuator_output_status_encode(system_id, component_id, &msg, &packet1);
11927 mavlink_msg_actuator_output_status_decode(&msg, &packet2);
11928 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11930 memset(&packet2, 0, sizeof(packet2));
11931 mavlink_msg_actuator_output_status_pack(system_id, component_id, &msg , packet1.time_usec , packet1.active , packet1.actuator );
11932 mavlink_msg_actuator_output_status_decode(&msg, &packet2);
11933 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11935 memset(&packet2, 0, sizeof(packet2));
11936 mavlink_msg_actuator_output_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.active , packet1.actuator );
11937 mavlink_msg_actuator_output_status_decode(&msg, &packet2);
11938 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11940 memset(&packet2, 0, sizeof(packet2));
11941 mavlink_msg_to_send_buffer(buffer, &msg);
11942 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11943 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11945 mavlink_msg_actuator_output_status_decode(last_msg, &packet2);
11946 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11948 memset(&packet2, 0, sizeof(packet2));
11949 mavlink_msg_actuator_output_status_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.active , packet1.actuator );
11950 mavlink_msg_actuator_output_status_decode(last_msg, &packet2);
11951 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11954 static void mavlink_test_time_estimate_to_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11956 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11957 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11958 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET >= 256) {
11959 return;
11961 #endif
11962 mavlink_message_t msg;
11963 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11964 uint16_t i;
11965 mavlink_time_estimate_to_target_t packet_in = {
11966 963497464,963497672,963497880,963498088,963498296
11968 mavlink_time_estimate_to_target_t packet1, packet2;
11969 memset(&packet1, 0, sizeof(packet1));
11970 packet1.safe_return = packet_in.safe_return;
11971 packet1.land = packet_in.land;
11972 packet1.mission_next_item = packet_in.mission_next_item;
11973 packet1.mission_end = packet_in.mission_end;
11974 packet1.commanded_action = packet_in.commanded_action;
11977 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11978 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11979 // cope with extensions
11980 memset(MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_MIN_LEN);
11982 #endif
11983 memset(&packet2, 0, sizeof(packet2));
11984 mavlink_msg_time_estimate_to_target_encode(system_id, component_id, &msg, &packet1);
11985 mavlink_msg_time_estimate_to_target_decode(&msg, &packet2);
11986 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11988 memset(&packet2, 0, sizeof(packet2));
11989 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 );
11990 mavlink_msg_time_estimate_to_target_decode(&msg, &packet2);
11991 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11993 memset(&packet2, 0, sizeof(packet2));
11994 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 );
11995 mavlink_msg_time_estimate_to_target_decode(&msg, &packet2);
11996 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
11998 memset(&packet2, 0, sizeof(packet2));
11999 mavlink_msg_to_send_buffer(buffer, &msg);
12000 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12001 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12003 mavlink_msg_time_estimate_to_target_decode(last_msg, &packet2);
12004 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12006 memset(&packet2, 0, sizeof(packet2));
12007 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 );
12008 mavlink_msg_time_estimate_to_target_decode(last_msg, &packet2);
12009 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12012 static void mavlink_test_tunnel(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12014 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12015 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12016 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TUNNEL >= 256) {
12017 return;
12019 #endif
12020 mavlink_message_t msg;
12021 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12022 uint16_t i;
12023 mavlink_tunnel_t packet_in = {
12024 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 }
12026 mavlink_tunnel_t packet1, packet2;
12027 memset(&packet1, 0, sizeof(packet1));
12028 packet1.payload_type = packet_in.payload_type;
12029 packet1.target_system = packet_in.target_system;
12030 packet1.target_component = packet_in.target_component;
12031 packet1.payload_length = packet_in.payload_length;
12033 mav_array_memcpy(packet1.payload, packet_in.payload, sizeof(uint8_t)*128);
12035 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12036 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12037 // cope with extensions
12038 memset(MAVLINK_MSG_ID_TUNNEL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_TUNNEL_MIN_LEN);
12040 #endif
12041 memset(&packet2, 0, sizeof(packet2));
12042 mavlink_msg_tunnel_encode(system_id, component_id, &msg, &packet1);
12043 mavlink_msg_tunnel_decode(&msg, &packet2);
12044 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12046 memset(&packet2, 0, sizeof(packet2));
12047 mavlink_msg_tunnel_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.payload_type , packet1.payload_length , packet1.payload );
12048 mavlink_msg_tunnel_decode(&msg, &packet2);
12049 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12051 memset(&packet2, 0, sizeof(packet2));
12052 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 );
12053 mavlink_msg_tunnel_decode(&msg, &packet2);
12054 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12056 memset(&packet2, 0, sizeof(packet2));
12057 mavlink_msg_to_send_buffer(buffer, &msg);
12058 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12059 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12061 mavlink_msg_tunnel_decode(last_msg, &packet2);
12062 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12064 memset(&packet2, 0, sizeof(packet2));
12065 mavlink_msg_tunnel_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.payload_type , packet1.payload_length , packet1.payload );
12066 mavlink_msg_tunnel_decode(last_msg, &packet2);
12067 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12070 static void mavlink_test_onboard_computer_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12072 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12073 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12074 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS >= 256) {
12075 return;
12077 #endif
12078 mavlink_message_t msg;
12079 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12080 uint16_t i;
12081 mavlink_onboard_computer_status_t packet_in = {
12082 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 }
12084 mavlink_onboard_computer_status_t packet1, packet2;
12085 memset(&packet1, 0, sizeof(packet1));
12086 packet1.time_usec = packet_in.time_usec;
12087 packet1.uptime = packet_in.uptime;
12088 packet1.ram_usage = packet_in.ram_usage;
12089 packet1.ram_total = packet_in.ram_total;
12090 packet1.type = packet_in.type;
12091 packet1.temperature_board = packet_in.temperature_board;
12093 mav_array_memcpy(packet1.storage_type, packet_in.storage_type, sizeof(uint32_t)*4);
12094 mav_array_memcpy(packet1.storage_usage, packet_in.storage_usage, sizeof(uint32_t)*4);
12095 mav_array_memcpy(packet1.storage_total, packet_in.storage_total, sizeof(uint32_t)*4);
12096 mav_array_memcpy(packet1.link_type, packet_in.link_type, sizeof(uint32_t)*6);
12097 mav_array_memcpy(packet1.link_tx_rate, packet_in.link_tx_rate, sizeof(uint32_t)*6);
12098 mav_array_memcpy(packet1.link_rx_rate, packet_in.link_rx_rate, sizeof(uint32_t)*6);
12099 mav_array_memcpy(packet1.link_tx_max, packet_in.link_tx_max, sizeof(uint32_t)*6);
12100 mav_array_memcpy(packet1.link_rx_max, packet_in.link_rx_max, sizeof(uint32_t)*6);
12101 mav_array_memcpy(packet1.fan_speed, packet_in.fan_speed, sizeof(int16_t)*4);
12102 mav_array_memcpy(packet1.cpu_cores, packet_in.cpu_cores, sizeof(uint8_t)*8);
12103 mav_array_memcpy(packet1.cpu_combined, packet_in.cpu_combined, sizeof(uint8_t)*10);
12104 mav_array_memcpy(packet1.gpu_cores, packet_in.gpu_cores, sizeof(uint8_t)*4);
12105 mav_array_memcpy(packet1.gpu_combined, packet_in.gpu_combined, sizeof(uint8_t)*10);
12106 mav_array_memcpy(packet1.temperature_core, packet_in.temperature_core, sizeof(int8_t)*8);
12108 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12109 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12110 // cope with extensions
12111 memset(MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_MIN_LEN);
12113 #endif
12114 memset(&packet2, 0, sizeof(packet2));
12115 mavlink_msg_onboard_computer_status_encode(system_id, component_id, &msg, &packet1);
12116 mavlink_msg_onboard_computer_status_decode(&msg, &packet2);
12117 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12119 memset(&packet2, 0, sizeof(packet2));
12120 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 );
12121 mavlink_msg_onboard_computer_status_decode(&msg, &packet2);
12122 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12124 memset(&packet2, 0, sizeof(packet2));
12125 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 );
12126 mavlink_msg_onboard_computer_status_decode(&msg, &packet2);
12127 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12129 memset(&packet2, 0, sizeof(packet2));
12130 mavlink_msg_to_send_buffer(buffer, &msg);
12131 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12132 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12134 mavlink_msg_onboard_computer_status_decode(last_msg, &packet2);
12135 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12137 memset(&packet2, 0, sizeof(packet2));
12138 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 );
12139 mavlink_msg_onboard_computer_status_decode(last_msg, &packet2);
12140 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12143 static void mavlink_test_component_information(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12145 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12146 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12147 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMPONENT_INFORMATION >= 256) {
12148 return;
12150 #endif
12151 mavlink_message_t msg;
12152 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12153 uint16_t i;
12154 mavlink_component_information_t packet_in = {
12155 963497464,963497672,963497880,963498088,"QRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFG","IJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXY"
12157 mavlink_component_information_t packet1, packet2;
12158 memset(&packet1, 0, sizeof(packet1));
12159 packet1.time_boot_ms = packet_in.time_boot_ms;
12160 packet1.metadata_type = packet_in.metadata_type;
12161 packet1.metadata_uid = packet_in.metadata_uid;
12162 packet1.translation_uid = packet_in.translation_uid;
12164 mav_array_memcpy(packet1.metadata_uri, packet_in.metadata_uri, sizeof(char)*70);
12165 mav_array_memcpy(packet1.translation_uri, packet_in.translation_uri, sizeof(char)*70);
12167 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12168 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12169 // cope with extensions
12170 memset(MAVLINK_MSG_ID_COMPONENT_INFORMATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COMPONENT_INFORMATION_MIN_LEN);
12172 #endif
12173 memset(&packet2, 0, sizeof(packet2));
12174 mavlink_msg_component_information_encode(system_id, component_id, &msg, &packet1);
12175 mavlink_msg_component_information_decode(&msg, &packet2);
12176 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12178 memset(&packet2, 0, sizeof(packet2));
12179 mavlink_msg_component_information_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.metadata_type , packet1.metadata_uid , packet1.metadata_uri , packet1.translation_uid , packet1.translation_uri );
12180 mavlink_msg_component_information_decode(&msg, &packet2);
12181 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12183 memset(&packet2, 0, sizeof(packet2));
12184 mavlink_msg_component_information_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.metadata_type , packet1.metadata_uid , packet1.metadata_uri , packet1.translation_uid , packet1.translation_uri );
12185 mavlink_msg_component_information_decode(&msg, &packet2);
12186 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12188 memset(&packet2, 0, sizeof(packet2));
12189 mavlink_msg_to_send_buffer(buffer, &msg);
12190 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12191 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12193 mavlink_msg_component_information_decode(last_msg, &packet2);
12194 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12196 memset(&packet2, 0, sizeof(packet2));
12197 mavlink_msg_component_information_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.metadata_type , packet1.metadata_uid , packet1.metadata_uri , packet1.translation_uid , packet1.translation_uri );
12198 mavlink_msg_component_information_decode(last_msg, &packet2);
12199 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12202 static void mavlink_test_play_tune_v2(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12204 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12205 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12206 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PLAY_TUNE_V2 >= 256) {
12207 return;
12209 #endif
12210 mavlink_message_t msg;
12211 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12212 uint16_t i;
12213 mavlink_play_tune_v2_t packet_in = {
12214 963497464,17,84,"GHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRS"
12216 mavlink_play_tune_v2_t packet1, packet2;
12217 memset(&packet1, 0, sizeof(packet1));
12218 packet1.format = packet_in.format;
12219 packet1.target_system = packet_in.target_system;
12220 packet1.target_component = packet_in.target_component;
12222 mav_array_memcpy(packet1.tune, packet_in.tune, sizeof(char)*248);
12224 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12225 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12226 // cope with extensions
12227 memset(MAVLINK_MSG_ID_PLAY_TUNE_V2_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PLAY_TUNE_V2_MIN_LEN);
12229 #endif
12230 memset(&packet2, 0, sizeof(packet2));
12231 mavlink_msg_play_tune_v2_encode(system_id, component_id, &msg, &packet1);
12232 mavlink_msg_play_tune_v2_decode(&msg, &packet2);
12233 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12235 memset(&packet2, 0, sizeof(packet2));
12236 mavlink_msg_play_tune_v2_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.format , packet1.tune );
12237 mavlink_msg_play_tune_v2_decode(&msg, &packet2);
12238 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12240 memset(&packet2, 0, sizeof(packet2));
12241 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 );
12242 mavlink_msg_play_tune_v2_decode(&msg, &packet2);
12243 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12245 memset(&packet2, 0, sizeof(packet2));
12246 mavlink_msg_to_send_buffer(buffer, &msg);
12247 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12248 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12250 mavlink_msg_play_tune_v2_decode(last_msg, &packet2);
12251 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12253 memset(&packet2, 0, sizeof(packet2));
12254 mavlink_msg_play_tune_v2_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.format , packet1.tune );
12255 mavlink_msg_play_tune_v2_decode(last_msg, &packet2);
12256 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12259 static void mavlink_test_supported_tunes(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
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_SUPPORTED_TUNES >= 256) {
12264 return;
12266 #endif
12267 mavlink_message_t msg;
12268 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12269 uint16_t i;
12270 mavlink_supported_tunes_t packet_in = {
12271 963497464,17,84
12273 mavlink_supported_tunes_t packet1, packet2;
12274 memset(&packet1, 0, sizeof(packet1));
12275 packet1.format = packet_in.format;
12276 packet1.target_system = packet_in.target_system;
12277 packet1.target_component = packet_in.target_component;
12280 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12281 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12282 // cope with extensions
12283 memset(MAVLINK_MSG_ID_SUPPORTED_TUNES_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SUPPORTED_TUNES_MIN_LEN);
12285 #endif
12286 memset(&packet2, 0, sizeof(packet2));
12287 mavlink_msg_supported_tunes_encode(system_id, component_id, &msg, &packet1);
12288 mavlink_msg_supported_tunes_decode(&msg, &packet2);
12289 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12291 memset(&packet2, 0, sizeof(packet2));
12292 mavlink_msg_supported_tunes_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.format );
12293 mavlink_msg_supported_tunes_decode(&msg, &packet2);
12294 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12296 memset(&packet2, 0, sizeof(packet2));
12297 mavlink_msg_supported_tunes_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.format );
12298 mavlink_msg_supported_tunes_decode(&msg, &packet2);
12299 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12301 memset(&packet2, 0, sizeof(packet2));
12302 mavlink_msg_to_send_buffer(buffer, &msg);
12303 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12304 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12306 mavlink_msg_supported_tunes_decode(last_msg, &packet2);
12307 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12309 memset(&packet2, 0, sizeof(packet2));
12310 mavlink_msg_supported_tunes_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.format );
12311 mavlink_msg_supported_tunes_decode(last_msg, &packet2);
12312 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12315 static void mavlink_test_wheel_distance(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12317 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12318 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12319 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_WHEEL_DISTANCE >= 256) {
12320 return;
12322 #endif
12323 mavlink_message_t msg;
12324 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12325 uint16_t i;
12326 mavlink_wheel_distance_t packet_in = {
12327 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
12329 mavlink_wheel_distance_t packet1, packet2;
12330 memset(&packet1, 0, sizeof(packet1));
12331 packet1.time_usec = packet_in.time_usec;
12332 packet1.count = packet_in.count;
12334 mav_array_memcpy(packet1.distance, packet_in.distance, sizeof(double)*16);
12336 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12337 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12338 // cope with extensions
12339 memset(MAVLINK_MSG_ID_WHEEL_DISTANCE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_WHEEL_DISTANCE_MIN_LEN);
12341 #endif
12342 memset(&packet2, 0, sizeof(packet2));
12343 mavlink_msg_wheel_distance_encode(system_id, component_id, &msg, &packet1);
12344 mavlink_msg_wheel_distance_decode(&msg, &packet2);
12345 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12347 memset(&packet2, 0, sizeof(packet2));
12348 mavlink_msg_wheel_distance_pack(system_id, component_id, &msg , packet1.time_usec , packet1.count , packet1.distance );
12349 mavlink_msg_wheel_distance_decode(&msg, &packet2);
12350 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12352 memset(&packet2, 0, sizeof(packet2));
12353 mavlink_msg_wheel_distance_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.count , packet1.distance );
12354 mavlink_msg_wheel_distance_decode(&msg, &packet2);
12355 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12357 memset(&packet2, 0, sizeof(packet2));
12358 mavlink_msg_to_send_buffer(buffer, &msg);
12359 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12360 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12362 mavlink_msg_wheel_distance_decode(last_msg, &packet2);
12363 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12365 memset(&packet2, 0, sizeof(packet2));
12366 mavlink_msg_wheel_distance_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.count , packet1.distance );
12367 mavlink_msg_wheel_distance_decode(last_msg, &packet2);
12368 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12371 static void mavlink_test_winch_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12373 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12374 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12375 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_WINCH_STATUS >= 256) {
12376 return;
12378 #endif
12379 mavlink_message_t msg;
12380 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12381 uint16_t i;
12382 mavlink_winch_status_t packet_in = {
12383 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,963498920,18899
12385 mavlink_winch_status_t packet1, packet2;
12386 memset(&packet1, 0, sizeof(packet1));
12387 packet1.time_usec = packet_in.time_usec;
12388 packet1.line_length = packet_in.line_length;
12389 packet1.speed = packet_in.speed;
12390 packet1.tension = packet_in.tension;
12391 packet1.voltage = packet_in.voltage;
12392 packet1.current = packet_in.current;
12393 packet1.status = packet_in.status;
12394 packet1.temperature = packet_in.temperature;
12397 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12398 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12399 // cope with extensions
12400 memset(MAVLINK_MSG_ID_WINCH_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_WINCH_STATUS_MIN_LEN);
12402 #endif
12403 memset(&packet2, 0, sizeof(packet2));
12404 mavlink_msg_winch_status_encode(system_id, component_id, &msg, &packet1);
12405 mavlink_msg_winch_status_decode(&msg, &packet2);
12406 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12408 memset(&packet2, 0, sizeof(packet2));
12409 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 );
12410 mavlink_msg_winch_status_decode(&msg, &packet2);
12411 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12413 memset(&packet2, 0, sizeof(packet2));
12414 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 );
12415 mavlink_msg_winch_status_decode(&msg, &packet2);
12416 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12418 memset(&packet2, 0, sizeof(packet2));
12419 mavlink_msg_to_send_buffer(buffer, &msg);
12420 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12421 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12423 mavlink_msg_winch_status_decode(last_msg, &packet2);
12424 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12426 memset(&packet2, 0, sizeof(packet2));
12427 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 );
12428 mavlink_msg_winch_status_decode(last_msg, &packet2);
12429 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12432 static void mavlink_test_open_drone_id_basic_id(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12434 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12435 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12436 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID >= 256) {
12437 return;
12439 #endif
12440 mavlink_message_t msg;
12441 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12442 uint16_t i;
12443 mavlink_open_drone_id_basic_id_t packet_in = {
12444 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 }
12446 mavlink_open_drone_id_basic_id_t packet1, packet2;
12447 memset(&packet1, 0, sizeof(packet1));
12448 packet1.target_system = packet_in.target_system;
12449 packet1.target_component = packet_in.target_component;
12450 packet1.id_type = packet_in.id_type;
12451 packet1.ua_type = packet_in.ua_type;
12453 mav_array_memcpy(packet1.id_or_mac, packet_in.id_or_mac, sizeof(uint8_t)*20);
12454 mav_array_memcpy(packet1.uas_id, packet_in.uas_id, sizeof(uint8_t)*20);
12456 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12457 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12458 // cope with extensions
12459 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);
12461 #endif
12462 memset(&packet2, 0, sizeof(packet2));
12463 mavlink_msg_open_drone_id_basic_id_encode(system_id, component_id, &msg, &packet1);
12464 mavlink_msg_open_drone_id_basic_id_decode(&msg, &packet2);
12465 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12467 memset(&packet2, 0, sizeof(packet2));
12468 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 );
12469 mavlink_msg_open_drone_id_basic_id_decode(&msg, &packet2);
12470 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12472 memset(&packet2, 0, sizeof(packet2));
12473 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 );
12474 mavlink_msg_open_drone_id_basic_id_decode(&msg, &packet2);
12475 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12477 memset(&packet2, 0, sizeof(packet2));
12478 mavlink_msg_to_send_buffer(buffer, &msg);
12479 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12480 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12482 mavlink_msg_open_drone_id_basic_id_decode(last_msg, &packet2);
12483 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12485 memset(&packet2, 0, sizeof(packet2));
12486 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 );
12487 mavlink_msg_open_drone_id_basic_id_decode(last_msg, &packet2);
12488 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12491 static void mavlink_test_open_drone_id_location(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12493 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12494 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12495 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION >= 256) {
12496 return;
12498 #endif
12499 mavlink_message_t msg;
12500 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12501 uint16_t i;
12502 mavlink_open_drone_id_location_t packet_in = {
12503 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
12505 mavlink_open_drone_id_location_t packet1, packet2;
12506 memset(&packet1, 0, sizeof(packet1));
12507 packet1.latitude = packet_in.latitude;
12508 packet1.longitude = packet_in.longitude;
12509 packet1.altitude_barometric = packet_in.altitude_barometric;
12510 packet1.altitude_geodetic = packet_in.altitude_geodetic;
12511 packet1.height = packet_in.height;
12512 packet1.timestamp = packet_in.timestamp;
12513 packet1.direction = packet_in.direction;
12514 packet1.speed_horizontal = packet_in.speed_horizontal;
12515 packet1.speed_vertical = packet_in.speed_vertical;
12516 packet1.target_system = packet_in.target_system;
12517 packet1.target_component = packet_in.target_component;
12518 packet1.status = packet_in.status;
12519 packet1.height_reference = packet_in.height_reference;
12520 packet1.horizontal_accuracy = packet_in.horizontal_accuracy;
12521 packet1.vertical_accuracy = packet_in.vertical_accuracy;
12522 packet1.barometer_accuracy = packet_in.barometer_accuracy;
12523 packet1.speed_accuracy = packet_in.speed_accuracy;
12524 packet1.timestamp_accuracy = packet_in.timestamp_accuracy;
12526 mav_array_memcpy(packet1.id_or_mac, packet_in.id_or_mac, sizeof(uint8_t)*20);
12528 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12529 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12530 // cope with extensions
12531 memset(MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_MIN_LEN);
12533 #endif
12534 memset(&packet2, 0, sizeof(packet2));
12535 mavlink_msg_open_drone_id_location_encode(system_id, component_id, &msg, &packet1);
12536 mavlink_msg_open_drone_id_location_decode(&msg, &packet2);
12537 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12539 memset(&packet2, 0, sizeof(packet2));
12540 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 );
12541 mavlink_msg_open_drone_id_location_decode(&msg, &packet2);
12542 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12544 memset(&packet2, 0, sizeof(packet2));
12545 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 );
12546 mavlink_msg_open_drone_id_location_decode(&msg, &packet2);
12547 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12549 memset(&packet2, 0, sizeof(packet2));
12550 mavlink_msg_to_send_buffer(buffer, &msg);
12551 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12552 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12554 mavlink_msg_open_drone_id_location_decode(last_msg, &packet2);
12555 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12557 memset(&packet2, 0, sizeof(packet2));
12558 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 );
12559 mavlink_msg_open_drone_id_location_decode(last_msg, &packet2);
12560 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12563 static void mavlink_test_open_drone_id_authentication(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12565 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12566 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12567 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION >= 256) {
12568 return;
12570 #endif
12571 mavlink_message_t msg;
12572 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12573 uint16_t i;
12574 mavlink_open_drone_id_authentication_t packet_in = {
12575 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 }
12577 mavlink_open_drone_id_authentication_t packet1, packet2;
12578 memset(&packet1, 0, sizeof(packet1));
12579 packet1.timestamp = packet_in.timestamp;
12580 packet1.target_system = packet_in.target_system;
12581 packet1.target_component = packet_in.target_component;
12582 packet1.authentication_type = packet_in.authentication_type;
12583 packet1.data_page = packet_in.data_page;
12584 packet1.page_count = packet_in.page_count;
12585 packet1.length = packet_in.length;
12587 mav_array_memcpy(packet1.id_or_mac, packet_in.id_or_mac, sizeof(uint8_t)*20);
12588 mav_array_memcpy(packet1.authentication_data, packet_in.authentication_data, sizeof(uint8_t)*23);
12590 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12591 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12592 // cope with extensions
12593 memset(MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_MIN_LEN);
12595 #endif
12596 memset(&packet2, 0, sizeof(packet2));
12597 mavlink_msg_open_drone_id_authentication_encode(system_id, component_id, &msg, &packet1);
12598 mavlink_msg_open_drone_id_authentication_decode(&msg, &packet2);
12599 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12601 memset(&packet2, 0, sizeof(packet2));
12602 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.page_count , packet1.length , packet1.timestamp , packet1.authentication_data );
12603 mavlink_msg_open_drone_id_authentication_decode(&msg, &packet2);
12604 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12606 memset(&packet2, 0, sizeof(packet2));
12607 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.page_count , packet1.length , packet1.timestamp , packet1.authentication_data );
12608 mavlink_msg_open_drone_id_authentication_decode(&msg, &packet2);
12609 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12611 memset(&packet2, 0, sizeof(packet2));
12612 mavlink_msg_to_send_buffer(buffer, &msg);
12613 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12614 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12616 mavlink_msg_open_drone_id_authentication_decode(last_msg, &packet2);
12617 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12619 memset(&packet2, 0, sizeof(packet2));
12620 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.page_count , packet1.length , packet1.timestamp , packet1.authentication_data );
12621 mavlink_msg_open_drone_id_authentication_decode(last_msg, &packet2);
12622 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12625 static void mavlink_test_open_drone_id_self_id(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12627 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12628 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12629 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_SELF_ID >= 256) {
12630 return;
12632 #endif
12633 mavlink_message_t msg;
12634 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12635 uint16_t i;
12636 mavlink_open_drone_id_self_id_t packet_in = {
12637 5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158 },199,"XYZABCDEFGHIJKLMNOPQRS"
12639 mavlink_open_drone_id_self_id_t packet1, packet2;
12640 memset(&packet1, 0, sizeof(packet1));
12641 packet1.target_system = packet_in.target_system;
12642 packet1.target_component = packet_in.target_component;
12643 packet1.description_type = packet_in.description_type;
12645 mav_array_memcpy(packet1.id_or_mac, packet_in.id_or_mac, sizeof(uint8_t)*20);
12646 mav_array_memcpy(packet1.description, packet_in.description, sizeof(char)*23);
12648 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12649 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12650 // cope with extensions
12651 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);
12653 #endif
12654 memset(&packet2, 0, sizeof(packet2));
12655 mavlink_msg_open_drone_id_self_id_encode(system_id, component_id, &msg, &packet1);
12656 mavlink_msg_open_drone_id_self_id_decode(&msg, &packet2);
12657 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12659 memset(&packet2, 0, sizeof(packet2));
12660 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 );
12661 mavlink_msg_open_drone_id_self_id_decode(&msg, &packet2);
12662 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12664 memset(&packet2, 0, sizeof(packet2));
12665 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 );
12666 mavlink_msg_open_drone_id_self_id_decode(&msg, &packet2);
12667 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12669 memset(&packet2, 0, sizeof(packet2));
12670 mavlink_msg_to_send_buffer(buffer, &msg);
12671 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12672 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12674 mavlink_msg_open_drone_id_self_id_decode(last_msg, &packet2);
12675 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12677 memset(&packet2, 0, sizeof(packet2));
12678 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 );
12679 mavlink_msg_open_drone_id_self_id_decode(last_msg, &packet2);
12680 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12683 static void mavlink_test_open_drone_id_system(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12685 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12686 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12687 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM >= 256) {
12688 return;
12690 #endif
12691 mavlink_message_t msg;
12692 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12693 uint16_t i;
12694 mavlink_open_drone_id_system_t packet_in = {
12695 963497464,963497672,73.0,101.0,18067,18171,65,132,{ 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218 },3,70,137,204
12697 mavlink_open_drone_id_system_t packet1, packet2;
12698 memset(&packet1, 0, sizeof(packet1));
12699 packet1.operator_latitude = packet_in.operator_latitude;
12700 packet1.operator_longitude = packet_in.operator_longitude;
12701 packet1.area_ceiling = packet_in.area_ceiling;
12702 packet1.area_floor = packet_in.area_floor;
12703 packet1.area_count = packet_in.area_count;
12704 packet1.area_radius = packet_in.area_radius;
12705 packet1.target_system = packet_in.target_system;
12706 packet1.target_component = packet_in.target_component;
12707 packet1.operator_location_type = packet_in.operator_location_type;
12708 packet1.classification_type = packet_in.classification_type;
12709 packet1.category_eu = packet_in.category_eu;
12710 packet1.class_eu = packet_in.class_eu;
12712 mav_array_memcpy(packet1.id_or_mac, packet_in.id_or_mac, sizeof(uint8_t)*20);
12714 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12715 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12716 // cope with extensions
12717 memset(MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_MIN_LEN);
12719 #endif
12720 memset(&packet2, 0, sizeof(packet2));
12721 mavlink_msg_open_drone_id_system_encode(system_id, component_id, &msg, &packet1);
12722 mavlink_msg_open_drone_id_system_decode(&msg, &packet2);
12723 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12725 memset(&packet2, 0, sizeof(packet2));
12726 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 );
12727 mavlink_msg_open_drone_id_system_decode(&msg, &packet2);
12728 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12730 memset(&packet2, 0, sizeof(packet2));
12731 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 );
12732 mavlink_msg_open_drone_id_system_decode(&msg, &packet2);
12733 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12735 memset(&packet2, 0, sizeof(packet2));
12736 mavlink_msg_to_send_buffer(buffer, &msg);
12737 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12738 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12740 mavlink_msg_open_drone_id_system_decode(last_msg, &packet2);
12741 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12743 memset(&packet2, 0, sizeof(packet2));
12744 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 );
12745 mavlink_msg_open_drone_id_system_decode(last_msg, &packet2);
12746 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12749 static void mavlink_test_open_drone_id_operator_id(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12751 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12752 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12753 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_OPERATOR_ID >= 256) {
12754 return;
12756 #endif
12757 mavlink_message_t msg;
12758 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12759 uint16_t i;
12760 mavlink_open_drone_id_operator_id_t packet_in = {
12761 5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158 },199,"XYZABCDEFGHIJKLMNOP"
12763 mavlink_open_drone_id_operator_id_t packet1, packet2;
12764 memset(&packet1, 0, sizeof(packet1));
12765 packet1.target_system = packet_in.target_system;
12766 packet1.target_component = packet_in.target_component;
12767 packet1.operator_id_type = packet_in.operator_id_type;
12769 mav_array_memcpy(packet1.id_or_mac, packet_in.id_or_mac, sizeof(uint8_t)*20);
12770 mav_array_memcpy(packet1.operator_id, packet_in.operator_id, sizeof(char)*20);
12772 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12773 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12774 // cope with extensions
12775 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);
12777 #endif
12778 memset(&packet2, 0, sizeof(packet2));
12779 mavlink_msg_open_drone_id_operator_id_encode(system_id, component_id, &msg, &packet1);
12780 mavlink_msg_open_drone_id_operator_id_decode(&msg, &packet2);
12781 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12783 memset(&packet2, 0, sizeof(packet2));
12784 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 );
12785 mavlink_msg_open_drone_id_operator_id_decode(&msg, &packet2);
12786 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12788 memset(&packet2, 0, sizeof(packet2));
12789 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 );
12790 mavlink_msg_open_drone_id_operator_id_decode(&msg, &packet2);
12791 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12793 memset(&packet2, 0, sizeof(packet2));
12794 mavlink_msg_to_send_buffer(buffer, &msg);
12795 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12796 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12798 mavlink_msg_open_drone_id_operator_id_decode(last_msg, &packet2);
12799 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12801 memset(&packet2, 0, sizeof(packet2));
12802 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 );
12803 mavlink_msg_open_drone_id_operator_id_decode(last_msg, &packet2);
12804 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12807 static void mavlink_test_open_drone_id_message_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12809 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12810 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12811 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_MESSAGE_PACK >= 256) {
12812 return;
12814 #endif
12815 mavlink_message_t msg;
12816 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12817 uint16_t i;
12818 mavlink_open_drone_id_message_pack_t packet_in = {
12819 5,72,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, 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, 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 }
12821 mavlink_open_drone_id_message_pack_t packet1, packet2;
12822 memset(&packet1, 0, sizeof(packet1));
12823 packet1.target_system = packet_in.target_system;
12824 packet1.target_component = packet_in.target_component;
12825 packet1.single_message_size = packet_in.single_message_size;
12826 packet1.msg_pack_size = packet_in.msg_pack_size;
12828 mav_array_memcpy(packet1.messages, packet_in.messages, sizeof(uint8_t)*250);
12830 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12831 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12832 // cope with extensions
12833 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);
12835 #endif
12836 memset(&packet2, 0, sizeof(packet2));
12837 mavlink_msg_open_drone_id_message_pack_encode(system_id, component_id, &msg, &packet1);
12838 mavlink_msg_open_drone_id_message_pack_decode(&msg, &packet2);
12839 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12841 memset(&packet2, 0, sizeof(packet2));
12842 mavlink_msg_open_drone_id_message_pack_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.single_message_size , packet1.msg_pack_size , packet1.messages );
12843 mavlink_msg_open_drone_id_message_pack_decode(&msg, &packet2);
12844 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12846 memset(&packet2, 0, sizeof(packet2));
12847 mavlink_msg_open_drone_id_message_pack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.single_message_size , packet1.msg_pack_size , packet1.messages );
12848 mavlink_msg_open_drone_id_message_pack_decode(&msg, &packet2);
12849 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12851 memset(&packet2, 0, sizeof(packet2));
12852 mavlink_msg_to_send_buffer(buffer, &msg);
12853 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12854 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12856 mavlink_msg_open_drone_id_message_pack_decode(last_msg, &packet2);
12857 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12859 memset(&packet2, 0, sizeof(packet2));
12860 mavlink_msg_open_drone_id_message_pack_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.single_message_size , packet1.msg_pack_size , packet1.messages );
12861 mavlink_msg_open_drone_id_message_pack_decode(last_msg, &packet2);
12862 MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
12865 static void mavlink_test_common(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12867 mavlink_test_sys_status(system_id, component_id, last_msg);
12868 mavlink_test_system_time(system_id, component_id, last_msg);
12869 mavlink_test_ping(system_id, component_id, last_msg);
12870 mavlink_test_change_operator_control(system_id, component_id, last_msg);
12871 mavlink_test_change_operator_control_ack(system_id, component_id, last_msg);
12872 mavlink_test_auth_key(system_id, component_id, last_msg);
12873 mavlink_test_link_node_status(system_id, component_id, last_msg);
12874 mavlink_test_set_mode(system_id, component_id, last_msg);
12875 mavlink_test_param_ack_transaction(system_id, component_id, last_msg);
12876 mavlink_test_param_request_read(system_id, component_id, last_msg);
12877 mavlink_test_param_request_list(system_id, component_id, last_msg);
12878 mavlink_test_param_value(system_id, component_id, last_msg);
12879 mavlink_test_param_set(system_id, component_id, last_msg);
12880 mavlink_test_gps_raw_int(system_id, component_id, last_msg);
12881 mavlink_test_gps_status(system_id, component_id, last_msg);
12882 mavlink_test_scaled_imu(system_id, component_id, last_msg);
12883 mavlink_test_raw_imu(system_id, component_id, last_msg);
12884 mavlink_test_raw_pressure(system_id, component_id, last_msg);
12885 mavlink_test_scaled_pressure(system_id, component_id, last_msg);
12886 mavlink_test_attitude(system_id, component_id, last_msg);
12887 mavlink_test_attitude_quaternion(system_id, component_id, last_msg);
12888 mavlink_test_local_position_ned(system_id, component_id, last_msg);
12889 mavlink_test_global_position_int(system_id, component_id, last_msg);
12890 mavlink_test_rc_channels_scaled(system_id, component_id, last_msg);
12891 mavlink_test_rc_channels_raw(system_id, component_id, last_msg);
12892 mavlink_test_servo_output_raw(system_id, component_id, last_msg);
12893 mavlink_test_mission_request_partial_list(system_id, component_id, last_msg);
12894 mavlink_test_mission_write_partial_list(system_id, component_id, last_msg);
12895 mavlink_test_mission_item(system_id, component_id, last_msg);
12896 mavlink_test_mission_request(system_id, component_id, last_msg);
12897 mavlink_test_mission_set_current(system_id, component_id, last_msg);
12898 mavlink_test_mission_current(system_id, component_id, last_msg);
12899 mavlink_test_mission_request_list(system_id, component_id, last_msg);
12900 mavlink_test_mission_count(system_id, component_id, last_msg);
12901 mavlink_test_mission_clear_all(system_id, component_id, last_msg);
12902 mavlink_test_mission_item_reached(system_id, component_id, last_msg);
12903 mavlink_test_mission_ack(system_id, component_id, last_msg);
12904 mavlink_test_set_gps_global_origin(system_id, component_id, last_msg);
12905 mavlink_test_gps_global_origin(system_id, component_id, last_msg);
12906 mavlink_test_param_map_rc(system_id, component_id, last_msg);
12907 mavlink_test_mission_request_int(system_id, component_id, last_msg);
12908 mavlink_test_mission_changed(system_id, component_id, last_msg);
12909 mavlink_test_safety_set_allowed_area(system_id, component_id, last_msg);
12910 mavlink_test_safety_allowed_area(system_id, component_id, last_msg);
12911 mavlink_test_attitude_quaternion_cov(system_id, component_id, last_msg);
12912 mavlink_test_nav_controller_output(system_id, component_id, last_msg);
12913 mavlink_test_global_position_int_cov(system_id, component_id, last_msg);
12914 mavlink_test_local_position_ned_cov(system_id, component_id, last_msg);
12915 mavlink_test_rc_channels(system_id, component_id, last_msg);
12916 mavlink_test_request_data_stream(system_id, component_id, last_msg);
12917 mavlink_test_data_stream(system_id, component_id, last_msg);
12918 mavlink_test_manual_control(system_id, component_id, last_msg);
12919 mavlink_test_rc_channels_override(system_id, component_id, last_msg);
12920 mavlink_test_mission_item_int(system_id, component_id, last_msg);
12921 mavlink_test_vfr_hud(system_id, component_id, last_msg);
12922 mavlink_test_command_int(system_id, component_id, last_msg);
12923 mavlink_test_command_long(system_id, component_id, last_msg);
12924 mavlink_test_command_ack(system_id, component_id, last_msg);
12925 mavlink_test_command_cancel(system_id, component_id, last_msg);
12926 mavlink_test_manual_setpoint(system_id, component_id, last_msg);
12927 mavlink_test_set_attitude_target(system_id, component_id, last_msg);
12928 mavlink_test_attitude_target(system_id, component_id, last_msg);
12929 mavlink_test_set_position_target_local_ned(system_id, component_id, last_msg);
12930 mavlink_test_position_target_local_ned(system_id, component_id, last_msg);
12931 mavlink_test_set_position_target_global_int(system_id, component_id, last_msg);
12932 mavlink_test_position_target_global_int(system_id, component_id, last_msg);
12933 mavlink_test_local_position_ned_system_global_offset(system_id, component_id, last_msg);
12934 mavlink_test_hil_state(system_id, component_id, last_msg);
12935 mavlink_test_hil_controls(system_id, component_id, last_msg);
12936 mavlink_test_hil_rc_inputs_raw(system_id, component_id, last_msg);
12937 mavlink_test_hil_actuator_controls(system_id, component_id, last_msg);
12938 mavlink_test_optical_flow(system_id, component_id, last_msg);
12939 mavlink_test_global_vision_position_estimate(system_id, component_id, last_msg);
12940 mavlink_test_vision_position_estimate(system_id, component_id, last_msg);
12941 mavlink_test_vision_speed_estimate(system_id, component_id, last_msg);
12942 mavlink_test_vicon_position_estimate(system_id, component_id, last_msg);
12943 mavlink_test_highres_imu(system_id, component_id, last_msg);
12944 mavlink_test_optical_flow_rad(system_id, component_id, last_msg);
12945 mavlink_test_hil_sensor(system_id, component_id, last_msg);
12946 mavlink_test_sim_state(system_id, component_id, last_msg);
12947 mavlink_test_radio_status(system_id, component_id, last_msg);
12948 mavlink_test_file_transfer_protocol(system_id, component_id, last_msg);
12949 mavlink_test_timesync(system_id, component_id, last_msg);
12950 mavlink_test_camera_trigger(system_id, component_id, last_msg);
12951 mavlink_test_hil_gps(system_id, component_id, last_msg);
12952 mavlink_test_hil_optical_flow(system_id, component_id, last_msg);
12953 mavlink_test_hil_state_quaternion(system_id, component_id, last_msg);
12954 mavlink_test_scaled_imu2(system_id, component_id, last_msg);
12955 mavlink_test_log_request_list(system_id, component_id, last_msg);
12956 mavlink_test_log_entry(system_id, component_id, last_msg);
12957 mavlink_test_log_request_data(system_id, component_id, last_msg);
12958 mavlink_test_log_data(system_id, component_id, last_msg);
12959 mavlink_test_log_erase(system_id, component_id, last_msg);
12960 mavlink_test_log_request_end(system_id, component_id, last_msg);
12961 mavlink_test_gps_inject_data(system_id, component_id, last_msg);
12962 mavlink_test_gps2_raw(system_id, component_id, last_msg);
12963 mavlink_test_power_status(system_id, component_id, last_msg);
12964 mavlink_test_serial_control(system_id, component_id, last_msg);
12965 mavlink_test_gps_rtk(system_id, component_id, last_msg);
12966 mavlink_test_gps2_rtk(system_id, component_id, last_msg);
12967 mavlink_test_scaled_imu3(system_id, component_id, last_msg);
12968 mavlink_test_data_transmission_handshake(system_id, component_id, last_msg);
12969 mavlink_test_encapsulated_data(system_id, component_id, last_msg);
12970 mavlink_test_distance_sensor(system_id, component_id, last_msg);
12971 mavlink_test_terrain_request(system_id, component_id, last_msg);
12972 mavlink_test_terrain_data(system_id, component_id, last_msg);
12973 mavlink_test_terrain_check(system_id, component_id, last_msg);
12974 mavlink_test_terrain_report(system_id, component_id, last_msg);
12975 mavlink_test_scaled_pressure2(system_id, component_id, last_msg);
12976 mavlink_test_att_pos_mocap(system_id, component_id, last_msg);
12977 mavlink_test_set_actuator_control_target(system_id, component_id, last_msg);
12978 mavlink_test_actuator_control_target(system_id, component_id, last_msg);
12979 mavlink_test_altitude(system_id, component_id, last_msg);
12980 mavlink_test_resource_request(system_id, component_id, last_msg);
12981 mavlink_test_scaled_pressure3(system_id, component_id, last_msg);
12982 mavlink_test_follow_target(system_id, component_id, last_msg);
12983 mavlink_test_control_system_state(system_id, component_id, last_msg);
12984 mavlink_test_battery_status(system_id, component_id, last_msg);
12985 mavlink_test_autopilot_version(system_id, component_id, last_msg);
12986 mavlink_test_landing_target(system_id, component_id, last_msg);
12987 mavlink_test_fence_status(system_id, component_id, last_msg);
12988 mavlink_test_mag_cal_report(system_id, component_id, last_msg);
12989 mavlink_test_efi_status(system_id, component_id, last_msg);
12990 mavlink_test_estimator_status(system_id, component_id, last_msg);
12991 mavlink_test_wind_cov(system_id, component_id, last_msg);
12992 mavlink_test_gps_input(system_id, component_id, last_msg);
12993 mavlink_test_gps_rtcm_data(system_id, component_id, last_msg);
12994 mavlink_test_high_latency(system_id, component_id, last_msg);
12995 mavlink_test_high_latency2(system_id, component_id, last_msg);
12996 mavlink_test_vibration(system_id, component_id, last_msg);
12997 mavlink_test_home_position(system_id, component_id, last_msg);
12998 mavlink_test_set_home_position(system_id, component_id, last_msg);
12999 mavlink_test_message_interval(system_id, component_id, last_msg);
13000 mavlink_test_extended_sys_state(system_id, component_id, last_msg);
13001 mavlink_test_adsb_vehicle(system_id, component_id, last_msg);
13002 mavlink_test_collision(system_id, component_id, last_msg);
13003 mavlink_test_v2_extension(system_id, component_id, last_msg);
13004 mavlink_test_memory_vect(system_id, component_id, last_msg);
13005 mavlink_test_debug_vect(system_id, component_id, last_msg);
13006 mavlink_test_named_value_float(system_id, component_id, last_msg);
13007 mavlink_test_named_value_int(system_id, component_id, last_msg);
13008 mavlink_test_statustext(system_id, component_id, last_msg);
13009 mavlink_test_debug(system_id, component_id, last_msg);
13010 mavlink_test_setup_signing(system_id, component_id, last_msg);
13011 mavlink_test_button_change(system_id, component_id, last_msg);
13012 mavlink_test_play_tune(system_id, component_id, last_msg);
13013 mavlink_test_camera_information(system_id, component_id, last_msg);
13014 mavlink_test_camera_settings(system_id, component_id, last_msg);
13015 mavlink_test_storage_information(system_id, component_id, last_msg);
13016 mavlink_test_camera_capture_status(system_id, component_id, last_msg);
13017 mavlink_test_camera_image_captured(system_id, component_id, last_msg);
13018 mavlink_test_flight_information(system_id, component_id, last_msg);
13019 mavlink_test_mount_orientation(system_id, component_id, last_msg);
13020 mavlink_test_logging_data(system_id, component_id, last_msg);
13021 mavlink_test_logging_data_acked(system_id, component_id, last_msg);
13022 mavlink_test_logging_ack(system_id, component_id, last_msg);
13023 mavlink_test_video_stream_information(system_id, component_id, last_msg);
13024 mavlink_test_video_stream_status(system_id, component_id, last_msg);
13025 mavlink_test_camera_fov_status(system_id, component_id, last_msg);
13026 mavlink_test_camera_tracking_image_status(system_id, component_id, last_msg);
13027 mavlink_test_camera_tracking_geo_status(system_id, component_id, last_msg);
13028 mavlink_test_gimbal_manager_information(system_id, component_id, last_msg);
13029 mavlink_test_gimbal_manager_status(system_id, component_id, last_msg);
13030 mavlink_test_gimbal_manager_set_attitude(system_id, component_id, last_msg);
13031 mavlink_test_gimbal_device_information(system_id, component_id, last_msg);
13032 mavlink_test_gimbal_device_set_attitude(system_id, component_id, last_msg);
13033 mavlink_test_gimbal_device_attitude_status(system_id, component_id, last_msg);
13034 mavlink_test_autopilot_state_for_gimbal_device(system_id, component_id, last_msg);
13035 mavlink_test_gimbal_manager_set_pitchyaw(system_id, component_id, last_msg);
13036 mavlink_test_gimbal_manager_set_manual_control(system_id, component_id, last_msg);
13037 mavlink_test_esc_info(system_id, component_id, last_msg);
13038 mavlink_test_esc_status(system_id, component_id, last_msg);
13039 mavlink_test_wifi_config_ap(system_id, component_id, last_msg);
13040 mavlink_test_ais_vessel(system_id, component_id, last_msg);
13041 mavlink_test_uavcan_node_status(system_id, component_id, last_msg);
13042 mavlink_test_uavcan_node_info(system_id, component_id, last_msg);
13043 mavlink_test_param_ext_request_read(system_id, component_id, last_msg);
13044 mavlink_test_param_ext_request_list(system_id, component_id, last_msg);
13045 mavlink_test_param_ext_value(system_id, component_id, last_msg);
13046 mavlink_test_param_ext_set(system_id, component_id, last_msg);
13047 mavlink_test_param_ext_ack(system_id, component_id, last_msg);
13048 mavlink_test_obstacle_distance(system_id, component_id, last_msg);
13049 mavlink_test_odometry(system_id, component_id, last_msg);
13050 mavlink_test_trajectory_representation_waypoints(system_id, component_id, last_msg);
13051 mavlink_test_trajectory_representation_bezier(system_id, component_id, last_msg);
13052 mavlink_test_cellular_status(system_id, component_id, last_msg);
13053 mavlink_test_isbd_link_status(system_id, component_id, last_msg);
13054 mavlink_test_cellular_config(system_id, component_id, last_msg);
13055 mavlink_test_raw_rpm(system_id, component_id, last_msg);
13056 mavlink_test_utm_global_position(system_id, component_id, last_msg);
13057 mavlink_test_debug_float_array(system_id, component_id, last_msg);
13058 mavlink_test_orbit_execution_status(system_id, component_id, last_msg);
13059 mavlink_test_smart_battery_info(system_id, component_id, last_msg);
13060 mavlink_test_generator_status(system_id, component_id, last_msg);
13061 mavlink_test_actuator_output_status(system_id, component_id, last_msg);
13062 mavlink_test_time_estimate_to_target(system_id, component_id, last_msg);
13063 mavlink_test_tunnel(system_id, component_id, last_msg);
13064 mavlink_test_onboard_computer_status(system_id, component_id, last_msg);
13065 mavlink_test_component_information(system_id, component_id, last_msg);
13066 mavlink_test_play_tune_v2(system_id, component_id, last_msg);
13067 mavlink_test_supported_tunes(system_id, component_id, last_msg);
13068 mavlink_test_wheel_distance(system_id, component_id, last_msg);
13069 mavlink_test_winch_status(system_id, component_id, last_msg);
13070 mavlink_test_open_drone_id_basic_id(system_id, component_id, last_msg);
13071 mavlink_test_open_drone_id_location(system_id, component_id, last_msg);
13072 mavlink_test_open_drone_id_authentication(system_id, component_id, last_msg);
13073 mavlink_test_open_drone_id_self_id(system_id, component_id, last_msg);
13074 mavlink_test_open_drone_id_system(system_id, component_id, last_msg);
13075 mavlink_test_open_drone_id_operator_id(system_id, component_id, last_msg);
13076 mavlink_test_open_drone_id_message_pack(system_id, component_id, last_msg);
13079 #ifdef __cplusplus
13081 #endif // __cplusplus
13082 #endif // COMMON_TESTSUITE_H