2
3
4
6#ifndef COMMON_TESTSUITE_H
7#define COMMON_TESTSUITE_H
13#ifndef MAVLINK_TEST_ALL
14#define MAVLINK_TEST_ALL
15static void mavlink_test_standard(uint8_t, uint8_t, mavlink_message_t *last_msg);
16static void mavlink_test_common(uint8_t, uint8_t, mavlink_message_t *last_msg);
18static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
20 mavlink_test_standard(system_id, component_id, last_msg);
21 mavlink_test_common(system_id, component_id, last_msg);
25#include "../standard/testsuite.h"
28static 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) {
36 mavlink_message_t msg;
37 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
39 mavlink_sys_status_t packet_in = {
40 963497464,963497672,963497880,17859,17963,18067,18171,18275,18379,18483,18587,18691,223,963499076,963499284,963499492
42 mavlink_sys_status_t packet1, packet2;
43 memset(&packet1, 0,
sizeof(packet1));
44 packet1.onboard_control_sensors_present = packet_in.onboard_control_sensors_present;
45 packet1.onboard_control_sensors_enabled = packet_in.onboard_control_sensors_enabled;
46 packet1.onboard_control_sensors_health = packet_in.onboard_control_sensors_health;
47 packet1.load = packet_in.load;
48 packet1.voltage_battery = packet_in.voltage_battery;
49 packet1.current_battery = packet_in.current_battery;
50 packet1.drop_rate_comm = packet_in.drop_rate_comm;
51 packet1.errors_comm = packet_in.errors_comm;
52 packet1.errors_count1 = packet_in.errors_count1;
53 packet1.errors_count2 = packet_in.errors_count2;
54 packet1.errors_count3 = packet_in.errors_count3;
55 packet1.errors_count4 = packet_in.errors_count4;
56 packet1.battery_remaining = packet_in.battery_remaining;
57 packet1.onboard_control_sensors_present_extended = packet_in.onboard_control_sensors_present_extended;
58 packet1.onboard_control_sensors_enabled_extended = packet_in.onboard_control_sensors_enabled_extended;
59 packet1.onboard_control_sensors_health_extended = packet_in.onboard_control_sensors_health_extended;
62#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
63 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
65 memset(MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN);
68 memset(&packet2, 0,
sizeof(packet2));
69 mavlink_msg_sys_status_encode(system_id, component_id, &msg, &packet1);
70 mavlink_msg_sys_status_decode(&msg, &packet2);
71 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
73 memset(&packet2, 0,
sizeof(packet2));
74 mavlink_msg_sys_status_pack(system_id, component_id, &msg , packet1.onboard_control_sensors_present , packet1.onboard_control_sensors_enabled , packet1.onboard_control_sensors_health , packet1.load , packet1.voltage_battery , packet1.current_battery , packet1.battery_remaining , packet1.drop_rate_comm , packet1.errors_comm , packet1.errors_count1 , packet1.errors_count2 , packet1.errors_count3 , packet1.errors_count4 , packet1.onboard_control_sensors_present_extended , packet1.onboard_control_sensors_enabled_extended , packet1.onboard_control_sensors_health_extended );
75 mavlink_msg_sys_status_decode(&msg, &packet2);
76 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
78 memset(&packet2, 0,
sizeof(packet2));
79 mavlink_msg_sys_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.onboard_control_sensors_present , packet1.onboard_control_sensors_enabled , packet1.onboard_control_sensors_health , packet1.load , packet1.voltage_battery , packet1.current_battery , packet1.battery_remaining , packet1.drop_rate_comm , packet1.errors_comm , packet1.errors_count1 , packet1.errors_count2 , packet1.errors_count3 , packet1.errors_count4 , packet1.onboard_control_sensors_present_extended , packet1.onboard_control_sensors_enabled_extended , packet1.onboard_control_sensors_health_extended );
80 mavlink_msg_sys_status_decode(&msg, &packet2);
81 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
83 memset(&packet2, 0,
sizeof(packet2));
84 mavlink_msg_to_send_buffer(buffer, &msg);
85 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
86 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
88 mavlink_msg_sys_status_decode(last_msg, &packet2);
89 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
91 memset(&packet2, 0,
sizeof(packet2));
92 mavlink_msg_sys_status_send(MAVLINK_COMM_1 , packet1.onboard_control_sensors_present , packet1.onboard_control_sensors_enabled , packet1.onboard_control_sensors_health , packet1.load , packet1.voltage_battery , packet1.current_battery , packet1.battery_remaining , packet1.drop_rate_comm , packet1.errors_comm , packet1.errors_count1 , packet1.errors_count2 , packet1.errors_count3 , packet1.errors_count4 , packet1.onboard_control_sensors_present_extended , packet1.onboard_control_sensors_enabled_extended , packet1.onboard_control_sensors_health_extended );
93 mavlink_msg_sys_status_decode(last_msg, &packet2);
94 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
96#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
97 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SYS_STATUS") != NULL);
98 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SYS_STATUS) != NULL);
102static void mavlink_test_system_time(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
104#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
105 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
106 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SYSTEM_TIME >= 256) {
110 mavlink_message_t msg;
111 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
113 mavlink_system_time_t packet_in = {
114 93372036854775807ULL,963497880
116 mavlink_system_time_t packet1, packet2;
117 memset(&packet1, 0,
sizeof(packet1));
118 packet1.time_unix_usec = packet_in.time_unix_usec;
119 packet1.time_boot_ms = packet_in.time_boot_ms;
122#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
123 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
125 memset(MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SYSTEM_TIME_MIN_LEN);
128 memset(&packet2, 0,
sizeof(packet2));
129 mavlink_msg_system_time_encode(system_id, component_id, &msg, &packet1);
130 mavlink_msg_system_time_decode(&msg, &packet2);
131 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
133 memset(&packet2, 0,
sizeof(packet2));
134 mavlink_msg_system_time_pack(system_id, component_id, &msg , packet1.time_unix_usec , packet1.time_boot_ms );
135 mavlink_msg_system_time_decode(&msg, &packet2);
136 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
138 memset(&packet2, 0,
sizeof(packet2));
139 mavlink_msg_system_time_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_unix_usec , packet1.time_boot_ms );
140 mavlink_msg_system_time_decode(&msg, &packet2);
141 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
143 memset(&packet2, 0,
sizeof(packet2));
144 mavlink_msg_to_send_buffer(buffer, &msg);
145 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
146 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
148 mavlink_msg_system_time_decode(last_msg, &packet2);
149 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
151 memset(&packet2, 0,
sizeof(packet2));
152 mavlink_msg_system_time_send(MAVLINK_COMM_1 , packet1.time_unix_usec , packet1.time_boot_ms );
153 mavlink_msg_system_time_decode(last_msg, &packet2);
154 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
156#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
157 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SYSTEM_TIME") != NULL);
158 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SYSTEM_TIME) != NULL);
162static void mavlink_test_ping(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
164#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
165 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
166 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PING >= 256) {
170 mavlink_message_t msg;
171 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
173 mavlink_ping_t packet_in = {
174 93372036854775807ULL,963497880,41,108
176 mavlink_ping_t packet1, packet2;
177 memset(&packet1, 0,
sizeof(packet1));
178 packet1.time_usec = packet_in.time_usec;
179 packet1.seq = packet_in.seq;
180 packet1.target_system = packet_in.target_system;
181 packet1.target_component = packet_in.target_component;
184#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
185 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
187 memset(MAVLINK_MSG_ID_PING_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_PING_MIN_LEN);
190 memset(&packet2, 0,
sizeof(packet2));
191 mavlink_msg_ping_encode(system_id, component_id, &msg, &packet1);
192 mavlink_msg_ping_decode(&msg, &packet2);
193 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
195 memset(&packet2, 0,
sizeof(packet2));
196 mavlink_msg_ping_pack(system_id, component_id, &msg , packet1.time_usec , packet1.seq , packet1.target_system , packet1.target_component );
197 mavlink_msg_ping_decode(&msg, &packet2);
198 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
200 memset(&packet2, 0,
sizeof(packet2));
201 mavlink_msg_ping_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.seq , packet1.target_system , packet1.target_component );
202 mavlink_msg_ping_decode(&msg, &packet2);
203 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
205 memset(&packet2, 0,
sizeof(packet2));
206 mavlink_msg_to_send_buffer(buffer, &msg);
207 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
208 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
210 mavlink_msg_ping_decode(last_msg, &packet2);
211 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
213 memset(&packet2, 0,
sizeof(packet2));
214 mavlink_msg_ping_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.seq , packet1.target_system , packet1.target_component );
215 mavlink_msg_ping_decode(last_msg, &packet2);
216 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
218#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
219 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"PING") != NULL);
220 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PING) != NULL);
224static void mavlink_test_change_operator_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
226#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
227 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
228 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL >= 256) {
232 mavlink_message_t msg;
233 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
235 mavlink_change_operator_control_t packet_in = {
236 5,72,139,
"DEFGHIJKLMNOPQRSTUVWXYZA"
238 mavlink_change_operator_control_t packet1, packet2;
239 memset(&packet1, 0,
sizeof(packet1));
240 packet1.target_system = packet_in.target_system;
241 packet1.control_request = packet_in.control_request;
242 packet1.version = packet_in.version;
244 mav_array_memcpy(packet1.passkey, packet_in.passkey,
sizeof(
char)*25);
246#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
247 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
249 memset(MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_MIN_LEN);
252 memset(&packet2, 0,
sizeof(packet2));
253 mavlink_msg_change_operator_control_encode(system_id, component_id, &msg, &packet1);
254 mavlink_msg_change_operator_control_decode(&msg, &packet2);
255 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
257 memset(&packet2, 0,
sizeof(packet2));
258 mavlink_msg_change_operator_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.control_request , packet1.version , packet1.passkey );
259 mavlink_msg_change_operator_control_decode(&msg, &packet2);
260 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
262 memset(&packet2, 0,
sizeof(packet2));
263 mavlink_msg_change_operator_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.control_request , packet1.version , packet1.passkey );
264 mavlink_msg_change_operator_control_decode(&msg, &packet2);
265 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
267 memset(&packet2, 0,
sizeof(packet2));
268 mavlink_msg_to_send_buffer(buffer, &msg);
269 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
270 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
272 mavlink_msg_change_operator_control_decode(last_msg, &packet2);
273 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
275 memset(&packet2, 0,
sizeof(packet2));
276 mavlink_msg_change_operator_control_send(MAVLINK_COMM_1 , packet1.target_system , packet1.control_request , packet1.version , packet1.passkey );
277 mavlink_msg_change_operator_control_decode(last_msg, &packet2);
278 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
280#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
281 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"CHANGE_OPERATOR_CONTROL") != NULL);
282 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL) != NULL);
286static void mavlink_test_change_operator_control_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
288#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
289 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
290 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK >= 256) {
294 mavlink_message_t msg;
295 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
297 mavlink_change_operator_control_ack_t packet_in = {
300 mavlink_change_operator_control_ack_t packet1, packet2;
301 memset(&packet1, 0,
sizeof(packet1));
302 packet1.gcs_system_id = packet_in.gcs_system_id;
303 packet1.control_request = packet_in.control_request;
304 packet1.ack = packet_in.ack;
307#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
308 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
310 memset(MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK_MIN_LEN);
313 memset(&packet2, 0,
sizeof(packet2));
314 mavlink_msg_change_operator_control_ack_encode(system_id, component_id, &msg, &packet1);
315 mavlink_msg_change_operator_control_ack_decode(&msg, &packet2);
316 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
318 memset(&packet2, 0,
sizeof(packet2));
319 mavlink_msg_change_operator_control_ack_pack(system_id, component_id, &msg , packet1.gcs_system_id , packet1.control_request , packet1.ack );
320 mavlink_msg_change_operator_control_ack_decode(&msg, &packet2);
321 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
323 memset(&packet2, 0,
sizeof(packet2));
324 mavlink_msg_change_operator_control_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.gcs_system_id , packet1.control_request , packet1.ack );
325 mavlink_msg_change_operator_control_ack_decode(&msg, &packet2);
326 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
328 memset(&packet2, 0,
sizeof(packet2));
329 mavlink_msg_to_send_buffer(buffer, &msg);
330 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
331 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
333 mavlink_msg_change_operator_control_ack_decode(last_msg, &packet2);
334 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
336 memset(&packet2, 0,
sizeof(packet2));
337 mavlink_msg_change_operator_control_ack_send(MAVLINK_COMM_1 , packet1.gcs_system_id , packet1.control_request , packet1.ack );
338 mavlink_msg_change_operator_control_ack_decode(last_msg, &packet2);
339 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
341#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
342 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"CHANGE_OPERATOR_CONTROL_ACK") != NULL);
343 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CHANGE_OPERATOR_CONTROL_ACK) != NULL);
347static void mavlink_test_auth_key(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
349#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
350 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
351 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AUTH_KEY >= 256) {
355 mavlink_message_t msg;
356 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
358 mavlink_auth_key_t packet_in = {
359 "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDE"
361 mavlink_auth_key_t packet1, packet2;
362 memset(&packet1, 0,
sizeof(packet1));
364 mav_array_memcpy(packet1.key, packet_in.key,
sizeof(
char)*32);
366#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
367 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
369 memset(MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_AUTH_KEY_MIN_LEN);
372 memset(&packet2, 0,
sizeof(packet2));
373 mavlink_msg_auth_key_encode(system_id, component_id, &msg, &packet1);
374 mavlink_msg_auth_key_decode(&msg, &packet2);
375 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
377 memset(&packet2, 0,
sizeof(packet2));
378 mavlink_msg_auth_key_pack(system_id, component_id, &msg , packet1.key );
379 mavlink_msg_auth_key_decode(&msg, &packet2);
380 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
382 memset(&packet2, 0,
sizeof(packet2));
383 mavlink_msg_auth_key_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.key );
384 mavlink_msg_auth_key_decode(&msg, &packet2);
385 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
387 memset(&packet2, 0,
sizeof(packet2));
388 mavlink_msg_to_send_buffer(buffer, &msg);
389 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
390 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
392 mavlink_msg_auth_key_decode(last_msg, &packet2);
393 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
395 memset(&packet2, 0,
sizeof(packet2));
396 mavlink_msg_auth_key_send(MAVLINK_COMM_1 , packet1.key );
397 mavlink_msg_auth_key_decode(last_msg, &packet2);
398 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
400#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
401 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"AUTH_KEY") != NULL);
402 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_AUTH_KEY) != NULL);
406static void mavlink_test_link_node_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
408#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
409 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
410 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LINK_NODE_STATUS >= 256) {
414 mavlink_message_t msg;
415 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
417 mavlink_link_node_status_t packet_in = {
418 93372036854775807ULL,963497880,963498088,963498296,963498504,963498712,18691,18795,18899,235,46
420 mavlink_link_node_status_t packet1, packet2;
421 memset(&packet1, 0,
sizeof(packet1));
422 packet1.timestamp = packet_in.timestamp;
423 packet1.tx_rate = packet_in.tx_rate;
424 packet1.rx_rate = packet_in.rx_rate;
425 packet1.messages_sent = packet_in.messages_sent;
426 packet1.messages_received = packet_in.messages_received;
427 packet1.messages_lost = packet_in.messages_lost;
428 packet1.rx_parse_err = packet_in.rx_parse_err;
429 packet1.tx_overflows = packet_in.tx_overflows;
430 packet1.rx_overflows = packet_in.rx_overflows;
431 packet1.tx_buf = packet_in.tx_buf;
432 packet1.rx_buf = packet_in.rx_buf;
435#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
436 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
438 memset(MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_LINK_NODE_STATUS_MIN_LEN);
441 memset(&packet2, 0,
sizeof(packet2));
442 mavlink_msg_link_node_status_encode(system_id, component_id, &msg, &packet1);
443 mavlink_msg_link_node_status_decode(&msg, &packet2);
444 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
446 memset(&packet2, 0,
sizeof(packet2));
447 mavlink_msg_link_node_status_pack(system_id, component_id, &msg , packet1.timestamp , packet1.tx_buf , packet1.rx_buf , packet1.tx_rate , packet1.rx_rate , packet1.rx_parse_err , packet1.tx_overflows , packet1.rx_overflows , packet1.messages_sent , packet1.messages_received , packet1.messages_lost );
448 mavlink_msg_link_node_status_decode(&msg, &packet2);
449 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
451 memset(&packet2, 0,
sizeof(packet2));
452 mavlink_msg_link_node_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.tx_buf , packet1.rx_buf , packet1.tx_rate , packet1.rx_rate , packet1.rx_parse_err , packet1.tx_overflows , packet1.rx_overflows , packet1.messages_sent , packet1.messages_received , packet1.messages_lost );
453 mavlink_msg_link_node_status_decode(&msg, &packet2);
454 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
456 memset(&packet2, 0,
sizeof(packet2));
457 mavlink_msg_to_send_buffer(buffer, &msg);
458 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
459 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
461 mavlink_msg_link_node_status_decode(last_msg, &packet2);
462 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
464 memset(&packet2, 0,
sizeof(packet2));
465 mavlink_msg_link_node_status_send(MAVLINK_COMM_1 , packet1.timestamp , packet1.tx_buf , packet1.rx_buf , packet1.tx_rate , packet1.rx_rate , packet1.rx_parse_err , packet1.tx_overflows , packet1.rx_overflows , packet1.messages_sent , packet1.messages_received , packet1.messages_lost );
466 mavlink_msg_link_node_status_decode(last_msg, &packet2);
467 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
469#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
470 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"LINK_NODE_STATUS") != NULL);
471 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LINK_NODE_STATUS) != NULL);
475static void mavlink_test_set_mode(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
477#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
478 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
479 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_MODE >= 256) {
483 mavlink_message_t msg;
484 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
486 mavlink_set_mode_t packet_in = {
489 mavlink_set_mode_t packet1, packet2;
490 memset(&packet1, 0,
sizeof(packet1));
491 packet1.custom_mode = packet_in.custom_mode;
492 packet1.target_system = packet_in.target_system;
493 packet1.base_mode = packet_in.base_mode;
496#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
497 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
499 memset(MAVLINK_MSG_ID_SET_MODE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SET_MODE_MIN_LEN);
502 memset(&packet2, 0,
sizeof(packet2));
503 mavlink_msg_set_mode_encode(system_id, component_id, &msg, &packet1);
504 mavlink_msg_set_mode_decode(&msg, &packet2);
505 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
507 memset(&packet2, 0,
sizeof(packet2));
508 mavlink_msg_set_mode_pack(system_id, component_id, &msg , packet1.target_system , packet1.base_mode , packet1.custom_mode );
509 mavlink_msg_set_mode_decode(&msg, &packet2);
510 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
512 memset(&packet2, 0,
sizeof(packet2));
513 mavlink_msg_set_mode_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.base_mode , packet1.custom_mode );
514 mavlink_msg_set_mode_decode(&msg, &packet2);
515 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
517 memset(&packet2, 0,
sizeof(packet2));
518 mavlink_msg_to_send_buffer(buffer, &msg);
519 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
520 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
522 mavlink_msg_set_mode_decode(last_msg, &packet2);
523 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
525 memset(&packet2, 0,
sizeof(packet2));
526 mavlink_msg_set_mode_send(MAVLINK_COMM_1 , packet1.target_system , packet1.base_mode , packet1.custom_mode );
527 mavlink_msg_set_mode_decode(last_msg, &packet2);
528 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
530#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
531 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SET_MODE") != NULL);
532 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SET_MODE) != NULL);
536static void mavlink_test_param_request_read(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
538#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
539 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
540 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_REQUEST_READ >= 256) {
544 mavlink_message_t msg;
545 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
547 mavlink_param_request_read_t packet_in = {
548 17235,139,206,
"EFGHIJKLMNOPQRS"
550 mavlink_param_request_read_t packet1, packet2;
551 memset(&packet1, 0,
sizeof(packet1));
552 packet1.param_index = packet_in.param_index;
553 packet1.target_system = packet_in.target_system;
554 packet1.target_component = packet_in.target_component;
556 mav_array_memcpy(packet1.param_id, packet_in.param_id,
sizeof(
char)*16);
558#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
559 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
561 memset(MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_PARAM_REQUEST_READ_MIN_LEN);
564 memset(&packet2, 0,
sizeof(packet2));
565 mavlink_msg_param_request_read_encode(system_id, component_id, &msg, &packet1);
566 mavlink_msg_param_request_read_decode(&msg, &packet2);
567 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
569 memset(&packet2, 0,
sizeof(packet2));
570 mavlink_msg_param_request_read_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index );
571 mavlink_msg_param_request_read_decode(&msg, &packet2);
572 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
574 memset(&packet2, 0,
sizeof(packet2));
575 mavlink_msg_param_request_read_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index );
576 mavlink_msg_param_request_read_decode(&msg, &packet2);
577 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
579 memset(&packet2, 0,
sizeof(packet2));
580 mavlink_msg_to_send_buffer(buffer, &msg);
581 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
582 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
584 mavlink_msg_param_request_read_decode(last_msg, &packet2);
585 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
587 memset(&packet2, 0,
sizeof(packet2));
588 mavlink_msg_param_request_read_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index );
589 mavlink_msg_param_request_read_decode(last_msg, &packet2);
590 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
592#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
593 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"PARAM_REQUEST_READ") != NULL);
594 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PARAM_REQUEST_READ) != NULL);
598static void mavlink_test_param_request_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
600#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
601 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
602 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_REQUEST_LIST >= 256) {
606 mavlink_message_t msg;
607 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
609 mavlink_param_request_list_t packet_in = {
612 mavlink_param_request_list_t packet1, packet2;
613 memset(&packet1, 0,
sizeof(packet1));
614 packet1.target_system = packet_in.target_system;
615 packet1.target_component = packet_in.target_component;
618#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
619 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
621 memset(MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_PARAM_REQUEST_LIST_MIN_LEN);
624 memset(&packet2, 0,
sizeof(packet2));
625 mavlink_msg_param_request_list_encode(system_id, component_id, &msg, &packet1);
626 mavlink_msg_param_request_list_decode(&msg, &packet2);
627 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
629 memset(&packet2, 0,
sizeof(packet2));
630 mavlink_msg_param_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
631 mavlink_msg_param_request_list_decode(&msg, &packet2);
632 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
634 memset(&packet2, 0,
sizeof(packet2));
635 mavlink_msg_param_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
636 mavlink_msg_param_request_list_decode(&msg, &packet2);
637 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
639 memset(&packet2, 0,
sizeof(packet2));
640 mavlink_msg_to_send_buffer(buffer, &msg);
641 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
642 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
644 mavlink_msg_param_request_list_decode(last_msg, &packet2);
645 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
647 memset(&packet2, 0,
sizeof(packet2));
648 mavlink_msg_param_request_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
649 mavlink_msg_param_request_list_decode(last_msg, &packet2);
650 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
652#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
653 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"PARAM_REQUEST_LIST") != NULL);
654 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PARAM_REQUEST_LIST) != NULL);
658static void mavlink_test_param_value(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
660#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
661 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
662 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_VALUE >= 256) {
666 mavlink_message_t msg;
667 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
669 mavlink_param_value_t packet_in = {
670 17.0,17443,17547,
"IJKLMNOPQRSTUVW",77
672 mavlink_param_value_t packet1, packet2;
673 memset(&packet1, 0,
sizeof(packet1));
674 packet1.param_value = packet_in.param_value;
675 packet1.param_count = packet_in.param_count;
676 packet1.param_index = packet_in.param_index;
677 packet1.param_type = packet_in.param_type;
679 mav_array_memcpy(packet1.param_id, packet_in.param_id,
sizeof(
char)*16);
681#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
682 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
684 memset(MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_PARAM_VALUE_MIN_LEN);
687 memset(&packet2, 0,
sizeof(packet2));
688 mavlink_msg_param_value_encode(system_id, component_id, &msg, &packet1);
689 mavlink_msg_param_value_decode(&msg, &packet2);
690 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
692 memset(&packet2, 0,
sizeof(packet2));
693 mavlink_msg_param_value_pack(system_id, component_id, &msg , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_count , packet1.param_index );
694 mavlink_msg_param_value_decode(&msg, &packet2);
695 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
697 memset(&packet2, 0,
sizeof(packet2));
698 mavlink_msg_param_value_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_count , packet1.param_index );
699 mavlink_msg_param_value_decode(&msg, &packet2);
700 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
702 memset(&packet2, 0,
sizeof(packet2));
703 mavlink_msg_to_send_buffer(buffer, &msg);
704 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
705 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
707 mavlink_msg_param_value_decode(last_msg, &packet2);
708 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
710 memset(&packet2, 0,
sizeof(packet2));
711 mavlink_msg_param_value_send(MAVLINK_COMM_1 , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_count , packet1.param_index );
712 mavlink_msg_param_value_decode(last_msg, &packet2);
713 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
715#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
716 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"PARAM_VALUE") != NULL);
717 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PARAM_VALUE) != NULL);
721static void mavlink_test_param_set(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
723#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
724 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
725 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_SET >= 256) {
729 mavlink_message_t msg;
730 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
732 mavlink_param_set_t packet_in = {
733 17.0,17,84,
"GHIJKLMNOPQRSTU",199
735 mavlink_param_set_t packet1, packet2;
736 memset(&packet1, 0,
sizeof(packet1));
737 packet1.param_value = packet_in.param_value;
738 packet1.target_system = packet_in.target_system;
739 packet1.target_component = packet_in.target_component;
740 packet1.param_type = packet_in.param_type;
742 mav_array_memcpy(packet1.param_id, packet_in.param_id,
sizeof(
char)*16);
744#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
745 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
747 memset(MAVLINK_MSG_ID_PARAM_SET_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_PARAM_SET_MIN_LEN);
750 memset(&packet2, 0,
sizeof(packet2));
751 mavlink_msg_param_set_encode(system_id, component_id, &msg, &packet1);
752 mavlink_msg_param_set_decode(&msg, &packet2);
753 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
755 memset(&packet2, 0,
sizeof(packet2));
756 mavlink_msg_param_set_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type );
757 mavlink_msg_param_set_decode(&msg, &packet2);
758 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
760 memset(&packet2, 0,
sizeof(packet2));
761 mavlink_msg_param_set_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type );
762 mavlink_msg_param_set_decode(&msg, &packet2);
763 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
765 memset(&packet2, 0,
sizeof(packet2));
766 mavlink_msg_to_send_buffer(buffer, &msg);
767 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
768 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
770 mavlink_msg_param_set_decode(last_msg, &packet2);
771 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
773 memset(&packet2, 0,
sizeof(packet2));
774 mavlink_msg_param_set_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type );
775 mavlink_msg_param_set_decode(last_msg, &packet2);
776 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
778#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
779 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"PARAM_SET") != NULL);
780 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PARAM_SET) != NULL);
784static void mavlink_test_gps_raw_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
786#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
787 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
788 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_RAW_INT >= 256) {
792 mavlink_message_t msg;
793 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
795 mavlink_gps_raw_int_t packet_in = {
796 93372036854775807ULL,963497880,963498088,963498296,18275,18379,18483,18587,89,156,963499024,963499232,963499440,963499648,963499856,19835
798 mavlink_gps_raw_int_t packet1, packet2;
799 memset(&packet1, 0,
sizeof(packet1));
800 packet1.time_usec = packet_in.time_usec;
801 packet1.lat = packet_in.lat;
802 packet1.lon = packet_in.lon;
803 packet1.alt = packet_in.alt;
804 packet1.eph = packet_in.eph;
805 packet1.epv = packet_in.epv;
806 packet1.vel = packet_in.vel;
807 packet1.cog = packet_in.cog;
808 packet1.fix_type = packet_in.fix_type;
809 packet1.satellites_visible = packet_in.satellites_visible;
810 packet1.alt_ellipsoid = packet_in.alt_ellipsoid;
811 packet1.h_acc = packet_in.h_acc;
812 packet1.v_acc = packet_in.v_acc;
813 packet1.vel_acc = packet_in.vel_acc;
814 packet1.hdg_acc = packet_in.hdg_acc;
815 packet1.yaw = packet_in.yaw;
818#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
819 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
821 memset(MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN);
824 memset(&packet2, 0,
sizeof(packet2));
825 mavlink_msg_gps_raw_int_encode(system_id, component_id, &msg, &packet1);
826 mavlink_msg_gps_raw_int_decode(&msg, &packet2);
827 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
829 memset(&packet2, 0,
sizeof(packet2));
830 mavlink_msg_gps_raw_int_pack(system_id, component_id, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible , packet1.alt_ellipsoid , packet1.h_acc , packet1.v_acc , packet1.vel_acc , packet1.hdg_acc , packet1.yaw );
831 mavlink_msg_gps_raw_int_decode(&msg, &packet2);
832 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
834 memset(&packet2, 0,
sizeof(packet2));
835 mavlink_msg_gps_raw_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible , packet1.alt_ellipsoid , packet1.h_acc , packet1.v_acc , packet1.vel_acc , packet1.hdg_acc , packet1.yaw );
836 mavlink_msg_gps_raw_int_decode(&msg, &packet2);
837 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
839 memset(&packet2, 0,
sizeof(packet2));
840 mavlink_msg_to_send_buffer(buffer, &msg);
841 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
842 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
844 mavlink_msg_gps_raw_int_decode(last_msg, &packet2);
845 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
847 memset(&packet2, 0,
sizeof(packet2));
848 mavlink_msg_gps_raw_int_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible , packet1.alt_ellipsoid , packet1.h_acc , packet1.v_acc , packet1.vel_acc , packet1.hdg_acc , packet1.yaw );
849 mavlink_msg_gps_raw_int_decode(last_msg, &packet2);
850 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
852#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
853 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"GPS_RAW_INT") != NULL);
854 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GPS_RAW_INT) != NULL);
858static void mavlink_test_gps_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
860#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
861 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
862 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_STATUS >= 256) {
866 mavlink_message_t msg;
867 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
869 mavlink_gps_status_t packet_in = {
870 5,{ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91 },{ 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151 },{ 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211 },{ 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },{ 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75 }
872 mavlink_gps_status_t packet1, packet2;
873 memset(&packet1, 0,
sizeof(packet1));
874 packet1.satellites_visible = packet_in.satellites_visible;
876 mav_array_memcpy(packet1.satellite_prn, packet_in.satellite_prn,
sizeof(uint8_t)*20);
877 mav_array_memcpy(packet1.satellite_used, packet_in.satellite_used,
sizeof(uint8_t)*20);
878 mav_array_memcpy(packet1.satellite_elevation, packet_in.satellite_elevation,
sizeof(uint8_t)*20);
879 mav_array_memcpy(packet1.satellite_azimuth, packet_in.satellite_azimuth,
sizeof(uint8_t)*20);
880 mav_array_memcpy(packet1.satellite_snr, packet_in.satellite_snr,
sizeof(uint8_t)*20);
882#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
883 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
885 memset(MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN);
888 memset(&packet2, 0,
sizeof(packet2));
889 mavlink_msg_gps_status_encode(system_id, component_id, &msg, &packet1);
890 mavlink_msg_gps_status_decode(&msg, &packet2);
891 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
893 memset(&packet2, 0,
sizeof(packet2));
894 mavlink_msg_gps_status_pack(system_id, component_id, &msg , packet1.satellites_visible , packet1.satellite_prn , packet1.satellite_used , packet1.satellite_elevation , packet1.satellite_azimuth , packet1.satellite_snr );
895 mavlink_msg_gps_status_decode(&msg, &packet2);
896 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
898 memset(&packet2, 0,
sizeof(packet2));
899 mavlink_msg_gps_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.satellites_visible , packet1.satellite_prn , packet1.satellite_used , packet1.satellite_elevation , packet1.satellite_azimuth , packet1.satellite_snr );
900 mavlink_msg_gps_status_decode(&msg, &packet2);
901 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
903 memset(&packet2, 0,
sizeof(packet2));
904 mavlink_msg_to_send_buffer(buffer, &msg);
905 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
906 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
908 mavlink_msg_gps_status_decode(last_msg, &packet2);
909 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
911 memset(&packet2, 0,
sizeof(packet2));
912 mavlink_msg_gps_status_send(MAVLINK_COMM_1 , packet1.satellites_visible , packet1.satellite_prn , packet1.satellite_used , packet1.satellite_elevation , packet1.satellite_azimuth , packet1.satellite_snr );
913 mavlink_msg_gps_status_decode(last_msg, &packet2);
914 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
916#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
917 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"GPS_STATUS") != NULL);
918 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GPS_STATUS) != NULL);
922static void mavlink_test_scaled_imu(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
924#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
925 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
926 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_IMU >= 256) {
930 mavlink_message_t msg;
931 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
933 mavlink_scaled_imu_t packet_in = {
934 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275,18379
936 mavlink_scaled_imu_t packet1, packet2;
937 memset(&packet1, 0,
sizeof(packet1));
938 packet1.time_boot_ms = packet_in.time_boot_ms;
939 packet1.xacc = packet_in.xacc;
940 packet1.yacc = packet_in.yacc;
941 packet1.zacc = packet_in.zacc;
942 packet1.xgyro = packet_in.xgyro;
943 packet1.ygyro = packet_in.ygyro;
944 packet1.zgyro = packet_in.zgyro;
945 packet1.xmag = packet_in.xmag;
946 packet1.ymag = packet_in.ymag;
947 packet1.zmag = packet_in.zmag;
948 packet1.temperature = packet_in.temperature;
951#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
952 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
954 memset(MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SCALED_IMU_MIN_LEN);
957 memset(&packet2, 0,
sizeof(packet2));
958 mavlink_msg_scaled_imu_encode(system_id, component_id, &msg, &packet1);
959 mavlink_msg_scaled_imu_decode(&msg, &packet2);
960 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
962 memset(&packet2, 0,
sizeof(packet2));
963 mavlink_msg_scaled_imu_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.temperature );
964 mavlink_msg_scaled_imu_decode(&msg, &packet2);
965 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
967 memset(&packet2, 0,
sizeof(packet2));
968 mavlink_msg_scaled_imu_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.temperature );
969 mavlink_msg_scaled_imu_decode(&msg, &packet2);
970 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
972 memset(&packet2, 0,
sizeof(packet2));
973 mavlink_msg_to_send_buffer(buffer, &msg);
974 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
975 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
977 mavlink_msg_scaled_imu_decode(last_msg, &packet2);
978 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
980 memset(&packet2, 0,
sizeof(packet2));
981 mavlink_msg_scaled_imu_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.temperature );
982 mavlink_msg_scaled_imu_decode(last_msg, &packet2);
983 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
985#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
986 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SCALED_IMU") != NULL);
987 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SCALED_IMU) != NULL);
991static void mavlink_test_raw_imu(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
993#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
994 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
995 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RAW_IMU >= 256) {
999 mavlink_message_t msg;
1000 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1002 mavlink_raw_imu_t packet_in = {
1003 93372036854775807ULL,17651,17755,17859,17963,18067,18171,18275,18379,18483,211,18639
1005 mavlink_raw_imu_t packet1, packet2;
1006 memset(&packet1, 0,
sizeof(packet1));
1007 packet1.time_usec = packet_in.time_usec;
1008 packet1.xacc = packet_in.xacc;
1009 packet1.yacc = packet_in.yacc;
1010 packet1.zacc = packet_in.zacc;
1011 packet1.xgyro = packet_in.xgyro;
1012 packet1.ygyro = packet_in.ygyro;
1013 packet1.zgyro = packet_in.zgyro;
1014 packet1.xmag = packet_in.xmag;
1015 packet1.ymag = packet_in.ymag;
1016 packet1.zmag = packet_in.zmag;
1017 packet1.id = packet_in.id;
1018 packet1.temperature = packet_in.temperature;
1021#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1022 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1024 memset(MAVLINK_MSG_ID_RAW_IMU_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_RAW_IMU_MIN_LEN);
1027 memset(&packet2, 0,
sizeof(packet2));
1028 mavlink_msg_raw_imu_encode(system_id, component_id, &msg, &packet1);
1029 mavlink_msg_raw_imu_decode(&msg, &packet2);
1030 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1032 memset(&packet2, 0,
sizeof(packet2));
1033 mavlink_msg_raw_imu_pack(system_id, component_id, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.id , packet1.temperature );
1034 mavlink_msg_raw_imu_decode(&msg, &packet2);
1035 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1037 memset(&packet2, 0,
sizeof(packet2));
1038 mavlink_msg_raw_imu_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.id , packet1.temperature );
1039 mavlink_msg_raw_imu_decode(&msg, &packet2);
1040 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1042 memset(&packet2, 0,
sizeof(packet2));
1043 mavlink_msg_to_send_buffer(buffer, &msg);
1044 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1045 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1047 mavlink_msg_raw_imu_decode(last_msg, &packet2);
1048 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1050 memset(&packet2, 0,
sizeof(packet2));
1051 mavlink_msg_raw_imu_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.id , packet1.temperature );
1052 mavlink_msg_raw_imu_decode(last_msg, &packet2);
1053 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1055#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1056 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"RAW_IMU") != NULL);
1057 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_RAW_IMU) != NULL);
1061static void mavlink_test_raw_pressure(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1063#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1064 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1065 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RAW_PRESSURE >= 256) {
1069 mavlink_message_t msg;
1070 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1072 mavlink_raw_pressure_t packet_in = {
1073 93372036854775807ULL,17651,17755,17859,17963
1075 mavlink_raw_pressure_t packet1, packet2;
1076 memset(&packet1, 0,
sizeof(packet1));
1077 packet1.time_usec = packet_in.time_usec;
1078 packet1.press_abs = packet_in.press_abs;
1079 packet1.press_diff1 = packet_in.press_diff1;
1080 packet1.press_diff2 = packet_in.press_diff2;
1081 packet1.temperature = packet_in.temperature;
1084#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1085 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1087 memset(MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_RAW_PRESSURE_MIN_LEN);
1090 memset(&packet2, 0,
sizeof(packet2));
1091 mavlink_msg_raw_pressure_encode(system_id, component_id, &msg, &packet1);
1092 mavlink_msg_raw_pressure_decode(&msg, &packet2);
1093 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1095 memset(&packet2, 0,
sizeof(packet2));
1096 mavlink_msg_raw_pressure_pack(system_id, component_id, &msg , packet1.time_usec , packet1.press_abs , packet1.press_diff1 , packet1.press_diff2 , packet1.temperature );
1097 mavlink_msg_raw_pressure_decode(&msg, &packet2);
1098 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1100 memset(&packet2, 0,
sizeof(packet2));
1101 mavlink_msg_raw_pressure_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.press_abs , packet1.press_diff1 , packet1.press_diff2 , packet1.temperature );
1102 mavlink_msg_raw_pressure_decode(&msg, &packet2);
1103 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1105 memset(&packet2, 0,
sizeof(packet2));
1106 mavlink_msg_to_send_buffer(buffer, &msg);
1107 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1108 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1110 mavlink_msg_raw_pressure_decode(last_msg, &packet2);
1111 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1113 memset(&packet2, 0,
sizeof(packet2));
1114 mavlink_msg_raw_pressure_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.press_abs , packet1.press_diff1 , packet1.press_diff2 , packet1.temperature );
1115 mavlink_msg_raw_pressure_decode(last_msg, &packet2);
1116 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1118#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1119 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"RAW_PRESSURE") != NULL);
1120 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_RAW_PRESSURE) != NULL);
1124static void mavlink_test_scaled_pressure(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1126#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1127 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1128 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_PRESSURE >= 256) {
1132 mavlink_message_t msg;
1133 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1135 mavlink_scaled_pressure_t packet_in = {
1136 963497464,45.0,73.0,17859,17963
1138 mavlink_scaled_pressure_t packet1, packet2;
1139 memset(&packet1, 0,
sizeof(packet1));
1140 packet1.time_boot_ms = packet_in.time_boot_ms;
1141 packet1.press_abs = packet_in.press_abs;
1142 packet1.press_diff = packet_in.press_diff;
1143 packet1.temperature = packet_in.temperature;
1144 packet1.temperature_press_diff = packet_in.temperature_press_diff;
1147#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1148 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1150 memset(MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SCALED_PRESSURE_MIN_LEN);
1153 memset(&packet2, 0,
sizeof(packet2));
1154 mavlink_msg_scaled_pressure_encode(system_id, component_id, &msg, &packet1);
1155 mavlink_msg_scaled_pressure_decode(&msg, &packet2);
1156 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1158 memset(&packet2, 0,
sizeof(packet2));
1159 mavlink_msg_scaled_pressure_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature , packet1.temperature_press_diff );
1160 mavlink_msg_scaled_pressure_decode(&msg, &packet2);
1161 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1163 memset(&packet2, 0,
sizeof(packet2));
1164 mavlink_msg_scaled_pressure_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature , packet1.temperature_press_diff );
1165 mavlink_msg_scaled_pressure_decode(&msg, &packet2);
1166 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1168 memset(&packet2, 0,
sizeof(packet2));
1169 mavlink_msg_to_send_buffer(buffer, &msg);
1170 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1171 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1173 mavlink_msg_scaled_pressure_decode(last_msg, &packet2);
1174 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1176 memset(&packet2, 0,
sizeof(packet2));
1177 mavlink_msg_scaled_pressure_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature , packet1.temperature_press_diff );
1178 mavlink_msg_scaled_pressure_decode(last_msg, &packet2);
1179 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1181#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1182 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SCALED_PRESSURE") != NULL);
1183 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SCALED_PRESSURE) != NULL);
1187static void mavlink_test_attitude(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1189#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1190 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1191 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATTITUDE >= 256) {
1195 mavlink_message_t msg;
1196 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1198 mavlink_attitude_t packet_in = {
1199 963497464,45.0,73.0,101.0,129.0,157.0,185.0
1201 mavlink_attitude_t packet1, packet2;
1202 memset(&packet1, 0,
sizeof(packet1));
1203 packet1.time_boot_ms = packet_in.time_boot_ms;
1204 packet1.roll = packet_in.roll;
1205 packet1.pitch = packet_in.pitch;
1206 packet1.yaw = packet_in.yaw;
1207 packet1.rollspeed = packet_in.rollspeed;
1208 packet1.pitchspeed = packet_in.pitchspeed;
1209 packet1.yawspeed = packet_in.yawspeed;
1212#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1213 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1215 memset(MAVLINK_MSG_ID_ATTITUDE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_ATTITUDE_MIN_LEN);
1218 memset(&packet2, 0,
sizeof(packet2));
1219 mavlink_msg_attitude_encode(system_id, component_id, &msg, &packet1);
1220 mavlink_msg_attitude_decode(&msg, &packet2);
1221 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1223 memset(&packet2, 0,
sizeof(packet2));
1224 mavlink_msg_attitude_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed );
1225 mavlink_msg_attitude_decode(&msg, &packet2);
1226 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1228 memset(&packet2, 0,
sizeof(packet2));
1229 mavlink_msg_attitude_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed );
1230 mavlink_msg_attitude_decode(&msg, &packet2);
1231 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1233 memset(&packet2, 0,
sizeof(packet2));
1234 mavlink_msg_to_send_buffer(buffer, &msg);
1235 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1236 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1238 mavlink_msg_attitude_decode(last_msg, &packet2);
1239 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1241 memset(&packet2, 0,
sizeof(packet2));
1242 mavlink_msg_attitude_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed );
1243 mavlink_msg_attitude_decode(last_msg, &packet2);
1244 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1246#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1247 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"ATTITUDE") != NULL);
1248 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ATTITUDE) != NULL);
1252static void mavlink_test_attitude_quaternion(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1254#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1255 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1256 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATTITUDE_QUATERNION >= 256) {
1260 mavlink_message_t msg;
1261 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1263 mavlink_attitude_quaternion_t packet_in = {
1264 963497464,45.0,73.0,101.0,129.0,157.0,185.0,213.0,{ 241.0, 242.0, 243.0, 244.0 }
1266 mavlink_attitude_quaternion_t packet1, packet2;
1267 memset(&packet1, 0,
sizeof(packet1));
1268 packet1.time_boot_ms = packet_in.time_boot_ms;
1269 packet1.q1 = packet_in.q1;
1270 packet1.q2 = packet_in.q2;
1271 packet1.q3 = packet_in.q3;
1272 packet1.q4 = packet_in.q4;
1273 packet1.rollspeed = packet_in.rollspeed;
1274 packet1.pitchspeed = packet_in.pitchspeed;
1275 packet1.yawspeed = packet_in.yawspeed;
1277 mav_array_memcpy(packet1.repr_offset_q, packet_in.repr_offset_q,
sizeof(
float)*4);
1279#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1280 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1282 memset(MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_ATTITUDE_QUATERNION_MIN_LEN);
1285 memset(&packet2, 0,
sizeof(packet2));
1286 mavlink_msg_attitude_quaternion_encode(system_id, component_id, &msg, &packet1);
1287 mavlink_msg_attitude_quaternion_decode(&msg, &packet2);
1288 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1290 memset(&packet2, 0,
sizeof(packet2));
1291 mavlink_msg_attitude_quaternion_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.repr_offset_q );
1292 mavlink_msg_attitude_quaternion_decode(&msg, &packet2);
1293 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1295 memset(&packet2, 0,
sizeof(packet2));
1296 mavlink_msg_attitude_quaternion_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.repr_offset_q );
1297 mavlink_msg_attitude_quaternion_decode(&msg, &packet2);
1298 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1300 memset(&packet2, 0,
sizeof(packet2));
1301 mavlink_msg_to_send_buffer(buffer, &msg);
1302 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1303 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1305 mavlink_msg_attitude_quaternion_decode(last_msg, &packet2);
1306 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1308 memset(&packet2, 0,
sizeof(packet2));
1309 mavlink_msg_attitude_quaternion_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.repr_offset_q );
1310 mavlink_msg_attitude_quaternion_decode(last_msg, &packet2);
1311 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1313#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1314 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"ATTITUDE_QUATERNION") != NULL);
1315 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ATTITUDE_QUATERNION) != NULL);
1319static void mavlink_test_local_position_ned(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1321#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1322 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1323 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOCAL_POSITION_NED >= 256) {
1327 mavlink_message_t msg;
1328 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1330 mavlink_local_position_ned_t packet_in = {
1331 963497464,45.0,73.0,101.0,129.0,157.0,185.0
1333 mavlink_local_position_ned_t packet1, packet2;
1334 memset(&packet1, 0,
sizeof(packet1));
1335 packet1.time_boot_ms = packet_in.time_boot_ms;
1336 packet1.x = packet_in.x;
1337 packet1.y = packet_in.y;
1338 packet1.z = packet_in.z;
1339 packet1.vx = packet_in.vx;
1340 packet1.vy = packet_in.vy;
1341 packet1.vz = packet_in.vz;
1344#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1345 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1347 memset(MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_LOCAL_POSITION_NED_MIN_LEN);
1350 memset(&packet2, 0,
sizeof(packet2));
1351 mavlink_msg_local_position_ned_encode(system_id, component_id, &msg, &packet1);
1352 mavlink_msg_local_position_ned_decode(&msg, &packet2);
1353 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1355 memset(&packet2, 0,
sizeof(packet2));
1356 mavlink_msg_local_position_ned_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz );
1357 mavlink_msg_local_position_ned_decode(&msg, &packet2);
1358 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1360 memset(&packet2, 0,
sizeof(packet2));
1361 mavlink_msg_local_position_ned_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz );
1362 mavlink_msg_local_position_ned_decode(&msg, &packet2);
1363 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1365 memset(&packet2, 0,
sizeof(packet2));
1366 mavlink_msg_to_send_buffer(buffer, &msg);
1367 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1368 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1370 mavlink_msg_local_position_ned_decode(last_msg, &packet2);
1371 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1373 memset(&packet2, 0,
sizeof(packet2));
1374 mavlink_msg_local_position_ned_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz );
1375 mavlink_msg_local_position_ned_decode(last_msg, &packet2);
1376 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1378#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1379 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"LOCAL_POSITION_NED") != NULL);
1380 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOCAL_POSITION_NED) != NULL);
1384static void mavlink_test_rc_channels_scaled(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1386#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1387 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1388 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RC_CHANNELS_SCALED >= 256) {
1392 mavlink_message_t msg;
1393 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1395 mavlink_rc_channels_scaled_t packet_in = {
1396 963497464,17443,17547,17651,17755,17859,17963,18067,18171,65,132
1398 mavlink_rc_channels_scaled_t packet1, packet2;
1399 memset(&packet1, 0,
sizeof(packet1));
1400 packet1.time_boot_ms = packet_in.time_boot_ms;
1401 packet1.chan1_scaled = packet_in.chan1_scaled;
1402 packet1.chan2_scaled = packet_in.chan2_scaled;
1403 packet1.chan3_scaled = packet_in.chan3_scaled;
1404 packet1.chan4_scaled = packet_in.chan4_scaled;
1405 packet1.chan5_scaled = packet_in.chan5_scaled;
1406 packet1.chan6_scaled = packet_in.chan6_scaled;
1407 packet1.chan7_scaled = packet_in.chan7_scaled;
1408 packet1.chan8_scaled = packet_in.chan8_scaled;
1409 packet1.port = packet_in.port;
1410 packet1.rssi = packet_in.rssi;
1413#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1414 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1416 memset(MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_RC_CHANNELS_SCALED_MIN_LEN);
1419 memset(&packet2, 0,
sizeof(packet2));
1420 mavlink_msg_rc_channels_scaled_encode(system_id, component_id, &msg, &packet1);
1421 mavlink_msg_rc_channels_scaled_decode(&msg, &packet2);
1422 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1424 memset(&packet2, 0,
sizeof(packet2));
1425 mavlink_msg_rc_channels_scaled_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.port , packet1.chan1_scaled , packet1.chan2_scaled , packet1.chan3_scaled , packet1.chan4_scaled , packet1.chan5_scaled , packet1.chan6_scaled , packet1.chan7_scaled , packet1.chan8_scaled , packet1.rssi );
1426 mavlink_msg_rc_channels_scaled_decode(&msg, &packet2);
1427 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1429 memset(&packet2, 0,
sizeof(packet2));
1430 mavlink_msg_rc_channels_scaled_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.port , packet1.chan1_scaled , packet1.chan2_scaled , packet1.chan3_scaled , packet1.chan4_scaled , packet1.chan5_scaled , packet1.chan6_scaled , packet1.chan7_scaled , packet1.chan8_scaled , packet1.rssi );
1431 mavlink_msg_rc_channels_scaled_decode(&msg, &packet2);
1432 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1434 memset(&packet2, 0,
sizeof(packet2));
1435 mavlink_msg_to_send_buffer(buffer, &msg);
1436 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1437 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1439 mavlink_msg_rc_channels_scaled_decode(last_msg, &packet2);
1440 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1442 memset(&packet2, 0,
sizeof(packet2));
1443 mavlink_msg_rc_channels_scaled_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.port , packet1.chan1_scaled , packet1.chan2_scaled , packet1.chan3_scaled , packet1.chan4_scaled , packet1.chan5_scaled , packet1.chan6_scaled , packet1.chan7_scaled , packet1.chan8_scaled , packet1.rssi );
1444 mavlink_msg_rc_channels_scaled_decode(last_msg, &packet2);
1445 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1447#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1448 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"RC_CHANNELS_SCALED") != NULL);
1449 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_RC_CHANNELS_SCALED) != NULL);
1453static void mavlink_test_rc_channels_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1455#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1456 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1457 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RC_CHANNELS_RAW >= 256) {
1461 mavlink_message_t msg;
1462 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1464 mavlink_rc_channels_raw_t packet_in = {
1465 963497464,17443,17547,17651,17755,17859,17963,18067,18171,65,132
1467 mavlink_rc_channels_raw_t packet1, packet2;
1468 memset(&packet1, 0,
sizeof(packet1));
1469 packet1.time_boot_ms = packet_in.time_boot_ms;
1470 packet1.chan1_raw = packet_in.chan1_raw;
1471 packet1.chan2_raw = packet_in.chan2_raw;
1472 packet1.chan3_raw = packet_in.chan3_raw;
1473 packet1.chan4_raw = packet_in.chan4_raw;
1474 packet1.chan5_raw = packet_in.chan5_raw;
1475 packet1.chan6_raw = packet_in.chan6_raw;
1476 packet1.chan7_raw = packet_in.chan7_raw;
1477 packet1.chan8_raw = packet_in.chan8_raw;
1478 packet1.port = packet_in.port;
1479 packet1.rssi = packet_in.rssi;
1482#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1483 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1485 memset(MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_RC_CHANNELS_RAW_MIN_LEN);
1488 memset(&packet2, 0,
sizeof(packet2));
1489 mavlink_msg_rc_channels_raw_encode(system_id, component_id, &msg, &packet1);
1490 mavlink_msg_rc_channels_raw_decode(&msg, &packet2);
1491 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1493 memset(&packet2, 0,
sizeof(packet2));
1494 mavlink_msg_rc_channels_raw_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.port , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.rssi );
1495 mavlink_msg_rc_channels_raw_decode(&msg, &packet2);
1496 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1498 memset(&packet2, 0,
sizeof(packet2));
1499 mavlink_msg_rc_channels_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.port , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.rssi );
1500 mavlink_msg_rc_channels_raw_decode(&msg, &packet2);
1501 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1503 memset(&packet2, 0,
sizeof(packet2));
1504 mavlink_msg_to_send_buffer(buffer, &msg);
1505 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1506 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1508 mavlink_msg_rc_channels_raw_decode(last_msg, &packet2);
1509 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1511 memset(&packet2, 0,
sizeof(packet2));
1512 mavlink_msg_rc_channels_raw_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.port , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.rssi );
1513 mavlink_msg_rc_channels_raw_decode(last_msg, &packet2);
1514 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1516#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1517 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"RC_CHANNELS_RAW") != NULL);
1518 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_RC_CHANNELS_RAW) != NULL);
1522static void mavlink_test_servo_output_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1524#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1525 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1526 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERVO_OUTPUT_RAW >= 256) {
1530 mavlink_message_t msg;
1531 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1533 mavlink_servo_output_raw_t packet_in = {
1534 963497464,17443,17547,17651,17755,17859,17963,18067,18171,65,18327,18431,18535,18639,18743,18847,18951,19055
1536 mavlink_servo_output_raw_t packet1, packet2;
1537 memset(&packet1, 0,
sizeof(packet1));
1538 packet1.time_usec = packet_in.time_usec;
1539 packet1.servo1_raw = packet_in.servo1_raw;
1540 packet1.servo2_raw = packet_in.servo2_raw;
1541 packet1.servo3_raw = packet_in.servo3_raw;
1542 packet1.servo4_raw = packet_in.servo4_raw;
1543 packet1.servo5_raw = packet_in.servo5_raw;
1544 packet1.servo6_raw = packet_in.servo6_raw;
1545 packet1.servo7_raw = packet_in.servo7_raw;
1546 packet1.servo8_raw = packet_in.servo8_raw;
1547 packet1.port = packet_in.port;
1548 packet1.servo9_raw = packet_in.servo9_raw;
1549 packet1.servo10_raw = packet_in.servo10_raw;
1550 packet1.servo11_raw = packet_in.servo11_raw;
1551 packet1.servo12_raw = packet_in.servo12_raw;
1552 packet1.servo13_raw = packet_in.servo13_raw;
1553 packet1.servo14_raw = packet_in.servo14_raw;
1554 packet1.servo15_raw = packet_in.servo15_raw;
1555 packet1.servo16_raw = packet_in.servo16_raw;
1558#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1559 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1561 memset(MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SERVO_OUTPUT_RAW_MIN_LEN);
1564 memset(&packet2, 0,
sizeof(packet2));
1565 mavlink_msg_servo_output_raw_encode(system_id, component_id, &msg, &packet1);
1566 mavlink_msg_servo_output_raw_decode(&msg, &packet2);
1567 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1569 memset(&packet2, 0,
sizeof(packet2));
1570 mavlink_msg_servo_output_raw_pack(system_id, component_id, &msg , packet1.time_usec , packet1.port , packet1.servo1_raw , packet1.servo2_raw , packet1.servo3_raw , packet1.servo4_raw , packet1.servo5_raw , packet1.servo6_raw , packet1.servo7_raw , packet1.servo8_raw , packet1.servo9_raw , packet1.servo10_raw , packet1.servo11_raw , packet1.servo12_raw , packet1.servo13_raw , packet1.servo14_raw , packet1.servo15_raw , packet1.servo16_raw );
1571 mavlink_msg_servo_output_raw_decode(&msg, &packet2);
1572 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1574 memset(&packet2, 0,
sizeof(packet2));
1575 mavlink_msg_servo_output_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.port , packet1.servo1_raw , packet1.servo2_raw , packet1.servo3_raw , packet1.servo4_raw , packet1.servo5_raw , packet1.servo6_raw , packet1.servo7_raw , packet1.servo8_raw , packet1.servo9_raw , packet1.servo10_raw , packet1.servo11_raw , packet1.servo12_raw , packet1.servo13_raw , packet1.servo14_raw , packet1.servo15_raw , packet1.servo16_raw );
1576 mavlink_msg_servo_output_raw_decode(&msg, &packet2);
1577 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1579 memset(&packet2, 0,
sizeof(packet2));
1580 mavlink_msg_to_send_buffer(buffer, &msg);
1581 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1582 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1584 mavlink_msg_servo_output_raw_decode(last_msg, &packet2);
1585 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1587 memset(&packet2, 0,
sizeof(packet2));
1588 mavlink_msg_servo_output_raw_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.port , packet1.servo1_raw , packet1.servo2_raw , packet1.servo3_raw , packet1.servo4_raw , packet1.servo5_raw , packet1.servo6_raw , packet1.servo7_raw , packet1.servo8_raw , packet1.servo9_raw , packet1.servo10_raw , packet1.servo11_raw , packet1.servo12_raw , packet1.servo13_raw , packet1.servo14_raw , packet1.servo15_raw , packet1.servo16_raw );
1589 mavlink_msg_servo_output_raw_decode(last_msg, &packet2);
1590 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1592#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1593 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SERVO_OUTPUT_RAW") != NULL);
1594 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SERVO_OUTPUT_RAW) != NULL);
1598static void mavlink_test_mission_request_partial_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1600#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1601 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1602 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST >= 256) {
1606 mavlink_message_t msg;
1607 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1609 mavlink_mission_request_partial_list_t packet_in = {
1610 17235,17339,17,84,151
1612 mavlink_mission_request_partial_list_t packet1, packet2;
1613 memset(&packet1, 0,
sizeof(packet1));
1614 packet1.start_index = packet_in.start_index;
1615 packet1.end_index = packet_in.end_index;
1616 packet1.target_system = packet_in.target_system;
1617 packet1.target_component = packet_in.target_component;
1618 packet1.mission_type = packet_in.mission_type;
1621#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1622 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1624 memset(MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_MIN_LEN);
1627 memset(&packet2, 0,
sizeof(packet2));
1628 mavlink_msg_mission_request_partial_list_encode(system_id, component_id, &msg, &packet1);
1629 mavlink_msg_mission_request_partial_list_decode(&msg, &packet2);
1630 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1632 memset(&packet2, 0,
sizeof(packet2));
1633 mavlink_msg_mission_request_partial_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index , packet1.mission_type );
1634 mavlink_msg_mission_request_partial_list_decode(&msg, &packet2);
1635 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1637 memset(&packet2, 0,
sizeof(packet2));
1638 mavlink_msg_mission_request_partial_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index , packet1.mission_type );
1639 mavlink_msg_mission_request_partial_list_decode(&msg, &packet2);
1640 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1642 memset(&packet2, 0,
sizeof(packet2));
1643 mavlink_msg_to_send_buffer(buffer, &msg);
1644 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1645 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1647 mavlink_msg_mission_request_partial_list_decode(last_msg, &packet2);
1648 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1650 memset(&packet2, 0,
sizeof(packet2));
1651 mavlink_msg_mission_request_partial_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index , packet1.mission_type );
1652 mavlink_msg_mission_request_partial_list_decode(last_msg, &packet2);
1653 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1655#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1656 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"MISSION_REQUEST_PARTIAL_LIST") != NULL);
1657 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST) != NULL);
1661static void mavlink_test_mission_write_partial_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1663#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1664 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1665 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST >= 256) {
1669 mavlink_message_t msg;
1670 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1672 mavlink_mission_write_partial_list_t packet_in = {
1673 17235,17339,17,84,151
1675 mavlink_mission_write_partial_list_t packet1, packet2;
1676 memset(&packet1, 0,
sizeof(packet1));
1677 packet1.start_index = packet_in.start_index;
1678 packet1.end_index = packet_in.end_index;
1679 packet1.target_system = packet_in.target_system;
1680 packet1.target_component = packet_in.target_component;
1681 packet1.mission_type = packet_in.mission_type;
1684#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1685 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1687 memset(MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_MIN_LEN);
1690 memset(&packet2, 0,
sizeof(packet2));
1691 mavlink_msg_mission_write_partial_list_encode(system_id, component_id, &msg, &packet1);
1692 mavlink_msg_mission_write_partial_list_decode(&msg, &packet2);
1693 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1695 memset(&packet2, 0,
sizeof(packet2));
1696 mavlink_msg_mission_write_partial_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index , packet1.mission_type );
1697 mavlink_msg_mission_write_partial_list_decode(&msg, &packet2);
1698 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1700 memset(&packet2, 0,
sizeof(packet2));
1701 mavlink_msg_mission_write_partial_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index , packet1.mission_type );
1702 mavlink_msg_mission_write_partial_list_decode(&msg, &packet2);
1703 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1705 memset(&packet2, 0,
sizeof(packet2));
1706 mavlink_msg_to_send_buffer(buffer, &msg);
1707 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1708 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1710 mavlink_msg_mission_write_partial_list_decode(last_msg, &packet2);
1711 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1713 memset(&packet2, 0,
sizeof(packet2));
1714 mavlink_msg_mission_write_partial_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.start_index , packet1.end_index , packet1.mission_type );
1715 mavlink_msg_mission_write_partial_list_decode(last_msg, &packet2);
1716 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1718#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1719 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"MISSION_WRITE_PARTIAL_LIST") != NULL);
1720 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST) != NULL);
1724static void mavlink_test_mission_item(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1726#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1727 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1728 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_ITEM >= 256) {
1732 mavlink_message_t msg;
1733 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1735 mavlink_mission_item_t packet_in = {
1736 17.0,45.0,73.0,101.0,129.0,157.0,185.0,18691,18795,101,168,235,46,113,180
1738 mavlink_mission_item_t packet1, packet2;
1739 memset(&packet1, 0,
sizeof(packet1));
1740 packet1.param1 = packet_in.param1;
1741 packet1.param2 = packet_in.param2;
1742 packet1.param3 = packet_in.param3;
1743 packet1.param4 = packet_in.param4;
1744 packet1.x = packet_in.x;
1745 packet1.y = packet_in.y;
1746 packet1.z = packet_in.z;
1747 packet1.seq = packet_in.seq;
1748 packet1.command = packet_in.command;
1749 packet1.target_system = packet_in.target_system;
1750 packet1.target_component = packet_in.target_component;
1751 packet1.frame = packet_in.frame;
1752 packet1.current = packet_in.current;
1753 packet1.autocontinue = packet_in.autocontinue;
1754 packet1.mission_type = packet_in.mission_type;
1757#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1758 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1760 memset(MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_MISSION_ITEM_MIN_LEN);
1763 memset(&packet2, 0,
sizeof(packet2));
1764 mavlink_msg_mission_item_encode(system_id, component_id, &msg, &packet1);
1765 mavlink_msg_mission_item_decode(&msg, &packet2);
1766 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1768 memset(&packet2, 0,
sizeof(packet2));
1769 mavlink_msg_mission_item_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z , packet1.mission_type );
1770 mavlink_msg_mission_item_decode(&msg, &packet2);
1771 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1773 memset(&packet2, 0,
sizeof(packet2));
1774 mavlink_msg_mission_item_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z , packet1.mission_type );
1775 mavlink_msg_mission_item_decode(&msg, &packet2);
1776 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1778 memset(&packet2, 0,
sizeof(packet2));
1779 mavlink_msg_to_send_buffer(buffer, &msg);
1780 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1781 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1783 mavlink_msg_mission_item_decode(last_msg, &packet2);
1784 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1786 memset(&packet2, 0,
sizeof(packet2));
1787 mavlink_msg_mission_item_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z , packet1.mission_type );
1788 mavlink_msg_mission_item_decode(last_msg, &packet2);
1789 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1791#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1792 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"MISSION_ITEM") != NULL);
1793 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_ITEM) != NULL);
1797static void mavlink_test_mission_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1799#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1800 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1801 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_REQUEST >= 256) {
1805 mavlink_message_t msg;
1806 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1808 mavlink_mission_request_t packet_in = {
1811 mavlink_mission_request_t packet1, packet2;
1812 memset(&packet1, 0,
sizeof(packet1));
1813 packet1.seq = packet_in.seq;
1814 packet1.target_system = packet_in.target_system;
1815 packet1.target_component = packet_in.target_component;
1816 packet1.mission_type = packet_in.mission_type;
1819#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1820 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1822 memset(MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_MISSION_REQUEST_MIN_LEN);
1825 memset(&packet2, 0,
sizeof(packet2));
1826 mavlink_msg_mission_request_encode(system_id, component_id, &msg, &packet1);
1827 mavlink_msg_mission_request_decode(&msg, &packet2);
1828 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1830 memset(&packet2, 0,
sizeof(packet2));
1831 mavlink_msg_mission_request_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.mission_type );
1832 mavlink_msg_mission_request_decode(&msg, &packet2);
1833 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1835 memset(&packet2, 0,
sizeof(packet2));
1836 mavlink_msg_mission_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.mission_type );
1837 mavlink_msg_mission_request_decode(&msg, &packet2);
1838 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1840 memset(&packet2, 0,
sizeof(packet2));
1841 mavlink_msg_to_send_buffer(buffer, &msg);
1842 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1843 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1845 mavlink_msg_mission_request_decode(last_msg, &packet2);
1846 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1848 memset(&packet2, 0,
sizeof(packet2));
1849 mavlink_msg_mission_request_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seq , packet1.mission_type );
1850 mavlink_msg_mission_request_decode(last_msg, &packet2);
1851 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1853#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1854 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"MISSION_REQUEST") != NULL);
1855 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_REQUEST) != NULL);
1859static void mavlink_test_mission_set_current(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1861#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1862 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1863 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_SET_CURRENT >= 256) {
1867 mavlink_message_t msg;
1868 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1870 mavlink_mission_set_current_t packet_in = {
1873 mavlink_mission_set_current_t packet1, packet2;
1874 memset(&packet1, 0,
sizeof(packet1));
1875 packet1.seq = packet_in.seq;
1876 packet1.target_system = packet_in.target_system;
1877 packet1.target_component = packet_in.target_component;
1880#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1881 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1883 memset(MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_MISSION_SET_CURRENT_MIN_LEN);
1886 memset(&packet2, 0,
sizeof(packet2));
1887 mavlink_msg_mission_set_current_encode(system_id, component_id, &msg, &packet1);
1888 mavlink_msg_mission_set_current_decode(&msg, &packet2);
1889 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1891 memset(&packet2, 0,
sizeof(packet2));
1892 mavlink_msg_mission_set_current_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq );
1893 mavlink_msg_mission_set_current_decode(&msg, &packet2);
1894 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1896 memset(&packet2, 0,
sizeof(packet2));
1897 mavlink_msg_mission_set_current_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq );
1898 mavlink_msg_mission_set_current_decode(&msg, &packet2);
1899 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1901 memset(&packet2, 0,
sizeof(packet2));
1902 mavlink_msg_to_send_buffer(buffer, &msg);
1903 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1904 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1906 mavlink_msg_mission_set_current_decode(last_msg, &packet2);
1907 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1909 memset(&packet2, 0,
sizeof(packet2));
1910 mavlink_msg_mission_set_current_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seq );
1911 mavlink_msg_mission_set_current_decode(last_msg, &packet2);
1912 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1914#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1915 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"MISSION_SET_CURRENT") != NULL);
1916 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_SET_CURRENT) != NULL);
1920static void mavlink_test_mission_current(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1922#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1923 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1924 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_CURRENT >= 256) {
1928 mavlink_message_t msg;
1929 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1931 mavlink_mission_current_t packet_in = {
1932 17235,17339,17,84,963497776,963497984,963498192
1934 mavlink_mission_current_t packet1, packet2;
1935 memset(&packet1, 0,
sizeof(packet1));
1936 packet1.seq = packet_in.seq;
1937 packet1.total = packet_in.total;
1938 packet1.mission_state = packet_in.mission_state;
1939 packet1.mission_mode = packet_in.mission_mode;
1940 packet1.mission_id = packet_in.mission_id;
1941 packet1.fence_id = packet_in.fence_id;
1942 packet1.rally_points_id = packet_in.rally_points_id;
1945#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1946 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
1948 memset(MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN);
1951 memset(&packet2, 0,
sizeof(packet2));
1952 mavlink_msg_mission_current_encode(system_id, component_id, &msg, &packet1);
1953 mavlink_msg_mission_current_decode(&msg, &packet2);
1954 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1956 memset(&packet2, 0,
sizeof(packet2));
1957 mavlink_msg_mission_current_pack(system_id, component_id, &msg , packet1.seq , packet1.total , packet1.mission_state , packet1.mission_mode , packet1.mission_id , packet1.fence_id , packet1.rally_points_id );
1958 mavlink_msg_mission_current_decode(&msg, &packet2);
1959 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1961 memset(&packet2, 0,
sizeof(packet2));
1962 mavlink_msg_mission_current_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seq , packet1.total , packet1.mission_state , packet1.mission_mode , packet1.mission_id , packet1.fence_id , packet1.rally_points_id );
1963 mavlink_msg_mission_current_decode(&msg, &packet2);
1964 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1966 memset(&packet2, 0,
sizeof(packet2));
1967 mavlink_msg_to_send_buffer(buffer, &msg);
1968 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
1969 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
1971 mavlink_msg_mission_current_decode(last_msg, &packet2);
1972 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1974 memset(&packet2, 0,
sizeof(packet2));
1975 mavlink_msg_mission_current_send(MAVLINK_COMM_1 , packet1.seq , packet1.total , packet1.mission_state , packet1.mission_mode , packet1.mission_id , packet1.fence_id , packet1.rally_points_id );
1976 mavlink_msg_mission_current_decode(last_msg, &packet2);
1977 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
1979#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
1980 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"MISSION_CURRENT") != NULL);
1981 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_CURRENT) != NULL);
1985static void mavlink_test_mission_request_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
1987#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
1988 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
1989 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_REQUEST_LIST >= 256) {
1993 mavlink_message_t msg;
1994 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
1996 mavlink_mission_request_list_t packet_in = {
1999 mavlink_mission_request_list_t packet1, packet2;
2000 memset(&packet1, 0,
sizeof(packet1));
2001 packet1.target_system = packet_in.target_system;
2002 packet1.target_component = packet_in.target_component;
2003 packet1.mission_type = packet_in.mission_type;
2006#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2007 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2009 memset(MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_MISSION_REQUEST_LIST_MIN_LEN);
2012 memset(&packet2, 0,
sizeof(packet2));
2013 mavlink_msg_mission_request_list_encode(system_id, component_id, &msg, &packet1);
2014 mavlink_msg_mission_request_list_decode(&msg, &packet2);
2015 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2017 memset(&packet2, 0,
sizeof(packet2));
2018 mavlink_msg_mission_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.mission_type );
2019 mavlink_msg_mission_request_list_decode(&msg, &packet2);
2020 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2022 memset(&packet2, 0,
sizeof(packet2));
2023 mavlink_msg_mission_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.mission_type );
2024 mavlink_msg_mission_request_list_decode(&msg, &packet2);
2025 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2027 memset(&packet2, 0,
sizeof(packet2));
2028 mavlink_msg_to_send_buffer(buffer, &msg);
2029 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2030 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2032 mavlink_msg_mission_request_list_decode(last_msg, &packet2);
2033 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2035 memset(&packet2, 0,
sizeof(packet2));
2036 mavlink_msg_mission_request_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.mission_type );
2037 mavlink_msg_mission_request_list_decode(last_msg, &packet2);
2038 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2040#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2041 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"MISSION_REQUEST_LIST") != NULL);
2042 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_REQUEST_LIST) != NULL);
2046static void mavlink_test_mission_count(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2048#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2049 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2050 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_COUNT >= 256) {
2054 mavlink_message_t msg;
2055 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2057 mavlink_mission_count_t packet_in = {
2058 17235,139,206,17,963497724
2060 mavlink_mission_count_t packet1, packet2;
2061 memset(&packet1, 0,
sizeof(packet1));
2062 packet1.count = packet_in.count;
2063 packet1.target_system = packet_in.target_system;
2064 packet1.target_component = packet_in.target_component;
2065 packet1.mission_type = packet_in.mission_type;
2066 packet1.opaque_id = packet_in.opaque_id;
2069#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2070 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2072 memset(MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_MISSION_COUNT_MIN_LEN);
2075 memset(&packet2, 0,
sizeof(packet2));
2076 mavlink_msg_mission_count_encode(system_id, component_id, &msg, &packet1);
2077 mavlink_msg_mission_count_decode(&msg, &packet2);
2078 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2080 memset(&packet2, 0,
sizeof(packet2));
2081 mavlink_msg_mission_count_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.count , packet1.mission_type , packet1.opaque_id );
2082 mavlink_msg_mission_count_decode(&msg, &packet2);
2083 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2085 memset(&packet2, 0,
sizeof(packet2));
2086 mavlink_msg_mission_count_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.count , packet1.mission_type , packet1.opaque_id );
2087 mavlink_msg_mission_count_decode(&msg, &packet2);
2088 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2090 memset(&packet2, 0,
sizeof(packet2));
2091 mavlink_msg_to_send_buffer(buffer, &msg);
2092 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2093 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2095 mavlink_msg_mission_count_decode(last_msg, &packet2);
2096 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2098 memset(&packet2, 0,
sizeof(packet2));
2099 mavlink_msg_mission_count_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.count , packet1.mission_type , packet1.opaque_id );
2100 mavlink_msg_mission_count_decode(last_msg, &packet2);
2101 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2103#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2104 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"MISSION_COUNT") != NULL);
2105 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_COUNT) != NULL);
2109static void mavlink_test_mission_clear_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2111#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2112 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2113 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_CLEAR_ALL >= 256) {
2117 mavlink_message_t msg;
2118 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2120 mavlink_mission_clear_all_t packet_in = {
2123 mavlink_mission_clear_all_t packet1, packet2;
2124 memset(&packet1, 0,
sizeof(packet1));
2125 packet1.target_system = packet_in.target_system;
2126 packet1.target_component = packet_in.target_component;
2127 packet1.mission_type = packet_in.mission_type;
2130#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2131 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2133 memset(MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_MISSION_CLEAR_ALL_MIN_LEN);
2136 memset(&packet2, 0,
sizeof(packet2));
2137 mavlink_msg_mission_clear_all_encode(system_id, component_id, &msg, &packet1);
2138 mavlink_msg_mission_clear_all_decode(&msg, &packet2);
2139 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2141 memset(&packet2, 0,
sizeof(packet2));
2142 mavlink_msg_mission_clear_all_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.mission_type );
2143 mavlink_msg_mission_clear_all_decode(&msg, &packet2);
2144 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2146 memset(&packet2, 0,
sizeof(packet2));
2147 mavlink_msg_mission_clear_all_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.mission_type );
2148 mavlink_msg_mission_clear_all_decode(&msg, &packet2);
2149 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2151 memset(&packet2, 0,
sizeof(packet2));
2152 mavlink_msg_to_send_buffer(buffer, &msg);
2153 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2154 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2156 mavlink_msg_mission_clear_all_decode(last_msg, &packet2);
2157 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2159 memset(&packet2, 0,
sizeof(packet2));
2160 mavlink_msg_mission_clear_all_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.mission_type );
2161 mavlink_msg_mission_clear_all_decode(last_msg, &packet2);
2162 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2164#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2165 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"MISSION_CLEAR_ALL") != NULL);
2166 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_CLEAR_ALL) != NULL);
2170static void mavlink_test_mission_item_reached(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_ITEM_REACHED >= 256) {
2178 mavlink_message_t msg;
2179 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2181 mavlink_mission_item_reached_t packet_in = {
2184 mavlink_mission_item_reached_t packet1, packet2;
2185 memset(&packet1, 0,
sizeof(packet1));
2186 packet1.seq = packet_in.seq;
2189#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2190 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2192 memset(MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_MISSION_ITEM_REACHED_MIN_LEN);
2195 memset(&packet2, 0,
sizeof(packet2));
2196 mavlink_msg_mission_item_reached_encode(system_id, component_id, &msg, &packet1);
2197 mavlink_msg_mission_item_reached_decode(&msg, &packet2);
2198 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2200 memset(&packet2, 0,
sizeof(packet2));
2201 mavlink_msg_mission_item_reached_pack(system_id, component_id, &msg , packet1.seq );
2202 mavlink_msg_mission_item_reached_decode(&msg, &packet2);
2203 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2205 memset(&packet2, 0,
sizeof(packet2));
2206 mavlink_msg_mission_item_reached_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seq );
2207 mavlink_msg_mission_item_reached_decode(&msg, &packet2);
2208 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2210 memset(&packet2, 0,
sizeof(packet2));
2211 mavlink_msg_to_send_buffer(buffer, &msg);
2212 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2213 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2215 mavlink_msg_mission_item_reached_decode(last_msg, &packet2);
2216 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2218 memset(&packet2, 0,
sizeof(packet2));
2219 mavlink_msg_mission_item_reached_send(MAVLINK_COMM_1 , packet1.seq );
2220 mavlink_msg_mission_item_reached_decode(last_msg, &packet2);
2221 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2223#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2224 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"MISSION_ITEM_REACHED") != NULL);
2225 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_ITEM_REACHED) != NULL);
2229static void mavlink_test_mission_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2231#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2232 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2233 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_ACK >= 256) {
2237 mavlink_message_t msg;
2238 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2240 mavlink_mission_ack_t packet_in = {
2241 5,72,139,206,963497672
2243 mavlink_mission_ack_t packet1, packet2;
2244 memset(&packet1, 0,
sizeof(packet1));
2245 packet1.target_system = packet_in.target_system;
2246 packet1.target_component = packet_in.target_component;
2247 packet1.type = packet_in.type;
2248 packet1.mission_type = packet_in.mission_type;
2249 packet1.opaque_id = packet_in.opaque_id;
2252#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2253 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2255 memset(MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_MISSION_ACK_MIN_LEN);
2258 memset(&packet2, 0,
sizeof(packet2));
2259 mavlink_msg_mission_ack_encode(system_id, component_id, &msg, &packet1);
2260 mavlink_msg_mission_ack_decode(&msg, &packet2);
2261 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2263 memset(&packet2, 0,
sizeof(packet2));
2264 mavlink_msg_mission_ack_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.type , packet1.mission_type , packet1.opaque_id );
2265 mavlink_msg_mission_ack_decode(&msg, &packet2);
2266 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2268 memset(&packet2, 0,
sizeof(packet2));
2269 mavlink_msg_mission_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.type , packet1.mission_type , packet1.opaque_id );
2270 mavlink_msg_mission_ack_decode(&msg, &packet2);
2271 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2273 memset(&packet2, 0,
sizeof(packet2));
2274 mavlink_msg_to_send_buffer(buffer, &msg);
2275 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2276 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2278 mavlink_msg_mission_ack_decode(last_msg, &packet2);
2279 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2281 memset(&packet2, 0,
sizeof(packet2));
2282 mavlink_msg_mission_ack_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.type , packet1.mission_type , packet1.opaque_id );
2283 mavlink_msg_mission_ack_decode(last_msg, &packet2);
2284 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2286#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2287 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"MISSION_ACK") != NULL);
2288 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_ACK) != NULL);
2292static void mavlink_test_set_gps_global_origin(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2294#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2295 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2296 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN >= 256) {
2300 mavlink_message_t msg;
2301 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2303 mavlink_set_gps_global_origin_t packet_in = {
2304 963497464,963497672,963497880,41,93372036854776626ULL
2306 mavlink_set_gps_global_origin_t packet1, packet2;
2307 memset(&packet1, 0,
sizeof(packet1));
2308 packet1.latitude = packet_in.latitude;
2309 packet1.longitude = packet_in.longitude;
2310 packet1.altitude = packet_in.altitude;
2311 packet1.target_system = packet_in.target_system;
2312 packet1.time_usec = packet_in.time_usec;
2315#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2316 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2318 memset(MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN_MIN_LEN);
2321 memset(&packet2, 0,
sizeof(packet2));
2322 mavlink_msg_set_gps_global_origin_encode(system_id, component_id, &msg, &packet1);
2323 mavlink_msg_set_gps_global_origin_decode(&msg, &packet2);
2324 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2326 memset(&packet2, 0,
sizeof(packet2));
2327 mavlink_msg_set_gps_global_origin_pack(system_id, component_id, &msg , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude , packet1.time_usec );
2328 mavlink_msg_set_gps_global_origin_decode(&msg, &packet2);
2329 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2331 memset(&packet2, 0,
sizeof(packet2));
2332 mavlink_msg_set_gps_global_origin_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude , packet1.time_usec );
2333 mavlink_msg_set_gps_global_origin_decode(&msg, &packet2);
2334 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2336 memset(&packet2, 0,
sizeof(packet2));
2337 mavlink_msg_to_send_buffer(buffer, &msg);
2338 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2339 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2341 mavlink_msg_set_gps_global_origin_decode(last_msg, &packet2);
2342 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2344 memset(&packet2, 0,
sizeof(packet2));
2345 mavlink_msg_set_gps_global_origin_send(MAVLINK_COMM_1 , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude , packet1.time_usec );
2346 mavlink_msg_set_gps_global_origin_decode(last_msg, &packet2);
2347 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2349#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2350 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SET_GPS_GLOBAL_ORIGIN") != NULL);
2351 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SET_GPS_GLOBAL_ORIGIN) != NULL);
2355static void mavlink_test_gps_global_origin(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2357#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2358 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2359 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN >= 256) {
2363 mavlink_message_t msg;
2364 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2366 mavlink_gps_global_origin_t packet_in = {
2367 963497464,963497672,963497880,93372036854776563ULL
2369 mavlink_gps_global_origin_t packet1, packet2;
2370 memset(&packet1, 0,
sizeof(packet1));
2371 packet1.latitude = packet_in.latitude;
2372 packet1.longitude = packet_in.longitude;
2373 packet1.altitude = packet_in.altitude;
2374 packet1.time_usec = packet_in.time_usec;
2377#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2378 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2380 memset(MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN_MIN_LEN);
2383 memset(&packet2, 0,
sizeof(packet2));
2384 mavlink_msg_gps_global_origin_encode(system_id, component_id, &msg, &packet1);
2385 mavlink_msg_gps_global_origin_decode(&msg, &packet2);
2386 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2388 memset(&packet2, 0,
sizeof(packet2));
2389 mavlink_msg_gps_global_origin_pack(system_id, component_id, &msg , packet1.latitude , packet1.longitude , packet1.altitude , packet1.time_usec );
2390 mavlink_msg_gps_global_origin_decode(&msg, &packet2);
2391 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2393 memset(&packet2, 0,
sizeof(packet2));
2394 mavlink_msg_gps_global_origin_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.latitude , packet1.longitude , packet1.altitude , packet1.time_usec );
2395 mavlink_msg_gps_global_origin_decode(&msg, &packet2);
2396 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2398 memset(&packet2, 0,
sizeof(packet2));
2399 mavlink_msg_to_send_buffer(buffer, &msg);
2400 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2401 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2403 mavlink_msg_gps_global_origin_decode(last_msg, &packet2);
2404 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2406 memset(&packet2, 0,
sizeof(packet2));
2407 mavlink_msg_gps_global_origin_send(MAVLINK_COMM_1 , packet1.latitude , packet1.longitude , packet1.altitude , packet1.time_usec );
2408 mavlink_msg_gps_global_origin_decode(last_msg, &packet2);
2409 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2411#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2412 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"GPS_GLOBAL_ORIGIN") != NULL);
2413 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GPS_GLOBAL_ORIGIN) != NULL);
2417static void mavlink_test_param_map_rc(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2419#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2420 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2421 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_MAP_RC >= 256) {
2425 mavlink_message_t msg;
2426 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2428 mavlink_param_map_rc_t packet_in = {
2429 17.0,45.0,73.0,101.0,18067,187,254,
"UVWXYZABCDEFGHI",113
2431 mavlink_param_map_rc_t packet1, packet2;
2432 memset(&packet1, 0,
sizeof(packet1));
2433 packet1.param_value0 = packet_in.param_value0;
2434 packet1.scale = packet_in.scale;
2435 packet1.param_value_min = packet_in.param_value_min;
2436 packet1.param_value_max = packet_in.param_value_max;
2437 packet1.param_index = packet_in.param_index;
2438 packet1.target_system = packet_in.target_system;
2439 packet1.target_component = packet_in.target_component;
2440 packet1.parameter_rc_channel_index = packet_in.parameter_rc_channel_index;
2442 mav_array_memcpy(packet1.param_id, packet_in.param_id,
sizeof(
char)*16);
2444#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2445 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2447 memset(MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN);
2450 memset(&packet2, 0,
sizeof(packet2));
2451 mavlink_msg_param_map_rc_encode(system_id, component_id, &msg, &packet1);
2452 mavlink_msg_param_map_rc_decode(&msg, &packet2);
2453 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2455 memset(&packet2, 0,
sizeof(packet2));
2456 mavlink_msg_param_map_rc_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.parameter_rc_channel_index , packet1.param_value0 , packet1.scale , packet1.param_value_min , packet1.param_value_max );
2457 mavlink_msg_param_map_rc_decode(&msg, &packet2);
2458 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2460 memset(&packet2, 0,
sizeof(packet2));
2461 mavlink_msg_param_map_rc_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.parameter_rc_channel_index , packet1.param_value0 , packet1.scale , packet1.param_value_min , packet1.param_value_max );
2462 mavlink_msg_param_map_rc_decode(&msg, &packet2);
2463 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2465 memset(&packet2, 0,
sizeof(packet2));
2466 mavlink_msg_to_send_buffer(buffer, &msg);
2467 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2468 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2470 mavlink_msg_param_map_rc_decode(last_msg, &packet2);
2471 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2473 memset(&packet2, 0,
sizeof(packet2));
2474 mavlink_msg_param_map_rc_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.parameter_rc_channel_index , packet1.param_value0 , packet1.scale , packet1.param_value_min , packet1.param_value_max );
2475 mavlink_msg_param_map_rc_decode(last_msg, &packet2);
2476 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2478#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2479 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"PARAM_MAP_RC") != NULL);
2480 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PARAM_MAP_RC) != NULL);
2484static void mavlink_test_mission_request_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2486#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2487 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2488 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_REQUEST_INT >= 256) {
2492 mavlink_message_t msg;
2493 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2495 mavlink_mission_request_int_t packet_in = {
2498 mavlink_mission_request_int_t packet1, packet2;
2499 memset(&packet1, 0,
sizeof(packet1));
2500 packet1.seq = packet_in.seq;
2501 packet1.target_system = packet_in.target_system;
2502 packet1.target_component = packet_in.target_component;
2503 packet1.mission_type = packet_in.mission_type;
2506#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2507 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2509 memset(MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_MISSION_REQUEST_INT_MIN_LEN);
2512 memset(&packet2, 0,
sizeof(packet2));
2513 mavlink_msg_mission_request_int_encode(system_id, component_id, &msg, &packet1);
2514 mavlink_msg_mission_request_int_decode(&msg, &packet2);
2515 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2517 memset(&packet2, 0,
sizeof(packet2));
2518 mavlink_msg_mission_request_int_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.mission_type );
2519 mavlink_msg_mission_request_int_decode(&msg, &packet2);
2520 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2522 memset(&packet2, 0,
sizeof(packet2));
2523 mavlink_msg_mission_request_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.mission_type );
2524 mavlink_msg_mission_request_int_decode(&msg, &packet2);
2525 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2527 memset(&packet2, 0,
sizeof(packet2));
2528 mavlink_msg_to_send_buffer(buffer, &msg);
2529 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2530 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2532 mavlink_msg_mission_request_int_decode(last_msg, &packet2);
2533 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2535 memset(&packet2, 0,
sizeof(packet2));
2536 mavlink_msg_mission_request_int_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seq , packet1.mission_type );
2537 mavlink_msg_mission_request_int_decode(last_msg, &packet2);
2538 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2540#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2541 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"MISSION_REQUEST_INT") != NULL);
2542 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_REQUEST_INT) != NULL);
2546static void mavlink_test_safety_set_allowed_area(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2548#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2549 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2550 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA >= 256) {
2554 mavlink_message_t msg;
2555 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2557 mavlink_safety_set_allowed_area_t packet_in = {
2558 17.0,45.0,73.0,101.0,129.0,157.0,77,144,211
2560 mavlink_safety_set_allowed_area_t packet1, packet2;
2561 memset(&packet1, 0,
sizeof(packet1));
2562 packet1.p1x = packet_in.p1x;
2563 packet1.p1y = packet_in.p1y;
2564 packet1.p1z = packet_in.p1z;
2565 packet1.p2x = packet_in.p2x;
2566 packet1.p2y = packet_in.p2y;
2567 packet1.p2z = packet_in.p2z;
2568 packet1.target_system = packet_in.target_system;
2569 packet1.target_component = packet_in.target_component;
2570 packet1.frame = packet_in.frame;
2573#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2574 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2576 memset(MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN);
2579 memset(&packet2, 0,
sizeof(packet2));
2580 mavlink_msg_safety_set_allowed_area_encode(system_id, component_id, &msg, &packet1);
2581 mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2);
2582 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2584 memset(&packet2, 0,
sizeof(packet2));
2585 mavlink_msg_safety_set_allowed_area_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z );
2586 mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2);
2587 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2589 memset(&packet2, 0,
sizeof(packet2));
2590 mavlink_msg_safety_set_allowed_area_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z );
2591 mavlink_msg_safety_set_allowed_area_decode(&msg, &packet2);
2592 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2594 memset(&packet2, 0,
sizeof(packet2));
2595 mavlink_msg_to_send_buffer(buffer, &msg);
2596 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2597 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2599 mavlink_msg_safety_set_allowed_area_decode(last_msg, &packet2);
2600 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2602 memset(&packet2, 0,
sizeof(packet2));
2603 mavlink_msg_safety_set_allowed_area_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z );
2604 mavlink_msg_safety_set_allowed_area_decode(last_msg, &packet2);
2605 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2607#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2608 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SAFETY_SET_ALLOWED_AREA") != NULL);
2609 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA) != NULL);
2613static void mavlink_test_safety_allowed_area(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2615#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2616 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2617 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA >= 256) {
2621 mavlink_message_t msg;
2622 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2624 mavlink_safety_allowed_area_t packet_in = {
2625 17.0,45.0,73.0,101.0,129.0,157.0,77
2627 mavlink_safety_allowed_area_t packet1, packet2;
2628 memset(&packet1, 0,
sizeof(packet1));
2629 packet1.p1x = packet_in.p1x;
2630 packet1.p1y = packet_in.p1y;
2631 packet1.p1z = packet_in.p1z;
2632 packet1.p2x = packet_in.p2x;
2633 packet1.p2y = packet_in.p2y;
2634 packet1.p2z = packet_in.p2z;
2635 packet1.frame = packet_in.frame;
2638#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2639 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2641 memset(MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_MIN_LEN);
2644 memset(&packet2, 0,
sizeof(packet2));
2645 mavlink_msg_safety_allowed_area_encode(system_id, component_id, &msg, &packet1);
2646 mavlink_msg_safety_allowed_area_decode(&msg, &packet2);
2647 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2649 memset(&packet2, 0,
sizeof(packet2));
2650 mavlink_msg_safety_allowed_area_pack(system_id, component_id, &msg , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z );
2651 mavlink_msg_safety_allowed_area_decode(&msg, &packet2);
2652 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2654 memset(&packet2, 0,
sizeof(packet2));
2655 mavlink_msg_safety_allowed_area_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z );
2656 mavlink_msg_safety_allowed_area_decode(&msg, &packet2);
2657 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2659 memset(&packet2, 0,
sizeof(packet2));
2660 mavlink_msg_to_send_buffer(buffer, &msg);
2661 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2662 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2664 mavlink_msg_safety_allowed_area_decode(last_msg, &packet2);
2665 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2667 memset(&packet2, 0,
sizeof(packet2));
2668 mavlink_msg_safety_allowed_area_send(MAVLINK_COMM_1 , packet1.frame , packet1.p1x , packet1.p1y , packet1.p1z , packet1.p2x , packet1.p2y , packet1.p2z );
2669 mavlink_msg_safety_allowed_area_decode(last_msg, &packet2);
2670 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2672#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2673 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SAFETY_ALLOWED_AREA") != NULL);
2674 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA) != NULL);
2678static void mavlink_test_attitude_quaternion_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2680#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2681 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2682 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV >= 256) {
2686 mavlink_message_t msg;
2687 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2689 mavlink_attitude_quaternion_cov_t packet_in = {
2690 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0 },185.0,213.0,241.0,{ 269.0, 270.0, 271.0, 272.0, 273.0, 274.0, 275.0, 276.0, 277.0 }
2692 mavlink_attitude_quaternion_cov_t packet1, packet2;
2693 memset(&packet1, 0,
sizeof(packet1));
2694 packet1.time_usec = packet_in.time_usec;
2695 packet1.rollspeed = packet_in.rollspeed;
2696 packet1.pitchspeed = packet_in.pitchspeed;
2697 packet1.yawspeed = packet_in.yawspeed;
2699 mav_array_memcpy(packet1.q, packet_in.q,
sizeof(
float)*4);
2700 mav_array_memcpy(packet1.covariance, packet_in.covariance,
sizeof(
float)*9);
2702#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2703 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2705 memset(MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV_MIN_LEN);
2708 memset(&packet2, 0,
sizeof(packet2));
2709 mavlink_msg_attitude_quaternion_cov_encode(system_id, component_id, &msg, &packet1);
2710 mavlink_msg_attitude_quaternion_cov_decode(&msg, &packet2);
2711 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2713 memset(&packet2, 0,
sizeof(packet2));
2714 mavlink_msg_attitude_quaternion_cov_pack(system_id, component_id, &msg , packet1.time_usec , packet1.q , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.covariance );
2715 mavlink_msg_attitude_quaternion_cov_decode(&msg, &packet2);
2716 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2718 memset(&packet2, 0,
sizeof(packet2));
2719 mavlink_msg_attitude_quaternion_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.q , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.covariance );
2720 mavlink_msg_attitude_quaternion_cov_decode(&msg, &packet2);
2721 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2723 memset(&packet2, 0,
sizeof(packet2));
2724 mavlink_msg_to_send_buffer(buffer, &msg);
2725 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2726 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2728 mavlink_msg_attitude_quaternion_cov_decode(last_msg, &packet2);
2729 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2731 memset(&packet2, 0,
sizeof(packet2));
2732 mavlink_msg_attitude_quaternion_cov_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.q , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.covariance );
2733 mavlink_msg_attitude_quaternion_cov_decode(last_msg, &packet2);
2734 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2736#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2737 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"ATTITUDE_QUATERNION_COV") != NULL);
2738 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ATTITUDE_QUATERNION_COV) != NULL);
2742static void mavlink_test_nav_controller_output(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2744#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2745 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2746 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT >= 256) {
2750 mavlink_message_t msg;
2751 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2753 mavlink_nav_controller_output_t packet_in = {
2754 17.0,45.0,73.0,101.0,129.0,18275,18379,18483
2756 mavlink_nav_controller_output_t packet1, packet2;
2757 memset(&packet1, 0,
sizeof(packet1));
2758 packet1.nav_roll = packet_in.nav_roll;
2759 packet1.nav_pitch = packet_in.nav_pitch;
2760 packet1.alt_error = packet_in.alt_error;
2761 packet1.aspd_error = packet_in.aspd_error;
2762 packet1.xtrack_error = packet_in.xtrack_error;
2763 packet1.nav_bearing = packet_in.nav_bearing;
2764 packet1.target_bearing = packet_in.target_bearing;
2765 packet1.wp_dist = packet_in.wp_dist;
2768#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2769 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2771 memset(MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT_MIN_LEN);
2774 memset(&packet2, 0,
sizeof(packet2));
2775 mavlink_msg_nav_controller_output_encode(system_id, component_id, &msg, &packet1);
2776 mavlink_msg_nav_controller_output_decode(&msg, &packet2);
2777 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2779 memset(&packet2, 0,
sizeof(packet2));
2780 mavlink_msg_nav_controller_output_pack(system_id, component_id, &msg , packet1.nav_roll , packet1.nav_pitch , packet1.nav_bearing , packet1.target_bearing , packet1.wp_dist , packet1.alt_error , packet1.aspd_error , packet1.xtrack_error );
2781 mavlink_msg_nav_controller_output_decode(&msg, &packet2);
2782 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2784 memset(&packet2, 0,
sizeof(packet2));
2785 mavlink_msg_nav_controller_output_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.nav_roll , packet1.nav_pitch , packet1.nav_bearing , packet1.target_bearing , packet1.wp_dist , packet1.alt_error , packet1.aspd_error , packet1.xtrack_error );
2786 mavlink_msg_nav_controller_output_decode(&msg, &packet2);
2787 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2789 memset(&packet2, 0,
sizeof(packet2));
2790 mavlink_msg_to_send_buffer(buffer, &msg);
2791 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2792 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2794 mavlink_msg_nav_controller_output_decode(last_msg, &packet2);
2795 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2797 memset(&packet2, 0,
sizeof(packet2));
2798 mavlink_msg_nav_controller_output_send(MAVLINK_COMM_1 , packet1.nav_roll , packet1.nav_pitch , packet1.nav_bearing , packet1.target_bearing , packet1.wp_dist , packet1.alt_error , packet1.aspd_error , packet1.xtrack_error );
2799 mavlink_msg_nav_controller_output_decode(last_msg, &packet2);
2800 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2802#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2803 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"NAV_CONTROLLER_OUTPUT") != NULL);
2804 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT) != NULL);
2808static void mavlink_test_global_position_int_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2810#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2811 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2812 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV >= 256) {
2816 mavlink_message_t msg;
2817 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2819 mavlink_global_position_int_cov_t packet_in = {
2820 93372036854775807ULL,963497880,963498088,963498296,963498504,185.0,213.0,241.0,{ 269.0, 270.0, 271.0, 272.0, 273.0, 274.0, 275.0, 276.0, 277.0, 278.0, 279.0, 280.0, 281.0, 282.0, 283.0, 284.0, 285.0, 286.0, 287.0, 288.0, 289.0, 290.0, 291.0, 292.0, 293.0, 294.0, 295.0, 296.0, 297.0, 298.0, 299.0, 300.0, 301.0, 302.0, 303.0, 304.0 },33
2822 mavlink_global_position_int_cov_t packet1, packet2;
2823 memset(&packet1, 0,
sizeof(packet1));
2824 packet1.time_usec = packet_in.time_usec;
2825 packet1.lat = packet_in.lat;
2826 packet1.lon = packet_in.lon;
2827 packet1.alt = packet_in.alt;
2828 packet1.relative_alt = packet_in.relative_alt;
2829 packet1.vx = packet_in.vx;
2830 packet1.vy = packet_in.vy;
2831 packet1.vz = packet_in.vz;
2832 packet1.estimator_type = packet_in.estimator_type;
2834 mav_array_memcpy(packet1.covariance, packet_in.covariance,
sizeof(
float)*36);
2836#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2837 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2839 memset(MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV_MIN_LEN);
2842 memset(&packet2, 0,
sizeof(packet2));
2843 mavlink_msg_global_position_int_cov_encode(system_id, component_id, &msg, &packet1);
2844 mavlink_msg_global_position_int_cov_decode(&msg, &packet2);
2845 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2847 memset(&packet2, 0,
sizeof(packet2));
2848 mavlink_msg_global_position_int_cov_pack(system_id, component_id, &msg , packet1.time_usec , packet1.estimator_type , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.covariance );
2849 mavlink_msg_global_position_int_cov_decode(&msg, &packet2);
2850 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2852 memset(&packet2, 0,
sizeof(packet2));
2853 mavlink_msg_global_position_int_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.estimator_type , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.covariance );
2854 mavlink_msg_global_position_int_cov_decode(&msg, &packet2);
2855 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2857 memset(&packet2, 0,
sizeof(packet2));
2858 mavlink_msg_to_send_buffer(buffer, &msg);
2859 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2860 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2862 mavlink_msg_global_position_int_cov_decode(last_msg, &packet2);
2863 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2865 memset(&packet2, 0,
sizeof(packet2));
2866 mavlink_msg_global_position_int_cov_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.estimator_type , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.covariance );
2867 mavlink_msg_global_position_int_cov_decode(last_msg, &packet2);
2868 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2870#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2871 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"GLOBAL_POSITION_INT_COV") != NULL);
2872 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GLOBAL_POSITION_INT_COV) != NULL);
2876static void mavlink_test_local_position_ned_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2878#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2879 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2880 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV >= 256) {
2884 mavlink_message_t msg;
2885 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2887 mavlink_local_position_ned_cov_t packet_in = {
2888 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,{ 325.0, 326.0, 327.0, 328.0, 329.0, 330.0, 331.0, 332.0, 333.0, 334.0, 335.0, 336.0, 337.0, 338.0, 339.0, 340.0, 341.0, 342.0, 343.0, 344.0, 345.0, 346.0, 347.0, 348.0, 349.0, 350.0, 351.0, 352.0, 353.0, 354.0, 355.0, 356.0, 357.0, 358.0, 359.0, 360.0, 361.0, 362.0, 363.0, 364.0, 365.0, 366.0, 367.0, 368.0, 369.0 },165
2890 mavlink_local_position_ned_cov_t packet1, packet2;
2891 memset(&packet1, 0,
sizeof(packet1));
2892 packet1.time_usec = packet_in.time_usec;
2893 packet1.x = packet_in.x;
2894 packet1.y = packet_in.y;
2895 packet1.z = packet_in.z;
2896 packet1.vx = packet_in.vx;
2897 packet1.vy = packet_in.vy;
2898 packet1.vz = packet_in.vz;
2899 packet1.ax = packet_in.ax;
2900 packet1.ay = packet_in.ay;
2901 packet1.az = packet_in.az;
2902 packet1.estimator_type = packet_in.estimator_type;
2904 mav_array_memcpy(packet1.covariance, packet_in.covariance,
sizeof(
float)*45);
2906#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2907 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2909 memset(MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV_MIN_LEN);
2912 memset(&packet2, 0,
sizeof(packet2));
2913 mavlink_msg_local_position_ned_cov_encode(system_id, component_id, &msg, &packet1);
2914 mavlink_msg_local_position_ned_cov_decode(&msg, &packet2);
2915 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2917 memset(&packet2, 0,
sizeof(packet2));
2918 mavlink_msg_local_position_ned_cov_pack(system_id, component_id, &msg , packet1.time_usec , packet1.estimator_type , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.ax , packet1.ay , packet1.az , packet1.covariance );
2919 mavlink_msg_local_position_ned_cov_decode(&msg, &packet2);
2920 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2922 memset(&packet2, 0,
sizeof(packet2));
2923 mavlink_msg_local_position_ned_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.estimator_type , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.ax , packet1.ay , packet1.az , packet1.covariance );
2924 mavlink_msg_local_position_ned_cov_decode(&msg, &packet2);
2925 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2927 memset(&packet2, 0,
sizeof(packet2));
2928 mavlink_msg_to_send_buffer(buffer, &msg);
2929 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
2930 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
2932 mavlink_msg_local_position_ned_cov_decode(last_msg, &packet2);
2933 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2935 memset(&packet2, 0,
sizeof(packet2));
2936 mavlink_msg_local_position_ned_cov_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.estimator_type , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.ax , packet1.ay , packet1.az , packet1.covariance );
2937 mavlink_msg_local_position_ned_cov_decode(last_msg, &packet2);
2938 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2940#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
2941 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"LOCAL_POSITION_NED_COV") != NULL);
2942 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOCAL_POSITION_NED_COV) != NULL);
2946static void mavlink_test_rc_channels(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
2948#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2949 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
2950 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RC_CHANNELS >= 256) {
2954 mavlink_message_t msg;
2955 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
2957 mavlink_rc_channels_t packet_in = {
2958 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275,18379,18483,18587,18691,18795,18899,19003,19107,19211,125,192
2960 mavlink_rc_channels_t packet1, packet2;
2961 memset(&packet1, 0,
sizeof(packet1));
2962 packet1.time_boot_ms = packet_in.time_boot_ms;
2963 packet1.chan1_raw = packet_in.chan1_raw;
2964 packet1.chan2_raw = packet_in.chan2_raw;
2965 packet1.chan3_raw = packet_in.chan3_raw;
2966 packet1.chan4_raw = packet_in.chan4_raw;
2967 packet1.chan5_raw = packet_in.chan5_raw;
2968 packet1.chan6_raw = packet_in.chan6_raw;
2969 packet1.chan7_raw = packet_in.chan7_raw;
2970 packet1.chan8_raw = packet_in.chan8_raw;
2971 packet1.chan9_raw = packet_in.chan9_raw;
2972 packet1.chan10_raw = packet_in.chan10_raw;
2973 packet1.chan11_raw = packet_in.chan11_raw;
2974 packet1.chan12_raw = packet_in.chan12_raw;
2975 packet1.chan13_raw = packet_in.chan13_raw;
2976 packet1.chan14_raw = packet_in.chan14_raw;
2977 packet1.chan15_raw = packet_in.chan15_raw;
2978 packet1.chan16_raw = packet_in.chan16_raw;
2979 packet1.chan17_raw = packet_in.chan17_raw;
2980 packet1.chan18_raw = packet_in.chan18_raw;
2981 packet1.chancount = packet_in.chancount;
2982 packet1.rssi = packet_in.rssi;
2985#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
2986 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
2988 memset(MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_RC_CHANNELS_MIN_LEN);
2991 memset(&packet2, 0,
sizeof(packet2));
2992 mavlink_msg_rc_channels_encode(system_id, component_id, &msg, &packet1);
2993 mavlink_msg_rc_channels_decode(&msg, &packet2);
2994 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
2996 memset(&packet2, 0,
sizeof(packet2));
2997 mavlink_msg_rc_channels_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.chancount , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.chan13_raw , packet1.chan14_raw , packet1.chan15_raw , packet1.chan16_raw , packet1.chan17_raw , packet1.chan18_raw , packet1.rssi );
2998 mavlink_msg_rc_channels_decode(&msg, &packet2);
2999 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3001 memset(&packet2, 0,
sizeof(packet2));
3002 mavlink_msg_rc_channels_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.chancount , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.chan13_raw , packet1.chan14_raw , packet1.chan15_raw , packet1.chan16_raw , packet1.chan17_raw , packet1.chan18_raw , packet1.rssi );
3003 mavlink_msg_rc_channels_decode(&msg, &packet2);
3004 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3006 memset(&packet2, 0,
sizeof(packet2));
3007 mavlink_msg_to_send_buffer(buffer, &msg);
3008 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3009 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3011 mavlink_msg_rc_channels_decode(last_msg, &packet2);
3012 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3014 memset(&packet2, 0,
sizeof(packet2));
3015 mavlink_msg_rc_channels_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.chancount , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.chan13_raw , packet1.chan14_raw , packet1.chan15_raw , packet1.chan16_raw , packet1.chan17_raw , packet1.chan18_raw , packet1.rssi );
3016 mavlink_msg_rc_channels_decode(last_msg, &packet2);
3017 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3019#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3020 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"RC_CHANNELS") != NULL);
3021 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_RC_CHANNELS) != NULL);
3025static void mavlink_test_request_data_stream(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3027#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3028 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3029 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_REQUEST_DATA_STREAM >= 256) {
3033 mavlink_message_t msg;
3034 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3036 mavlink_request_data_stream_t packet_in = {
3039 mavlink_request_data_stream_t packet1, packet2;
3040 memset(&packet1, 0,
sizeof(packet1));
3041 packet1.req_message_rate = packet_in.req_message_rate;
3042 packet1.target_system = packet_in.target_system;
3043 packet1.target_component = packet_in.target_component;
3044 packet1.req_stream_id = packet_in.req_stream_id;
3045 packet1.start_stop = packet_in.start_stop;
3048#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3049 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3051 memset(MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_REQUEST_DATA_STREAM_MIN_LEN);
3054 memset(&packet2, 0,
sizeof(packet2));
3055 mavlink_msg_request_data_stream_encode(system_id, component_id, &msg, &packet1);
3056 mavlink_msg_request_data_stream_decode(&msg, &packet2);
3057 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3059 memset(&packet2, 0,
sizeof(packet2));
3060 mavlink_msg_request_data_stream_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.req_stream_id , packet1.req_message_rate , packet1.start_stop );
3061 mavlink_msg_request_data_stream_decode(&msg, &packet2);
3062 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3064 memset(&packet2, 0,
sizeof(packet2));
3065 mavlink_msg_request_data_stream_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.req_stream_id , packet1.req_message_rate , packet1.start_stop );
3066 mavlink_msg_request_data_stream_decode(&msg, &packet2);
3067 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3069 memset(&packet2, 0,
sizeof(packet2));
3070 mavlink_msg_to_send_buffer(buffer, &msg);
3071 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3072 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3074 mavlink_msg_request_data_stream_decode(last_msg, &packet2);
3075 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3077 memset(&packet2, 0,
sizeof(packet2));
3078 mavlink_msg_request_data_stream_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.req_stream_id , packet1.req_message_rate , packet1.start_stop );
3079 mavlink_msg_request_data_stream_decode(last_msg, &packet2);
3080 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3082#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3083 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"REQUEST_DATA_STREAM") != NULL);
3084 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_REQUEST_DATA_STREAM) != NULL);
3088static void mavlink_test_data_stream(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3090#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3091 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3092 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DATA_STREAM >= 256) {
3096 mavlink_message_t msg;
3097 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3099 mavlink_data_stream_t packet_in = {
3102 mavlink_data_stream_t packet1, packet2;
3103 memset(&packet1, 0,
sizeof(packet1));
3104 packet1.message_rate = packet_in.message_rate;
3105 packet1.stream_id = packet_in.stream_id;
3106 packet1.on_off = packet_in.on_off;
3109#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3110 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3112 memset(MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_DATA_STREAM_MIN_LEN);
3115 memset(&packet2, 0,
sizeof(packet2));
3116 mavlink_msg_data_stream_encode(system_id, component_id, &msg, &packet1);
3117 mavlink_msg_data_stream_decode(&msg, &packet2);
3118 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3120 memset(&packet2, 0,
sizeof(packet2));
3121 mavlink_msg_data_stream_pack(system_id, component_id, &msg , packet1.stream_id , packet1.message_rate , packet1.on_off );
3122 mavlink_msg_data_stream_decode(&msg, &packet2);
3123 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3125 memset(&packet2, 0,
sizeof(packet2));
3126 mavlink_msg_data_stream_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.stream_id , packet1.message_rate , packet1.on_off );
3127 mavlink_msg_data_stream_decode(&msg, &packet2);
3128 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3130 memset(&packet2, 0,
sizeof(packet2));
3131 mavlink_msg_to_send_buffer(buffer, &msg);
3132 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3133 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3135 mavlink_msg_data_stream_decode(last_msg, &packet2);
3136 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3138 memset(&packet2, 0,
sizeof(packet2));
3139 mavlink_msg_data_stream_send(MAVLINK_COMM_1 , packet1.stream_id , packet1.message_rate , packet1.on_off );
3140 mavlink_msg_data_stream_decode(last_msg, &packet2);
3141 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3143#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3144 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"DATA_STREAM") != NULL);
3145 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_DATA_STREAM) != NULL);
3149static void mavlink_test_manual_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3151#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3152 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3153 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MANUAL_CONTROL >= 256) {
3157 mavlink_message_t msg;
3158 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3160 mavlink_manual_control_t packet_in = {
3161 17235,17339,17443,17547,17651,163,17807,108,17963,18067,18171,18275,18379,18483,18587,18691
3163 mavlink_manual_control_t packet1, packet2;
3164 memset(&packet1, 0,
sizeof(packet1));
3165 packet1.x = packet_in.x;
3166 packet1.y = packet_in.y;
3167 packet1.z = packet_in.z;
3168 packet1.r = packet_in.r;
3169 packet1.buttons = packet_in.buttons;
3170 packet1.target = packet_in.target;
3171 packet1.buttons2 = packet_in.buttons2;
3172 packet1.enabled_extensions = packet_in.enabled_extensions;
3173 packet1.s = packet_in.s;
3174 packet1.t = packet_in.t;
3175 packet1.aux1 = packet_in.aux1;
3176 packet1.aux2 = packet_in.aux2;
3177 packet1.aux3 = packet_in.aux3;
3178 packet1.aux4 = packet_in.aux4;
3179 packet1.aux5 = packet_in.aux5;
3180 packet1.aux6 = packet_in.aux6;
3183#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3184 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3186 memset(MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_MANUAL_CONTROL_MIN_LEN);
3189 memset(&packet2, 0,
sizeof(packet2));
3190 mavlink_msg_manual_control_encode(system_id, component_id, &msg, &packet1);
3191 mavlink_msg_manual_control_decode(&msg, &packet2);
3192 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3194 memset(&packet2, 0,
sizeof(packet2));
3195 mavlink_msg_manual_control_pack(system_id, component_id, &msg , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons , packet1.buttons2 , packet1.enabled_extensions , packet1.s , packet1.t , packet1.aux1 , packet1.aux2 , packet1.aux3 , packet1.aux4 , packet1.aux5 , packet1.aux6 );
3196 mavlink_msg_manual_control_decode(&msg, &packet2);
3197 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3199 memset(&packet2, 0,
sizeof(packet2));
3200 mavlink_msg_manual_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons , packet1.buttons2 , packet1.enabled_extensions , packet1.s , packet1.t , packet1.aux1 , packet1.aux2 , packet1.aux3 , packet1.aux4 , packet1.aux5 , packet1.aux6 );
3201 mavlink_msg_manual_control_decode(&msg, &packet2);
3202 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3204 memset(&packet2, 0,
sizeof(packet2));
3205 mavlink_msg_to_send_buffer(buffer, &msg);
3206 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3207 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3209 mavlink_msg_manual_control_decode(last_msg, &packet2);
3210 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3212 memset(&packet2, 0,
sizeof(packet2));
3213 mavlink_msg_manual_control_send(MAVLINK_COMM_1 , packet1.target , packet1.x , packet1.y , packet1.z , packet1.r , packet1.buttons , packet1.buttons2 , packet1.enabled_extensions , packet1.s , packet1.t , packet1.aux1 , packet1.aux2 , packet1.aux3 , packet1.aux4 , packet1.aux5 , packet1.aux6 );
3214 mavlink_msg_manual_control_decode(last_msg, &packet2);
3215 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3217#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3218 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"MANUAL_CONTROL") != NULL);
3219 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MANUAL_CONTROL) != NULL);
3223static void mavlink_test_rc_channels_override(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3225#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3226 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3227 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE >= 256) {
3231 mavlink_message_t msg;
3232 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3234 mavlink_rc_channels_override_t packet_in = {
3235 17235,17339,17443,17547,17651,17755,17859,17963,53,120,18171,18275,18379,18483,18587,18691,18795,18899,19003,19107
3237 mavlink_rc_channels_override_t packet1, packet2;
3238 memset(&packet1, 0,
sizeof(packet1));
3239 packet1.chan1_raw = packet_in.chan1_raw;
3240 packet1.chan2_raw = packet_in.chan2_raw;
3241 packet1.chan3_raw = packet_in.chan3_raw;
3242 packet1.chan4_raw = packet_in.chan4_raw;
3243 packet1.chan5_raw = packet_in.chan5_raw;
3244 packet1.chan6_raw = packet_in.chan6_raw;
3245 packet1.chan7_raw = packet_in.chan7_raw;
3246 packet1.chan8_raw = packet_in.chan8_raw;
3247 packet1.target_system = packet_in.target_system;
3248 packet1.target_component = packet_in.target_component;
3249 packet1.chan9_raw = packet_in.chan9_raw;
3250 packet1.chan10_raw = packet_in.chan10_raw;
3251 packet1.chan11_raw = packet_in.chan11_raw;
3252 packet1.chan12_raw = packet_in.chan12_raw;
3253 packet1.chan13_raw = packet_in.chan13_raw;
3254 packet1.chan14_raw = packet_in.chan14_raw;
3255 packet1.chan15_raw = packet_in.chan15_raw;
3256 packet1.chan16_raw = packet_in.chan16_raw;
3257 packet1.chan17_raw = packet_in.chan17_raw;
3258 packet1.chan18_raw = packet_in.chan18_raw;
3261#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3262 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3264 memset(MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN);
3267 memset(&packet2, 0,
sizeof(packet2));
3268 mavlink_msg_rc_channels_override_encode(system_id, component_id, &msg, &packet1);
3269 mavlink_msg_rc_channels_override_decode(&msg, &packet2);
3270 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3272 memset(&packet2, 0,
sizeof(packet2));
3273 mavlink_msg_rc_channels_override_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.chan13_raw , packet1.chan14_raw , packet1.chan15_raw , packet1.chan16_raw , packet1.chan17_raw , packet1.chan18_raw );
3274 mavlink_msg_rc_channels_override_decode(&msg, &packet2);
3275 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3277 memset(&packet2, 0,
sizeof(packet2));
3278 mavlink_msg_rc_channels_override_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.chan13_raw , packet1.chan14_raw , packet1.chan15_raw , packet1.chan16_raw , packet1.chan17_raw , packet1.chan18_raw );
3279 mavlink_msg_rc_channels_override_decode(&msg, &packet2);
3280 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3282 memset(&packet2, 0,
sizeof(packet2));
3283 mavlink_msg_to_send_buffer(buffer, &msg);
3284 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3285 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3287 mavlink_msg_rc_channels_override_decode(last_msg, &packet2);
3288 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3290 memset(&packet2, 0,
sizeof(packet2));
3291 mavlink_msg_rc_channels_override_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.chan13_raw , packet1.chan14_raw , packet1.chan15_raw , packet1.chan16_raw , packet1.chan17_raw , packet1.chan18_raw );
3292 mavlink_msg_rc_channels_override_decode(last_msg, &packet2);
3293 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3295#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3296 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"RC_CHANNELS_OVERRIDE") != NULL);
3297 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE) != NULL);
3301static void mavlink_test_mission_item_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3303#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3304 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3305 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MISSION_ITEM_INT >= 256) {
3309 mavlink_message_t msg;
3310 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3312 mavlink_mission_item_int_t packet_in = {
3313 17.0,45.0,73.0,101.0,963498296,963498504,185.0,18691,18795,101,168,235,46,113,180
3315 mavlink_mission_item_int_t packet1, packet2;
3316 memset(&packet1, 0,
sizeof(packet1));
3317 packet1.param1 = packet_in.param1;
3318 packet1.param2 = packet_in.param2;
3319 packet1.param3 = packet_in.param3;
3320 packet1.param4 = packet_in.param4;
3321 packet1.x = packet_in.x;
3322 packet1.y = packet_in.y;
3323 packet1.z = packet_in.z;
3324 packet1.seq = packet_in.seq;
3325 packet1.command = packet_in.command;
3326 packet1.target_system = packet_in.target_system;
3327 packet1.target_component = packet_in.target_component;
3328 packet1.frame = packet_in.frame;
3329 packet1.current = packet_in.current;
3330 packet1.autocontinue = packet_in.autocontinue;
3331 packet1.mission_type = packet_in.mission_type;
3334#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3335 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3337 memset(MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_MISSION_ITEM_INT_MIN_LEN);
3340 memset(&packet2, 0,
sizeof(packet2));
3341 mavlink_msg_mission_item_int_encode(system_id, component_id, &msg, &packet1);
3342 mavlink_msg_mission_item_int_decode(&msg, &packet2);
3343 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3345 memset(&packet2, 0,
sizeof(packet2));
3346 mavlink_msg_mission_item_int_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z , packet1.mission_type );
3347 mavlink_msg_mission_item_int_decode(&msg, &packet2);
3348 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3350 memset(&packet2, 0,
sizeof(packet2));
3351 mavlink_msg_mission_item_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z , packet1.mission_type );
3352 mavlink_msg_mission_item_int_decode(&msg, &packet2);
3353 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3355 memset(&packet2, 0,
sizeof(packet2));
3356 mavlink_msg_to_send_buffer(buffer, &msg);
3357 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3358 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3360 mavlink_msg_mission_item_int_decode(last_msg, &packet2);
3361 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3363 memset(&packet2, 0,
sizeof(packet2));
3364 mavlink_msg_mission_item_int_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seq , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z , packet1.mission_type );
3365 mavlink_msg_mission_item_int_decode(last_msg, &packet2);
3366 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3368#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3369 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"MISSION_ITEM_INT") != NULL);
3370 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MISSION_ITEM_INT) != NULL);
3374static void mavlink_test_vfr_hud(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3376#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3377 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3378 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VFR_HUD >= 256) {
3382 mavlink_message_t msg;
3383 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3385 mavlink_vfr_hud_t packet_in = {
3386 17.0,45.0,73.0,101.0,18067,18171
3388 mavlink_vfr_hud_t packet1, packet2;
3389 memset(&packet1, 0,
sizeof(packet1));
3390 packet1.airspeed = packet_in.airspeed;
3391 packet1.groundspeed = packet_in.groundspeed;
3392 packet1.alt = packet_in.alt;
3393 packet1.climb = packet_in.climb;
3394 packet1.heading = packet_in.heading;
3395 packet1.throttle = packet_in.throttle;
3398#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3399 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3401 memset(MAVLINK_MSG_ID_VFR_HUD_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_VFR_HUD_MIN_LEN);
3404 memset(&packet2, 0,
sizeof(packet2));
3405 mavlink_msg_vfr_hud_encode(system_id, component_id, &msg, &packet1);
3406 mavlink_msg_vfr_hud_decode(&msg, &packet2);
3407 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3409 memset(&packet2, 0,
sizeof(packet2));
3410 mavlink_msg_vfr_hud_pack(system_id, component_id, &msg , packet1.airspeed , packet1.groundspeed , packet1.heading , packet1.throttle , packet1.alt , packet1.climb );
3411 mavlink_msg_vfr_hud_decode(&msg, &packet2);
3412 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3414 memset(&packet2, 0,
sizeof(packet2));
3415 mavlink_msg_vfr_hud_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.airspeed , packet1.groundspeed , packet1.heading , packet1.throttle , packet1.alt , packet1.climb );
3416 mavlink_msg_vfr_hud_decode(&msg, &packet2);
3417 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3419 memset(&packet2, 0,
sizeof(packet2));
3420 mavlink_msg_to_send_buffer(buffer, &msg);
3421 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3422 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3424 mavlink_msg_vfr_hud_decode(last_msg, &packet2);
3425 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3427 memset(&packet2, 0,
sizeof(packet2));
3428 mavlink_msg_vfr_hud_send(MAVLINK_COMM_1 , packet1.airspeed , packet1.groundspeed , packet1.heading , packet1.throttle , packet1.alt , packet1.climb );
3429 mavlink_msg_vfr_hud_decode(last_msg, &packet2);
3430 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3432#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3433 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"VFR_HUD") != NULL);
3434 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_VFR_HUD) != NULL);
3438static void mavlink_test_command_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3440#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3441 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3442 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMMAND_INT >= 256) {
3446 mavlink_message_t msg;
3447 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3449 mavlink_command_int_t packet_in = {
3450 17.0,45.0,73.0,101.0,963498296,963498504,185.0,18691,223,34,101,168,235
3452 mavlink_command_int_t packet1, packet2;
3453 memset(&packet1, 0,
sizeof(packet1));
3454 packet1.param1 = packet_in.param1;
3455 packet1.param2 = packet_in.param2;
3456 packet1.param3 = packet_in.param3;
3457 packet1.param4 = packet_in.param4;
3458 packet1.x = packet_in.x;
3459 packet1.y = packet_in.y;
3460 packet1.z = packet_in.z;
3461 packet1.command = packet_in.command;
3462 packet1.target_system = packet_in.target_system;
3463 packet1.target_component = packet_in.target_component;
3464 packet1.frame = packet_in.frame;
3465 packet1.current = packet_in.current;
3466 packet1.autocontinue = packet_in.autocontinue;
3469#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3470 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3472 memset(MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_COMMAND_INT_MIN_LEN);
3475 memset(&packet2, 0,
sizeof(packet2));
3476 mavlink_msg_command_int_encode(system_id, component_id, &msg, &packet1);
3477 mavlink_msg_command_int_decode(&msg, &packet2);
3478 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3480 memset(&packet2, 0,
sizeof(packet2));
3481 mavlink_msg_command_int_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z );
3482 mavlink_msg_command_int_decode(&msg, &packet2);
3483 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3485 memset(&packet2, 0,
sizeof(packet2));
3486 mavlink_msg_command_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z );
3487 mavlink_msg_command_int_decode(&msg, &packet2);
3488 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3490 memset(&packet2, 0,
sizeof(packet2));
3491 mavlink_msg_to_send_buffer(buffer, &msg);
3492 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3493 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3495 mavlink_msg_command_int_decode(last_msg, &packet2);
3496 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3498 memset(&packet2, 0,
sizeof(packet2));
3499 mavlink_msg_command_int_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.frame , packet1.command , packet1.current , packet1.autocontinue , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.x , packet1.y , packet1.z );
3500 mavlink_msg_command_int_decode(last_msg, &packet2);
3501 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3503#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3504 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"COMMAND_INT") != NULL);
3505 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_COMMAND_INT) != NULL);
3509static void mavlink_test_command_long(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3511#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3512 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3513 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMMAND_LONG >= 256) {
3517 mavlink_message_t msg;
3518 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3520 mavlink_command_long_t packet_in = {
3521 17.0,45.0,73.0,101.0,129.0,157.0,185.0,18691,223,34,101
3523 mavlink_command_long_t packet1, packet2;
3524 memset(&packet1, 0,
sizeof(packet1));
3525 packet1.param1 = packet_in.param1;
3526 packet1.param2 = packet_in.param2;
3527 packet1.param3 = packet_in.param3;
3528 packet1.param4 = packet_in.param4;
3529 packet1.param5 = packet_in.param5;
3530 packet1.param6 = packet_in.param6;
3531 packet1.param7 = packet_in.param7;
3532 packet1.command = packet_in.command;
3533 packet1.target_system = packet_in.target_system;
3534 packet1.target_component = packet_in.target_component;
3535 packet1.confirmation = packet_in.confirmation;
3538#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3539 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3541 memset(MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_COMMAND_LONG_MIN_LEN);
3544 memset(&packet2, 0,
sizeof(packet2));
3545 mavlink_msg_command_long_encode(system_id, component_id, &msg, &packet1);
3546 mavlink_msg_command_long_decode(&msg, &packet2);
3547 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3549 memset(&packet2, 0,
sizeof(packet2));
3550 mavlink_msg_command_long_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.command , packet1.confirmation , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.param5 , packet1.param6 , packet1.param7 );
3551 mavlink_msg_command_long_decode(&msg, &packet2);
3552 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3554 memset(&packet2, 0,
sizeof(packet2));
3555 mavlink_msg_command_long_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.command , packet1.confirmation , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.param5 , packet1.param6 , packet1.param7 );
3556 mavlink_msg_command_long_decode(&msg, &packet2);
3557 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3559 memset(&packet2, 0,
sizeof(packet2));
3560 mavlink_msg_to_send_buffer(buffer, &msg);
3561 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3562 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3564 mavlink_msg_command_long_decode(last_msg, &packet2);
3565 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3567 memset(&packet2, 0,
sizeof(packet2));
3568 mavlink_msg_command_long_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.command , packet1.confirmation , packet1.param1 , packet1.param2 , packet1.param3 , packet1.param4 , packet1.param5 , packet1.param6 , packet1.param7 );
3569 mavlink_msg_command_long_decode(last_msg, &packet2);
3570 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3572#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3573 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"COMMAND_LONG") != NULL);
3574 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_COMMAND_LONG) != NULL);
3578static void mavlink_test_command_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3580#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3581 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3582 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMMAND_ACK >= 256) {
3586 mavlink_message_t msg;
3587 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3589 mavlink_command_ack_t packet_in = {
3590 17235,139,206,963497672,29,96
3592 mavlink_command_ack_t packet1, packet2;
3593 memset(&packet1, 0,
sizeof(packet1));
3594 packet1.command = packet_in.command;
3595 packet1.result = packet_in.result;
3596 packet1.progress = packet_in.progress;
3597 packet1.result_param2 = packet_in.result_param2;
3598 packet1.target_system = packet_in.target_system;
3599 packet1.target_component = packet_in.target_component;
3602#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3603 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3605 memset(MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_COMMAND_ACK_MIN_LEN);
3608 memset(&packet2, 0,
sizeof(packet2));
3609 mavlink_msg_command_ack_encode(system_id, component_id, &msg, &packet1);
3610 mavlink_msg_command_ack_decode(&msg, &packet2);
3611 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3613 memset(&packet2, 0,
sizeof(packet2));
3614 mavlink_msg_command_ack_pack(system_id, component_id, &msg , packet1.command , packet1.result , packet1.progress , packet1.result_param2 , packet1.target_system , packet1.target_component );
3615 mavlink_msg_command_ack_decode(&msg, &packet2);
3616 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3618 memset(&packet2, 0,
sizeof(packet2));
3619 mavlink_msg_command_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.command , packet1.result , packet1.progress , packet1.result_param2 , packet1.target_system , packet1.target_component );
3620 mavlink_msg_command_ack_decode(&msg, &packet2);
3621 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3623 memset(&packet2, 0,
sizeof(packet2));
3624 mavlink_msg_to_send_buffer(buffer, &msg);
3625 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3626 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3628 mavlink_msg_command_ack_decode(last_msg, &packet2);
3629 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3631 memset(&packet2, 0,
sizeof(packet2));
3632 mavlink_msg_command_ack_send(MAVLINK_COMM_1 , packet1.command , packet1.result , packet1.progress , packet1.result_param2 , packet1.target_system , packet1.target_component );
3633 mavlink_msg_command_ack_decode(last_msg, &packet2);
3634 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3636#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3637 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"COMMAND_ACK") != NULL);
3638 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_COMMAND_ACK) != NULL);
3642static void mavlink_test_command_cancel(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3644#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3645 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3646 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMMAND_CANCEL >= 256) {
3650 mavlink_message_t msg;
3651 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3653 mavlink_command_cancel_t packet_in = {
3656 mavlink_command_cancel_t packet1, packet2;
3657 memset(&packet1, 0,
sizeof(packet1));
3658 packet1.command = packet_in.command;
3659 packet1.target_system = packet_in.target_system;
3660 packet1.target_component = packet_in.target_component;
3663#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3664 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3666 memset(MAVLINK_MSG_ID_COMMAND_CANCEL_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_COMMAND_CANCEL_MIN_LEN);
3669 memset(&packet2, 0,
sizeof(packet2));
3670 mavlink_msg_command_cancel_encode(system_id, component_id, &msg, &packet1);
3671 mavlink_msg_command_cancel_decode(&msg, &packet2);
3672 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3674 memset(&packet2, 0,
sizeof(packet2));
3675 mavlink_msg_command_cancel_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.command );
3676 mavlink_msg_command_cancel_decode(&msg, &packet2);
3677 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3679 memset(&packet2, 0,
sizeof(packet2));
3680 mavlink_msg_command_cancel_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.command );
3681 mavlink_msg_command_cancel_decode(&msg, &packet2);
3682 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3684 memset(&packet2, 0,
sizeof(packet2));
3685 mavlink_msg_to_send_buffer(buffer, &msg);
3686 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3687 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3689 mavlink_msg_command_cancel_decode(last_msg, &packet2);
3690 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3692 memset(&packet2, 0,
sizeof(packet2));
3693 mavlink_msg_command_cancel_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.command );
3694 mavlink_msg_command_cancel_decode(last_msg, &packet2);
3695 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3697#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3698 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"COMMAND_CANCEL") != NULL);
3699 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_COMMAND_CANCEL) != NULL);
3703static void mavlink_test_manual_setpoint(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_MANUAL_SETPOINT >= 256) {
3711 mavlink_message_t msg;
3712 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3714 mavlink_manual_setpoint_t packet_in = {
3715 963497464,45.0,73.0,101.0,129.0,65,132
3717 mavlink_manual_setpoint_t packet1, packet2;
3718 memset(&packet1, 0,
sizeof(packet1));
3719 packet1.time_boot_ms = packet_in.time_boot_ms;
3720 packet1.roll = packet_in.roll;
3721 packet1.pitch = packet_in.pitch;
3722 packet1.yaw = packet_in.yaw;
3723 packet1.thrust = packet_in.thrust;
3724 packet1.mode_switch = packet_in.mode_switch;
3725 packet1.manual_override_switch = packet_in.manual_override_switch;
3728#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3729 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3731 memset(MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_MANUAL_SETPOINT_MIN_LEN);
3734 memset(&packet2, 0,
sizeof(packet2));
3735 mavlink_msg_manual_setpoint_encode(system_id, component_id, &msg, &packet1);
3736 mavlink_msg_manual_setpoint_decode(&msg, &packet2);
3737 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3739 memset(&packet2, 0,
sizeof(packet2));
3740 mavlink_msg_manual_setpoint_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.mode_switch , packet1.manual_override_switch );
3741 mavlink_msg_manual_setpoint_decode(&msg, &packet2);
3742 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3744 memset(&packet2, 0,
sizeof(packet2));
3745 mavlink_msg_manual_setpoint_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.mode_switch , packet1.manual_override_switch );
3746 mavlink_msg_manual_setpoint_decode(&msg, &packet2);
3747 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
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_manual_setpoint_decode(last_msg, &packet2);
3755 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3757 memset(&packet2, 0,
sizeof(packet2));
3758 mavlink_msg_manual_setpoint_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.thrust , packet1.mode_switch , packet1.manual_override_switch );
3759 mavlink_msg_manual_setpoint_decode(last_msg, &packet2);
3760 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3762#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3763 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"MANUAL_SETPOINT") != NULL);
3764 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MANUAL_SETPOINT) != NULL);
3768static void mavlink_test_set_attitude_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3770#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3771 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3772 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_ATTITUDE_TARGET >= 256) {
3776 mavlink_message_t msg;
3777 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3779 mavlink_set_attitude_target_t packet_in = {
3780 963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,241.0,113,180,247,{ 290.0, 291.0, 292.0 }
3782 mavlink_set_attitude_target_t packet1, packet2;
3783 memset(&packet1, 0,
sizeof(packet1));
3784 packet1.time_boot_ms = packet_in.time_boot_ms;
3785 packet1.body_roll_rate = packet_in.body_roll_rate;
3786 packet1.body_pitch_rate = packet_in.body_pitch_rate;
3787 packet1.body_yaw_rate = packet_in.body_yaw_rate;
3788 packet1.thrust = packet_in.thrust;
3789 packet1.target_system = packet_in.target_system;
3790 packet1.target_component = packet_in.target_component;
3791 packet1.type_mask = packet_in.type_mask;
3793 mav_array_memcpy(packet1.q, packet_in.q,
sizeof(
float)*4);
3794 mav_array_memcpy(packet1.thrust_body, packet_in.thrust_body,
sizeof(
float)*3);
3796#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3797 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3799 memset(MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SET_ATTITUDE_TARGET_MIN_LEN);
3802 memset(&packet2, 0,
sizeof(packet2));
3803 mavlink_msg_set_attitude_target_encode(system_id, component_id, &msg, &packet1);
3804 mavlink_msg_set_attitude_target_decode(&msg, &packet2);
3805 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3807 memset(&packet2, 0,
sizeof(packet2));
3808 mavlink_msg_set_attitude_target_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust , packet1.thrust_body );
3809 mavlink_msg_set_attitude_target_decode(&msg, &packet2);
3810 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3812 memset(&packet2, 0,
sizeof(packet2));
3813 mavlink_msg_set_attitude_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust , packet1.thrust_body );
3814 mavlink_msg_set_attitude_target_decode(&msg, &packet2);
3815 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3817 memset(&packet2, 0,
sizeof(packet2));
3818 mavlink_msg_to_send_buffer(buffer, &msg);
3819 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3820 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3822 mavlink_msg_set_attitude_target_decode(last_msg, &packet2);
3823 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3825 memset(&packet2, 0,
sizeof(packet2));
3826 mavlink_msg_set_attitude_target_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust , packet1.thrust_body );
3827 mavlink_msg_set_attitude_target_decode(last_msg, &packet2);
3828 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3830#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3831 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SET_ATTITUDE_TARGET") != NULL);
3832 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SET_ATTITUDE_TARGET) != NULL);
3836static void mavlink_test_attitude_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3838#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3839 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3840 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATTITUDE_TARGET >= 256) {
3844 mavlink_message_t msg;
3845 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3847 mavlink_attitude_target_t packet_in = {
3848 963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,241.0,113
3850 mavlink_attitude_target_t packet1, packet2;
3851 memset(&packet1, 0,
sizeof(packet1));
3852 packet1.time_boot_ms = packet_in.time_boot_ms;
3853 packet1.body_roll_rate = packet_in.body_roll_rate;
3854 packet1.body_pitch_rate = packet_in.body_pitch_rate;
3855 packet1.body_yaw_rate = packet_in.body_yaw_rate;
3856 packet1.thrust = packet_in.thrust;
3857 packet1.type_mask = packet_in.type_mask;
3859 mav_array_memcpy(packet1.q, packet_in.q,
sizeof(
float)*4);
3861#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3862 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3864 memset(MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_ATTITUDE_TARGET_MIN_LEN);
3867 memset(&packet2, 0,
sizeof(packet2));
3868 mavlink_msg_attitude_target_encode(system_id, component_id, &msg, &packet1);
3869 mavlink_msg_attitude_target_decode(&msg, &packet2);
3870 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3872 memset(&packet2, 0,
sizeof(packet2));
3873 mavlink_msg_attitude_target_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust );
3874 mavlink_msg_attitude_target_decode(&msg, &packet2);
3875 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3877 memset(&packet2, 0,
sizeof(packet2));
3878 mavlink_msg_attitude_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust );
3879 mavlink_msg_attitude_target_decode(&msg, &packet2);
3880 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3882 memset(&packet2, 0,
sizeof(packet2));
3883 mavlink_msg_to_send_buffer(buffer, &msg);
3884 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3885 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3887 mavlink_msg_attitude_target_decode(last_msg, &packet2);
3888 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3890 memset(&packet2, 0,
sizeof(packet2));
3891 mavlink_msg_attitude_target_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.type_mask , packet1.q , packet1.body_roll_rate , packet1.body_pitch_rate , packet1.body_yaw_rate , packet1.thrust );
3892 mavlink_msg_attitude_target_decode(last_msg, &packet2);
3893 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3895#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3896 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"ATTITUDE_TARGET") != NULL);
3897 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ATTITUDE_TARGET) != NULL);
3901static void mavlink_test_set_position_target_local_ned(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3903#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3904 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3905 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED >= 256) {
3909 mavlink_message_t msg;
3910 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3912 mavlink_set_position_target_local_ned_t packet_in = {
3913 963497464,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27,94,161
3915 mavlink_set_position_target_local_ned_t packet1, packet2;
3916 memset(&packet1, 0,
sizeof(packet1));
3917 packet1.time_boot_ms = packet_in.time_boot_ms;
3918 packet1.x = packet_in.x;
3919 packet1.y = packet_in.y;
3920 packet1.z = packet_in.z;
3921 packet1.vx = packet_in.vx;
3922 packet1.vy = packet_in.vy;
3923 packet1.vz = packet_in.vz;
3924 packet1.afx = packet_in.afx;
3925 packet1.afy = packet_in.afy;
3926 packet1.afz = packet_in.afz;
3927 packet1.yaw = packet_in.yaw;
3928 packet1.yaw_rate = packet_in.yaw_rate;
3929 packet1.type_mask = packet_in.type_mask;
3930 packet1.target_system = packet_in.target_system;
3931 packet1.target_component = packet_in.target_component;
3932 packet1.coordinate_frame = packet_in.coordinate_frame;
3935#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3936 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
3938 memset(MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED_MIN_LEN);
3941 memset(&packet2, 0,
sizeof(packet2));
3942 mavlink_msg_set_position_target_local_ned_encode(system_id, component_id, &msg, &packet1);
3943 mavlink_msg_set_position_target_local_ned_decode(&msg, &packet2);
3944 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3946 memset(&packet2, 0,
sizeof(packet2));
3947 mavlink_msg_set_position_target_local_ned_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
3948 mavlink_msg_set_position_target_local_ned_decode(&msg, &packet2);
3949 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3951 memset(&packet2, 0,
sizeof(packet2));
3952 mavlink_msg_set_position_target_local_ned_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
3953 mavlink_msg_set_position_target_local_ned_decode(&msg, &packet2);
3954 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3956 memset(&packet2, 0,
sizeof(packet2));
3957 mavlink_msg_to_send_buffer(buffer, &msg);
3958 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
3959 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
3961 mavlink_msg_set_position_target_local_ned_decode(last_msg, &packet2);
3962 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3964 memset(&packet2, 0,
sizeof(packet2));
3965 mavlink_msg_set_position_target_local_ned_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
3966 mavlink_msg_set_position_target_local_ned_decode(last_msg, &packet2);
3967 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
3969#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
3970 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SET_POSITION_TARGET_LOCAL_NED") != NULL);
3971 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SET_POSITION_TARGET_LOCAL_NED) != NULL);
3975static void mavlink_test_position_target_local_ned(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
3977#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
3978 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
3979 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED >= 256) {
3983 mavlink_message_t msg;
3984 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
3986 mavlink_position_target_local_ned_t packet_in = {
3987 963497464,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27
3989 mavlink_position_target_local_ned_t packet1, packet2;
3990 memset(&packet1, 0,
sizeof(packet1));
3991 packet1.time_boot_ms = packet_in.time_boot_ms;
3992 packet1.x = packet_in.x;
3993 packet1.y = packet_in.y;
3994 packet1.z = packet_in.z;
3995 packet1.vx = packet_in.vx;
3996 packet1.vy = packet_in.vy;
3997 packet1.vz = packet_in.vz;
3998 packet1.afx = packet_in.afx;
3999 packet1.afy = packet_in.afy;
4000 packet1.afz = packet_in.afz;
4001 packet1.yaw = packet_in.yaw;
4002 packet1.yaw_rate = packet_in.yaw_rate;
4003 packet1.type_mask = packet_in.type_mask;
4004 packet1.coordinate_frame = packet_in.coordinate_frame;
4007#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4008 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4010 memset(MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED_MIN_LEN);
4013 memset(&packet2, 0,
sizeof(packet2));
4014 mavlink_msg_position_target_local_ned_encode(system_id, component_id, &msg, &packet1);
4015 mavlink_msg_position_target_local_ned_decode(&msg, &packet2);
4016 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4018 memset(&packet2, 0,
sizeof(packet2));
4019 mavlink_msg_position_target_local_ned_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
4020 mavlink_msg_position_target_local_ned_decode(&msg, &packet2);
4021 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4023 memset(&packet2, 0,
sizeof(packet2));
4024 mavlink_msg_position_target_local_ned_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
4025 mavlink_msg_position_target_local_ned_decode(&msg, &packet2);
4026 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4028 memset(&packet2, 0,
sizeof(packet2));
4029 mavlink_msg_to_send_buffer(buffer, &msg);
4030 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4031 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4033 mavlink_msg_position_target_local_ned_decode(last_msg, &packet2);
4034 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4036 memset(&packet2, 0,
sizeof(packet2));
4037 mavlink_msg_position_target_local_ned_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.x , packet1.y , packet1.z , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
4038 mavlink_msg_position_target_local_ned_decode(last_msg, &packet2);
4039 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4041#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4042 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"POSITION_TARGET_LOCAL_NED") != NULL);
4043 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_POSITION_TARGET_LOCAL_NED) != NULL);
4047static void mavlink_test_set_position_target_global_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4049#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4050 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4051 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT >= 256) {
4055 mavlink_message_t msg;
4056 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4058 mavlink_set_position_target_global_int_t packet_in = {
4059 963497464,963497672,963497880,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27,94,161
4061 mavlink_set_position_target_global_int_t packet1, packet2;
4062 memset(&packet1, 0,
sizeof(packet1));
4063 packet1.time_boot_ms = packet_in.time_boot_ms;
4064 packet1.lat_int = packet_in.lat_int;
4065 packet1.lon_int = packet_in.lon_int;
4066 packet1.alt = packet_in.alt;
4067 packet1.vx = packet_in.vx;
4068 packet1.vy = packet_in.vy;
4069 packet1.vz = packet_in.vz;
4070 packet1.afx = packet_in.afx;
4071 packet1.afy = packet_in.afy;
4072 packet1.afz = packet_in.afz;
4073 packet1.yaw = packet_in.yaw;
4074 packet1.yaw_rate = packet_in.yaw_rate;
4075 packet1.type_mask = packet_in.type_mask;
4076 packet1.target_system = packet_in.target_system;
4077 packet1.target_component = packet_in.target_component;
4078 packet1.coordinate_frame = packet_in.coordinate_frame;
4081#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4082 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4084 memset(MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT_MIN_LEN);
4087 memset(&packet2, 0,
sizeof(packet2));
4088 mavlink_msg_set_position_target_global_int_encode(system_id, component_id, &msg, &packet1);
4089 mavlink_msg_set_position_target_global_int_decode(&msg, &packet2);
4090 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4092 memset(&packet2, 0,
sizeof(packet2));
4093 mavlink_msg_set_position_target_global_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
4094 mavlink_msg_set_position_target_global_int_decode(&msg, &packet2);
4095 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4097 memset(&packet2, 0,
sizeof(packet2));
4098 mavlink_msg_set_position_target_global_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
4099 mavlink_msg_set_position_target_global_int_decode(&msg, &packet2);
4100 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4102 memset(&packet2, 0,
sizeof(packet2));
4103 mavlink_msg_to_send_buffer(buffer, &msg);
4104 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4105 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4107 mavlink_msg_set_position_target_global_int_decode(last_msg, &packet2);
4108 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4110 memset(&packet2, 0,
sizeof(packet2));
4111 mavlink_msg_set_position_target_global_int_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.target_system , packet1.target_component , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
4112 mavlink_msg_set_position_target_global_int_decode(last_msg, &packet2);
4113 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4115#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4116 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SET_POSITION_TARGET_GLOBAL_INT") != NULL);
4117 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SET_POSITION_TARGET_GLOBAL_INT) != NULL);
4121static void mavlink_test_position_target_global_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4123#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4124 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4125 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT >= 256) {
4129 mavlink_message_t msg;
4130 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4132 mavlink_position_target_global_int_t packet_in = {
4133 963497464,963497672,963497880,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,19731,27
4135 mavlink_position_target_global_int_t packet1, packet2;
4136 memset(&packet1, 0,
sizeof(packet1));
4137 packet1.time_boot_ms = packet_in.time_boot_ms;
4138 packet1.lat_int = packet_in.lat_int;
4139 packet1.lon_int = packet_in.lon_int;
4140 packet1.alt = packet_in.alt;
4141 packet1.vx = packet_in.vx;
4142 packet1.vy = packet_in.vy;
4143 packet1.vz = packet_in.vz;
4144 packet1.afx = packet_in.afx;
4145 packet1.afy = packet_in.afy;
4146 packet1.afz = packet_in.afz;
4147 packet1.yaw = packet_in.yaw;
4148 packet1.yaw_rate = packet_in.yaw_rate;
4149 packet1.type_mask = packet_in.type_mask;
4150 packet1.coordinate_frame = packet_in.coordinate_frame;
4153#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4154 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4156 memset(MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT_MIN_LEN);
4159 memset(&packet2, 0,
sizeof(packet2));
4160 mavlink_msg_position_target_global_int_encode(system_id, component_id, &msg, &packet1);
4161 mavlink_msg_position_target_global_int_decode(&msg, &packet2);
4162 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4164 memset(&packet2, 0,
sizeof(packet2));
4165 mavlink_msg_position_target_global_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
4166 mavlink_msg_position_target_global_int_decode(&msg, &packet2);
4167 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4169 memset(&packet2, 0,
sizeof(packet2));
4170 mavlink_msg_position_target_global_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
4171 mavlink_msg_position_target_global_int_decode(&msg, &packet2);
4172 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4174 memset(&packet2, 0,
sizeof(packet2));
4175 mavlink_msg_to_send_buffer(buffer, &msg);
4176 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4177 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4179 mavlink_msg_position_target_global_int_decode(last_msg, &packet2);
4180 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4182 memset(&packet2, 0,
sizeof(packet2));
4183 mavlink_msg_position_target_global_int_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.coordinate_frame , packet1.type_mask , packet1.lat_int , packet1.lon_int , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.afx , packet1.afy , packet1.afz , packet1.yaw , packet1.yaw_rate );
4184 mavlink_msg_position_target_global_int_decode(last_msg, &packet2);
4185 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4187#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4188 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"POSITION_TARGET_GLOBAL_INT") != NULL);
4189 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_POSITION_TARGET_GLOBAL_INT) != NULL);
4193static void mavlink_test_local_position_ned_system_global_offset(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4195#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4196 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4197 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET >= 256) {
4201 mavlink_message_t msg;
4202 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4204 mavlink_local_position_ned_system_global_offset_t packet_in = {
4205 963497464,45.0,73.0,101.0,129.0,157.0,185.0
4207 mavlink_local_position_ned_system_global_offset_t packet1, packet2;
4208 memset(&packet1, 0,
sizeof(packet1));
4209 packet1.time_boot_ms = packet_in.time_boot_ms;
4210 packet1.x = packet_in.x;
4211 packet1.y = packet_in.y;
4212 packet1.z = packet_in.z;
4213 packet1.roll = packet_in.roll;
4214 packet1.pitch = packet_in.pitch;
4215 packet1.yaw = packet_in.yaw;
4218#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4219 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4221 memset(MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET_MIN_LEN);
4224 memset(&packet2, 0,
sizeof(packet2));
4225 mavlink_msg_local_position_ned_system_global_offset_encode(system_id, component_id, &msg, &packet1);
4226 mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2);
4227 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4229 memset(&packet2, 0,
sizeof(packet2));
4230 mavlink_msg_local_position_ned_system_global_offset_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
4231 mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2);
4232 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4234 memset(&packet2, 0,
sizeof(packet2));
4235 mavlink_msg_local_position_ned_system_global_offset_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
4236 mavlink_msg_local_position_ned_system_global_offset_decode(&msg, &packet2);
4237 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4239 memset(&packet2, 0,
sizeof(packet2));
4240 mavlink_msg_to_send_buffer(buffer, &msg);
4241 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4242 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4244 mavlink_msg_local_position_ned_system_global_offset_decode(last_msg, &packet2);
4245 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4247 memset(&packet2, 0,
sizeof(packet2));
4248 mavlink_msg_local_position_ned_system_global_offset_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw );
4249 mavlink_msg_local_position_ned_system_global_offset_decode(last_msg, &packet2);
4250 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4252#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4253 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET") != NULL);
4254 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOCAL_POSITION_NED_SYSTEM_GLOBAL_OFFSET) != NULL);
4258static void mavlink_test_hil_state(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4260#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4261 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4262 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_STATE >= 256) {
4266 mavlink_message_t msg;
4267 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4269 mavlink_hil_state_t packet_in = {
4270 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,963499128,963499336,963499544,19523,19627,19731,19835,19939,20043
4272 mavlink_hil_state_t packet1, packet2;
4273 memset(&packet1, 0,
sizeof(packet1));
4274 packet1.time_usec = packet_in.time_usec;
4275 packet1.roll = packet_in.roll;
4276 packet1.pitch = packet_in.pitch;
4277 packet1.yaw = packet_in.yaw;
4278 packet1.rollspeed = packet_in.rollspeed;
4279 packet1.pitchspeed = packet_in.pitchspeed;
4280 packet1.yawspeed = packet_in.yawspeed;
4281 packet1.lat = packet_in.lat;
4282 packet1.lon = packet_in.lon;
4283 packet1.alt = packet_in.alt;
4284 packet1.vx = packet_in.vx;
4285 packet1.vy = packet_in.vy;
4286 packet1.vz = packet_in.vz;
4287 packet1.xacc = packet_in.xacc;
4288 packet1.yacc = packet_in.yacc;
4289 packet1.zacc = packet_in.zacc;
4292#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4293 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4295 memset(MAVLINK_MSG_ID_HIL_STATE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_HIL_STATE_MIN_LEN);
4298 memset(&packet2, 0,
sizeof(packet2));
4299 mavlink_msg_hil_state_encode(system_id, component_id, &msg, &packet1);
4300 mavlink_msg_hil_state_decode(&msg, &packet2);
4301 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4303 memset(&packet2, 0,
sizeof(packet2));
4304 mavlink_msg_hil_state_pack(system_id, component_id, &msg , packet1.time_usec , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.xacc , packet1.yacc , packet1.zacc );
4305 mavlink_msg_hil_state_decode(&msg, &packet2);
4306 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4308 memset(&packet2, 0,
sizeof(packet2));
4309 mavlink_msg_hil_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.xacc , packet1.yacc , packet1.zacc );
4310 mavlink_msg_hil_state_decode(&msg, &packet2);
4311 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4313 memset(&packet2, 0,
sizeof(packet2));
4314 mavlink_msg_to_send_buffer(buffer, &msg);
4315 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4316 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4318 mavlink_msg_hil_state_decode(last_msg, &packet2);
4319 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4321 memset(&packet2, 0,
sizeof(packet2));
4322 mavlink_msg_hil_state_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.roll , packet1.pitch , packet1.yaw , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.xacc , packet1.yacc , packet1.zacc );
4323 mavlink_msg_hil_state_decode(last_msg, &packet2);
4324 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4326#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4327 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"HIL_STATE") != NULL);
4328 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HIL_STATE) != NULL);
4332static void mavlink_test_hil_controls(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4334#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4335 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4336 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_CONTROLS >= 256) {
4340 mavlink_message_t msg;
4341 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4343 mavlink_hil_controls_t packet_in = {
4344 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,125,192
4346 mavlink_hil_controls_t packet1, packet2;
4347 memset(&packet1, 0,
sizeof(packet1));
4348 packet1.time_usec = packet_in.time_usec;
4349 packet1.roll_ailerons = packet_in.roll_ailerons;
4350 packet1.pitch_elevator = packet_in.pitch_elevator;
4351 packet1.yaw_rudder = packet_in.yaw_rudder;
4352 packet1.throttle = packet_in.throttle;
4353 packet1.aux1 = packet_in.aux1;
4354 packet1.aux2 = packet_in.aux2;
4355 packet1.aux3 = packet_in.aux3;
4356 packet1.aux4 = packet_in.aux4;
4357 packet1.mode = packet_in.mode;
4358 packet1.nav_mode = packet_in.nav_mode;
4361#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4362 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4364 memset(MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_HIL_CONTROLS_MIN_LEN);
4367 memset(&packet2, 0,
sizeof(packet2));
4368 mavlink_msg_hil_controls_encode(system_id, component_id, &msg, &packet1);
4369 mavlink_msg_hil_controls_decode(&msg, &packet2);
4370 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4372 memset(&packet2, 0,
sizeof(packet2));
4373 mavlink_msg_hil_controls_pack(system_id, component_id, &msg , packet1.time_usec , packet1.roll_ailerons , packet1.pitch_elevator , packet1.yaw_rudder , packet1.throttle , packet1.aux1 , packet1.aux2 , packet1.aux3 , packet1.aux4 , packet1.mode , packet1.nav_mode );
4374 mavlink_msg_hil_controls_decode(&msg, &packet2);
4375 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4377 memset(&packet2, 0,
sizeof(packet2));
4378 mavlink_msg_hil_controls_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.roll_ailerons , packet1.pitch_elevator , packet1.yaw_rudder , packet1.throttle , packet1.aux1 , packet1.aux2 , packet1.aux3 , packet1.aux4 , packet1.mode , packet1.nav_mode );
4379 mavlink_msg_hil_controls_decode(&msg, &packet2);
4380 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4382 memset(&packet2, 0,
sizeof(packet2));
4383 mavlink_msg_to_send_buffer(buffer, &msg);
4384 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4385 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4387 mavlink_msg_hil_controls_decode(last_msg, &packet2);
4388 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4390 memset(&packet2, 0,
sizeof(packet2));
4391 mavlink_msg_hil_controls_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.roll_ailerons , packet1.pitch_elevator , packet1.yaw_rudder , packet1.throttle , packet1.aux1 , packet1.aux2 , packet1.aux3 , packet1.aux4 , packet1.mode , packet1.nav_mode );
4392 mavlink_msg_hil_controls_decode(last_msg, &packet2);
4393 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4395#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4396 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"HIL_CONTROLS") != NULL);
4397 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HIL_CONTROLS) != NULL);
4401static void mavlink_test_hil_rc_inputs_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4403#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4404 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4405 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW >= 256) {
4409 mavlink_message_t msg;
4410 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4412 mavlink_hil_rc_inputs_raw_t packet_in = {
4413 93372036854775807ULL,17651,17755,17859,17963,18067,18171,18275,18379,18483,18587,18691,18795,101
4415 mavlink_hil_rc_inputs_raw_t packet1, packet2;
4416 memset(&packet1, 0,
sizeof(packet1));
4417 packet1.time_usec = packet_in.time_usec;
4418 packet1.chan1_raw = packet_in.chan1_raw;
4419 packet1.chan2_raw = packet_in.chan2_raw;
4420 packet1.chan3_raw = packet_in.chan3_raw;
4421 packet1.chan4_raw = packet_in.chan4_raw;
4422 packet1.chan5_raw = packet_in.chan5_raw;
4423 packet1.chan6_raw = packet_in.chan6_raw;
4424 packet1.chan7_raw = packet_in.chan7_raw;
4425 packet1.chan8_raw = packet_in.chan8_raw;
4426 packet1.chan9_raw = packet_in.chan9_raw;
4427 packet1.chan10_raw = packet_in.chan10_raw;
4428 packet1.chan11_raw = packet_in.chan11_raw;
4429 packet1.chan12_raw = packet_in.chan12_raw;
4430 packet1.rssi = packet_in.rssi;
4433#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4434 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4436 memset(MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW_MIN_LEN);
4439 memset(&packet2, 0,
sizeof(packet2));
4440 mavlink_msg_hil_rc_inputs_raw_encode(system_id, component_id, &msg, &packet1);
4441 mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2);
4442 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4444 memset(&packet2, 0,
sizeof(packet2));
4445 mavlink_msg_hil_rc_inputs_raw_pack(system_id, component_id, &msg , packet1.time_usec , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.rssi );
4446 mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2);
4447 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4449 memset(&packet2, 0,
sizeof(packet2));
4450 mavlink_msg_hil_rc_inputs_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.rssi );
4451 mavlink_msg_hil_rc_inputs_raw_decode(&msg, &packet2);
4452 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4454 memset(&packet2, 0,
sizeof(packet2));
4455 mavlink_msg_to_send_buffer(buffer, &msg);
4456 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4457 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4459 mavlink_msg_hil_rc_inputs_raw_decode(last_msg, &packet2);
4460 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4462 memset(&packet2, 0,
sizeof(packet2));
4463 mavlink_msg_hil_rc_inputs_raw_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.chan1_raw , packet1.chan2_raw , packet1.chan3_raw , packet1.chan4_raw , packet1.chan5_raw , packet1.chan6_raw , packet1.chan7_raw , packet1.chan8_raw , packet1.chan9_raw , packet1.chan10_raw , packet1.chan11_raw , packet1.chan12_raw , packet1.rssi );
4464 mavlink_msg_hil_rc_inputs_raw_decode(last_msg, &packet2);
4465 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4467#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4468 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"HIL_RC_INPUTS_RAW") != NULL);
4469 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HIL_RC_INPUTS_RAW) != NULL);
4473static void mavlink_test_hil_actuator_controls(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4475#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4476 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4477 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS >= 256) {
4481 mavlink_message_t msg;
4482 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4484 mavlink_hil_actuator_controls_t packet_in = {
4485 93372036854775807ULL,93372036854776311ULL,{ 129.0, 130.0, 131.0, 132.0, 133.0, 134.0, 135.0, 136.0, 137.0, 138.0, 139.0, 140.0, 141.0, 142.0, 143.0, 144.0 },245
4487 mavlink_hil_actuator_controls_t packet1, packet2;
4488 memset(&packet1, 0,
sizeof(packet1));
4489 packet1.time_usec = packet_in.time_usec;
4490 packet1.flags = packet_in.flags;
4491 packet1.mode = packet_in.mode;
4493 mav_array_memcpy(packet1.controls, packet_in.controls,
sizeof(
float)*16);
4495#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4496 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4498 memset(MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS_MIN_LEN);
4501 memset(&packet2, 0,
sizeof(packet2));
4502 mavlink_msg_hil_actuator_controls_encode(system_id, component_id, &msg, &packet1);
4503 mavlink_msg_hil_actuator_controls_decode(&msg, &packet2);
4504 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4506 memset(&packet2, 0,
sizeof(packet2));
4507 mavlink_msg_hil_actuator_controls_pack(system_id, component_id, &msg , packet1.time_usec , packet1.controls , packet1.mode , packet1.flags );
4508 mavlink_msg_hil_actuator_controls_decode(&msg, &packet2);
4509 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4511 memset(&packet2, 0,
sizeof(packet2));
4512 mavlink_msg_hil_actuator_controls_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.controls , packet1.mode , packet1.flags );
4513 mavlink_msg_hil_actuator_controls_decode(&msg, &packet2);
4514 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4516 memset(&packet2, 0,
sizeof(packet2));
4517 mavlink_msg_to_send_buffer(buffer, &msg);
4518 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4519 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4521 mavlink_msg_hil_actuator_controls_decode(last_msg, &packet2);
4522 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4524 memset(&packet2, 0,
sizeof(packet2));
4525 mavlink_msg_hil_actuator_controls_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.controls , packet1.mode , packet1.flags );
4526 mavlink_msg_hil_actuator_controls_decode(last_msg, &packet2);
4527 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4529#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4530 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"HIL_ACTUATOR_CONTROLS") != NULL);
4531 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HIL_ACTUATOR_CONTROLS) != NULL);
4535static void mavlink_test_optical_flow(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4537#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4538 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4539 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPTICAL_FLOW >= 256) {
4543 mavlink_message_t msg;
4544 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4546 mavlink_optical_flow_t packet_in = {
4547 93372036854775807ULL,73.0,101.0,129.0,18275,18379,77,144,199.0,227.0
4549 mavlink_optical_flow_t packet1, packet2;
4550 memset(&packet1, 0,
sizeof(packet1));
4551 packet1.time_usec = packet_in.time_usec;
4552 packet1.flow_comp_m_x = packet_in.flow_comp_m_x;
4553 packet1.flow_comp_m_y = packet_in.flow_comp_m_y;
4554 packet1.ground_distance = packet_in.ground_distance;
4555 packet1.flow_x = packet_in.flow_x;
4556 packet1.flow_y = packet_in.flow_y;
4557 packet1.sensor_id = packet_in.sensor_id;
4558 packet1.quality = packet_in.quality;
4559 packet1.flow_rate_x = packet_in.flow_rate_x;
4560 packet1.flow_rate_y = packet_in.flow_rate_y;
4563#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4564 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4566 memset(MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_OPTICAL_FLOW_MIN_LEN);
4569 memset(&packet2, 0,
sizeof(packet2));
4570 mavlink_msg_optical_flow_encode(system_id, component_id, &msg, &packet1);
4571 mavlink_msg_optical_flow_decode(&msg, &packet2);
4572 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4574 memset(&packet2, 0,
sizeof(packet2));
4575 mavlink_msg_optical_flow_pack(system_id, component_id, &msg , packet1.time_usec , packet1.sensor_id , packet1.flow_x , packet1.flow_y , packet1.flow_comp_m_x , packet1.flow_comp_m_y , packet1.quality , packet1.ground_distance , packet1.flow_rate_x , packet1.flow_rate_y );
4576 mavlink_msg_optical_flow_decode(&msg, &packet2);
4577 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4579 memset(&packet2, 0,
sizeof(packet2));
4580 mavlink_msg_optical_flow_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.sensor_id , packet1.flow_x , packet1.flow_y , packet1.flow_comp_m_x , packet1.flow_comp_m_y , packet1.quality , packet1.ground_distance , packet1.flow_rate_x , packet1.flow_rate_y );
4581 mavlink_msg_optical_flow_decode(&msg, &packet2);
4582 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
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_optical_flow_decode(last_msg, &packet2);
4590 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4592 memset(&packet2, 0,
sizeof(packet2));
4593 mavlink_msg_optical_flow_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.sensor_id , packet1.flow_x , packet1.flow_y , packet1.flow_comp_m_x , packet1.flow_comp_m_y , packet1.quality , packet1.ground_distance , packet1.flow_rate_x , packet1.flow_rate_y );
4594 mavlink_msg_optical_flow_decode(last_msg, &packet2);
4595 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4597#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4598 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"OPTICAL_FLOW") != NULL);
4599 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OPTICAL_FLOW) != NULL);
4603static void mavlink_test_global_vision_position_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4605#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4606 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4607 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE >= 256) {
4611 mavlink_message_t msg;
4612 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4614 mavlink_global_vision_position_estimate_t packet_in = {
4615 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,{ 241.0, 242.0, 243.0, 244.0, 245.0, 246.0, 247.0, 248.0, 249.0, 250.0, 251.0, 252.0, 253.0, 254.0, 255.0, 256.0, 257.0, 258.0, 259.0, 260.0, 261.0 },97
4617 mavlink_global_vision_position_estimate_t packet1, packet2;
4618 memset(&packet1, 0,
sizeof(packet1));
4619 packet1.usec = packet_in.usec;
4620 packet1.x = packet_in.x;
4621 packet1.y = packet_in.y;
4622 packet1.z = packet_in.z;
4623 packet1.roll = packet_in.roll;
4624 packet1.pitch = packet_in.pitch;
4625 packet1.yaw = packet_in.yaw;
4626 packet1.reset_counter = packet_in.reset_counter;
4628 mav_array_memcpy(packet1.covariance, packet_in.covariance,
sizeof(
float)*21);
4630#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4631 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4633 memset(MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE_MIN_LEN);
4636 memset(&packet2, 0,
sizeof(packet2));
4637 mavlink_msg_global_vision_position_estimate_encode(system_id, component_id, &msg, &packet1);
4638 mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2);
4639 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4641 memset(&packet2, 0,
sizeof(packet2));
4642 mavlink_msg_global_vision_position_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw , packet1.covariance , packet1.reset_counter );
4643 mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2);
4644 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4646 memset(&packet2, 0,
sizeof(packet2));
4647 mavlink_msg_global_vision_position_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw , packet1.covariance , packet1.reset_counter );
4648 mavlink_msg_global_vision_position_estimate_decode(&msg, &packet2);
4649 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4651 memset(&packet2, 0,
sizeof(packet2));
4652 mavlink_msg_to_send_buffer(buffer, &msg);
4653 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4654 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4656 mavlink_msg_global_vision_position_estimate_decode(last_msg, &packet2);
4657 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4659 memset(&packet2, 0,
sizeof(packet2));
4660 mavlink_msg_global_vision_position_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw , packet1.covariance , packet1.reset_counter );
4661 mavlink_msg_global_vision_position_estimate_decode(last_msg, &packet2);
4662 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4664#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4665 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"GLOBAL_VISION_POSITION_ESTIMATE") != NULL);
4666 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GLOBAL_VISION_POSITION_ESTIMATE) != NULL);
4670static void mavlink_test_vision_position_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4672#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4673 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4674 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE >= 256) {
4678 mavlink_message_t msg;
4679 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4681 mavlink_vision_position_estimate_t packet_in = {
4682 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,{ 241.0, 242.0, 243.0, 244.0, 245.0, 246.0, 247.0, 248.0, 249.0, 250.0, 251.0, 252.0, 253.0, 254.0, 255.0, 256.0, 257.0, 258.0, 259.0, 260.0, 261.0 },97
4684 mavlink_vision_position_estimate_t packet1, packet2;
4685 memset(&packet1, 0,
sizeof(packet1));
4686 packet1.usec = packet_in.usec;
4687 packet1.x = packet_in.x;
4688 packet1.y = packet_in.y;
4689 packet1.z = packet_in.z;
4690 packet1.roll = packet_in.roll;
4691 packet1.pitch = packet_in.pitch;
4692 packet1.yaw = packet_in.yaw;
4693 packet1.reset_counter = packet_in.reset_counter;
4695 mav_array_memcpy(packet1.covariance, packet_in.covariance,
sizeof(
float)*21);
4697#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4698 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4700 memset(MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE_MIN_LEN);
4703 memset(&packet2, 0,
sizeof(packet2));
4704 mavlink_msg_vision_position_estimate_encode(system_id, component_id, &msg, &packet1);
4705 mavlink_msg_vision_position_estimate_decode(&msg, &packet2);
4706 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4708 memset(&packet2, 0,
sizeof(packet2));
4709 mavlink_msg_vision_position_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw , packet1.covariance , packet1.reset_counter );
4710 mavlink_msg_vision_position_estimate_decode(&msg, &packet2);
4711 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4713 memset(&packet2, 0,
sizeof(packet2));
4714 mavlink_msg_vision_position_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw , packet1.covariance , packet1.reset_counter );
4715 mavlink_msg_vision_position_estimate_decode(&msg, &packet2);
4716 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4718 memset(&packet2, 0,
sizeof(packet2));
4719 mavlink_msg_to_send_buffer(buffer, &msg);
4720 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4721 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4723 mavlink_msg_vision_position_estimate_decode(last_msg, &packet2);
4724 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4726 memset(&packet2, 0,
sizeof(packet2));
4727 mavlink_msg_vision_position_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw , packet1.covariance , packet1.reset_counter );
4728 mavlink_msg_vision_position_estimate_decode(last_msg, &packet2);
4729 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4731#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4732 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"VISION_POSITION_ESTIMATE") != NULL);
4733 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_VISION_POSITION_ESTIMATE) != NULL);
4737static void mavlink_test_vision_speed_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4739#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4740 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4741 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE >= 256) {
4745 mavlink_message_t msg;
4746 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4748 mavlink_vision_speed_estimate_t packet_in = {
4749 93372036854775807ULL,73.0,101.0,129.0,{ 157.0, 158.0, 159.0, 160.0, 161.0, 162.0, 163.0, 164.0, 165.0 },173
4751 mavlink_vision_speed_estimate_t packet1, packet2;
4752 memset(&packet1, 0,
sizeof(packet1));
4753 packet1.usec = packet_in.usec;
4754 packet1.x = packet_in.x;
4755 packet1.y = packet_in.y;
4756 packet1.z = packet_in.z;
4757 packet1.reset_counter = packet_in.reset_counter;
4759 mav_array_memcpy(packet1.covariance, packet_in.covariance,
sizeof(
float)*9);
4761#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4762 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4764 memset(MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE_MIN_LEN);
4767 memset(&packet2, 0,
sizeof(packet2));
4768 mavlink_msg_vision_speed_estimate_encode(system_id, component_id, &msg, &packet1);
4769 mavlink_msg_vision_speed_estimate_decode(&msg, &packet2);
4770 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4772 memset(&packet2, 0,
sizeof(packet2));
4773 mavlink_msg_vision_speed_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.covariance , packet1.reset_counter );
4774 mavlink_msg_vision_speed_estimate_decode(&msg, &packet2);
4775 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4777 memset(&packet2, 0,
sizeof(packet2));
4778 mavlink_msg_vision_speed_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.covariance , packet1.reset_counter );
4779 mavlink_msg_vision_speed_estimate_decode(&msg, &packet2);
4780 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4782 memset(&packet2, 0,
sizeof(packet2));
4783 mavlink_msg_to_send_buffer(buffer, &msg);
4784 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4785 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4787 mavlink_msg_vision_speed_estimate_decode(last_msg, &packet2);
4788 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4790 memset(&packet2, 0,
sizeof(packet2));
4791 mavlink_msg_vision_speed_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.covariance , packet1.reset_counter );
4792 mavlink_msg_vision_speed_estimate_decode(last_msg, &packet2);
4793 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4795#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4796 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"VISION_SPEED_ESTIMATE") != NULL);
4797 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_VISION_SPEED_ESTIMATE) != NULL);
4801static void mavlink_test_vicon_position_estimate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4803#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4804 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4805 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE >= 256) {
4809 mavlink_message_t msg;
4810 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4812 mavlink_vicon_position_estimate_t packet_in = {
4813 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,{ 241.0, 242.0, 243.0, 244.0, 245.0, 246.0, 247.0, 248.0, 249.0, 250.0, 251.0, 252.0, 253.0, 254.0, 255.0, 256.0, 257.0, 258.0, 259.0, 260.0, 261.0 }
4815 mavlink_vicon_position_estimate_t packet1, packet2;
4816 memset(&packet1, 0,
sizeof(packet1));
4817 packet1.usec = packet_in.usec;
4818 packet1.x = packet_in.x;
4819 packet1.y = packet_in.y;
4820 packet1.z = packet_in.z;
4821 packet1.roll = packet_in.roll;
4822 packet1.pitch = packet_in.pitch;
4823 packet1.yaw = packet_in.yaw;
4825 mav_array_memcpy(packet1.covariance, packet_in.covariance,
sizeof(
float)*21);
4827#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4828 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4830 memset(MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE_MIN_LEN);
4833 memset(&packet2, 0,
sizeof(packet2));
4834 mavlink_msg_vicon_position_estimate_encode(system_id, component_id, &msg, &packet1);
4835 mavlink_msg_vicon_position_estimate_decode(&msg, &packet2);
4836 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4838 memset(&packet2, 0,
sizeof(packet2));
4839 mavlink_msg_vicon_position_estimate_pack(system_id, component_id, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw , packet1.covariance );
4840 mavlink_msg_vicon_position_estimate_decode(&msg, &packet2);
4841 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4843 memset(&packet2, 0,
sizeof(packet2));
4844 mavlink_msg_vicon_position_estimate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw , packet1.covariance );
4845 mavlink_msg_vicon_position_estimate_decode(&msg, &packet2);
4846 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
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_vicon_position_estimate_decode(last_msg, &packet2);
4854 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4856 memset(&packet2, 0,
sizeof(packet2));
4857 mavlink_msg_vicon_position_estimate_send(MAVLINK_COMM_1 , packet1.usec , packet1.x , packet1.y , packet1.z , packet1.roll , packet1.pitch , packet1.yaw , packet1.covariance );
4858 mavlink_msg_vicon_position_estimate_decode(last_msg, &packet2);
4859 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4861#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4862 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"VICON_POSITION_ESTIMATE") != NULL);
4863 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_VICON_POSITION_ESTIMATE) != NULL);
4867static void mavlink_test_highres_imu(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4869#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4870 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4871 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIGHRES_IMU >= 256) {
4875 mavlink_message_t msg;
4876 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4878 mavlink_highres_imu_t packet_in = {
4879 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,409.0,20355,63
4881 mavlink_highres_imu_t packet1, packet2;
4882 memset(&packet1, 0,
sizeof(packet1));
4883 packet1.time_usec = packet_in.time_usec;
4884 packet1.xacc = packet_in.xacc;
4885 packet1.yacc = packet_in.yacc;
4886 packet1.zacc = packet_in.zacc;
4887 packet1.xgyro = packet_in.xgyro;
4888 packet1.ygyro = packet_in.ygyro;
4889 packet1.zgyro = packet_in.zgyro;
4890 packet1.xmag = packet_in.xmag;
4891 packet1.ymag = packet_in.ymag;
4892 packet1.zmag = packet_in.zmag;
4893 packet1.abs_pressure = packet_in.abs_pressure;
4894 packet1.diff_pressure = packet_in.diff_pressure;
4895 packet1.pressure_alt = packet_in.pressure_alt;
4896 packet1.temperature = packet_in.temperature;
4897 packet1.fields_updated = packet_in.fields_updated;
4898 packet1.id = packet_in.id;
4901#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4902 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4904 memset(MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_HIGHRES_IMU_MIN_LEN);
4907 memset(&packet2, 0,
sizeof(packet2));
4908 mavlink_msg_highres_imu_encode(system_id, component_id, &msg, &packet1);
4909 mavlink_msg_highres_imu_decode(&msg, &packet2);
4910 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4912 memset(&packet2, 0,
sizeof(packet2));
4913 mavlink_msg_highres_imu_pack(system_id, component_id, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated , packet1.id );
4914 mavlink_msg_highres_imu_decode(&msg, &packet2);
4915 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4917 memset(&packet2, 0,
sizeof(packet2));
4918 mavlink_msg_highres_imu_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated , packet1.id );
4919 mavlink_msg_highres_imu_decode(&msg, &packet2);
4920 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
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_highres_imu_decode(last_msg, &packet2);
4928 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4930 memset(&packet2, 0,
sizeof(packet2));
4931 mavlink_msg_highres_imu_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated , packet1.id );
4932 mavlink_msg_highres_imu_decode(last_msg, &packet2);
4933 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4935#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
4936 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"HIGHRES_IMU") != NULL);
4937 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HIGHRES_IMU) != NULL);
4941static void mavlink_test_optical_flow_rad(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
4943#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4944 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
4945 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPTICAL_FLOW_RAD >= 256) {
4949 mavlink_message_t msg;
4950 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
4952 mavlink_optical_flow_rad_t packet_in = {
4953 93372036854775807ULL,963497880,101.0,129.0,157.0,185.0,213.0,963499128,269.0,19315,3,70
4955 mavlink_optical_flow_rad_t packet1, packet2;
4956 memset(&packet1, 0,
sizeof(packet1));
4957 packet1.time_usec = packet_in.time_usec;
4958 packet1.integration_time_us = packet_in.integration_time_us;
4959 packet1.integrated_x = packet_in.integrated_x;
4960 packet1.integrated_y = packet_in.integrated_y;
4961 packet1.integrated_xgyro = packet_in.integrated_xgyro;
4962 packet1.integrated_ygyro = packet_in.integrated_ygyro;
4963 packet1.integrated_zgyro = packet_in.integrated_zgyro;
4964 packet1.time_delta_distance_us = packet_in.time_delta_distance_us;
4965 packet1.distance = packet_in.distance;
4966 packet1.temperature = packet_in.temperature;
4967 packet1.sensor_id = packet_in.sensor_id;
4968 packet1.quality = packet_in.quality;
4971#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
4972 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
4974 memset(MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_OPTICAL_FLOW_RAD_MIN_LEN);
4977 memset(&packet2, 0,
sizeof(packet2));
4978 mavlink_msg_optical_flow_rad_encode(system_id, component_id, &msg, &packet1);
4979 mavlink_msg_optical_flow_rad_decode(&msg, &packet2);
4980 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4982 memset(&packet2, 0,
sizeof(packet2));
4983 mavlink_msg_optical_flow_rad_pack(system_id, component_id, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
4984 mavlink_msg_optical_flow_rad_decode(&msg, &packet2);
4985 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4987 memset(&packet2, 0,
sizeof(packet2));
4988 mavlink_msg_optical_flow_rad_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
4989 mavlink_msg_optical_flow_rad_decode(&msg, &packet2);
4990 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
4992 memset(&packet2, 0,
sizeof(packet2));
4993 mavlink_msg_to_send_buffer(buffer, &msg);
4994 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
4995 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
4997 mavlink_msg_optical_flow_rad_decode(last_msg, &packet2);
4998 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5000 memset(&packet2, 0,
sizeof(packet2));
5001 mavlink_msg_optical_flow_rad_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
5002 mavlink_msg_optical_flow_rad_decode(last_msg, &packet2);
5003 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5005#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5006 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"OPTICAL_FLOW_RAD") != NULL);
5007 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OPTICAL_FLOW_RAD) != NULL);
5011static void mavlink_test_hil_sensor(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5013#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5014 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5015 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_SENSOR >= 256) {
5019 mavlink_message_t msg;
5020 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5022 mavlink_hil_sensor_t packet_in = {
5023 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,409.0,963500584,197
5025 mavlink_hil_sensor_t packet1, packet2;
5026 memset(&packet1, 0,
sizeof(packet1));
5027 packet1.time_usec = packet_in.time_usec;
5028 packet1.xacc = packet_in.xacc;
5029 packet1.yacc = packet_in.yacc;
5030 packet1.zacc = packet_in.zacc;
5031 packet1.xgyro = packet_in.xgyro;
5032 packet1.ygyro = packet_in.ygyro;
5033 packet1.zgyro = packet_in.zgyro;
5034 packet1.xmag = packet_in.xmag;
5035 packet1.ymag = packet_in.ymag;
5036 packet1.zmag = packet_in.zmag;
5037 packet1.abs_pressure = packet_in.abs_pressure;
5038 packet1.diff_pressure = packet_in.diff_pressure;
5039 packet1.pressure_alt = packet_in.pressure_alt;
5040 packet1.temperature = packet_in.temperature;
5041 packet1.fields_updated = packet_in.fields_updated;
5042 packet1.id = packet_in.id;
5045#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5046 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5048 memset(MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_HIL_SENSOR_MIN_LEN);
5051 memset(&packet2, 0,
sizeof(packet2));
5052 mavlink_msg_hil_sensor_encode(system_id, component_id, &msg, &packet1);
5053 mavlink_msg_hil_sensor_decode(&msg, &packet2);
5054 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5056 memset(&packet2, 0,
sizeof(packet2));
5057 mavlink_msg_hil_sensor_pack(system_id, component_id, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated , packet1.id );
5058 mavlink_msg_hil_sensor_decode(&msg, &packet2);
5059 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5061 memset(&packet2, 0,
sizeof(packet2));
5062 mavlink_msg_hil_sensor_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated , packet1.id );
5063 mavlink_msg_hil_sensor_decode(&msg, &packet2);
5064 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5066 memset(&packet2, 0,
sizeof(packet2));
5067 mavlink_msg_to_send_buffer(buffer, &msg);
5068 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5069 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5071 mavlink_msg_hil_sensor_decode(last_msg, &packet2);
5072 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5074 memset(&packet2, 0,
sizeof(packet2));
5075 mavlink_msg_hil_sensor_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated , packet1.id );
5076 mavlink_msg_hil_sensor_decode(last_msg, &packet2);
5077 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5079#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5080 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"HIL_SENSOR") != NULL);
5081 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HIL_SENSOR) != NULL);
5085static void mavlink_test_sim_state(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5087#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5088 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5089 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SIM_STATE >= 256) {
5093 mavlink_message_t msg;
5094 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5096 mavlink_sim_state_t packet_in = {
5097 17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,409.0,437.0,465.0,493.0,521.0,549.0,577.0,963501832,963502040
5099 mavlink_sim_state_t packet1, packet2;
5100 memset(&packet1, 0,
sizeof(packet1));
5101 packet1.q1 = packet_in.q1;
5102 packet1.q2 = packet_in.q2;
5103 packet1.q3 = packet_in.q3;
5104 packet1.q4 = packet_in.q4;
5105 packet1.roll = packet_in.roll;
5106 packet1.pitch = packet_in.pitch;
5107 packet1.yaw = packet_in.yaw;
5108 packet1.xacc = packet_in.xacc;
5109 packet1.yacc = packet_in.yacc;
5110 packet1.zacc = packet_in.zacc;
5111 packet1.xgyro = packet_in.xgyro;
5112 packet1.ygyro = packet_in.ygyro;
5113 packet1.zgyro = packet_in.zgyro;
5114 packet1.lat = packet_in.lat;
5115 packet1.lon = packet_in.lon;
5116 packet1.alt = packet_in.alt;
5117 packet1.std_dev_horz = packet_in.std_dev_horz;
5118 packet1.std_dev_vert = packet_in.std_dev_vert;
5119 packet1.vn = packet_in.vn;
5120 packet1.ve = packet_in.ve;
5121 packet1.vd = packet_in.vd;
5122 packet1.lat_int = packet_in.lat_int;
5123 packet1.lon_int = packet_in.lon_int;
5126#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5127 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5129 memset(MAVLINK_MSG_ID_SIM_STATE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SIM_STATE_MIN_LEN);
5132 memset(&packet2, 0,
sizeof(packet2));
5133 mavlink_msg_sim_state_encode(system_id, component_id, &msg, &packet1);
5134 mavlink_msg_sim_state_decode(&msg, &packet2);
5135 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5137 memset(&packet2, 0,
sizeof(packet2));
5138 mavlink_msg_sim_state_pack(system_id, component_id, &msg , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lon , packet1.alt , packet1.std_dev_horz , packet1.std_dev_vert , packet1.vn , packet1.ve , packet1.vd , packet1.lat_int , packet1.lon_int );
5139 mavlink_msg_sim_state_decode(&msg, &packet2);
5140 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5142 memset(&packet2, 0,
sizeof(packet2));
5143 mavlink_msg_sim_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lon , packet1.alt , packet1.std_dev_horz , packet1.std_dev_vert , packet1.vn , packet1.ve , packet1.vd , packet1.lat_int , packet1.lon_int );
5144 mavlink_msg_sim_state_decode(&msg, &packet2);
5145 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5147 memset(&packet2, 0,
sizeof(packet2));
5148 mavlink_msg_to_send_buffer(buffer, &msg);
5149 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5150 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5152 mavlink_msg_sim_state_decode(last_msg, &packet2);
5153 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5155 memset(&packet2, 0,
sizeof(packet2));
5156 mavlink_msg_sim_state_send(MAVLINK_COMM_1 , packet1.q1 , packet1.q2 , packet1.q3 , packet1.q4 , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lon , packet1.alt , packet1.std_dev_horz , packet1.std_dev_vert , packet1.vn , packet1.ve , packet1.vd , packet1.lat_int , packet1.lon_int );
5157 mavlink_msg_sim_state_decode(last_msg, &packet2);
5158 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5160#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5161 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SIM_STATE") != NULL);
5162 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SIM_STATE) != NULL);
5166static void mavlink_test_radio_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5168#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5169 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5170 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RADIO_STATUS >= 256) {
5174 mavlink_message_t msg;
5175 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5177 mavlink_radio_status_t packet_in = {
5178 17235,17339,17,84,151,218,29
5180 mavlink_radio_status_t packet1, packet2;
5181 memset(&packet1, 0,
sizeof(packet1));
5182 packet1.rxerrors = packet_in.rxerrors;
5183 packet1.fixed = packet_in.fixed;
5184 packet1.rssi = packet_in.rssi;
5185 packet1.remrssi = packet_in.remrssi;
5186 packet1.txbuf = packet_in.txbuf;
5187 packet1.noise = packet_in.noise;
5188 packet1.remnoise = packet_in.remnoise;
5191#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5192 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5194 memset(MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_RADIO_STATUS_MIN_LEN);
5197 memset(&packet2, 0,
sizeof(packet2));
5198 mavlink_msg_radio_status_encode(system_id, component_id, &msg, &packet1);
5199 mavlink_msg_radio_status_decode(&msg, &packet2);
5200 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5202 memset(&packet2, 0,
sizeof(packet2));
5203 mavlink_msg_radio_status_pack(system_id, component_id, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
5204 mavlink_msg_radio_status_decode(&msg, &packet2);
5205 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5207 memset(&packet2, 0,
sizeof(packet2));
5208 mavlink_msg_radio_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
5209 mavlink_msg_radio_status_decode(&msg, &packet2);
5210 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5212 memset(&packet2, 0,
sizeof(packet2));
5213 mavlink_msg_to_send_buffer(buffer, &msg);
5214 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5215 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5217 mavlink_msg_radio_status_decode(last_msg, &packet2);
5218 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5220 memset(&packet2, 0,
sizeof(packet2));
5221 mavlink_msg_radio_status_send(MAVLINK_COMM_1 , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
5222 mavlink_msg_radio_status_decode(last_msg, &packet2);
5223 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5225#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5226 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"RADIO_STATUS") != NULL);
5227 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_RADIO_STATUS) != NULL);
5231static void mavlink_test_file_transfer_protocol(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_FILE_TRANSFER_PROTOCOL >= 256) {
5239 mavlink_message_t msg;
5240 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5242 mavlink_file_transfer_protocol_t packet_in = {
5243 5,72,139,{ 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200 }
5245 mavlink_file_transfer_protocol_t packet1, packet2;
5246 memset(&packet1, 0,
sizeof(packet1));
5247 packet1.target_network = packet_in.target_network;
5248 packet1.target_system = packet_in.target_system;
5249 packet1.target_component = packet_in.target_component;
5251 mav_array_memcpy(packet1.payload, packet_in.payload,
sizeof(uint8_t)*251);
5253#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5254 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5256 memset(MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL_MIN_LEN);
5259 memset(&packet2, 0,
sizeof(packet2));
5260 mavlink_msg_file_transfer_protocol_encode(system_id, component_id, &msg, &packet1);
5261 mavlink_msg_file_transfer_protocol_decode(&msg, &packet2);
5262 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5264 memset(&packet2, 0,
sizeof(packet2));
5265 mavlink_msg_file_transfer_protocol_pack(system_id, component_id, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.payload );
5266 mavlink_msg_file_transfer_protocol_decode(&msg, &packet2);
5267 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5269 memset(&packet2, 0,
sizeof(packet2));
5270 mavlink_msg_file_transfer_protocol_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.payload );
5271 mavlink_msg_file_transfer_protocol_decode(&msg, &packet2);
5272 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5274 memset(&packet2, 0,
sizeof(packet2));
5275 mavlink_msg_to_send_buffer(buffer, &msg);
5276 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5277 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5279 mavlink_msg_file_transfer_protocol_decode(last_msg, &packet2);
5280 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5282 memset(&packet2, 0,
sizeof(packet2));
5283 mavlink_msg_file_transfer_protocol_send(MAVLINK_COMM_1 , packet1.target_network , packet1.target_system , packet1.target_component , packet1.payload );
5284 mavlink_msg_file_transfer_protocol_decode(last_msg, &packet2);
5285 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5287#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5288 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"FILE_TRANSFER_PROTOCOL") != NULL);
5289 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL) != NULL);
5293static void mavlink_test_timesync(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5295#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5296 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5297 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TIMESYNC >= 256) {
5301 mavlink_message_t msg;
5302 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5304 mavlink_timesync_t packet_in = {
5305 93372036854775807LL,93372036854776311LL,53,120
5307 mavlink_timesync_t packet1, packet2;
5308 memset(&packet1, 0,
sizeof(packet1));
5309 packet1.tc1 = packet_in.tc1;
5310 packet1.ts1 = packet_in.ts1;
5311 packet1.target_system = packet_in.target_system;
5312 packet1.target_component = packet_in.target_component;
5315#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5316 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5318 memset(MAVLINK_MSG_ID_TIMESYNC_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_TIMESYNC_MIN_LEN);
5321 memset(&packet2, 0,
sizeof(packet2));
5322 mavlink_msg_timesync_encode(system_id, component_id, &msg, &packet1);
5323 mavlink_msg_timesync_decode(&msg, &packet2);
5324 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5326 memset(&packet2, 0,
sizeof(packet2));
5327 mavlink_msg_timesync_pack(system_id, component_id, &msg , packet1.tc1 , packet1.ts1 , packet1.target_system , packet1.target_component );
5328 mavlink_msg_timesync_decode(&msg, &packet2);
5329 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5331 memset(&packet2, 0,
sizeof(packet2));
5332 mavlink_msg_timesync_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.tc1 , packet1.ts1 , packet1.target_system , packet1.target_component );
5333 mavlink_msg_timesync_decode(&msg, &packet2);
5334 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5336 memset(&packet2, 0,
sizeof(packet2));
5337 mavlink_msg_to_send_buffer(buffer, &msg);
5338 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5339 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5341 mavlink_msg_timesync_decode(last_msg, &packet2);
5342 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5344 memset(&packet2, 0,
sizeof(packet2));
5345 mavlink_msg_timesync_send(MAVLINK_COMM_1 , packet1.tc1 , packet1.ts1 , packet1.target_system , packet1.target_component );
5346 mavlink_msg_timesync_decode(last_msg, &packet2);
5347 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5349#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5350 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"TIMESYNC") != NULL);
5351 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_TIMESYNC) != NULL);
5355static void mavlink_test_camera_trigger(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5357#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5358 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5359 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_TRIGGER >= 256) {
5363 mavlink_message_t msg;
5364 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5366 mavlink_camera_trigger_t packet_in = {
5367 93372036854775807ULL,963497880
5369 mavlink_camera_trigger_t packet1, packet2;
5370 memset(&packet1, 0,
sizeof(packet1));
5371 packet1.time_usec = packet_in.time_usec;
5372 packet1.seq = packet_in.seq;
5375#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5376 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5378 memset(MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_TRIGGER_MIN_LEN);
5381 memset(&packet2, 0,
sizeof(packet2));
5382 mavlink_msg_camera_trigger_encode(system_id, component_id, &msg, &packet1);
5383 mavlink_msg_camera_trigger_decode(&msg, &packet2);
5384 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5386 memset(&packet2, 0,
sizeof(packet2));
5387 mavlink_msg_camera_trigger_pack(system_id, component_id, &msg , packet1.time_usec , packet1.seq );
5388 mavlink_msg_camera_trigger_decode(&msg, &packet2);
5389 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5391 memset(&packet2, 0,
sizeof(packet2));
5392 mavlink_msg_camera_trigger_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.seq );
5393 mavlink_msg_camera_trigger_decode(&msg, &packet2);
5394 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5396 memset(&packet2, 0,
sizeof(packet2));
5397 mavlink_msg_to_send_buffer(buffer, &msg);
5398 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5399 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5401 mavlink_msg_camera_trigger_decode(last_msg, &packet2);
5402 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5404 memset(&packet2, 0,
sizeof(packet2));
5405 mavlink_msg_camera_trigger_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.seq );
5406 mavlink_msg_camera_trigger_decode(last_msg, &packet2);
5407 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5409#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5410 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"CAMERA_TRIGGER") != NULL);
5411 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CAMERA_TRIGGER) != NULL);
5415static void mavlink_test_hil_gps(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5417#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5418 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5419 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_GPS >= 256) {
5423 mavlink_message_t msg;
5424 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5426 mavlink_hil_gps_t packet_in = {
5427 93372036854775807ULL,963497880,963498088,963498296,18275,18379,18483,18587,18691,18795,18899,235,46,113,19159
5429 mavlink_hil_gps_t packet1, packet2;
5430 memset(&packet1, 0,
sizeof(packet1));
5431 packet1.time_usec = packet_in.time_usec;
5432 packet1.lat = packet_in.lat;
5433 packet1.lon = packet_in.lon;
5434 packet1.alt = packet_in.alt;
5435 packet1.eph = packet_in.eph;
5436 packet1.epv = packet_in.epv;
5437 packet1.vel = packet_in.vel;
5438 packet1.vn = packet_in.vn;
5439 packet1.ve = packet_in.ve;
5440 packet1.vd = packet_in.vd;
5441 packet1.cog = packet_in.cog;
5442 packet1.fix_type = packet_in.fix_type;
5443 packet1.satellites_visible = packet_in.satellites_visible;
5444 packet1.id = packet_in.id;
5445 packet1.yaw = packet_in.yaw;
5448#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5449 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5451 memset(MAVLINK_MSG_ID_HIL_GPS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_HIL_GPS_MIN_LEN);
5454 memset(&packet2, 0,
sizeof(packet2));
5455 mavlink_msg_hil_gps_encode(system_id, component_id, &msg, &packet1);
5456 mavlink_msg_hil_gps_decode(&msg, &packet2);
5457 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5459 memset(&packet2, 0,
sizeof(packet2));
5460 mavlink_msg_hil_gps_pack(system_id, component_id, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.vn , packet1.ve , packet1.vd , packet1.cog , packet1.satellites_visible , packet1.id , packet1.yaw );
5461 mavlink_msg_hil_gps_decode(&msg, &packet2);
5462 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5464 memset(&packet2, 0,
sizeof(packet2));
5465 mavlink_msg_hil_gps_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.vn , packet1.ve , packet1.vd , packet1.cog , packet1.satellites_visible , packet1.id , packet1.yaw );
5466 mavlink_msg_hil_gps_decode(&msg, &packet2);
5467 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5469 memset(&packet2, 0,
sizeof(packet2));
5470 mavlink_msg_to_send_buffer(buffer, &msg);
5471 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5472 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5474 mavlink_msg_hil_gps_decode(last_msg, &packet2);
5475 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5477 memset(&packet2, 0,
sizeof(packet2));
5478 mavlink_msg_hil_gps_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.vn , packet1.ve , packet1.vd , packet1.cog , packet1.satellites_visible , packet1.id , packet1.yaw );
5479 mavlink_msg_hil_gps_decode(last_msg, &packet2);
5480 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5482#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5483 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"HIL_GPS") != NULL);
5484 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HIL_GPS) != NULL);
5488static void mavlink_test_hil_optical_flow(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5490#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5491 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5492 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_OPTICAL_FLOW >= 256) {
5496 mavlink_message_t msg;
5497 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5499 mavlink_hil_optical_flow_t packet_in = {
5500 93372036854775807ULL,963497880,101.0,129.0,157.0,185.0,213.0,963499128,269.0,19315,3,70
5502 mavlink_hil_optical_flow_t packet1, packet2;
5503 memset(&packet1, 0,
sizeof(packet1));
5504 packet1.time_usec = packet_in.time_usec;
5505 packet1.integration_time_us = packet_in.integration_time_us;
5506 packet1.integrated_x = packet_in.integrated_x;
5507 packet1.integrated_y = packet_in.integrated_y;
5508 packet1.integrated_xgyro = packet_in.integrated_xgyro;
5509 packet1.integrated_ygyro = packet_in.integrated_ygyro;
5510 packet1.integrated_zgyro = packet_in.integrated_zgyro;
5511 packet1.time_delta_distance_us = packet_in.time_delta_distance_us;
5512 packet1.distance = packet_in.distance;
5513 packet1.temperature = packet_in.temperature;
5514 packet1.sensor_id = packet_in.sensor_id;
5515 packet1.quality = packet_in.quality;
5518#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5519 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5521 memset(MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_HIL_OPTICAL_FLOW_MIN_LEN);
5524 memset(&packet2, 0,
sizeof(packet2));
5525 mavlink_msg_hil_optical_flow_encode(system_id, component_id, &msg, &packet1);
5526 mavlink_msg_hil_optical_flow_decode(&msg, &packet2);
5527 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5529 memset(&packet2, 0,
sizeof(packet2));
5530 mavlink_msg_hil_optical_flow_pack(system_id, component_id, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
5531 mavlink_msg_hil_optical_flow_decode(&msg, &packet2);
5532 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5534 memset(&packet2, 0,
sizeof(packet2));
5535 mavlink_msg_hil_optical_flow_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
5536 mavlink_msg_hil_optical_flow_decode(&msg, &packet2);
5537 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5539 memset(&packet2, 0,
sizeof(packet2));
5540 mavlink_msg_to_send_buffer(buffer, &msg);
5541 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5542 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5544 mavlink_msg_hil_optical_flow_decode(last_msg, &packet2);
5545 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5547 memset(&packet2, 0,
sizeof(packet2));
5548 mavlink_msg_hil_optical_flow_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.sensor_id , packet1.integration_time_us , packet1.integrated_x , packet1.integrated_y , packet1.integrated_xgyro , packet1.integrated_ygyro , packet1.integrated_zgyro , packet1.temperature , packet1.quality , packet1.time_delta_distance_us , packet1.distance );
5549 mavlink_msg_hil_optical_flow_decode(last_msg, &packet2);
5550 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5552#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5553 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"HIL_OPTICAL_FLOW") != NULL);
5554 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HIL_OPTICAL_FLOW) != NULL);
5558static void mavlink_test_hil_state_quaternion(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5560#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5561 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5562 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIL_STATE_QUATERNION >= 256) {
5566 mavlink_message_t msg;
5567 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5569 mavlink_hil_state_quaternion_t packet_in = {
5570 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0 },185.0,213.0,241.0,963499336,963499544,963499752,19731,19835,19939,20043,20147,20251,20355,20459
5572 mavlink_hil_state_quaternion_t packet1, packet2;
5573 memset(&packet1, 0,
sizeof(packet1));
5574 packet1.time_usec = packet_in.time_usec;
5575 packet1.rollspeed = packet_in.rollspeed;
5576 packet1.pitchspeed = packet_in.pitchspeed;
5577 packet1.yawspeed = packet_in.yawspeed;
5578 packet1.lat = packet_in.lat;
5579 packet1.lon = packet_in.lon;
5580 packet1.alt = packet_in.alt;
5581 packet1.vx = packet_in.vx;
5582 packet1.vy = packet_in.vy;
5583 packet1.vz = packet_in.vz;
5584 packet1.ind_airspeed = packet_in.ind_airspeed;
5585 packet1.true_airspeed = packet_in.true_airspeed;
5586 packet1.xacc = packet_in.xacc;
5587 packet1.yacc = packet_in.yacc;
5588 packet1.zacc = packet_in.zacc;
5590 mav_array_memcpy(packet1.attitude_quaternion, packet_in.attitude_quaternion,
sizeof(
float)*4);
5592#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5593 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5595 memset(MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_HIL_STATE_QUATERNION_MIN_LEN);
5598 memset(&packet2, 0,
sizeof(packet2));
5599 mavlink_msg_hil_state_quaternion_encode(system_id, component_id, &msg, &packet1);
5600 mavlink_msg_hil_state_quaternion_decode(&msg, &packet2);
5601 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5603 memset(&packet2, 0,
sizeof(packet2));
5604 mavlink_msg_hil_state_quaternion_pack(system_id, component_id, &msg , packet1.time_usec , packet1.attitude_quaternion , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.ind_airspeed , packet1.true_airspeed , packet1.xacc , packet1.yacc , packet1.zacc );
5605 mavlink_msg_hil_state_quaternion_decode(&msg, &packet2);
5606 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5608 memset(&packet2, 0,
sizeof(packet2));
5609 mavlink_msg_hil_state_quaternion_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.attitude_quaternion , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.ind_airspeed , packet1.true_airspeed , packet1.xacc , packet1.yacc , packet1.zacc );
5610 mavlink_msg_hil_state_quaternion_decode(&msg, &packet2);
5611 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5613 memset(&packet2, 0,
sizeof(packet2));
5614 mavlink_msg_to_send_buffer(buffer, &msg);
5615 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5616 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5618 mavlink_msg_hil_state_quaternion_decode(last_msg, &packet2);
5619 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5621 memset(&packet2, 0,
sizeof(packet2));
5622 mavlink_msg_hil_state_quaternion_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.attitude_quaternion , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.lat , packet1.lon , packet1.alt , packet1.vx , packet1.vy , packet1.vz , packet1.ind_airspeed , packet1.true_airspeed , packet1.xacc , packet1.yacc , packet1.zacc );
5623 mavlink_msg_hil_state_quaternion_decode(last_msg, &packet2);
5624 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5626#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5627 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"HIL_STATE_QUATERNION") != NULL);
5628 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HIL_STATE_QUATERNION) != NULL);
5632static void mavlink_test_scaled_imu2(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5634#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5635 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5636 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_IMU2 >= 256) {
5640 mavlink_message_t msg;
5641 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5643 mavlink_scaled_imu2_t packet_in = {
5644 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275,18379
5646 mavlink_scaled_imu2_t packet1, packet2;
5647 memset(&packet1, 0,
sizeof(packet1));
5648 packet1.time_boot_ms = packet_in.time_boot_ms;
5649 packet1.xacc = packet_in.xacc;
5650 packet1.yacc = packet_in.yacc;
5651 packet1.zacc = packet_in.zacc;
5652 packet1.xgyro = packet_in.xgyro;
5653 packet1.ygyro = packet_in.ygyro;
5654 packet1.zgyro = packet_in.zgyro;
5655 packet1.xmag = packet_in.xmag;
5656 packet1.ymag = packet_in.ymag;
5657 packet1.zmag = packet_in.zmag;
5658 packet1.temperature = packet_in.temperature;
5661#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5662 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5664 memset(MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SCALED_IMU2_MIN_LEN);
5667 memset(&packet2, 0,
sizeof(packet2));
5668 mavlink_msg_scaled_imu2_encode(system_id, component_id, &msg, &packet1);
5669 mavlink_msg_scaled_imu2_decode(&msg, &packet2);
5670 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5672 memset(&packet2, 0,
sizeof(packet2));
5673 mavlink_msg_scaled_imu2_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.temperature );
5674 mavlink_msg_scaled_imu2_decode(&msg, &packet2);
5675 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5677 memset(&packet2, 0,
sizeof(packet2));
5678 mavlink_msg_scaled_imu2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.temperature );
5679 mavlink_msg_scaled_imu2_decode(&msg, &packet2);
5680 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5682 memset(&packet2, 0,
sizeof(packet2));
5683 mavlink_msg_to_send_buffer(buffer, &msg);
5684 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5685 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5687 mavlink_msg_scaled_imu2_decode(last_msg, &packet2);
5688 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5690 memset(&packet2, 0,
sizeof(packet2));
5691 mavlink_msg_scaled_imu2_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.temperature );
5692 mavlink_msg_scaled_imu2_decode(last_msg, &packet2);
5693 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5695#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5696 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SCALED_IMU2") != NULL);
5697 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SCALED_IMU2) != NULL);
5701static void mavlink_test_log_request_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5703#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5704 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5705 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_REQUEST_LIST >= 256) {
5709 mavlink_message_t msg;
5710 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5712 mavlink_log_request_list_t packet_in = {
5715 mavlink_log_request_list_t packet1, packet2;
5716 memset(&packet1, 0,
sizeof(packet1));
5717 packet1.start = packet_in.start;
5718 packet1.end = packet_in.end;
5719 packet1.target_system = packet_in.target_system;
5720 packet1.target_component = packet_in.target_component;
5723#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5724 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5726 memset(MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_LOG_REQUEST_LIST_MIN_LEN);
5729 memset(&packet2, 0,
sizeof(packet2));
5730 mavlink_msg_log_request_list_encode(system_id, component_id, &msg, &packet1);
5731 mavlink_msg_log_request_list_decode(&msg, &packet2);
5732 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5734 memset(&packet2, 0,
sizeof(packet2));
5735 mavlink_msg_log_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.start , packet1.end );
5736 mavlink_msg_log_request_list_decode(&msg, &packet2);
5737 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5739 memset(&packet2, 0,
sizeof(packet2));
5740 mavlink_msg_log_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.start , packet1.end );
5741 mavlink_msg_log_request_list_decode(&msg, &packet2);
5742 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5744 memset(&packet2, 0,
sizeof(packet2));
5745 mavlink_msg_to_send_buffer(buffer, &msg);
5746 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5747 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5749 mavlink_msg_log_request_list_decode(last_msg, &packet2);
5750 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5752 memset(&packet2, 0,
sizeof(packet2));
5753 mavlink_msg_log_request_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.start , packet1.end );
5754 mavlink_msg_log_request_list_decode(last_msg, &packet2);
5755 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5757#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5758 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"LOG_REQUEST_LIST") != NULL);
5759 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOG_REQUEST_LIST) != NULL);
5763static void mavlink_test_log_entry(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5765#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5766 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5767 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_ENTRY >= 256) {
5771 mavlink_message_t msg;
5772 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5774 mavlink_log_entry_t packet_in = {
5775 963497464,963497672,17651,17755,17859
5777 mavlink_log_entry_t packet1, packet2;
5778 memset(&packet1, 0,
sizeof(packet1));
5779 packet1.time_utc = packet_in.time_utc;
5780 packet1.size = packet_in.size;
5781 packet1.id = packet_in.id;
5782 packet1.num_logs = packet_in.num_logs;
5783 packet1.last_log_num = packet_in.last_log_num;
5786#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5787 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5789 memset(MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_LOG_ENTRY_MIN_LEN);
5792 memset(&packet2, 0,
sizeof(packet2));
5793 mavlink_msg_log_entry_encode(system_id, component_id, &msg, &packet1);
5794 mavlink_msg_log_entry_decode(&msg, &packet2);
5795 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5797 memset(&packet2, 0,
sizeof(packet2));
5798 mavlink_msg_log_entry_pack(system_id, component_id, &msg , packet1.id , packet1.num_logs , packet1.last_log_num , packet1.time_utc , packet1.size );
5799 mavlink_msg_log_entry_decode(&msg, &packet2);
5800 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5802 memset(&packet2, 0,
sizeof(packet2));
5803 mavlink_msg_log_entry_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.num_logs , packet1.last_log_num , packet1.time_utc , packet1.size );
5804 mavlink_msg_log_entry_decode(&msg, &packet2);
5805 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5807 memset(&packet2, 0,
sizeof(packet2));
5808 mavlink_msg_to_send_buffer(buffer, &msg);
5809 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5810 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5812 mavlink_msg_log_entry_decode(last_msg, &packet2);
5813 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5815 memset(&packet2, 0,
sizeof(packet2));
5816 mavlink_msg_log_entry_send(MAVLINK_COMM_1 , packet1.id , packet1.num_logs , packet1.last_log_num , packet1.time_utc , packet1.size );
5817 mavlink_msg_log_entry_decode(last_msg, &packet2);
5818 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5820#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5821 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"LOG_ENTRY") != NULL);
5822 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOG_ENTRY) != NULL);
5826static void mavlink_test_log_request_data(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_LOG_REQUEST_DATA >= 256) {
5834 mavlink_message_t msg;
5835 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5837 mavlink_log_request_data_t packet_in = {
5838 963497464,963497672,17651,163,230
5840 mavlink_log_request_data_t packet1, packet2;
5841 memset(&packet1, 0,
sizeof(packet1));
5842 packet1.ofs = packet_in.ofs;
5843 packet1.count = packet_in.count;
5844 packet1.id = packet_in.id;
5845 packet1.target_system = packet_in.target_system;
5846 packet1.target_component = packet_in.target_component;
5849#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5850 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5852 memset(MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_LOG_REQUEST_DATA_MIN_LEN);
5855 memset(&packet2, 0,
sizeof(packet2));
5856 mavlink_msg_log_request_data_encode(system_id, component_id, &msg, &packet1);
5857 mavlink_msg_log_request_data_decode(&msg, &packet2);
5858 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5860 memset(&packet2, 0,
sizeof(packet2));
5861 mavlink_msg_log_request_data_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id , packet1.ofs , packet1.count );
5862 mavlink_msg_log_request_data_decode(&msg, &packet2);
5863 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5865 memset(&packet2, 0,
sizeof(packet2));
5866 mavlink_msg_log_request_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.id , packet1.ofs , packet1.count );
5867 mavlink_msg_log_request_data_decode(&msg, &packet2);
5868 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5870 memset(&packet2, 0,
sizeof(packet2));
5871 mavlink_msg_to_send_buffer(buffer, &msg);
5872 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5873 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5875 mavlink_msg_log_request_data_decode(last_msg, &packet2);
5876 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5878 memset(&packet2, 0,
sizeof(packet2));
5879 mavlink_msg_log_request_data_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.id , packet1.ofs , packet1.count );
5880 mavlink_msg_log_request_data_decode(last_msg, &packet2);
5881 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5883#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5884 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"LOG_REQUEST_DATA") != NULL);
5885 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOG_REQUEST_DATA) != NULL);
5889static void mavlink_test_log_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5891#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5892 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5893 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_DATA >= 256) {
5897 mavlink_message_t msg;
5898 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5900 mavlink_log_data_t packet_in = {
5901 963497464,17443,151,{ 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 }
5903 mavlink_log_data_t packet1, packet2;
5904 memset(&packet1, 0,
sizeof(packet1));
5905 packet1.ofs = packet_in.ofs;
5906 packet1.id = packet_in.id;
5907 packet1.count = packet_in.count;
5909 mav_array_memcpy(packet1.data, packet_in.data,
sizeof(uint8_t)*90);
5911#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5912 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5914 memset(MAVLINK_MSG_ID_LOG_DATA_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_LOG_DATA_MIN_LEN);
5917 memset(&packet2, 0,
sizeof(packet2));
5918 mavlink_msg_log_data_encode(system_id, component_id, &msg, &packet1);
5919 mavlink_msg_log_data_decode(&msg, &packet2);
5920 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5922 memset(&packet2, 0,
sizeof(packet2));
5923 mavlink_msg_log_data_pack(system_id, component_id, &msg , packet1.id , packet1.ofs , packet1.count , packet1.data );
5924 mavlink_msg_log_data_decode(&msg, &packet2);
5925 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5927 memset(&packet2, 0,
sizeof(packet2));
5928 mavlink_msg_log_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.ofs , packet1.count , packet1.data );
5929 mavlink_msg_log_data_decode(&msg, &packet2);
5930 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5932 memset(&packet2, 0,
sizeof(packet2));
5933 mavlink_msg_to_send_buffer(buffer, &msg);
5934 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5935 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5937 mavlink_msg_log_data_decode(last_msg, &packet2);
5938 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5940 memset(&packet2, 0,
sizeof(packet2));
5941 mavlink_msg_log_data_send(MAVLINK_COMM_1 , packet1.id , packet1.ofs , packet1.count , packet1.data );
5942 mavlink_msg_log_data_decode(last_msg, &packet2);
5943 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5945#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
5946 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"LOG_DATA") != NULL);
5947 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOG_DATA) != NULL);
5951static void mavlink_test_log_erase(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
5953#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5954 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
5955 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_ERASE >= 256) {
5959 mavlink_message_t msg;
5960 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
5962 mavlink_log_erase_t packet_in = {
5965 mavlink_log_erase_t packet1, packet2;
5966 memset(&packet1, 0,
sizeof(packet1));
5967 packet1.target_system = packet_in.target_system;
5968 packet1.target_component = packet_in.target_component;
5971#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
5972 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
5974 memset(MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_LOG_ERASE_MIN_LEN);
5977 memset(&packet2, 0,
sizeof(packet2));
5978 mavlink_msg_log_erase_encode(system_id, component_id, &msg, &packet1);
5979 mavlink_msg_log_erase_decode(&msg, &packet2);
5980 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5982 memset(&packet2, 0,
sizeof(packet2));
5983 mavlink_msg_log_erase_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
5984 mavlink_msg_log_erase_decode(&msg, &packet2);
5985 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5987 memset(&packet2, 0,
sizeof(packet2));
5988 mavlink_msg_log_erase_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
5989 mavlink_msg_log_erase_decode(&msg, &packet2);
5990 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
5992 memset(&packet2, 0,
sizeof(packet2));
5993 mavlink_msg_to_send_buffer(buffer, &msg);
5994 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
5995 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
5997 mavlink_msg_log_erase_decode(last_msg, &packet2);
5998 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6000 memset(&packet2, 0,
sizeof(packet2));
6001 mavlink_msg_log_erase_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
6002 mavlink_msg_log_erase_decode(last_msg, &packet2);
6003 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6005#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6006 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"LOG_ERASE") != NULL);
6007 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOG_ERASE) != NULL);
6011static void mavlink_test_log_request_end(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6013#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6014 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6015 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOG_REQUEST_END >= 256) {
6019 mavlink_message_t msg;
6020 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6022 mavlink_log_request_end_t packet_in = {
6025 mavlink_log_request_end_t packet1, packet2;
6026 memset(&packet1, 0,
sizeof(packet1));
6027 packet1.target_system = packet_in.target_system;
6028 packet1.target_component = packet_in.target_component;
6031#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6032 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6034 memset(MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_LOG_REQUEST_END_MIN_LEN);
6037 memset(&packet2, 0,
sizeof(packet2));
6038 mavlink_msg_log_request_end_encode(system_id, component_id, &msg, &packet1);
6039 mavlink_msg_log_request_end_decode(&msg, &packet2);
6040 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6042 memset(&packet2, 0,
sizeof(packet2));
6043 mavlink_msg_log_request_end_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
6044 mavlink_msg_log_request_end_decode(&msg, &packet2);
6045 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6047 memset(&packet2, 0,
sizeof(packet2));
6048 mavlink_msg_log_request_end_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
6049 mavlink_msg_log_request_end_decode(&msg, &packet2);
6050 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6052 memset(&packet2, 0,
sizeof(packet2));
6053 mavlink_msg_to_send_buffer(buffer, &msg);
6054 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6055 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6057 mavlink_msg_log_request_end_decode(last_msg, &packet2);
6058 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6060 memset(&packet2, 0,
sizeof(packet2));
6061 mavlink_msg_log_request_end_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
6062 mavlink_msg_log_request_end_decode(last_msg, &packet2);
6063 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6065#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6066 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"LOG_REQUEST_END") != NULL);
6067 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOG_REQUEST_END) != NULL);
6071static void mavlink_test_gps_inject_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6073#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6074 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6075 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_INJECT_DATA >= 256) {
6079 mavlink_message_t msg;
6080 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6082 mavlink_gps_inject_data_t packet_in = {
6083 5,72,139,{ 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59 }
6085 mavlink_gps_inject_data_t packet1, packet2;
6086 memset(&packet1, 0,
sizeof(packet1));
6087 packet1.target_system = packet_in.target_system;
6088 packet1.target_component = packet_in.target_component;
6089 packet1.len = packet_in.len;
6091 mav_array_memcpy(packet1.data, packet_in.data,
sizeof(uint8_t)*110);
6093#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6094 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6096 memset(MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_GPS_INJECT_DATA_MIN_LEN);
6099 memset(&packet2, 0,
sizeof(packet2));
6100 mavlink_msg_gps_inject_data_encode(system_id, component_id, &msg, &packet1);
6101 mavlink_msg_gps_inject_data_decode(&msg, &packet2);
6102 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6104 memset(&packet2, 0,
sizeof(packet2));
6105 mavlink_msg_gps_inject_data_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.len , packet1.data );
6106 mavlink_msg_gps_inject_data_decode(&msg, &packet2);
6107 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6109 memset(&packet2, 0,
sizeof(packet2));
6110 mavlink_msg_gps_inject_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.len , packet1.data );
6111 mavlink_msg_gps_inject_data_decode(&msg, &packet2);
6112 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6114 memset(&packet2, 0,
sizeof(packet2));
6115 mavlink_msg_to_send_buffer(buffer, &msg);
6116 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6117 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6119 mavlink_msg_gps_inject_data_decode(last_msg, &packet2);
6120 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6122 memset(&packet2, 0,
sizeof(packet2));
6123 mavlink_msg_gps_inject_data_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.len , packet1.data );
6124 mavlink_msg_gps_inject_data_decode(last_msg, &packet2);
6125 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6127#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6128 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"GPS_INJECT_DATA") != NULL);
6129 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GPS_INJECT_DATA) != NULL);
6133static void mavlink_test_gps2_raw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6135#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6136 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6137 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS2_RAW >= 256) {
6141 mavlink_message_t msg;
6142 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6144 mavlink_gps2_raw_t packet_in = {
6145 93372036854775807ULL,963497880,963498088,963498296,963498504,18483,18587,18691,18795,101,168,235,19055,963499388,963499596,963499804,963500012,963500220
6147 mavlink_gps2_raw_t packet1, packet2;
6148 memset(&packet1, 0,
sizeof(packet1));
6149 packet1.time_usec = packet_in.time_usec;
6150 packet1.lat = packet_in.lat;
6151 packet1.lon = packet_in.lon;
6152 packet1.alt = packet_in.alt;
6153 packet1.dgps_age = packet_in.dgps_age;
6154 packet1.eph = packet_in.eph;
6155 packet1.epv = packet_in.epv;
6156 packet1.vel = packet_in.vel;
6157 packet1.cog = packet_in.cog;
6158 packet1.fix_type = packet_in.fix_type;
6159 packet1.satellites_visible = packet_in.satellites_visible;
6160 packet1.dgps_numch = packet_in.dgps_numch;
6161 packet1.yaw = packet_in.yaw;
6162 packet1.alt_ellipsoid = packet_in.alt_ellipsoid;
6163 packet1.h_acc = packet_in.h_acc;
6164 packet1.v_acc = packet_in.v_acc;
6165 packet1.vel_acc = packet_in.vel_acc;
6166 packet1.hdg_acc = packet_in.hdg_acc;
6169#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6170 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6172 memset(MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_GPS2_RAW_MIN_LEN);
6175 memset(&packet2, 0,
sizeof(packet2));
6176 mavlink_msg_gps2_raw_encode(system_id, component_id, &msg, &packet1);
6177 mavlink_msg_gps2_raw_decode(&msg, &packet2);
6178 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6180 memset(&packet2, 0,
sizeof(packet2));
6181 mavlink_msg_gps2_raw_pack(system_id, component_id, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible , packet1.dgps_numch , packet1.dgps_age , packet1.yaw , packet1.alt_ellipsoid , packet1.h_acc , packet1.v_acc , packet1.vel_acc , packet1.hdg_acc );
6182 mavlink_msg_gps2_raw_decode(&msg, &packet2);
6183 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6185 memset(&packet2, 0,
sizeof(packet2));
6186 mavlink_msg_gps2_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible , packet1.dgps_numch , packet1.dgps_age , packet1.yaw , packet1.alt_ellipsoid , packet1.h_acc , packet1.v_acc , packet1.vel_acc , packet1.hdg_acc );
6187 mavlink_msg_gps2_raw_decode(&msg, &packet2);
6188 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6190 memset(&packet2, 0,
sizeof(packet2));
6191 mavlink_msg_to_send_buffer(buffer, &msg);
6192 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6193 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6195 mavlink_msg_gps2_raw_decode(last_msg, &packet2);
6196 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6198 memset(&packet2, 0,
sizeof(packet2));
6199 mavlink_msg_gps2_raw_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.eph , packet1.epv , packet1.vel , packet1.cog , packet1.satellites_visible , packet1.dgps_numch , packet1.dgps_age , packet1.yaw , packet1.alt_ellipsoid , packet1.h_acc , packet1.v_acc , packet1.vel_acc , packet1.hdg_acc );
6200 mavlink_msg_gps2_raw_decode(last_msg, &packet2);
6201 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6203#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6204 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"GPS2_RAW") != NULL);
6205 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GPS2_RAW) != NULL);
6209static void mavlink_test_power_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6211#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6212 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6213 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_POWER_STATUS >= 256) {
6217 mavlink_message_t msg;
6218 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6220 mavlink_power_status_t packet_in = {
6223 mavlink_power_status_t packet1, packet2;
6224 memset(&packet1, 0,
sizeof(packet1));
6225 packet1.Vcc = packet_in.Vcc;
6226 packet1.Vservo = packet_in.Vservo;
6227 packet1.flags = packet_in.flags;
6230#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6231 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6233 memset(MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_POWER_STATUS_MIN_LEN);
6236 memset(&packet2, 0,
sizeof(packet2));
6237 mavlink_msg_power_status_encode(system_id, component_id, &msg, &packet1);
6238 mavlink_msg_power_status_decode(&msg, &packet2);
6239 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6241 memset(&packet2, 0,
sizeof(packet2));
6242 mavlink_msg_power_status_pack(system_id, component_id, &msg , packet1.Vcc , packet1.Vservo , packet1.flags );
6243 mavlink_msg_power_status_decode(&msg, &packet2);
6244 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6246 memset(&packet2, 0,
sizeof(packet2));
6247 mavlink_msg_power_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.Vcc , packet1.Vservo , packet1.flags );
6248 mavlink_msg_power_status_decode(&msg, &packet2);
6249 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6251 memset(&packet2, 0,
sizeof(packet2));
6252 mavlink_msg_to_send_buffer(buffer, &msg);
6253 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6254 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6256 mavlink_msg_power_status_decode(last_msg, &packet2);
6257 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6259 memset(&packet2, 0,
sizeof(packet2));
6260 mavlink_msg_power_status_send(MAVLINK_COMM_1 , packet1.Vcc , packet1.Vservo , packet1.flags );
6261 mavlink_msg_power_status_decode(last_msg, &packet2);
6262 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6264#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6265 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"POWER_STATUS") != NULL);
6266 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_POWER_STATUS) != NULL);
6270static void mavlink_test_serial_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6272#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6273 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6274 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SERIAL_CONTROL >= 256) {
6278 mavlink_message_t msg;
6279 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6281 mavlink_serial_control_t packet_in = {
6282 963497464,17443,151,218,29,{ 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165 },178,245
6284 mavlink_serial_control_t packet1, packet2;
6285 memset(&packet1, 0,
sizeof(packet1));
6286 packet1.baudrate = packet_in.baudrate;
6287 packet1.timeout = packet_in.timeout;
6288 packet1.device = packet_in.device;
6289 packet1.flags = packet_in.flags;
6290 packet1.count = packet_in.count;
6291 packet1.target_system = packet_in.target_system;
6292 packet1.target_component = packet_in.target_component;
6294 mav_array_memcpy(packet1.data, packet_in.data,
sizeof(uint8_t)*70);
6296#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6297 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6299 memset(MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SERIAL_CONTROL_MIN_LEN);
6302 memset(&packet2, 0,
sizeof(packet2));
6303 mavlink_msg_serial_control_encode(system_id, component_id, &msg, &packet1);
6304 mavlink_msg_serial_control_decode(&msg, &packet2);
6305 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6307 memset(&packet2, 0,
sizeof(packet2));
6308 mavlink_msg_serial_control_pack(system_id, component_id, &msg , packet1.device , packet1.flags , packet1.timeout , packet1.baudrate , packet1.count , packet1.data , packet1.target_system , packet1.target_component );
6309 mavlink_msg_serial_control_decode(&msg, &packet2);
6310 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6312 memset(&packet2, 0,
sizeof(packet2));
6313 mavlink_msg_serial_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.device , packet1.flags , packet1.timeout , packet1.baudrate , packet1.count , packet1.data , packet1.target_system , packet1.target_component );
6314 mavlink_msg_serial_control_decode(&msg, &packet2);
6315 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6317 memset(&packet2, 0,
sizeof(packet2));
6318 mavlink_msg_to_send_buffer(buffer, &msg);
6319 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6320 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6322 mavlink_msg_serial_control_decode(last_msg, &packet2);
6323 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6325 memset(&packet2, 0,
sizeof(packet2));
6326 mavlink_msg_serial_control_send(MAVLINK_COMM_1 , packet1.device , packet1.flags , packet1.timeout , packet1.baudrate , packet1.count , packet1.data , packet1.target_system , packet1.target_component );
6327 mavlink_msg_serial_control_decode(last_msg, &packet2);
6328 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6330#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6331 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SERIAL_CONTROL") != NULL);
6332 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SERIAL_CONTROL) != NULL);
6336static void mavlink_test_gps_rtk(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6338#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6339 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6340 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_RTK >= 256) {
6344 mavlink_message_t msg;
6345 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6347 mavlink_gps_rtk_t packet_in = {
6348 963497464,963497672,963497880,963498088,963498296,963498504,963498712,18691,223,34,101,168,235
6350 mavlink_gps_rtk_t packet1, packet2;
6351 memset(&packet1, 0,
sizeof(packet1));
6352 packet1.time_last_baseline_ms = packet_in.time_last_baseline_ms;
6353 packet1.tow = packet_in.tow;
6354 packet1.baseline_a_mm = packet_in.baseline_a_mm;
6355 packet1.baseline_b_mm = packet_in.baseline_b_mm;
6356 packet1.baseline_c_mm = packet_in.baseline_c_mm;
6357 packet1.accuracy = packet_in.accuracy;
6358 packet1.iar_num_hypotheses = packet_in.iar_num_hypotheses;
6359 packet1.wn = packet_in.wn;
6360 packet1.rtk_receiver_id = packet_in.rtk_receiver_id;
6361 packet1.rtk_health = packet_in.rtk_health;
6362 packet1.rtk_rate = packet_in.rtk_rate;
6363 packet1.nsats = packet_in.nsats;
6364 packet1.baseline_coords_type = packet_in.baseline_coords_type;
6367#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6368 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6370 memset(MAVLINK_MSG_ID_GPS_RTK_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_GPS_RTK_MIN_LEN);
6373 memset(&packet2, 0,
sizeof(packet2));
6374 mavlink_msg_gps_rtk_encode(system_id, component_id, &msg, &packet1);
6375 mavlink_msg_gps_rtk_decode(&msg, &packet2);
6376 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6378 memset(&packet2, 0,
sizeof(packet2));
6379 mavlink_msg_gps_rtk_pack(system_id, component_id, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
6380 mavlink_msg_gps_rtk_decode(&msg, &packet2);
6381 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6383 memset(&packet2, 0,
sizeof(packet2));
6384 mavlink_msg_gps_rtk_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
6385 mavlink_msg_gps_rtk_decode(&msg, &packet2);
6386 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6388 memset(&packet2, 0,
sizeof(packet2));
6389 mavlink_msg_to_send_buffer(buffer, &msg);
6390 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6391 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6393 mavlink_msg_gps_rtk_decode(last_msg, &packet2);
6394 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6396 memset(&packet2, 0,
sizeof(packet2));
6397 mavlink_msg_gps_rtk_send(MAVLINK_COMM_1 , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
6398 mavlink_msg_gps_rtk_decode(last_msg, &packet2);
6399 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6401#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6402 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"GPS_RTK") != NULL);
6403 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GPS_RTK) != NULL);
6407static void mavlink_test_gps2_rtk(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6409#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6410 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6411 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS2_RTK >= 256) {
6415 mavlink_message_t msg;
6416 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6418 mavlink_gps2_rtk_t packet_in = {
6419 963497464,963497672,963497880,963498088,963498296,963498504,963498712,18691,223,34,101,168,235
6421 mavlink_gps2_rtk_t packet1, packet2;
6422 memset(&packet1, 0,
sizeof(packet1));
6423 packet1.time_last_baseline_ms = packet_in.time_last_baseline_ms;
6424 packet1.tow = packet_in.tow;
6425 packet1.baseline_a_mm = packet_in.baseline_a_mm;
6426 packet1.baseline_b_mm = packet_in.baseline_b_mm;
6427 packet1.baseline_c_mm = packet_in.baseline_c_mm;
6428 packet1.accuracy = packet_in.accuracy;
6429 packet1.iar_num_hypotheses = packet_in.iar_num_hypotheses;
6430 packet1.wn = packet_in.wn;
6431 packet1.rtk_receiver_id = packet_in.rtk_receiver_id;
6432 packet1.rtk_health = packet_in.rtk_health;
6433 packet1.rtk_rate = packet_in.rtk_rate;
6434 packet1.nsats = packet_in.nsats;
6435 packet1.baseline_coords_type = packet_in.baseline_coords_type;
6438#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6439 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6441 memset(MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_GPS2_RTK_MIN_LEN);
6444 memset(&packet2, 0,
sizeof(packet2));
6445 mavlink_msg_gps2_rtk_encode(system_id, component_id, &msg, &packet1);
6446 mavlink_msg_gps2_rtk_decode(&msg, &packet2);
6447 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6449 memset(&packet2, 0,
sizeof(packet2));
6450 mavlink_msg_gps2_rtk_pack(system_id, component_id, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
6451 mavlink_msg_gps2_rtk_decode(&msg, &packet2);
6452 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6454 memset(&packet2, 0,
sizeof(packet2));
6455 mavlink_msg_gps2_rtk_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
6456 mavlink_msg_gps2_rtk_decode(&msg, &packet2);
6457 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6459 memset(&packet2, 0,
sizeof(packet2));
6460 mavlink_msg_to_send_buffer(buffer, &msg);
6461 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6462 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6464 mavlink_msg_gps2_rtk_decode(last_msg, &packet2);
6465 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6467 memset(&packet2, 0,
sizeof(packet2));
6468 mavlink_msg_gps2_rtk_send(MAVLINK_COMM_1 , packet1.time_last_baseline_ms , packet1.rtk_receiver_id , packet1.wn , packet1.tow , packet1.rtk_health , packet1.rtk_rate , packet1.nsats , packet1.baseline_coords_type , packet1.baseline_a_mm , packet1.baseline_b_mm , packet1.baseline_c_mm , packet1.accuracy , packet1.iar_num_hypotheses );
6469 mavlink_msg_gps2_rtk_decode(last_msg, &packet2);
6470 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6472#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6473 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"GPS2_RTK") != NULL);
6474 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GPS2_RTK) != NULL);
6478static void mavlink_test_scaled_imu3(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6480#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6481 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6482 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_IMU3 >= 256) {
6486 mavlink_message_t msg;
6487 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6489 mavlink_scaled_imu3_t packet_in = {
6490 963497464,17443,17547,17651,17755,17859,17963,18067,18171,18275,18379
6492 mavlink_scaled_imu3_t packet1, packet2;
6493 memset(&packet1, 0,
sizeof(packet1));
6494 packet1.time_boot_ms = packet_in.time_boot_ms;
6495 packet1.xacc = packet_in.xacc;
6496 packet1.yacc = packet_in.yacc;
6497 packet1.zacc = packet_in.zacc;
6498 packet1.xgyro = packet_in.xgyro;
6499 packet1.ygyro = packet_in.ygyro;
6500 packet1.zgyro = packet_in.zgyro;
6501 packet1.xmag = packet_in.xmag;
6502 packet1.ymag = packet_in.ymag;
6503 packet1.zmag = packet_in.zmag;
6504 packet1.temperature = packet_in.temperature;
6507#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6508 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6510 memset(MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SCALED_IMU3_MIN_LEN);
6513 memset(&packet2, 0,
sizeof(packet2));
6514 mavlink_msg_scaled_imu3_encode(system_id, component_id, &msg, &packet1);
6515 mavlink_msg_scaled_imu3_decode(&msg, &packet2);
6516 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6518 memset(&packet2, 0,
sizeof(packet2));
6519 mavlink_msg_scaled_imu3_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.temperature );
6520 mavlink_msg_scaled_imu3_decode(&msg, &packet2);
6521 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6523 memset(&packet2, 0,
sizeof(packet2));
6524 mavlink_msg_scaled_imu3_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.temperature );
6525 mavlink_msg_scaled_imu3_decode(&msg, &packet2);
6526 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6528 memset(&packet2, 0,
sizeof(packet2));
6529 mavlink_msg_to_send_buffer(buffer, &msg);
6530 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6531 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6533 mavlink_msg_scaled_imu3_decode(last_msg, &packet2);
6534 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6536 memset(&packet2, 0,
sizeof(packet2));
6537 mavlink_msg_scaled_imu3_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.temperature );
6538 mavlink_msg_scaled_imu3_decode(last_msg, &packet2);
6539 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6541#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6542 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SCALED_IMU3") != NULL);
6543 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SCALED_IMU3) != NULL);
6547static void mavlink_test_data_transmission_handshake(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6549#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6550 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6551 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE >= 256) {
6555 mavlink_message_t msg;
6556 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6558 mavlink_data_transmission_handshake_t packet_in = {
6559 963497464,17443,17547,17651,163,230,41
6561 mavlink_data_transmission_handshake_t packet1, packet2;
6562 memset(&packet1, 0,
sizeof(packet1));
6563 packet1.size = packet_in.size;
6564 packet1.width = packet_in.width;
6565 packet1.height = packet_in.height;
6566 packet1.packets = packet_in.packets;
6567 packet1.type = packet_in.type;
6568 packet1.payload = packet_in.payload;
6569 packet1.jpg_quality = packet_in.jpg_quality;
6572#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6573 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6575 memset(MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE_MIN_LEN);
6578 memset(&packet2, 0,
sizeof(packet2));
6579 mavlink_msg_data_transmission_handshake_encode(system_id, component_id, &msg, &packet1);
6580 mavlink_msg_data_transmission_handshake_decode(&msg, &packet2);
6581 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6583 memset(&packet2, 0,
sizeof(packet2));
6584 mavlink_msg_data_transmission_handshake_pack(system_id, component_id, &msg , packet1.type , packet1.size , packet1.width , packet1.height , packet1.packets , packet1.payload , packet1.jpg_quality );
6585 mavlink_msg_data_transmission_handshake_decode(&msg, &packet2);
6586 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6588 memset(&packet2, 0,
sizeof(packet2));
6589 mavlink_msg_data_transmission_handshake_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.size , packet1.width , packet1.height , packet1.packets , packet1.payload , packet1.jpg_quality );
6590 mavlink_msg_data_transmission_handshake_decode(&msg, &packet2);
6591 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6593 memset(&packet2, 0,
sizeof(packet2));
6594 mavlink_msg_to_send_buffer(buffer, &msg);
6595 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6596 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6598 mavlink_msg_data_transmission_handshake_decode(last_msg, &packet2);
6599 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6601 memset(&packet2, 0,
sizeof(packet2));
6602 mavlink_msg_data_transmission_handshake_send(MAVLINK_COMM_1 , packet1.type , packet1.size , packet1.width , packet1.height , packet1.packets , packet1.payload , packet1.jpg_quality );
6603 mavlink_msg_data_transmission_handshake_decode(last_msg, &packet2);
6604 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6606#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6607 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"DATA_TRANSMISSION_HANDSHAKE") != NULL);
6608 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_DATA_TRANSMISSION_HANDSHAKE) != NULL);
6612static void mavlink_test_encapsulated_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6614#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6615 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6616 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ENCAPSULATED_DATA >= 256) {
6620 mavlink_message_t msg;
6621 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6623 mavlink_encapsulated_data_t packet_in = {
6624 17235,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135 }
6626 mavlink_encapsulated_data_t packet1, packet2;
6627 memset(&packet1, 0,
sizeof(packet1));
6628 packet1.seqnr = packet_in.seqnr;
6630 mav_array_memcpy(packet1.data, packet_in.data,
sizeof(uint8_t)*253);
6632#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6633 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6635 memset(MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_ENCAPSULATED_DATA_MIN_LEN);
6638 memset(&packet2, 0,
sizeof(packet2));
6639 mavlink_msg_encapsulated_data_encode(system_id, component_id, &msg, &packet1);
6640 mavlink_msg_encapsulated_data_decode(&msg, &packet2);
6641 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6643 memset(&packet2, 0,
sizeof(packet2));
6644 mavlink_msg_encapsulated_data_pack(system_id, component_id, &msg , packet1.seqnr , packet1.data );
6645 mavlink_msg_encapsulated_data_decode(&msg, &packet2);
6646 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6648 memset(&packet2, 0,
sizeof(packet2));
6649 mavlink_msg_encapsulated_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seqnr , packet1.data );
6650 mavlink_msg_encapsulated_data_decode(&msg, &packet2);
6651 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6653 memset(&packet2, 0,
sizeof(packet2));
6654 mavlink_msg_to_send_buffer(buffer, &msg);
6655 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6656 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6658 mavlink_msg_encapsulated_data_decode(last_msg, &packet2);
6659 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6661 memset(&packet2, 0,
sizeof(packet2));
6662 mavlink_msg_encapsulated_data_send(MAVLINK_COMM_1 , packet1.seqnr , packet1.data );
6663 mavlink_msg_encapsulated_data_decode(last_msg, &packet2);
6664 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6666#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6667 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"ENCAPSULATED_DATA") != NULL);
6668 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ENCAPSULATED_DATA) != NULL);
6672static void mavlink_test_distance_sensor(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6674#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6675 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6676 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DISTANCE_SENSOR >= 256) {
6680 mavlink_message_t msg;
6681 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6683 mavlink_distance_sensor_t packet_in = {
6684 963497464,17443,17547,17651,163,230,41,108,115.0,143.0,{ 171.0, 172.0, 173.0, 174.0 },247
6686 mavlink_distance_sensor_t packet1, packet2;
6687 memset(&packet1, 0,
sizeof(packet1));
6688 packet1.time_boot_ms = packet_in.time_boot_ms;
6689 packet1.min_distance = packet_in.min_distance;
6690 packet1.max_distance = packet_in.max_distance;
6691 packet1.current_distance = packet_in.current_distance;
6692 packet1.type = packet_in.type;
6693 packet1.id = packet_in.id;
6694 packet1.orientation = packet_in.orientation;
6695 packet1.covariance = packet_in.covariance;
6696 packet1.horizontal_fov = packet_in.horizontal_fov;
6697 packet1.vertical_fov = packet_in.vertical_fov;
6698 packet1.signal_quality = packet_in.signal_quality;
6700 mav_array_memcpy(packet1.quaternion, packet_in.quaternion,
sizeof(
float)*4);
6702#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6703 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6705 memset(MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_DISTANCE_SENSOR_MIN_LEN);
6708 memset(&packet2, 0,
sizeof(packet2));
6709 mavlink_msg_distance_sensor_encode(system_id, component_id, &msg, &packet1);
6710 mavlink_msg_distance_sensor_decode(&msg, &packet2);
6711 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6713 memset(&packet2, 0,
sizeof(packet2));
6714 mavlink_msg_distance_sensor_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance , packet1.horizontal_fov , packet1.vertical_fov , packet1.quaternion , packet1.signal_quality );
6715 mavlink_msg_distance_sensor_decode(&msg, &packet2);
6716 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6718 memset(&packet2, 0,
sizeof(packet2));
6719 mavlink_msg_distance_sensor_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance , packet1.horizontal_fov , packet1.vertical_fov , packet1.quaternion , packet1.signal_quality );
6720 mavlink_msg_distance_sensor_decode(&msg, &packet2);
6721 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6723 memset(&packet2, 0,
sizeof(packet2));
6724 mavlink_msg_to_send_buffer(buffer, &msg);
6725 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6726 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6728 mavlink_msg_distance_sensor_decode(last_msg, &packet2);
6729 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6731 memset(&packet2, 0,
sizeof(packet2));
6732 mavlink_msg_distance_sensor_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.min_distance , packet1.max_distance , packet1.current_distance , packet1.type , packet1.id , packet1.orientation , packet1.covariance , packet1.horizontal_fov , packet1.vertical_fov , packet1.quaternion , packet1.signal_quality );
6733 mavlink_msg_distance_sensor_decode(last_msg, &packet2);
6734 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6736#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6737 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"DISTANCE_SENSOR") != NULL);
6738 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_DISTANCE_SENSOR) != NULL);
6742static void mavlink_test_terrain_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6744#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6745 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6746 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TERRAIN_REQUEST >= 256) {
6750 mavlink_message_t msg;
6751 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6753 mavlink_terrain_request_t packet_in = {
6754 93372036854775807ULL,963497880,963498088,18067
6756 mavlink_terrain_request_t packet1, packet2;
6757 memset(&packet1, 0,
sizeof(packet1));
6758 packet1.mask = packet_in.mask;
6759 packet1.lat = packet_in.lat;
6760 packet1.lon = packet_in.lon;
6761 packet1.grid_spacing = packet_in.grid_spacing;
6764#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6765 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6767 memset(MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_TERRAIN_REQUEST_MIN_LEN);
6770 memset(&packet2, 0,
sizeof(packet2));
6771 mavlink_msg_terrain_request_encode(system_id, component_id, &msg, &packet1);
6772 mavlink_msg_terrain_request_decode(&msg, &packet2);
6773 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6775 memset(&packet2, 0,
sizeof(packet2));
6776 mavlink_msg_terrain_request_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.mask );
6777 mavlink_msg_terrain_request_decode(&msg, &packet2);
6778 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6780 memset(&packet2, 0,
sizeof(packet2));
6781 mavlink_msg_terrain_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.mask );
6782 mavlink_msg_terrain_request_decode(&msg, &packet2);
6783 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6785 memset(&packet2, 0,
sizeof(packet2));
6786 mavlink_msg_to_send_buffer(buffer, &msg);
6787 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6788 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6790 mavlink_msg_terrain_request_decode(last_msg, &packet2);
6791 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6793 memset(&packet2, 0,
sizeof(packet2));
6794 mavlink_msg_terrain_request_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.mask );
6795 mavlink_msg_terrain_request_decode(last_msg, &packet2);
6796 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6798#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6799 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"TERRAIN_REQUEST") != NULL);
6800 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_TERRAIN_REQUEST) != NULL);
6804static void mavlink_test_terrain_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6806#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6807 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6808 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TERRAIN_DATA >= 256) {
6812 mavlink_message_t msg;
6813 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6815 mavlink_terrain_data_t packet_in = {
6816 963497464,963497672,17651,{ 17755, 17756, 17757, 17758, 17759, 17760, 17761, 17762, 17763, 17764, 17765, 17766, 17767, 17768, 17769, 17770 },3
6818 mavlink_terrain_data_t packet1, packet2;
6819 memset(&packet1, 0,
sizeof(packet1));
6820 packet1.lat = packet_in.lat;
6821 packet1.lon = packet_in.lon;
6822 packet1.grid_spacing = packet_in.grid_spacing;
6823 packet1.gridbit = packet_in.gridbit;
6825 mav_array_memcpy(packet1.data, packet_in.data,
sizeof(int16_t)*16);
6827#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6828 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6830 memset(MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_TERRAIN_DATA_MIN_LEN);
6833 memset(&packet2, 0,
sizeof(packet2));
6834 mavlink_msg_terrain_data_encode(system_id, component_id, &msg, &packet1);
6835 mavlink_msg_terrain_data_decode(&msg, &packet2);
6836 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6838 memset(&packet2, 0,
sizeof(packet2));
6839 mavlink_msg_terrain_data_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.gridbit , packet1.data );
6840 mavlink_msg_terrain_data_decode(&msg, &packet2);
6841 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6843 memset(&packet2, 0,
sizeof(packet2));
6844 mavlink_msg_terrain_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.gridbit , packet1.data );
6845 mavlink_msg_terrain_data_decode(&msg, &packet2);
6846 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6848 memset(&packet2, 0,
sizeof(packet2));
6849 mavlink_msg_to_send_buffer(buffer, &msg);
6850 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6851 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6853 mavlink_msg_terrain_data_decode(last_msg, &packet2);
6854 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6856 memset(&packet2, 0,
sizeof(packet2));
6857 mavlink_msg_terrain_data_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon , packet1.grid_spacing , packet1.gridbit , packet1.data );
6858 mavlink_msg_terrain_data_decode(last_msg, &packet2);
6859 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6861#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6862 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"TERRAIN_DATA") != NULL);
6863 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_TERRAIN_DATA) != NULL);
6867static void mavlink_test_terrain_check(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6869#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6870 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6871 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TERRAIN_CHECK >= 256) {
6875 mavlink_message_t msg;
6876 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6878 mavlink_terrain_check_t packet_in = {
6881 mavlink_terrain_check_t packet1, packet2;
6882 memset(&packet1, 0,
sizeof(packet1));
6883 packet1.lat = packet_in.lat;
6884 packet1.lon = packet_in.lon;
6887#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6888 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6890 memset(MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_TERRAIN_CHECK_MIN_LEN);
6893 memset(&packet2, 0,
sizeof(packet2));
6894 mavlink_msg_terrain_check_encode(system_id, component_id, &msg, &packet1);
6895 mavlink_msg_terrain_check_decode(&msg, &packet2);
6896 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6898 memset(&packet2, 0,
sizeof(packet2));
6899 mavlink_msg_terrain_check_pack(system_id, component_id, &msg , packet1.lat , packet1.lon );
6900 mavlink_msg_terrain_check_decode(&msg, &packet2);
6901 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6903 memset(&packet2, 0,
sizeof(packet2));
6904 mavlink_msg_terrain_check_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon );
6905 mavlink_msg_terrain_check_decode(&msg, &packet2);
6906 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6908 memset(&packet2, 0,
sizeof(packet2));
6909 mavlink_msg_to_send_buffer(buffer, &msg);
6910 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6911 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6913 mavlink_msg_terrain_check_decode(last_msg, &packet2);
6914 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6916 memset(&packet2, 0,
sizeof(packet2));
6917 mavlink_msg_terrain_check_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon );
6918 mavlink_msg_terrain_check_decode(last_msg, &packet2);
6919 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6921#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6922 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"TERRAIN_CHECK") != NULL);
6923 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_TERRAIN_CHECK) != NULL);
6927static void mavlink_test_terrain_report(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6929#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6930 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6931 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TERRAIN_REPORT >= 256) {
6935 mavlink_message_t msg;
6936 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
6938 mavlink_terrain_report_t packet_in = {
6939 963497464,963497672,73.0,101.0,18067,18171,18275
6941 mavlink_terrain_report_t packet1, packet2;
6942 memset(&packet1, 0,
sizeof(packet1));
6943 packet1.lat = packet_in.lat;
6944 packet1.lon = packet_in.lon;
6945 packet1.terrain_height = packet_in.terrain_height;
6946 packet1.current_height = packet_in.current_height;
6947 packet1.spacing = packet_in.spacing;
6948 packet1.pending = packet_in.pending;
6949 packet1.loaded = packet_in.loaded;
6952#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6953 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
6955 memset(MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_TERRAIN_REPORT_MIN_LEN);
6958 memset(&packet2, 0,
sizeof(packet2));
6959 mavlink_msg_terrain_report_encode(system_id, component_id, &msg, &packet1);
6960 mavlink_msg_terrain_report_decode(&msg, &packet2);
6961 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6963 memset(&packet2, 0,
sizeof(packet2));
6964 mavlink_msg_terrain_report_pack(system_id, component_id, &msg , packet1.lat , packet1.lon , packet1.spacing , packet1.terrain_height , packet1.current_height , packet1.pending , packet1.loaded );
6965 mavlink_msg_terrain_report_decode(&msg, &packet2);
6966 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6968 memset(&packet2, 0,
sizeof(packet2));
6969 mavlink_msg_terrain_report_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.lat , packet1.lon , packet1.spacing , packet1.terrain_height , packet1.current_height , packet1.pending , packet1.loaded );
6970 mavlink_msg_terrain_report_decode(&msg, &packet2);
6971 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6973 memset(&packet2, 0,
sizeof(packet2));
6974 mavlink_msg_to_send_buffer(buffer, &msg);
6975 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
6976 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
6978 mavlink_msg_terrain_report_decode(last_msg, &packet2);
6979 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6981 memset(&packet2, 0,
sizeof(packet2));
6982 mavlink_msg_terrain_report_send(MAVLINK_COMM_1 , packet1.lat , packet1.lon , packet1.spacing , packet1.terrain_height , packet1.current_height , packet1.pending , packet1.loaded );
6983 mavlink_msg_terrain_report_decode(last_msg, &packet2);
6984 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
6986#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
6987 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"TERRAIN_REPORT") != NULL);
6988 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_TERRAIN_REPORT) != NULL);
6992static void mavlink_test_scaled_pressure2(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
6994#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
6995 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
6996 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_PRESSURE2 >= 256) {
7000 mavlink_message_t msg;
7001 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7003 mavlink_scaled_pressure2_t packet_in = {
7004 963497464,45.0,73.0,17859,17963
7006 mavlink_scaled_pressure2_t packet1, packet2;
7007 memset(&packet1, 0,
sizeof(packet1));
7008 packet1.time_boot_ms = packet_in.time_boot_ms;
7009 packet1.press_abs = packet_in.press_abs;
7010 packet1.press_diff = packet_in.press_diff;
7011 packet1.temperature = packet_in.temperature;
7012 packet1.temperature_press_diff = packet_in.temperature_press_diff;
7015#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7016 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7018 memset(MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SCALED_PRESSURE2_MIN_LEN);
7021 memset(&packet2, 0,
sizeof(packet2));
7022 mavlink_msg_scaled_pressure2_encode(system_id, component_id, &msg, &packet1);
7023 mavlink_msg_scaled_pressure2_decode(&msg, &packet2);
7024 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7026 memset(&packet2, 0,
sizeof(packet2));
7027 mavlink_msg_scaled_pressure2_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature , packet1.temperature_press_diff );
7028 mavlink_msg_scaled_pressure2_decode(&msg, &packet2);
7029 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7031 memset(&packet2, 0,
sizeof(packet2));
7032 mavlink_msg_scaled_pressure2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature , packet1.temperature_press_diff );
7033 mavlink_msg_scaled_pressure2_decode(&msg, &packet2);
7034 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7036 memset(&packet2, 0,
sizeof(packet2));
7037 mavlink_msg_to_send_buffer(buffer, &msg);
7038 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7039 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7041 mavlink_msg_scaled_pressure2_decode(last_msg, &packet2);
7042 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7044 memset(&packet2, 0,
sizeof(packet2));
7045 mavlink_msg_scaled_pressure2_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature , packet1.temperature_press_diff );
7046 mavlink_msg_scaled_pressure2_decode(last_msg, &packet2);
7047 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7049#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7050 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SCALED_PRESSURE2") != NULL);
7051 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SCALED_PRESSURE2) != NULL);
7055static void mavlink_test_att_pos_mocap(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7057#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7058 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7059 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ATT_POS_MOCAP >= 256) {
7063 mavlink_message_t msg;
7064 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7066 mavlink_att_pos_mocap_t packet_in = {
7067 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0 },185.0,213.0,241.0,{ 269.0, 270.0, 271.0, 272.0, 273.0, 274.0, 275.0, 276.0, 277.0, 278.0, 279.0, 280.0, 281.0, 282.0, 283.0, 284.0, 285.0, 286.0, 287.0, 288.0, 289.0 }
7069 mavlink_att_pos_mocap_t packet1, packet2;
7070 memset(&packet1, 0,
sizeof(packet1));
7071 packet1.time_usec = packet_in.time_usec;
7072 packet1.x = packet_in.x;
7073 packet1.y = packet_in.y;
7074 packet1.z = packet_in.z;
7076 mav_array_memcpy(packet1.q, packet_in.q,
sizeof(
float)*4);
7077 mav_array_memcpy(packet1.covariance, packet_in.covariance,
sizeof(
float)*21);
7079#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7080 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7082 memset(MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_ATT_POS_MOCAP_MIN_LEN);
7085 memset(&packet2, 0,
sizeof(packet2));
7086 mavlink_msg_att_pos_mocap_encode(system_id, component_id, &msg, &packet1);
7087 mavlink_msg_att_pos_mocap_decode(&msg, &packet2);
7088 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7090 memset(&packet2, 0,
sizeof(packet2));
7091 mavlink_msg_att_pos_mocap_pack(system_id, component_id, &msg , packet1.time_usec , packet1.q , packet1.x , packet1.y , packet1.z , packet1.covariance );
7092 mavlink_msg_att_pos_mocap_decode(&msg, &packet2);
7093 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7095 memset(&packet2, 0,
sizeof(packet2));
7096 mavlink_msg_att_pos_mocap_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.q , packet1.x , packet1.y , packet1.z , packet1.covariance );
7097 mavlink_msg_att_pos_mocap_decode(&msg, &packet2);
7098 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7100 memset(&packet2, 0,
sizeof(packet2));
7101 mavlink_msg_to_send_buffer(buffer, &msg);
7102 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7103 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7105 mavlink_msg_att_pos_mocap_decode(last_msg, &packet2);
7106 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7108 memset(&packet2, 0,
sizeof(packet2));
7109 mavlink_msg_att_pos_mocap_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.q , packet1.x , packet1.y , packet1.z , packet1.covariance );
7110 mavlink_msg_att_pos_mocap_decode(last_msg, &packet2);
7111 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7113#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7114 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"ATT_POS_MOCAP") != NULL);
7115 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ATT_POS_MOCAP) != NULL);
7119static void mavlink_test_set_actuator_control_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7121#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7122 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7123 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET >= 256) {
7127 mavlink_message_t msg;
7128 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7130 mavlink_set_actuator_control_target_t packet_in = {
7131 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0, 77.0, 78.0, 79.0, 80.0 },125,192,3
7133 mavlink_set_actuator_control_target_t packet1, packet2;
7134 memset(&packet1, 0,
sizeof(packet1));
7135 packet1.time_usec = packet_in.time_usec;
7136 packet1.group_mlx = packet_in.group_mlx;
7137 packet1.target_system = packet_in.target_system;
7138 packet1.target_component = packet_in.target_component;
7140 mav_array_memcpy(packet1.controls, packet_in.controls,
sizeof(
float)*8);
7142#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7143 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7145 memset(MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET_MIN_LEN);
7148 memset(&packet2, 0,
sizeof(packet2));
7149 mavlink_msg_set_actuator_control_target_encode(system_id, component_id, &msg, &packet1);
7150 mavlink_msg_set_actuator_control_target_decode(&msg, &packet2);
7151 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7153 memset(&packet2, 0,
sizeof(packet2));
7154 mavlink_msg_set_actuator_control_target_pack(system_id, component_id, &msg , packet1.time_usec , packet1.group_mlx , packet1.target_system , packet1.target_component , packet1.controls );
7155 mavlink_msg_set_actuator_control_target_decode(&msg, &packet2);
7156 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7158 memset(&packet2, 0,
sizeof(packet2));
7159 mavlink_msg_set_actuator_control_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.group_mlx , packet1.target_system , packet1.target_component , packet1.controls );
7160 mavlink_msg_set_actuator_control_target_decode(&msg, &packet2);
7161 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7163 memset(&packet2, 0,
sizeof(packet2));
7164 mavlink_msg_to_send_buffer(buffer, &msg);
7165 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7166 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7168 mavlink_msg_set_actuator_control_target_decode(last_msg, &packet2);
7169 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7171 memset(&packet2, 0,
sizeof(packet2));
7172 mavlink_msg_set_actuator_control_target_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.group_mlx , packet1.target_system , packet1.target_component , packet1.controls );
7173 mavlink_msg_set_actuator_control_target_decode(last_msg, &packet2);
7174 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7176#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7177 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SET_ACTUATOR_CONTROL_TARGET") != NULL);
7178 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SET_ACTUATOR_CONTROL_TARGET) != NULL);
7182static void mavlink_test_actuator_control_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7184#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7185 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7186 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET >= 256) {
7190 mavlink_message_t msg;
7191 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7193 mavlink_actuator_control_target_t packet_in = {
7194 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0, 77.0, 78.0, 79.0, 80.0 },125
7196 mavlink_actuator_control_target_t packet1, packet2;
7197 memset(&packet1, 0,
sizeof(packet1));
7198 packet1.time_usec = packet_in.time_usec;
7199 packet1.group_mlx = packet_in.group_mlx;
7201 mav_array_memcpy(packet1.controls, packet_in.controls,
sizeof(
float)*8);
7203#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7204 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7206 memset(MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET_MIN_LEN);
7209 memset(&packet2, 0,
sizeof(packet2));
7210 mavlink_msg_actuator_control_target_encode(system_id, component_id, &msg, &packet1);
7211 mavlink_msg_actuator_control_target_decode(&msg, &packet2);
7212 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7214 memset(&packet2, 0,
sizeof(packet2));
7215 mavlink_msg_actuator_control_target_pack(system_id, component_id, &msg , packet1.time_usec , packet1.group_mlx , packet1.controls );
7216 mavlink_msg_actuator_control_target_decode(&msg, &packet2);
7217 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7219 memset(&packet2, 0,
sizeof(packet2));
7220 mavlink_msg_actuator_control_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.group_mlx , packet1.controls );
7221 mavlink_msg_actuator_control_target_decode(&msg, &packet2);
7222 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7224 memset(&packet2, 0,
sizeof(packet2));
7225 mavlink_msg_to_send_buffer(buffer, &msg);
7226 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7227 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7229 mavlink_msg_actuator_control_target_decode(last_msg, &packet2);
7230 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7232 memset(&packet2, 0,
sizeof(packet2));
7233 mavlink_msg_actuator_control_target_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.group_mlx , packet1.controls );
7234 mavlink_msg_actuator_control_target_decode(last_msg, &packet2);
7235 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7237#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7238 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"ACTUATOR_CONTROL_TARGET") != NULL);
7239 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ACTUATOR_CONTROL_TARGET) != NULL);
7243static void mavlink_test_altitude(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7245#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7246 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7247 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ALTITUDE >= 256) {
7251 mavlink_message_t msg;
7252 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7254 mavlink_altitude_t packet_in = {
7255 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0
7257 mavlink_altitude_t packet1, packet2;
7258 memset(&packet1, 0,
sizeof(packet1));
7259 packet1.time_usec = packet_in.time_usec;
7260 packet1.altitude_monotonic = packet_in.altitude_monotonic;
7261 packet1.altitude_amsl = packet_in.altitude_amsl;
7262 packet1.altitude_local = packet_in.altitude_local;
7263 packet1.altitude_relative = packet_in.altitude_relative;
7264 packet1.altitude_terrain = packet_in.altitude_terrain;
7265 packet1.bottom_clearance = packet_in.bottom_clearance;
7268#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7269 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7271 memset(MAVLINK_MSG_ID_ALTITUDE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_ALTITUDE_MIN_LEN);
7274 memset(&packet2, 0,
sizeof(packet2));
7275 mavlink_msg_altitude_encode(system_id, component_id, &msg, &packet1);
7276 mavlink_msg_altitude_decode(&msg, &packet2);
7277 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7279 memset(&packet2, 0,
sizeof(packet2));
7280 mavlink_msg_altitude_pack(system_id, component_id, &msg , packet1.time_usec , packet1.altitude_monotonic , packet1.altitude_amsl , packet1.altitude_local , packet1.altitude_relative , packet1.altitude_terrain , packet1.bottom_clearance );
7281 mavlink_msg_altitude_decode(&msg, &packet2);
7282 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7284 memset(&packet2, 0,
sizeof(packet2));
7285 mavlink_msg_altitude_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.altitude_monotonic , packet1.altitude_amsl , packet1.altitude_local , packet1.altitude_relative , packet1.altitude_terrain , packet1.bottom_clearance );
7286 mavlink_msg_altitude_decode(&msg, &packet2);
7287 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7289 memset(&packet2, 0,
sizeof(packet2));
7290 mavlink_msg_to_send_buffer(buffer, &msg);
7291 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7292 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7294 mavlink_msg_altitude_decode(last_msg, &packet2);
7295 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7297 memset(&packet2, 0,
sizeof(packet2));
7298 mavlink_msg_altitude_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.altitude_monotonic , packet1.altitude_amsl , packet1.altitude_local , packet1.altitude_relative , packet1.altitude_terrain , packet1.bottom_clearance );
7299 mavlink_msg_altitude_decode(last_msg, &packet2);
7300 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7302#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7303 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"ALTITUDE") != NULL);
7304 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ALTITUDE) != NULL);
7308static void mavlink_test_resource_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7310#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7311 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7312 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RESOURCE_REQUEST >= 256) {
7316 mavlink_message_t msg;
7317 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7319 mavlink_resource_request_t packet_in = {
7320 5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2 },243,{ 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173 }
7322 mavlink_resource_request_t packet1, packet2;
7323 memset(&packet1, 0,
sizeof(packet1));
7324 packet1.request_id = packet_in.request_id;
7325 packet1.uri_type = packet_in.uri_type;
7326 packet1.transfer_type = packet_in.transfer_type;
7328 mav_array_memcpy(packet1.uri, packet_in.uri,
sizeof(uint8_t)*120);
7329 mav_array_memcpy(packet1.storage, packet_in.storage,
sizeof(uint8_t)*120);
7331#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7332 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7334 memset(MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_RESOURCE_REQUEST_MIN_LEN);
7337 memset(&packet2, 0,
sizeof(packet2));
7338 mavlink_msg_resource_request_encode(system_id, component_id, &msg, &packet1);
7339 mavlink_msg_resource_request_decode(&msg, &packet2);
7340 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7342 memset(&packet2, 0,
sizeof(packet2));
7343 mavlink_msg_resource_request_pack(system_id, component_id, &msg , packet1.request_id , packet1.uri_type , packet1.uri , packet1.transfer_type , packet1.storage );
7344 mavlink_msg_resource_request_decode(&msg, &packet2);
7345 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7347 memset(&packet2, 0,
sizeof(packet2));
7348 mavlink_msg_resource_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.request_id , packet1.uri_type , packet1.uri , packet1.transfer_type , packet1.storage );
7349 mavlink_msg_resource_request_decode(&msg, &packet2);
7350 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7352 memset(&packet2, 0,
sizeof(packet2));
7353 mavlink_msg_to_send_buffer(buffer, &msg);
7354 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7355 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7357 mavlink_msg_resource_request_decode(last_msg, &packet2);
7358 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7360 memset(&packet2, 0,
sizeof(packet2));
7361 mavlink_msg_resource_request_send(MAVLINK_COMM_1 , packet1.request_id , packet1.uri_type , packet1.uri , packet1.transfer_type , packet1.storage );
7362 mavlink_msg_resource_request_decode(last_msg, &packet2);
7363 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7365#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7366 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"RESOURCE_REQUEST") != NULL);
7367 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_RESOURCE_REQUEST) != NULL);
7371static void mavlink_test_scaled_pressure3(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7373#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7374 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7375 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SCALED_PRESSURE3 >= 256) {
7379 mavlink_message_t msg;
7380 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7382 mavlink_scaled_pressure3_t packet_in = {
7383 963497464,45.0,73.0,17859,17963
7385 mavlink_scaled_pressure3_t packet1, packet2;
7386 memset(&packet1, 0,
sizeof(packet1));
7387 packet1.time_boot_ms = packet_in.time_boot_ms;
7388 packet1.press_abs = packet_in.press_abs;
7389 packet1.press_diff = packet_in.press_diff;
7390 packet1.temperature = packet_in.temperature;
7391 packet1.temperature_press_diff = packet_in.temperature_press_diff;
7394#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7395 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7397 memset(MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SCALED_PRESSURE3_MIN_LEN);
7400 memset(&packet2, 0,
sizeof(packet2));
7401 mavlink_msg_scaled_pressure3_encode(system_id, component_id, &msg, &packet1);
7402 mavlink_msg_scaled_pressure3_decode(&msg, &packet2);
7403 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7405 memset(&packet2, 0,
sizeof(packet2));
7406 mavlink_msg_scaled_pressure3_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature , packet1.temperature_press_diff );
7407 mavlink_msg_scaled_pressure3_decode(&msg, &packet2);
7408 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7410 memset(&packet2, 0,
sizeof(packet2));
7411 mavlink_msg_scaled_pressure3_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature , packet1.temperature_press_diff );
7412 mavlink_msg_scaled_pressure3_decode(&msg, &packet2);
7413 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7415 memset(&packet2, 0,
sizeof(packet2));
7416 mavlink_msg_to_send_buffer(buffer, &msg);
7417 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7418 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7420 mavlink_msg_scaled_pressure3_decode(last_msg, &packet2);
7421 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7423 memset(&packet2, 0,
sizeof(packet2));
7424 mavlink_msg_scaled_pressure3_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.press_abs , packet1.press_diff , packet1.temperature , packet1.temperature_press_diff );
7425 mavlink_msg_scaled_pressure3_decode(last_msg, &packet2);
7426 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7428#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7429 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SCALED_PRESSURE3") != NULL);
7430 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SCALED_PRESSURE3) != NULL);
7434static void mavlink_test_follow_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7436#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7437 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7438 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FOLLOW_TARGET >= 256) {
7442 mavlink_message_t msg;
7443 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7445 mavlink_follow_target_t packet_in = {
7446 93372036854775807ULL,93372036854776311ULL,963498296,963498504,185.0,{ 213.0, 214.0, 215.0 },{ 297.0, 298.0, 299.0 },{ 381.0, 382.0, 383.0, 384.0 },{ 493.0, 494.0, 495.0 },{ 577.0, 578.0, 579.0 },25
7448 mavlink_follow_target_t packet1, packet2;
7449 memset(&packet1, 0,
sizeof(packet1));
7450 packet1.timestamp = packet_in.timestamp;
7451 packet1.custom_state = packet_in.custom_state;
7452 packet1.lat = packet_in.lat;
7453 packet1.lon = packet_in.lon;
7454 packet1.alt = packet_in.alt;
7455 packet1.est_capabilities = packet_in.est_capabilities;
7457 mav_array_memcpy(packet1.vel, packet_in.vel,
sizeof(
float)*3);
7458 mav_array_memcpy(packet1.acc, packet_in.acc,
sizeof(
float)*3);
7459 mav_array_memcpy(packet1.attitude_q, packet_in.attitude_q,
sizeof(
float)*4);
7460 mav_array_memcpy(packet1.rates, packet_in.rates,
sizeof(
float)*3);
7461 mav_array_memcpy(packet1.position_cov, packet_in.position_cov,
sizeof(
float)*3);
7463#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7464 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7466 memset(MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_FOLLOW_TARGET_MIN_LEN);
7469 memset(&packet2, 0,
sizeof(packet2));
7470 mavlink_msg_follow_target_encode(system_id, component_id, &msg, &packet1);
7471 mavlink_msg_follow_target_decode(&msg, &packet2);
7472 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7474 memset(&packet2, 0,
sizeof(packet2));
7475 mavlink_msg_follow_target_pack(system_id, component_id, &msg , packet1.timestamp , packet1.est_capabilities , packet1.lat , packet1.lon , packet1.alt , packet1.vel , packet1.acc , packet1.attitude_q , packet1.rates , packet1.position_cov , packet1.custom_state );
7476 mavlink_msg_follow_target_decode(&msg, &packet2);
7477 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7479 memset(&packet2, 0,
sizeof(packet2));
7480 mavlink_msg_follow_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.est_capabilities , packet1.lat , packet1.lon , packet1.alt , packet1.vel , packet1.acc , packet1.attitude_q , packet1.rates , packet1.position_cov , packet1.custom_state );
7481 mavlink_msg_follow_target_decode(&msg, &packet2);
7482 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7484 memset(&packet2, 0,
sizeof(packet2));
7485 mavlink_msg_to_send_buffer(buffer, &msg);
7486 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7487 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7489 mavlink_msg_follow_target_decode(last_msg, &packet2);
7490 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7492 memset(&packet2, 0,
sizeof(packet2));
7493 mavlink_msg_follow_target_send(MAVLINK_COMM_1 , packet1.timestamp , packet1.est_capabilities , packet1.lat , packet1.lon , packet1.alt , packet1.vel , packet1.acc , packet1.attitude_q , packet1.rates , packet1.position_cov , packet1.custom_state );
7494 mavlink_msg_follow_target_decode(last_msg, &packet2);
7495 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7497#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7498 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"FOLLOW_TARGET") != NULL);
7499 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_FOLLOW_TARGET) != NULL);
7503static void mavlink_test_control_system_state(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7505#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7506 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7507 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE >= 256) {
7511 mavlink_message_t msg;
7512 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7514 mavlink_control_system_state_t packet_in = {
7515 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,{ 353.0, 354.0, 355.0 },{ 437.0, 438.0, 439.0 },{ 521.0, 522.0, 523.0, 524.0 },633.0,661.0,689.0
7517 mavlink_control_system_state_t packet1, packet2;
7518 memset(&packet1, 0,
sizeof(packet1));
7519 packet1.time_usec = packet_in.time_usec;
7520 packet1.x_acc = packet_in.x_acc;
7521 packet1.y_acc = packet_in.y_acc;
7522 packet1.z_acc = packet_in.z_acc;
7523 packet1.x_vel = packet_in.x_vel;
7524 packet1.y_vel = packet_in.y_vel;
7525 packet1.z_vel = packet_in.z_vel;
7526 packet1.x_pos = packet_in.x_pos;
7527 packet1.y_pos = packet_in.y_pos;
7528 packet1.z_pos = packet_in.z_pos;
7529 packet1.airspeed = packet_in.airspeed;
7530 packet1.roll_rate = packet_in.roll_rate;
7531 packet1.pitch_rate = packet_in.pitch_rate;
7532 packet1.yaw_rate = packet_in.yaw_rate;
7534 mav_array_memcpy(packet1.vel_variance, packet_in.vel_variance,
sizeof(
float)*3);
7535 mav_array_memcpy(packet1.pos_variance, packet_in.pos_variance,
sizeof(
float)*3);
7536 mav_array_memcpy(packet1.q, packet_in.q,
sizeof(
float)*4);
7538#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7539 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7541 memset(MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE_MIN_LEN);
7544 memset(&packet2, 0,
sizeof(packet2));
7545 mavlink_msg_control_system_state_encode(system_id, component_id, &msg, &packet1);
7546 mavlink_msg_control_system_state_decode(&msg, &packet2);
7547 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7549 memset(&packet2, 0,
sizeof(packet2));
7550 mavlink_msg_control_system_state_pack(system_id, component_id, &msg , packet1.time_usec , packet1.x_acc , packet1.y_acc , packet1.z_acc , packet1.x_vel , packet1.y_vel , packet1.z_vel , packet1.x_pos , packet1.y_pos , packet1.z_pos , packet1.airspeed , packet1.vel_variance , packet1.pos_variance , packet1.q , packet1.roll_rate , packet1.pitch_rate , packet1.yaw_rate );
7551 mavlink_msg_control_system_state_decode(&msg, &packet2);
7552 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7554 memset(&packet2, 0,
sizeof(packet2));
7555 mavlink_msg_control_system_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.x_acc , packet1.y_acc , packet1.z_acc , packet1.x_vel , packet1.y_vel , packet1.z_vel , packet1.x_pos , packet1.y_pos , packet1.z_pos , packet1.airspeed , packet1.vel_variance , packet1.pos_variance , packet1.q , packet1.roll_rate , packet1.pitch_rate , packet1.yaw_rate );
7556 mavlink_msg_control_system_state_decode(&msg, &packet2);
7557 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7559 memset(&packet2, 0,
sizeof(packet2));
7560 mavlink_msg_to_send_buffer(buffer, &msg);
7561 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7562 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7564 mavlink_msg_control_system_state_decode(last_msg, &packet2);
7565 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7567 memset(&packet2, 0,
sizeof(packet2));
7568 mavlink_msg_control_system_state_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.x_acc , packet1.y_acc , packet1.z_acc , packet1.x_vel , packet1.y_vel , packet1.z_vel , packet1.x_pos , packet1.y_pos , packet1.z_pos , packet1.airspeed , packet1.vel_variance , packet1.pos_variance , packet1.q , packet1.roll_rate , packet1.pitch_rate , packet1.yaw_rate );
7569 mavlink_msg_control_system_state_decode(last_msg, &packet2);
7570 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7572#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7573 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"CONTROL_SYSTEM_STATE") != NULL);
7574 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CONTROL_SYSTEM_STATE) != NULL);
7578static void mavlink_test_battery_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7580#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7581 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7582 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_BATTERY_STATUS >= 256) {
7586 mavlink_message_t msg;
7587 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7589 mavlink_battery_status_t packet_in = {
7590 963497464,963497672,17651,{ 17755, 17756, 17757, 17758, 17759, 17760, 17761, 17762, 17763, 17764 },18795,101,168,235,46,963499336,125,{ 19367, 19368, 19369, 19370 },216,963500064
7592 mavlink_battery_status_t packet1, packet2;
7593 memset(&packet1, 0,
sizeof(packet1));
7594 packet1.current_consumed = packet_in.current_consumed;
7595 packet1.energy_consumed = packet_in.energy_consumed;
7596 packet1.temperature = packet_in.temperature;
7597 packet1.current_battery = packet_in.current_battery;
7598 packet1.id = packet_in.id;
7599 packet1.battery_function = packet_in.battery_function;
7600 packet1.type = packet_in.type;
7601 packet1.battery_remaining = packet_in.battery_remaining;
7602 packet1.time_remaining = packet_in.time_remaining;
7603 packet1.charge_state = packet_in.charge_state;
7604 packet1.mode = packet_in.mode;
7605 packet1.fault_bitmask = packet_in.fault_bitmask;
7607 mav_array_memcpy(packet1.voltages, packet_in.voltages,
sizeof(uint16_t)*10);
7608 mav_array_memcpy(packet1.voltages_ext, packet_in.voltages_ext,
sizeof(uint16_t)*4);
7610#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7611 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7613 memset(MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_BATTERY_STATUS_MIN_LEN);
7616 memset(&packet2, 0,
sizeof(packet2));
7617 mavlink_msg_battery_status_encode(system_id, component_id, &msg, &packet1);
7618 mavlink_msg_battery_status_decode(&msg, &packet2);
7619 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7621 memset(&packet2, 0,
sizeof(packet2));
7622 mavlink_msg_battery_status_pack(system_id, component_id, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.temperature , packet1.voltages , packet1.current_battery , packet1.current_consumed , packet1.energy_consumed , packet1.battery_remaining , packet1.time_remaining , packet1.charge_state , packet1.voltages_ext , packet1.mode , packet1.fault_bitmask );
7623 mavlink_msg_battery_status_decode(&msg, &packet2);
7624 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7626 memset(&packet2, 0,
sizeof(packet2));
7627 mavlink_msg_battery_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.temperature , packet1.voltages , packet1.current_battery , packet1.current_consumed , packet1.energy_consumed , packet1.battery_remaining , packet1.time_remaining , packet1.charge_state , packet1.voltages_ext , packet1.mode , packet1.fault_bitmask );
7628 mavlink_msg_battery_status_decode(&msg, &packet2);
7629 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7631 memset(&packet2, 0,
sizeof(packet2));
7632 mavlink_msg_to_send_buffer(buffer, &msg);
7633 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7634 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7636 mavlink_msg_battery_status_decode(last_msg, &packet2);
7637 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7639 memset(&packet2, 0,
sizeof(packet2));
7640 mavlink_msg_battery_status_send(MAVLINK_COMM_1 , packet1.id , packet1.battery_function , packet1.type , packet1.temperature , packet1.voltages , packet1.current_battery , packet1.current_consumed , packet1.energy_consumed , packet1.battery_remaining , packet1.time_remaining , packet1.charge_state , packet1.voltages_ext , packet1.mode , packet1.fault_bitmask );
7641 mavlink_msg_battery_status_decode(last_msg, &packet2);
7642 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7644#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7645 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"BATTERY_STATUS") != NULL);
7646 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_BATTERY_STATUS) != NULL);
7650static void mavlink_test_landing_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7652#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7653 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7654 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LANDING_TARGET >= 256) {
7658 mavlink_message_t msg;
7659 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7661 mavlink_landing_target_t packet_in = {
7662 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,89,156,227.0,255.0,283.0,{ 311.0, 312.0, 313.0, 314.0 },51,118
7664 mavlink_landing_target_t packet1, packet2;
7665 memset(&packet1, 0,
sizeof(packet1));
7666 packet1.time_usec = packet_in.time_usec;
7667 packet1.angle_x = packet_in.angle_x;
7668 packet1.angle_y = packet_in.angle_y;
7669 packet1.distance = packet_in.distance;
7670 packet1.size_x = packet_in.size_x;
7671 packet1.size_y = packet_in.size_y;
7672 packet1.target_num = packet_in.target_num;
7673 packet1.frame = packet_in.frame;
7674 packet1.x = packet_in.x;
7675 packet1.y = packet_in.y;
7676 packet1.z = packet_in.z;
7677 packet1.type = packet_in.type;
7678 packet1.position_valid = packet_in.position_valid;
7680 mav_array_memcpy(packet1.q, packet_in.q,
sizeof(
float)*4);
7682#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7683 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7685 memset(MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_LANDING_TARGET_MIN_LEN);
7688 memset(&packet2, 0,
sizeof(packet2));
7689 mavlink_msg_landing_target_encode(system_id, component_id, &msg, &packet1);
7690 mavlink_msg_landing_target_decode(&msg, &packet2);
7691 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7693 memset(&packet2, 0,
sizeof(packet2));
7694 mavlink_msg_landing_target_pack(system_id, component_id, &msg , packet1.time_usec , packet1.target_num , packet1.frame , packet1.angle_x , packet1.angle_y , packet1.distance , packet1.size_x , packet1.size_y , packet1.x , packet1.y , packet1.z , packet1.q , packet1.type , packet1.position_valid );
7695 mavlink_msg_landing_target_decode(&msg, &packet2);
7696 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7698 memset(&packet2, 0,
sizeof(packet2));
7699 mavlink_msg_landing_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.target_num , packet1.frame , packet1.angle_x , packet1.angle_y , packet1.distance , packet1.size_x , packet1.size_y , packet1.x , packet1.y , packet1.z , packet1.q , packet1.type , packet1.position_valid );
7700 mavlink_msg_landing_target_decode(&msg, &packet2);
7701 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7703 memset(&packet2, 0,
sizeof(packet2));
7704 mavlink_msg_to_send_buffer(buffer, &msg);
7705 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7706 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7708 mavlink_msg_landing_target_decode(last_msg, &packet2);
7709 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7711 memset(&packet2, 0,
sizeof(packet2));
7712 mavlink_msg_landing_target_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.target_num , packet1.frame , packet1.angle_x , packet1.angle_y , packet1.distance , packet1.size_x , packet1.size_y , packet1.x , packet1.y , packet1.z , packet1.q , packet1.type , packet1.position_valid );
7713 mavlink_msg_landing_target_decode(last_msg, &packet2);
7714 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7716#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7717 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"LANDING_TARGET") != NULL);
7718 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LANDING_TARGET) != NULL);
7722static void mavlink_test_fence_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7724#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7725 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7726 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FENCE_STATUS >= 256) {
7730 mavlink_message_t msg;
7731 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7733 mavlink_fence_status_t packet_in = {
7734 963497464,17443,151,218,29
7736 mavlink_fence_status_t packet1, packet2;
7737 memset(&packet1, 0,
sizeof(packet1));
7738 packet1.breach_time = packet_in.breach_time;
7739 packet1.breach_count = packet_in.breach_count;
7740 packet1.breach_status = packet_in.breach_status;
7741 packet1.breach_type = packet_in.breach_type;
7742 packet1.breach_mitigation = packet_in.breach_mitigation;
7745#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7746 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7748 memset(MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_FENCE_STATUS_MIN_LEN);
7751 memset(&packet2, 0,
sizeof(packet2));
7752 mavlink_msg_fence_status_encode(system_id, component_id, &msg, &packet1);
7753 mavlink_msg_fence_status_decode(&msg, &packet2);
7754 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7756 memset(&packet2, 0,
sizeof(packet2));
7757 mavlink_msg_fence_status_pack(system_id, component_id, &msg , packet1.breach_status , packet1.breach_count , packet1.breach_type , packet1.breach_time , packet1.breach_mitigation );
7758 mavlink_msg_fence_status_decode(&msg, &packet2);
7759 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7761 memset(&packet2, 0,
sizeof(packet2));
7762 mavlink_msg_fence_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.breach_status , packet1.breach_count , packet1.breach_type , packet1.breach_time , packet1.breach_mitigation );
7763 mavlink_msg_fence_status_decode(&msg, &packet2);
7764 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7766 memset(&packet2, 0,
sizeof(packet2));
7767 mavlink_msg_to_send_buffer(buffer, &msg);
7768 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7769 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7771 mavlink_msg_fence_status_decode(last_msg, &packet2);
7772 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7774 memset(&packet2, 0,
sizeof(packet2));
7775 mavlink_msg_fence_status_send(MAVLINK_COMM_1 , packet1.breach_status , packet1.breach_count , packet1.breach_type , packet1.breach_time , packet1.breach_mitigation );
7776 mavlink_msg_fence_status_decode(last_msg, &packet2);
7777 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7779#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7780 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"FENCE_STATUS") != NULL);
7781 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_FENCE_STATUS) != NULL);
7785static void mavlink_test_mag_cal_report(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7787#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7788 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7789 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MAG_CAL_REPORT >= 256) {
7793 mavlink_message_t msg;
7794 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7796 mavlink_mag_cal_report_t packet_in = {
7797 17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,125,192,3,70,325.0,149,216,367.0
7799 mavlink_mag_cal_report_t packet1, packet2;
7800 memset(&packet1, 0,
sizeof(packet1));
7801 packet1.fitness = packet_in.fitness;
7802 packet1.ofs_x = packet_in.ofs_x;
7803 packet1.ofs_y = packet_in.ofs_y;
7804 packet1.ofs_z = packet_in.ofs_z;
7805 packet1.diag_x = packet_in.diag_x;
7806 packet1.diag_y = packet_in.diag_y;
7807 packet1.diag_z = packet_in.diag_z;
7808 packet1.offdiag_x = packet_in.offdiag_x;
7809 packet1.offdiag_y = packet_in.offdiag_y;
7810 packet1.offdiag_z = packet_in.offdiag_z;
7811 packet1.compass_id = packet_in.compass_id;
7812 packet1.cal_mask = packet_in.cal_mask;
7813 packet1.cal_status = packet_in.cal_status;
7814 packet1.autosaved = packet_in.autosaved;
7815 packet1.orientation_confidence = packet_in.orientation_confidence;
7816 packet1.old_orientation = packet_in.old_orientation;
7817 packet1.new_orientation = packet_in.new_orientation;
7818 packet1.scale_factor = packet_in.scale_factor;
7821#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7822 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7824 memset(MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN);
7827 memset(&packet2, 0,
sizeof(packet2));
7828 mavlink_msg_mag_cal_report_encode(system_id, component_id, &msg, &packet1);
7829 mavlink_msg_mag_cal_report_decode(&msg, &packet2);
7830 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7832 memset(&packet2, 0,
sizeof(packet2));
7833 mavlink_msg_mag_cal_report_pack(system_id, component_id, &msg , packet1.compass_id , packet1.cal_mask , packet1.cal_status , packet1.autosaved , packet1.fitness , packet1.ofs_x , packet1.ofs_y , packet1.ofs_z , packet1.diag_x , packet1.diag_y , packet1.diag_z , packet1.offdiag_x , packet1.offdiag_y , packet1.offdiag_z , packet1.orientation_confidence , packet1.old_orientation , packet1.new_orientation , packet1.scale_factor );
7834 mavlink_msg_mag_cal_report_decode(&msg, &packet2);
7835 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7837 memset(&packet2, 0,
sizeof(packet2));
7838 mavlink_msg_mag_cal_report_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.compass_id , packet1.cal_mask , packet1.cal_status , packet1.autosaved , packet1.fitness , packet1.ofs_x , packet1.ofs_y , packet1.ofs_z , packet1.diag_x , packet1.diag_y , packet1.diag_z , packet1.offdiag_x , packet1.offdiag_y , packet1.offdiag_z , packet1.orientation_confidence , packet1.old_orientation , packet1.new_orientation , packet1.scale_factor );
7839 mavlink_msg_mag_cal_report_decode(&msg, &packet2);
7840 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7842 memset(&packet2, 0,
sizeof(packet2));
7843 mavlink_msg_to_send_buffer(buffer, &msg);
7844 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7845 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7847 mavlink_msg_mag_cal_report_decode(last_msg, &packet2);
7848 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7850 memset(&packet2, 0,
sizeof(packet2));
7851 mavlink_msg_mag_cal_report_send(MAVLINK_COMM_1 , packet1.compass_id , packet1.cal_mask , packet1.cal_status , packet1.autosaved , packet1.fitness , packet1.ofs_x , packet1.ofs_y , packet1.ofs_z , packet1.diag_x , packet1.diag_y , packet1.diag_z , packet1.offdiag_x , packet1.offdiag_y , packet1.offdiag_z , packet1.orientation_confidence , packet1.old_orientation , packet1.new_orientation , packet1.scale_factor );
7852 mavlink_msg_mag_cal_report_decode(last_msg, &packet2);
7853 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7855#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7856 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"MAG_CAL_REPORT") != NULL);
7857 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MAG_CAL_REPORT) != NULL);
7861static void mavlink_test_efi_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7863#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7864 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7865 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_EFI_STATUS >= 256) {
7869 mavlink_message_t msg;
7870 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7872 mavlink_efi_status_t packet_in = {
7873 17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,409.0,437.0,197,472.0,500.0
7875 mavlink_efi_status_t packet1, packet2;
7876 memset(&packet1, 0,
sizeof(packet1));
7877 packet1.ecu_index = packet_in.ecu_index;
7878 packet1.rpm = packet_in.rpm;
7879 packet1.fuel_consumed = packet_in.fuel_consumed;
7880 packet1.fuel_flow = packet_in.fuel_flow;
7881 packet1.engine_load = packet_in.engine_load;
7882 packet1.throttle_position = packet_in.throttle_position;
7883 packet1.spark_dwell_time = packet_in.spark_dwell_time;
7884 packet1.barometric_pressure = packet_in.barometric_pressure;
7885 packet1.intake_manifold_pressure = packet_in.intake_manifold_pressure;
7886 packet1.intake_manifold_temperature = packet_in.intake_manifold_temperature;
7887 packet1.cylinder_head_temperature = packet_in.cylinder_head_temperature;
7888 packet1.ignition_timing = packet_in.ignition_timing;
7889 packet1.injection_time = packet_in.injection_time;
7890 packet1.exhaust_gas_temperature = packet_in.exhaust_gas_temperature;
7891 packet1.throttle_out = packet_in.throttle_out;
7892 packet1.pt_compensation = packet_in.pt_compensation;
7893 packet1.health = packet_in.health;
7894 packet1.ignition_voltage = packet_in.ignition_voltage;
7895 packet1.fuel_pressure = packet_in.fuel_pressure;
7898#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7899 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7901 memset(MAVLINK_MSG_ID_EFI_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_EFI_STATUS_MIN_LEN);
7904 memset(&packet2, 0,
sizeof(packet2));
7905 mavlink_msg_efi_status_encode(system_id, component_id, &msg, &packet1);
7906 mavlink_msg_efi_status_decode(&msg, &packet2);
7907 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7909 memset(&packet2, 0,
sizeof(packet2));
7910 mavlink_msg_efi_status_pack(system_id, component_id, &msg , packet1.health , packet1.ecu_index , packet1.rpm , packet1.fuel_consumed , packet1.fuel_flow , packet1.engine_load , packet1.throttle_position , packet1.spark_dwell_time , packet1.barometric_pressure , packet1.intake_manifold_pressure , packet1.intake_manifold_temperature , packet1.cylinder_head_temperature , packet1.ignition_timing , packet1.injection_time , packet1.exhaust_gas_temperature , packet1.throttle_out , packet1.pt_compensation , packet1.ignition_voltage , packet1.fuel_pressure );
7911 mavlink_msg_efi_status_decode(&msg, &packet2);
7912 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7914 memset(&packet2, 0,
sizeof(packet2));
7915 mavlink_msg_efi_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.health , packet1.ecu_index , packet1.rpm , packet1.fuel_consumed , packet1.fuel_flow , packet1.engine_load , packet1.throttle_position , packet1.spark_dwell_time , packet1.barometric_pressure , packet1.intake_manifold_pressure , packet1.intake_manifold_temperature , packet1.cylinder_head_temperature , packet1.ignition_timing , packet1.injection_time , packet1.exhaust_gas_temperature , packet1.throttle_out , packet1.pt_compensation , packet1.ignition_voltage , packet1.fuel_pressure );
7916 mavlink_msg_efi_status_decode(&msg, &packet2);
7917 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7919 memset(&packet2, 0,
sizeof(packet2));
7920 mavlink_msg_to_send_buffer(buffer, &msg);
7921 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7922 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7924 mavlink_msg_efi_status_decode(last_msg, &packet2);
7925 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7927 memset(&packet2, 0,
sizeof(packet2));
7928 mavlink_msg_efi_status_send(MAVLINK_COMM_1 , packet1.health , packet1.ecu_index , packet1.rpm , packet1.fuel_consumed , packet1.fuel_flow , packet1.engine_load , packet1.throttle_position , packet1.spark_dwell_time , packet1.barometric_pressure , packet1.intake_manifold_pressure , packet1.intake_manifold_temperature , packet1.cylinder_head_temperature , packet1.ignition_timing , packet1.injection_time , packet1.exhaust_gas_temperature , packet1.throttle_out , packet1.pt_compensation , packet1.ignition_voltage , packet1.fuel_pressure );
7929 mavlink_msg_efi_status_decode(last_msg, &packet2);
7930 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7932#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
7933 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"EFI_STATUS") != NULL);
7934 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_EFI_STATUS) != NULL);
7938static void mavlink_test_estimator_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
7940#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7941 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
7942 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ESTIMATOR_STATUS >= 256) {
7946 mavlink_message_t msg;
7947 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
7949 mavlink_estimator_status_t packet_in = {
7950 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,19315
7952 mavlink_estimator_status_t packet1, packet2;
7953 memset(&packet1, 0,
sizeof(packet1));
7954 packet1.time_usec = packet_in.time_usec;
7955 packet1.vel_ratio = packet_in.vel_ratio;
7956 packet1.pos_horiz_ratio = packet_in.pos_horiz_ratio;
7957 packet1.pos_vert_ratio = packet_in.pos_vert_ratio;
7958 packet1.mag_ratio = packet_in.mag_ratio;
7959 packet1.hagl_ratio = packet_in.hagl_ratio;
7960 packet1.tas_ratio = packet_in.tas_ratio;
7961 packet1.pos_horiz_accuracy = packet_in.pos_horiz_accuracy;
7962 packet1.pos_vert_accuracy = packet_in.pos_vert_accuracy;
7963 packet1.flags = packet_in.flags;
7966#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
7967 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
7969 memset(MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_ESTIMATOR_STATUS_MIN_LEN);
7972 memset(&packet2, 0,
sizeof(packet2));
7973 mavlink_msg_estimator_status_encode(system_id, component_id, &msg, &packet1);
7974 mavlink_msg_estimator_status_decode(&msg, &packet2);
7975 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7977 memset(&packet2, 0,
sizeof(packet2));
7978 mavlink_msg_estimator_status_pack(system_id, component_id, &msg , packet1.time_usec , packet1.flags , packet1.vel_ratio , packet1.pos_horiz_ratio , packet1.pos_vert_ratio , packet1.mag_ratio , packet1.hagl_ratio , packet1.tas_ratio , packet1.pos_horiz_accuracy , packet1.pos_vert_accuracy );
7979 mavlink_msg_estimator_status_decode(&msg, &packet2);
7980 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7982 memset(&packet2, 0,
sizeof(packet2));
7983 mavlink_msg_estimator_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.flags , packet1.vel_ratio , packet1.pos_horiz_ratio , packet1.pos_vert_ratio , packet1.mag_ratio , packet1.hagl_ratio , packet1.tas_ratio , packet1.pos_horiz_accuracy , packet1.pos_vert_accuracy );
7984 mavlink_msg_estimator_status_decode(&msg, &packet2);
7985 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7987 memset(&packet2, 0,
sizeof(packet2));
7988 mavlink_msg_to_send_buffer(buffer, &msg);
7989 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
7990 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
7992 mavlink_msg_estimator_status_decode(last_msg, &packet2);
7993 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
7995 memset(&packet2, 0,
sizeof(packet2));
7996 mavlink_msg_estimator_status_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.flags , packet1.vel_ratio , packet1.pos_horiz_ratio , packet1.pos_vert_ratio , packet1.mag_ratio , packet1.hagl_ratio , packet1.tas_ratio , packet1.pos_horiz_accuracy , packet1.pos_vert_accuracy );
7997 mavlink_msg_estimator_status_decode(last_msg, &packet2);
7998 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8000#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8001 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"ESTIMATOR_STATUS") != NULL);
8002 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ESTIMATOR_STATUS) != NULL);
8006static void mavlink_test_wind_cov(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8008#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8009 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8010 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_WIND_COV >= 256) {
8014 mavlink_message_t msg;
8015 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8017 mavlink_wind_cov_t packet_in = {
8018 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0
8020 mavlink_wind_cov_t packet1, packet2;
8021 memset(&packet1, 0,
sizeof(packet1));
8022 packet1.time_usec = packet_in.time_usec;
8023 packet1.wind_x = packet_in.wind_x;
8024 packet1.wind_y = packet_in.wind_y;
8025 packet1.wind_z = packet_in.wind_z;
8026 packet1.var_horiz = packet_in.var_horiz;
8027 packet1.var_vert = packet_in.var_vert;
8028 packet1.wind_alt = packet_in.wind_alt;
8029 packet1.horiz_accuracy = packet_in.horiz_accuracy;
8030 packet1.vert_accuracy = packet_in.vert_accuracy;
8033#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8034 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8036 memset(MAVLINK_MSG_ID_WIND_COV_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_WIND_COV_MIN_LEN);
8039 memset(&packet2, 0,
sizeof(packet2));
8040 mavlink_msg_wind_cov_encode(system_id, component_id, &msg, &packet1);
8041 mavlink_msg_wind_cov_decode(&msg, &packet2);
8042 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8044 memset(&packet2, 0,
sizeof(packet2));
8045 mavlink_msg_wind_cov_pack(system_id, component_id, &msg , packet1.time_usec , packet1.wind_x , packet1.wind_y , packet1.wind_z , packet1.var_horiz , packet1.var_vert , packet1.wind_alt , packet1.horiz_accuracy , packet1.vert_accuracy );
8046 mavlink_msg_wind_cov_decode(&msg, &packet2);
8047 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8049 memset(&packet2, 0,
sizeof(packet2));
8050 mavlink_msg_wind_cov_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.wind_x , packet1.wind_y , packet1.wind_z , packet1.var_horiz , packet1.var_vert , packet1.wind_alt , packet1.horiz_accuracy , packet1.vert_accuracy );
8051 mavlink_msg_wind_cov_decode(&msg, &packet2);
8052 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8054 memset(&packet2, 0,
sizeof(packet2));
8055 mavlink_msg_to_send_buffer(buffer, &msg);
8056 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8057 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8059 mavlink_msg_wind_cov_decode(last_msg, &packet2);
8060 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8062 memset(&packet2, 0,
sizeof(packet2));
8063 mavlink_msg_wind_cov_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.wind_x , packet1.wind_y , packet1.wind_z , packet1.var_horiz , packet1.var_vert , packet1.wind_alt , packet1.horiz_accuracy , packet1.vert_accuracy );
8064 mavlink_msg_wind_cov_decode(last_msg, &packet2);
8065 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8067#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8068 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"WIND_COV") != NULL);
8069 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_WIND_COV) != NULL);
8073static void mavlink_test_gps_input(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8075#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8076 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8077 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_INPUT >= 256) {
8081 mavlink_message_t msg;
8082 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8084 mavlink_gps_input_t packet_in = {
8085 93372036854775807ULL,963497880,963498088,963498296,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,20147,20251,185,252,63,20511
8087 mavlink_gps_input_t packet1, packet2;
8088 memset(&packet1, 0,
sizeof(packet1));
8089 packet1.time_usec = packet_in.time_usec;
8090 packet1.time_week_ms = packet_in.time_week_ms;
8091 packet1.lat = packet_in.lat;
8092 packet1.lon = packet_in.lon;
8093 packet1.alt = packet_in.alt;
8094 packet1.hdop = packet_in.hdop;
8095 packet1.vdop = packet_in.vdop;
8096 packet1.vn = packet_in.vn;
8097 packet1.ve = packet_in.ve;
8098 packet1.vd = packet_in.vd;
8099 packet1.speed_accuracy = packet_in.speed_accuracy;
8100 packet1.horiz_accuracy = packet_in.horiz_accuracy;
8101 packet1.vert_accuracy = packet_in.vert_accuracy;
8102 packet1.ignore_flags = packet_in.ignore_flags;
8103 packet1.time_week = packet_in.time_week;
8104 packet1.gps_id = packet_in.gps_id;
8105 packet1.fix_type = packet_in.fix_type;
8106 packet1.satellites_visible = packet_in.satellites_visible;
8107 packet1.yaw = packet_in.yaw;
8110#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8111 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8113 memset(MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN);
8116 memset(&packet2, 0,
sizeof(packet2));
8117 mavlink_msg_gps_input_encode(system_id, component_id, &msg, &packet1);
8118 mavlink_msg_gps_input_decode(&msg, &packet2);
8119 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8121 memset(&packet2, 0,
sizeof(packet2));
8122 mavlink_msg_gps_input_pack(system_id, component_id, &msg , packet1.time_usec , packet1.gps_id , packet1.ignore_flags , packet1.time_week_ms , packet1.time_week , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.hdop , packet1.vdop , packet1.vn , packet1.ve , packet1.vd , packet1.speed_accuracy , packet1.horiz_accuracy , packet1.vert_accuracy , packet1.satellites_visible , packet1.yaw );
8123 mavlink_msg_gps_input_decode(&msg, &packet2);
8124 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8126 memset(&packet2, 0,
sizeof(packet2));
8127 mavlink_msg_gps_input_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.gps_id , packet1.ignore_flags , packet1.time_week_ms , packet1.time_week , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.hdop , packet1.vdop , packet1.vn , packet1.ve , packet1.vd , packet1.speed_accuracy , packet1.horiz_accuracy , packet1.vert_accuracy , packet1.satellites_visible , packet1.yaw );
8128 mavlink_msg_gps_input_decode(&msg, &packet2);
8129 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8131 memset(&packet2, 0,
sizeof(packet2));
8132 mavlink_msg_to_send_buffer(buffer, &msg);
8133 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8134 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8136 mavlink_msg_gps_input_decode(last_msg, &packet2);
8137 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8139 memset(&packet2, 0,
sizeof(packet2));
8140 mavlink_msg_gps_input_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.gps_id , packet1.ignore_flags , packet1.time_week_ms , packet1.time_week , packet1.fix_type , packet1.lat , packet1.lon , packet1.alt , packet1.hdop , packet1.vdop , packet1.vn , packet1.ve , packet1.vd , packet1.speed_accuracy , packet1.horiz_accuracy , packet1.vert_accuracy , packet1.satellites_visible , packet1.yaw );
8141 mavlink_msg_gps_input_decode(last_msg, &packet2);
8142 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8144#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8145 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"GPS_INPUT") != NULL);
8146 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GPS_INPUT) != NULL);
8150static void mavlink_test_gps_rtcm_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8152#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8153 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8154 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GPS_RTCM_DATA >= 256) {
8158 mavlink_message_t msg;
8159 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8161 mavlink_gps_rtcm_data_t packet_in = {
8162 5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62 }
8164 mavlink_gps_rtcm_data_t packet1, packet2;
8165 memset(&packet1, 0,
sizeof(packet1));
8166 packet1.flags = packet_in.flags;
8167 packet1.len = packet_in.len;
8169 mav_array_memcpy(packet1.data, packet_in.data,
sizeof(uint8_t)*180);
8171#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8172 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8174 memset(MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_GPS_RTCM_DATA_MIN_LEN);
8177 memset(&packet2, 0,
sizeof(packet2));
8178 mavlink_msg_gps_rtcm_data_encode(system_id, component_id, &msg, &packet1);
8179 mavlink_msg_gps_rtcm_data_decode(&msg, &packet2);
8180 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8182 memset(&packet2, 0,
sizeof(packet2));
8183 mavlink_msg_gps_rtcm_data_pack(system_id, component_id, &msg , packet1.flags , packet1.len , packet1.data );
8184 mavlink_msg_gps_rtcm_data_decode(&msg, &packet2);
8185 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8187 memset(&packet2, 0,
sizeof(packet2));
8188 mavlink_msg_gps_rtcm_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.flags , packet1.len , packet1.data );
8189 mavlink_msg_gps_rtcm_data_decode(&msg, &packet2);
8190 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
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_gps_rtcm_data_decode(last_msg, &packet2);
8198 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8200 memset(&packet2, 0,
sizeof(packet2));
8201 mavlink_msg_gps_rtcm_data_send(MAVLINK_COMM_1 , packet1.flags , packet1.len , packet1.data );
8202 mavlink_msg_gps_rtcm_data_decode(last_msg, &packet2);
8203 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8205#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8206 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"GPS_RTCM_DATA") != NULL);
8207 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GPS_RTCM_DATA) != NULL);
8211static void mavlink_test_high_latency(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8213#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8214 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8215 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIGH_LATENCY >= 256) {
8219 mavlink_message_t msg;
8220 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8222 mavlink_high_latency_t packet_in = {
8223 963497464,963497672,963497880,17859,17963,18067,18171,18275,18379,18483,211,22,89,156,223,34,101,168,235,46,113,180,247,58
8225 mavlink_high_latency_t packet1, packet2;
8226 memset(&packet1, 0,
sizeof(packet1));
8227 packet1.custom_mode = packet_in.custom_mode;
8228 packet1.latitude = packet_in.latitude;
8229 packet1.longitude = packet_in.longitude;
8230 packet1.roll = packet_in.roll;
8231 packet1.pitch = packet_in.pitch;
8232 packet1.heading = packet_in.heading;
8233 packet1.heading_sp = packet_in.heading_sp;
8234 packet1.altitude_amsl = packet_in.altitude_amsl;
8235 packet1.altitude_sp = packet_in.altitude_sp;
8236 packet1.wp_distance = packet_in.wp_distance;
8237 packet1.base_mode = packet_in.base_mode;
8238 packet1.landed_state = packet_in.landed_state;
8239 packet1.throttle = packet_in.throttle;
8240 packet1.airspeed = packet_in.airspeed;
8241 packet1.airspeed_sp = packet_in.airspeed_sp;
8242 packet1.groundspeed = packet_in.groundspeed;
8243 packet1.climb_rate = packet_in.climb_rate;
8244 packet1.gps_nsat = packet_in.gps_nsat;
8245 packet1.gps_fix_type = packet_in.gps_fix_type;
8246 packet1.battery_remaining = packet_in.battery_remaining;
8247 packet1.temperature = packet_in.temperature;
8248 packet1.temperature_air = packet_in.temperature_air;
8249 packet1.failsafe = packet_in.failsafe;
8250 packet1.wp_num = packet_in.wp_num;
8253#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8254 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8256 memset(MAVLINK_MSG_ID_HIGH_LATENCY_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_HIGH_LATENCY_MIN_LEN);
8259 memset(&packet2, 0,
sizeof(packet2));
8260 mavlink_msg_high_latency_encode(system_id, component_id, &msg, &packet1);
8261 mavlink_msg_high_latency_decode(&msg, &packet2);
8262 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8264 memset(&packet2, 0,
sizeof(packet2));
8265 mavlink_msg_high_latency_pack(system_id, component_id, &msg , packet1.base_mode , packet1.custom_mode , packet1.landed_state , packet1.roll , packet1.pitch , packet1.heading , packet1.throttle , packet1.heading_sp , packet1.latitude , packet1.longitude , packet1.altitude_amsl , packet1.altitude_sp , packet1.airspeed , packet1.airspeed_sp , packet1.groundspeed , packet1.climb_rate , packet1.gps_nsat , packet1.gps_fix_type , packet1.battery_remaining , packet1.temperature , packet1.temperature_air , packet1.failsafe , packet1.wp_num , packet1.wp_distance );
8266 mavlink_msg_high_latency_decode(&msg, &packet2);
8267 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8269 memset(&packet2, 0,
sizeof(packet2));
8270 mavlink_msg_high_latency_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.base_mode , packet1.custom_mode , packet1.landed_state , packet1.roll , packet1.pitch , packet1.heading , packet1.throttle , packet1.heading_sp , packet1.latitude , packet1.longitude , packet1.altitude_amsl , packet1.altitude_sp , packet1.airspeed , packet1.airspeed_sp , packet1.groundspeed , packet1.climb_rate , packet1.gps_nsat , packet1.gps_fix_type , packet1.battery_remaining , packet1.temperature , packet1.temperature_air , packet1.failsafe , packet1.wp_num , packet1.wp_distance );
8271 mavlink_msg_high_latency_decode(&msg, &packet2);
8272 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8274 memset(&packet2, 0,
sizeof(packet2));
8275 mavlink_msg_to_send_buffer(buffer, &msg);
8276 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8277 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8279 mavlink_msg_high_latency_decode(last_msg, &packet2);
8280 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8282 memset(&packet2, 0,
sizeof(packet2));
8283 mavlink_msg_high_latency_send(MAVLINK_COMM_1 , packet1.base_mode , packet1.custom_mode , packet1.landed_state , packet1.roll , packet1.pitch , packet1.heading , packet1.throttle , packet1.heading_sp , packet1.latitude , packet1.longitude , packet1.altitude_amsl , packet1.altitude_sp , packet1.airspeed , packet1.airspeed_sp , packet1.groundspeed , packet1.climb_rate , packet1.gps_nsat , packet1.gps_fix_type , packet1.battery_remaining , packet1.temperature , packet1.temperature_air , packet1.failsafe , packet1.wp_num , packet1.wp_distance );
8284 mavlink_msg_high_latency_decode(last_msg, &packet2);
8285 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8287#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8288 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"HIGH_LATENCY") != NULL);
8289 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HIGH_LATENCY) != NULL);
8293static void mavlink_test_high_latency2(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8295#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8296 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8297 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HIGH_LATENCY2 >= 256) {
8301 mavlink_message_t msg;
8302 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8304 mavlink_high_latency2_t packet_in = {
8305 963497464,963497672,963497880,17859,17963,18067,18171,18275,18379,77,144,211,22,89,156,223,34,101,168,235,46,113,180,247,58,125,192
8307 mavlink_high_latency2_t packet1, packet2;
8308 memset(&packet1, 0,
sizeof(packet1));
8309 packet1.timestamp = packet_in.timestamp;
8310 packet1.latitude = packet_in.latitude;
8311 packet1.longitude = packet_in.longitude;
8312 packet1.custom_mode = packet_in.custom_mode;
8313 packet1.altitude = packet_in.altitude;
8314 packet1.target_altitude = packet_in.target_altitude;
8315 packet1.target_distance = packet_in.target_distance;
8316 packet1.wp_num = packet_in.wp_num;
8317 packet1.failure_flags = packet_in.failure_flags;
8318 packet1.type = packet_in.type;
8319 packet1.autopilot = packet_in.autopilot;
8320 packet1.heading = packet_in.heading;
8321 packet1.target_heading = packet_in.target_heading;
8322 packet1.throttle = packet_in.throttle;
8323 packet1.airspeed = packet_in.airspeed;
8324 packet1.airspeed_sp = packet_in.airspeed_sp;
8325 packet1.groundspeed = packet_in.groundspeed;
8326 packet1.windspeed = packet_in.windspeed;
8327 packet1.wind_heading = packet_in.wind_heading;
8328 packet1.eph = packet_in.eph;
8329 packet1.epv = packet_in.epv;
8330 packet1.temperature_air = packet_in.temperature_air;
8331 packet1.climb_rate = packet_in.climb_rate;
8332 packet1.battery = packet_in.battery;
8333 packet1.custom0 = packet_in.custom0;
8334 packet1.custom1 = packet_in.custom1;
8335 packet1.custom2 = packet_in.custom2;
8338#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8339 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8341 memset(MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN);
8344 memset(&packet2, 0,
sizeof(packet2));
8345 mavlink_msg_high_latency2_encode(system_id, component_id, &msg, &packet1);
8346 mavlink_msg_high_latency2_decode(&msg, &packet2);
8347 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8349 memset(&packet2, 0,
sizeof(packet2));
8350 mavlink_msg_high_latency2_pack(system_id, component_id, &msg , packet1.timestamp , packet1.type , packet1.autopilot , packet1.custom_mode , packet1.latitude , packet1.longitude , packet1.altitude , packet1.target_altitude , packet1.heading , packet1.target_heading , packet1.target_distance , packet1.throttle , packet1.airspeed , packet1.airspeed_sp , packet1.groundspeed , packet1.windspeed , packet1.wind_heading , packet1.eph , packet1.epv , packet1.temperature_air , packet1.climb_rate , packet1.battery , packet1.wp_num , packet1.failure_flags , packet1.custom0 , packet1.custom1 , packet1.custom2 );
8351 mavlink_msg_high_latency2_decode(&msg, &packet2);
8352 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8354 memset(&packet2, 0,
sizeof(packet2));
8355 mavlink_msg_high_latency2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.type , packet1.autopilot , packet1.custom_mode , packet1.latitude , packet1.longitude , packet1.altitude , packet1.target_altitude , packet1.heading , packet1.target_heading , packet1.target_distance , packet1.throttle , packet1.airspeed , packet1.airspeed_sp , packet1.groundspeed , packet1.windspeed , packet1.wind_heading , packet1.eph , packet1.epv , packet1.temperature_air , packet1.climb_rate , packet1.battery , packet1.wp_num , packet1.failure_flags , packet1.custom0 , packet1.custom1 , packet1.custom2 );
8356 mavlink_msg_high_latency2_decode(&msg, &packet2);
8357 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8359 memset(&packet2, 0,
sizeof(packet2));
8360 mavlink_msg_to_send_buffer(buffer, &msg);
8361 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8362 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8364 mavlink_msg_high_latency2_decode(last_msg, &packet2);
8365 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8367 memset(&packet2, 0,
sizeof(packet2));
8368 mavlink_msg_high_latency2_send(MAVLINK_COMM_1 , packet1.timestamp , packet1.type , packet1.autopilot , packet1.custom_mode , packet1.latitude , packet1.longitude , packet1.altitude , packet1.target_altitude , packet1.heading , packet1.target_heading , packet1.target_distance , packet1.throttle , packet1.airspeed , packet1.airspeed_sp , packet1.groundspeed , packet1.windspeed , packet1.wind_heading , packet1.eph , packet1.epv , packet1.temperature_air , packet1.climb_rate , packet1.battery , packet1.wp_num , packet1.failure_flags , packet1.custom0 , packet1.custom1 , packet1.custom2 );
8369 mavlink_msg_high_latency2_decode(last_msg, &packet2);
8370 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8372#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8373 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"HIGH_LATENCY2") != NULL);
8374 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HIGH_LATENCY2) != NULL);
8378static void mavlink_test_vibration(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8380#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8381 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8382 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VIBRATION >= 256) {
8386 mavlink_message_t msg;
8387 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8389 mavlink_vibration_t packet_in = {
8390 93372036854775807ULL,73.0,101.0,129.0,963498504,963498712,963498920
8392 mavlink_vibration_t packet1, packet2;
8393 memset(&packet1, 0,
sizeof(packet1));
8394 packet1.time_usec = packet_in.time_usec;
8395 packet1.vibration_x = packet_in.vibration_x;
8396 packet1.vibration_y = packet_in.vibration_y;
8397 packet1.vibration_z = packet_in.vibration_z;
8398 packet1.clipping_0 = packet_in.clipping_0;
8399 packet1.clipping_1 = packet_in.clipping_1;
8400 packet1.clipping_2 = packet_in.clipping_2;
8403#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8404 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8406 memset(MAVLINK_MSG_ID_VIBRATION_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_VIBRATION_MIN_LEN);
8409 memset(&packet2, 0,
sizeof(packet2));
8410 mavlink_msg_vibration_encode(system_id, component_id, &msg, &packet1);
8411 mavlink_msg_vibration_decode(&msg, &packet2);
8412 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8414 memset(&packet2, 0,
sizeof(packet2));
8415 mavlink_msg_vibration_pack(system_id, component_id, &msg , packet1.time_usec , packet1.vibration_x , packet1.vibration_y , packet1.vibration_z , packet1.clipping_0 , packet1.clipping_1 , packet1.clipping_2 );
8416 mavlink_msg_vibration_decode(&msg, &packet2);
8417 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8419 memset(&packet2, 0,
sizeof(packet2));
8420 mavlink_msg_vibration_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.vibration_x , packet1.vibration_y , packet1.vibration_z , packet1.clipping_0 , packet1.clipping_1 , packet1.clipping_2 );
8421 mavlink_msg_vibration_decode(&msg, &packet2);
8422 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8424 memset(&packet2, 0,
sizeof(packet2));
8425 mavlink_msg_to_send_buffer(buffer, &msg);
8426 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8427 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8429 mavlink_msg_vibration_decode(last_msg, &packet2);
8430 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8432 memset(&packet2, 0,
sizeof(packet2));
8433 mavlink_msg_vibration_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.vibration_x , packet1.vibration_y , packet1.vibration_z , packet1.clipping_0 , packet1.clipping_1 , packet1.clipping_2 );
8434 mavlink_msg_vibration_decode(last_msg, &packet2);
8435 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8437#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8438 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"VIBRATION") != NULL);
8439 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_VIBRATION) != NULL);
8443static void mavlink_test_home_position(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8445#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8446 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8447 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HOME_POSITION >= 256) {
8451 mavlink_message_t msg;
8452 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8454 mavlink_home_position_t packet_in = {
8455 963497464,963497672,963497880,101.0,129.0,157.0,{ 185.0, 186.0, 187.0, 188.0 },297.0,325.0,353.0,93372036854779083ULL
8457 mavlink_home_position_t packet1, packet2;
8458 memset(&packet1, 0,
sizeof(packet1));
8459 packet1.latitude = packet_in.latitude;
8460 packet1.longitude = packet_in.longitude;
8461 packet1.altitude = packet_in.altitude;
8462 packet1.x = packet_in.x;
8463 packet1.y = packet_in.y;
8464 packet1.z = packet_in.z;
8465 packet1.approach_x = packet_in.approach_x;
8466 packet1.approach_y = packet_in.approach_y;
8467 packet1.approach_z = packet_in.approach_z;
8468 packet1.time_usec = packet_in.time_usec;
8470 mav_array_memcpy(packet1.q, packet_in.q,
sizeof(
float)*4);
8472#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8473 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8475 memset(MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_HOME_POSITION_MIN_LEN);
8478 memset(&packet2, 0,
sizeof(packet2));
8479 mavlink_msg_home_position_encode(system_id, component_id, &msg, &packet1);
8480 mavlink_msg_home_position_decode(&msg, &packet2);
8481 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8483 memset(&packet2, 0,
sizeof(packet2));
8484 mavlink_msg_home_position_pack(system_id, component_id, &msg , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z , packet1.time_usec );
8485 mavlink_msg_home_position_decode(&msg, &packet2);
8486 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8488 memset(&packet2, 0,
sizeof(packet2));
8489 mavlink_msg_home_position_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z , packet1.time_usec );
8490 mavlink_msg_home_position_decode(&msg, &packet2);
8491 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8493 memset(&packet2, 0,
sizeof(packet2));
8494 mavlink_msg_to_send_buffer(buffer, &msg);
8495 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8496 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8498 mavlink_msg_home_position_decode(last_msg, &packet2);
8499 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8501 memset(&packet2, 0,
sizeof(packet2));
8502 mavlink_msg_home_position_send(MAVLINK_COMM_1 , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z , packet1.time_usec );
8503 mavlink_msg_home_position_decode(last_msg, &packet2);
8504 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8506#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8507 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"HOME_POSITION") != NULL);
8508 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HOME_POSITION) != NULL);
8512static void mavlink_test_set_home_position(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8514#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8515 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8516 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_HOME_POSITION >= 256) {
8520 mavlink_message_t msg;
8521 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8523 mavlink_set_home_position_t packet_in = {
8524 963497464,963497672,963497880,101.0,129.0,157.0,{ 185.0, 186.0, 187.0, 188.0 },297.0,325.0,353.0,161,93372036854779146ULL
8526 mavlink_set_home_position_t packet1, packet2;
8527 memset(&packet1, 0,
sizeof(packet1));
8528 packet1.latitude = packet_in.latitude;
8529 packet1.longitude = packet_in.longitude;
8530 packet1.altitude = packet_in.altitude;
8531 packet1.x = packet_in.x;
8532 packet1.y = packet_in.y;
8533 packet1.z = packet_in.z;
8534 packet1.approach_x = packet_in.approach_x;
8535 packet1.approach_y = packet_in.approach_y;
8536 packet1.approach_z = packet_in.approach_z;
8537 packet1.target_system = packet_in.target_system;
8538 packet1.time_usec = packet_in.time_usec;
8540 mav_array_memcpy(packet1.q, packet_in.q,
sizeof(
float)*4);
8542#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8543 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8545 memset(MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SET_HOME_POSITION_MIN_LEN);
8548 memset(&packet2, 0,
sizeof(packet2));
8549 mavlink_msg_set_home_position_encode(system_id, component_id, &msg, &packet1);
8550 mavlink_msg_set_home_position_decode(&msg, &packet2);
8551 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8553 memset(&packet2, 0,
sizeof(packet2));
8554 mavlink_msg_set_home_position_pack(system_id, component_id, &msg , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z , packet1.time_usec );
8555 mavlink_msg_set_home_position_decode(&msg, &packet2);
8556 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8558 memset(&packet2, 0,
sizeof(packet2));
8559 mavlink_msg_set_home_position_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z , packet1.time_usec );
8560 mavlink_msg_set_home_position_decode(&msg, &packet2);
8561 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8563 memset(&packet2, 0,
sizeof(packet2));
8564 mavlink_msg_to_send_buffer(buffer, &msg);
8565 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8566 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8568 mavlink_msg_set_home_position_decode(last_msg, &packet2);
8569 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8571 memset(&packet2, 0,
sizeof(packet2));
8572 mavlink_msg_set_home_position_send(MAVLINK_COMM_1 , packet1.target_system , packet1.latitude , packet1.longitude , packet1.altitude , packet1.x , packet1.y , packet1.z , packet1.q , packet1.approach_x , packet1.approach_y , packet1.approach_z , packet1.time_usec );
8573 mavlink_msg_set_home_position_decode(last_msg, &packet2);
8574 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8576#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8577 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SET_HOME_POSITION") != NULL);
8578 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SET_HOME_POSITION) != NULL);
8582static void mavlink_test_message_interval(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8584#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8585 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8586 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MESSAGE_INTERVAL >= 256) {
8590 mavlink_message_t msg;
8591 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8593 mavlink_message_interval_t packet_in = {
8596 mavlink_message_interval_t packet1, packet2;
8597 memset(&packet1, 0,
sizeof(packet1));
8598 packet1.interval_us = packet_in.interval_us;
8599 packet1.message_id = packet_in.message_id;
8602#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8603 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8605 memset(MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_MESSAGE_INTERVAL_MIN_LEN);
8608 memset(&packet2, 0,
sizeof(packet2));
8609 mavlink_msg_message_interval_encode(system_id, component_id, &msg, &packet1);
8610 mavlink_msg_message_interval_decode(&msg, &packet2);
8611 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8613 memset(&packet2, 0,
sizeof(packet2));
8614 mavlink_msg_message_interval_pack(system_id, component_id, &msg , packet1.message_id , packet1.interval_us );
8615 mavlink_msg_message_interval_decode(&msg, &packet2);
8616 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8618 memset(&packet2, 0,
sizeof(packet2));
8619 mavlink_msg_message_interval_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.message_id , packet1.interval_us );
8620 mavlink_msg_message_interval_decode(&msg, &packet2);
8621 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8623 memset(&packet2, 0,
sizeof(packet2));
8624 mavlink_msg_to_send_buffer(buffer, &msg);
8625 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8626 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8628 mavlink_msg_message_interval_decode(last_msg, &packet2);
8629 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8631 memset(&packet2, 0,
sizeof(packet2));
8632 mavlink_msg_message_interval_send(MAVLINK_COMM_1 , packet1.message_id , packet1.interval_us );
8633 mavlink_msg_message_interval_decode(last_msg, &packet2);
8634 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8636#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8637 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"MESSAGE_INTERVAL") != NULL);
8638 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MESSAGE_INTERVAL) != NULL);
8642static void mavlink_test_extended_sys_state(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8644#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8645 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8646 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_EXTENDED_SYS_STATE >= 256) {
8650 mavlink_message_t msg;
8651 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8653 mavlink_extended_sys_state_t packet_in = {
8656 mavlink_extended_sys_state_t packet1, packet2;
8657 memset(&packet1, 0,
sizeof(packet1));
8658 packet1.vtol_state = packet_in.vtol_state;
8659 packet1.landed_state = packet_in.landed_state;
8662#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8663 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8665 memset(MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_EXTENDED_SYS_STATE_MIN_LEN);
8668 memset(&packet2, 0,
sizeof(packet2));
8669 mavlink_msg_extended_sys_state_encode(system_id, component_id, &msg, &packet1);
8670 mavlink_msg_extended_sys_state_decode(&msg, &packet2);
8671 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8673 memset(&packet2, 0,
sizeof(packet2));
8674 mavlink_msg_extended_sys_state_pack(system_id, component_id, &msg , packet1.vtol_state , packet1.landed_state );
8675 mavlink_msg_extended_sys_state_decode(&msg, &packet2);
8676 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8678 memset(&packet2, 0,
sizeof(packet2));
8679 mavlink_msg_extended_sys_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.vtol_state , packet1.landed_state );
8680 mavlink_msg_extended_sys_state_decode(&msg, &packet2);
8681 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8683 memset(&packet2, 0,
sizeof(packet2));
8684 mavlink_msg_to_send_buffer(buffer, &msg);
8685 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8686 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8688 mavlink_msg_extended_sys_state_decode(last_msg, &packet2);
8689 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8691 memset(&packet2, 0,
sizeof(packet2));
8692 mavlink_msg_extended_sys_state_send(MAVLINK_COMM_1 , packet1.vtol_state , packet1.landed_state );
8693 mavlink_msg_extended_sys_state_decode(last_msg, &packet2);
8694 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8696#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8697 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"EXTENDED_SYS_STATE") != NULL);
8698 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_EXTENDED_SYS_STATE) != NULL);
8702static void mavlink_test_adsb_vehicle(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8704#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8705 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8706 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ADSB_VEHICLE >= 256) {
8710 mavlink_message_t msg;
8711 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8713 mavlink_adsb_vehicle_t packet_in = {
8714 963497464,963497672,963497880,963498088,18067,18171,18275,18379,18483,211,
"BCDEFGHI",113,180
8716 mavlink_adsb_vehicle_t packet1, packet2;
8717 memset(&packet1, 0,
sizeof(packet1));
8718 packet1.ICAO_address = packet_in.ICAO_address;
8719 packet1.lat = packet_in.lat;
8720 packet1.lon = packet_in.lon;
8721 packet1.altitude = packet_in.altitude;
8722 packet1.heading = packet_in.heading;
8723 packet1.hor_velocity = packet_in.hor_velocity;
8724 packet1.ver_velocity = packet_in.ver_velocity;
8725 packet1.flags = packet_in.flags;
8726 packet1.squawk = packet_in.squawk;
8727 packet1.altitude_type = packet_in.altitude_type;
8728 packet1.emitter_type = packet_in.emitter_type;
8729 packet1.tslc = packet_in.tslc;
8731 mav_array_memcpy(packet1.callsign, packet_in.callsign,
sizeof(
char)*9);
8733#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8734 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8736 memset(MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_ADSB_VEHICLE_MIN_LEN);
8739 memset(&packet2, 0,
sizeof(packet2));
8740 mavlink_msg_adsb_vehicle_encode(system_id, component_id, &msg, &packet1);
8741 mavlink_msg_adsb_vehicle_decode(&msg, &packet2);
8742 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8744 memset(&packet2, 0,
sizeof(packet2));
8745 mavlink_msg_adsb_vehicle_pack(system_id, component_id, &msg , packet1.ICAO_address , packet1.lat , packet1.lon , packet1.altitude_type , packet1.altitude , packet1.heading , packet1.hor_velocity , packet1.ver_velocity , packet1.callsign , packet1.emitter_type , packet1.tslc , packet1.flags , packet1.squawk );
8746 mavlink_msg_adsb_vehicle_decode(&msg, &packet2);
8747 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8749 memset(&packet2, 0,
sizeof(packet2));
8750 mavlink_msg_adsb_vehicle_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.ICAO_address , packet1.lat , packet1.lon , packet1.altitude_type , packet1.altitude , packet1.heading , packet1.hor_velocity , packet1.ver_velocity , packet1.callsign , packet1.emitter_type , packet1.tslc , packet1.flags , packet1.squawk );
8751 mavlink_msg_adsb_vehicle_decode(&msg, &packet2);
8752 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8754 memset(&packet2, 0,
sizeof(packet2));
8755 mavlink_msg_to_send_buffer(buffer, &msg);
8756 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8757 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8759 mavlink_msg_adsb_vehicle_decode(last_msg, &packet2);
8760 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8762 memset(&packet2, 0,
sizeof(packet2));
8763 mavlink_msg_adsb_vehicle_send(MAVLINK_COMM_1 , packet1.ICAO_address , packet1.lat , packet1.lon , packet1.altitude_type , packet1.altitude , packet1.heading , packet1.hor_velocity , packet1.ver_velocity , packet1.callsign , packet1.emitter_type , packet1.tslc , packet1.flags , packet1.squawk );
8764 mavlink_msg_adsb_vehicle_decode(last_msg, &packet2);
8765 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8767#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8768 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"ADSB_VEHICLE") != NULL);
8769 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ADSB_VEHICLE) != NULL);
8773static void mavlink_test_collision(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8775#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8776 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8777 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COLLISION >= 256) {
8781 mavlink_message_t msg;
8782 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8784 mavlink_collision_t packet_in = {
8785 963497464,45.0,73.0,101.0,53,120,187
8787 mavlink_collision_t packet1, packet2;
8788 memset(&packet1, 0,
sizeof(packet1));
8789 packet1.id = packet_in.id;
8790 packet1.time_to_minimum_delta = packet_in.time_to_minimum_delta;
8791 packet1.altitude_minimum_delta = packet_in.altitude_minimum_delta;
8792 packet1.horizontal_minimum_delta = packet_in.horizontal_minimum_delta;
8793 packet1.src = packet_in.src;
8794 packet1.action = packet_in.action;
8795 packet1.threat_level = packet_in.threat_level;
8798#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8799 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8801 memset(MAVLINK_MSG_ID_COLLISION_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_COLLISION_MIN_LEN);
8804 memset(&packet2, 0,
sizeof(packet2));
8805 mavlink_msg_collision_encode(system_id, component_id, &msg, &packet1);
8806 mavlink_msg_collision_decode(&msg, &packet2);
8807 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8809 memset(&packet2, 0,
sizeof(packet2));
8810 mavlink_msg_collision_pack(system_id, component_id, &msg , packet1.src , packet1.id , packet1.action , packet1.threat_level , packet1.time_to_minimum_delta , packet1.altitude_minimum_delta , packet1.horizontal_minimum_delta );
8811 mavlink_msg_collision_decode(&msg, &packet2);
8812 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8814 memset(&packet2, 0,
sizeof(packet2));
8815 mavlink_msg_collision_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.src , packet1.id , packet1.action , packet1.threat_level , packet1.time_to_minimum_delta , packet1.altitude_minimum_delta , packet1.horizontal_minimum_delta );
8816 mavlink_msg_collision_decode(&msg, &packet2);
8817 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8819 memset(&packet2, 0,
sizeof(packet2));
8820 mavlink_msg_to_send_buffer(buffer, &msg);
8821 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8822 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8824 mavlink_msg_collision_decode(last_msg, &packet2);
8825 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8827 memset(&packet2, 0,
sizeof(packet2));
8828 mavlink_msg_collision_send(MAVLINK_COMM_1 , packet1.src , packet1.id , packet1.action , packet1.threat_level , packet1.time_to_minimum_delta , packet1.altitude_minimum_delta , packet1.horizontal_minimum_delta );
8829 mavlink_msg_collision_decode(last_msg, &packet2);
8830 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8832#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8833 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"COLLISION") != NULL);
8834 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_COLLISION) != NULL);
8838static void mavlink_test_v2_extension(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8840#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8841 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8842 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_V2_EXTENSION >= 256) {
8846 mavlink_message_t msg;
8847 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8849 mavlink_v2_extension_t packet_in = {
8850 17235,139,206,17,{ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76 }
8852 mavlink_v2_extension_t packet1, packet2;
8853 memset(&packet1, 0,
sizeof(packet1));
8854 packet1.message_type = packet_in.message_type;
8855 packet1.target_network = packet_in.target_network;
8856 packet1.target_system = packet_in.target_system;
8857 packet1.target_component = packet_in.target_component;
8859 mav_array_memcpy(packet1.payload, packet_in.payload,
sizeof(uint8_t)*249);
8861#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8862 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8864 memset(MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN);
8867 memset(&packet2, 0,
sizeof(packet2));
8868 mavlink_msg_v2_extension_encode(system_id, component_id, &msg, &packet1);
8869 mavlink_msg_v2_extension_decode(&msg, &packet2);
8870 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8872 memset(&packet2, 0,
sizeof(packet2));
8873 mavlink_msg_v2_extension_pack(system_id, component_id, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.message_type , packet1.payload );
8874 mavlink_msg_v2_extension_decode(&msg, &packet2);
8875 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8877 memset(&packet2, 0,
sizeof(packet2));
8878 mavlink_msg_v2_extension_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_network , packet1.target_system , packet1.target_component , packet1.message_type , packet1.payload );
8879 mavlink_msg_v2_extension_decode(&msg, &packet2);
8880 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8882 memset(&packet2, 0,
sizeof(packet2));
8883 mavlink_msg_to_send_buffer(buffer, &msg);
8884 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8885 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8887 mavlink_msg_v2_extension_decode(last_msg, &packet2);
8888 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8890 memset(&packet2, 0,
sizeof(packet2));
8891 mavlink_msg_v2_extension_send(MAVLINK_COMM_1 , packet1.target_network , packet1.target_system , packet1.target_component , packet1.message_type , packet1.payload );
8892 mavlink_msg_v2_extension_decode(last_msg, &packet2);
8893 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8895#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8896 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"V2_EXTENSION") != NULL);
8897 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_V2_EXTENSION) != NULL);
8901static void mavlink_test_memory_vect(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8903#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8904 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8905 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MEMORY_VECT >= 256) {
8909 mavlink_message_t msg;
8910 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8912 mavlink_memory_vect_t packet_in = {
8913 17235,139,206,{ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48 }
8915 mavlink_memory_vect_t packet1, packet2;
8916 memset(&packet1, 0,
sizeof(packet1));
8917 packet1.address = packet_in.address;
8918 packet1.ver = packet_in.ver;
8919 packet1.type = packet_in.type;
8921 mav_array_memcpy(packet1.value, packet_in.value,
sizeof(int8_t)*32);
8923#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8924 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8926 memset(MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_MEMORY_VECT_MIN_LEN);
8929 memset(&packet2, 0,
sizeof(packet2));
8930 mavlink_msg_memory_vect_encode(system_id, component_id, &msg, &packet1);
8931 mavlink_msg_memory_vect_decode(&msg, &packet2);
8932 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8934 memset(&packet2, 0,
sizeof(packet2));
8935 mavlink_msg_memory_vect_pack(system_id, component_id, &msg , packet1.address , packet1.ver , packet1.type , packet1.value );
8936 mavlink_msg_memory_vect_decode(&msg, &packet2);
8937 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8939 memset(&packet2, 0,
sizeof(packet2));
8940 mavlink_msg_memory_vect_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.address , packet1.ver , packet1.type , packet1.value );
8941 mavlink_msg_memory_vect_decode(&msg, &packet2);
8942 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8944 memset(&packet2, 0,
sizeof(packet2));
8945 mavlink_msg_to_send_buffer(buffer, &msg);
8946 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
8947 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
8949 mavlink_msg_memory_vect_decode(last_msg, &packet2);
8950 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8952 memset(&packet2, 0,
sizeof(packet2));
8953 mavlink_msg_memory_vect_send(MAVLINK_COMM_1 , packet1.address , packet1.ver , packet1.type , packet1.value );
8954 mavlink_msg_memory_vect_decode(last_msg, &packet2);
8955 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8957#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
8958 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"MEMORY_VECT") != NULL);
8959 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MEMORY_VECT) != NULL);
8963static void mavlink_test_debug_vect(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
8965#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8966 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
8967 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DEBUG_VECT >= 256) {
8971 mavlink_message_t msg;
8972 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
8974 mavlink_debug_vect_t packet_in = {
8975 93372036854775807ULL,73.0,101.0,129.0,
"UVWXYZABC"
8977 mavlink_debug_vect_t packet1, packet2;
8978 memset(&packet1, 0,
sizeof(packet1));
8979 packet1.time_usec = packet_in.time_usec;
8980 packet1.x = packet_in.x;
8981 packet1.y = packet_in.y;
8982 packet1.z = packet_in.z;
8984 mav_array_memcpy(packet1.name, packet_in.name,
sizeof(
char)*10);
8986#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
8987 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
8989 memset(MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_DEBUG_VECT_MIN_LEN);
8992 memset(&packet2, 0,
sizeof(packet2));
8993 mavlink_msg_debug_vect_encode(system_id, component_id, &msg, &packet1);
8994 mavlink_msg_debug_vect_decode(&msg, &packet2);
8995 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
8997 memset(&packet2, 0,
sizeof(packet2));
8998 mavlink_msg_debug_vect_pack(system_id, component_id, &msg , packet1.name , packet1.time_usec , packet1.x , packet1.y , packet1.z );
8999 mavlink_msg_debug_vect_decode(&msg, &packet2);
9000 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9002 memset(&packet2, 0,
sizeof(packet2));
9003 mavlink_msg_debug_vect_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.name , packet1.time_usec , packet1.x , packet1.y , packet1.z );
9004 mavlink_msg_debug_vect_decode(&msg, &packet2);
9005 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
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_debug_vect_decode(last_msg, &packet2);
9013 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9015 memset(&packet2, 0,
sizeof(packet2));
9016 mavlink_msg_debug_vect_send(MAVLINK_COMM_1 , packet1.name , packet1.time_usec , packet1.x , packet1.y , packet1.z );
9017 mavlink_msg_debug_vect_decode(last_msg, &packet2);
9018 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9020#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9021 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"DEBUG_VECT") != NULL);
9022 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_DEBUG_VECT) != NULL);
9026static void mavlink_test_named_value_float(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9028#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9029 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9030 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_NAMED_VALUE_FLOAT >= 256) {
9034 mavlink_message_t msg;
9035 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9037 mavlink_named_value_float_t packet_in = {
9038 963497464,45.0,
"IJKLMNOPQ"
9040 mavlink_named_value_float_t packet1, packet2;
9041 memset(&packet1, 0,
sizeof(packet1));
9042 packet1.time_boot_ms = packet_in.time_boot_ms;
9043 packet1.value = packet_in.value;
9045 mav_array_memcpy(packet1.name, packet_in.name,
sizeof(
char)*10);
9047#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9048 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9050 memset(MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_NAMED_VALUE_FLOAT_MIN_LEN);
9053 memset(&packet2, 0,
sizeof(packet2));
9054 mavlink_msg_named_value_float_encode(system_id, component_id, &msg, &packet1);
9055 mavlink_msg_named_value_float_decode(&msg, &packet2);
9056 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9058 memset(&packet2, 0,
sizeof(packet2));
9059 mavlink_msg_named_value_float_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.name , packet1.value );
9060 mavlink_msg_named_value_float_decode(&msg, &packet2);
9061 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9063 memset(&packet2, 0,
sizeof(packet2));
9064 mavlink_msg_named_value_float_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.name , packet1.value );
9065 mavlink_msg_named_value_float_decode(&msg, &packet2);
9066 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9068 memset(&packet2, 0,
sizeof(packet2));
9069 mavlink_msg_to_send_buffer(buffer, &msg);
9070 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9071 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9073 mavlink_msg_named_value_float_decode(last_msg, &packet2);
9074 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9076 memset(&packet2, 0,
sizeof(packet2));
9077 mavlink_msg_named_value_float_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.name , packet1.value );
9078 mavlink_msg_named_value_float_decode(last_msg, &packet2);
9079 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9081#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9082 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"NAMED_VALUE_FLOAT") != NULL);
9083 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_NAMED_VALUE_FLOAT) != NULL);
9087static void mavlink_test_named_value_int(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9089#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9090 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9091 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_NAMED_VALUE_INT >= 256) {
9095 mavlink_message_t msg;
9096 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9098 mavlink_named_value_int_t packet_in = {
9099 963497464,963497672,
"IJKLMNOPQ"
9101 mavlink_named_value_int_t packet1, packet2;
9102 memset(&packet1, 0,
sizeof(packet1));
9103 packet1.time_boot_ms = packet_in.time_boot_ms;
9104 packet1.value = packet_in.value;
9106 mav_array_memcpy(packet1.name, packet_in.name,
sizeof(
char)*10);
9108#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9109 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9111 memset(MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_NAMED_VALUE_INT_MIN_LEN);
9114 memset(&packet2, 0,
sizeof(packet2));
9115 mavlink_msg_named_value_int_encode(system_id, component_id, &msg, &packet1);
9116 mavlink_msg_named_value_int_decode(&msg, &packet2);
9117 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9119 memset(&packet2, 0,
sizeof(packet2));
9120 mavlink_msg_named_value_int_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.name , packet1.value );
9121 mavlink_msg_named_value_int_decode(&msg, &packet2);
9122 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9124 memset(&packet2, 0,
sizeof(packet2));
9125 mavlink_msg_named_value_int_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.name , packet1.value );
9126 mavlink_msg_named_value_int_decode(&msg, &packet2);
9127 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9129 memset(&packet2, 0,
sizeof(packet2));
9130 mavlink_msg_to_send_buffer(buffer, &msg);
9131 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9132 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9134 mavlink_msg_named_value_int_decode(last_msg, &packet2);
9135 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9137 memset(&packet2, 0,
sizeof(packet2));
9138 mavlink_msg_named_value_int_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.name , packet1.value );
9139 mavlink_msg_named_value_int_decode(last_msg, &packet2);
9140 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9142#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9143 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"NAMED_VALUE_INT") != NULL);
9144 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_NAMED_VALUE_INT) != NULL);
9148static void mavlink_test_statustext(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9150#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9151 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9152 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_STATUSTEXT >= 256) {
9156 mavlink_message_t msg;
9157 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9159 mavlink_statustext_t packet_in = {
9160 5,
"BCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX",19887,228
9162 mavlink_statustext_t packet1, packet2;
9163 memset(&packet1, 0,
sizeof(packet1));
9164 packet1.severity = packet_in.severity;
9165 packet1.id = packet_in.id;
9166 packet1.chunk_seq = packet_in.chunk_seq;
9168 mav_array_memcpy(packet1.text, packet_in.text,
sizeof(
char)*50);
9170#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9171 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9173 memset(MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_STATUSTEXT_MIN_LEN);
9176 memset(&packet2, 0,
sizeof(packet2));
9177 mavlink_msg_statustext_encode(system_id, component_id, &msg, &packet1);
9178 mavlink_msg_statustext_decode(&msg, &packet2);
9179 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9181 memset(&packet2, 0,
sizeof(packet2));
9182 mavlink_msg_statustext_pack(system_id, component_id, &msg , packet1.severity , packet1.text , packet1.id , packet1.chunk_seq );
9183 mavlink_msg_statustext_decode(&msg, &packet2);
9184 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9186 memset(&packet2, 0,
sizeof(packet2));
9187 mavlink_msg_statustext_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.severity , packet1.text , packet1.id , packet1.chunk_seq );
9188 mavlink_msg_statustext_decode(&msg, &packet2);
9189 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9191 memset(&packet2, 0,
sizeof(packet2));
9192 mavlink_msg_to_send_buffer(buffer, &msg);
9193 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9194 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9196 mavlink_msg_statustext_decode(last_msg, &packet2);
9197 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9199 memset(&packet2, 0,
sizeof(packet2));
9200 mavlink_msg_statustext_send(MAVLINK_COMM_1 , packet1.severity , packet1.text , packet1.id , packet1.chunk_seq );
9201 mavlink_msg_statustext_decode(last_msg, &packet2);
9202 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9204#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9205 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"STATUSTEXT") != NULL);
9206 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_STATUSTEXT) != NULL);
9210static void mavlink_test_debug(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9212#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9213 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9214 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DEBUG >= 256) {
9218 mavlink_message_t msg;
9219 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9221 mavlink_debug_t packet_in = {
9224 mavlink_debug_t packet1, packet2;
9225 memset(&packet1, 0,
sizeof(packet1));
9226 packet1.time_boot_ms = packet_in.time_boot_ms;
9227 packet1.value = packet_in.value;
9228 packet1.ind = packet_in.ind;
9231#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9232 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9234 memset(MAVLINK_MSG_ID_DEBUG_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_DEBUG_MIN_LEN);
9237 memset(&packet2, 0,
sizeof(packet2));
9238 mavlink_msg_debug_encode(system_id, component_id, &msg, &packet1);
9239 mavlink_msg_debug_decode(&msg, &packet2);
9240 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9242 memset(&packet2, 0,
sizeof(packet2));
9243 mavlink_msg_debug_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.ind , packet1.value );
9244 mavlink_msg_debug_decode(&msg, &packet2);
9245 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9247 memset(&packet2, 0,
sizeof(packet2));
9248 mavlink_msg_debug_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.ind , packet1.value );
9249 mavlink_msg_debug_decode(&msg, &packet2);
9250 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
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_debug_decode(last_msg, &packet2);
9258 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9260 memset(&packet2, 0,
sizeof(packet2));
9261 mavlink_msg_debug_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.ind , packet1.value );
9262 mavlink_msg_debug_decode(last_msg, &packet2);
9263 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9265#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9266 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"DEBUG") != NULL);
9267 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_DEBUG) != NULL);
9271static void mavlink_test_setup_signing(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9273#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9274 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9275 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SETUP_SIGNING >= 256) {
9279 mavlink_message_t msg;
9280 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9282 mavlink_setup_signing_t packet_in = {
9283 93372036854775807ULL,29,96,{ 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194 }
9285 mavlink_setup_signing_t packet1, packet2;
9286 memset(&packet1, 0,
sizeof(packet1));
9287 packet1.initial_timestamp = packet_in.initial_timestamp;
9288 packet1.target_system = packet_in.target_system;
9289 packet1.target_component = packet_in.target_component;
9291 mav_array_memcpy(packet1.secret_key, packet_in.secret_key,
sizeof(uint8_t)*32);
9293#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9294 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9296 memset(MAVLINK_MSG_ID_SETUP_SIGNING_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SETUP_SIGNING_MIN_LEN);
9299 memset(&packet2, 0,
sizeof(packet2));
9300 mavlink_msg_setup_signing_encode(system_id, component_id, &msg, &packet1);
9301 mavlink_msg_setup_signing_decode(&msg, &packet2);
9302 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9304 memset(&packet2, 0,
sizeof(packet2));
9305 mavlink_msg_setup_signing_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.secret_key , packet1.initial_timestamp );
9306 mavlink_msg_setup_signing_decode(&msg, &packet2);
9307 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9309 memset(&packet2, 0,
sizeof(packet2));
9310 mavlink_msg_setup_signing_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.secret_key , packet1.initial_timestamp );
9311 mavlink_msg_setup_signing_decode(&msg, &packet2);
9312 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9314 memset(&packet2, 0,
sizeof(packet2));
9315 mavlink_msg_to_send_buffer(buffer, &msg);
9316 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9317 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9319 mavlink_msg_setup_signing_decode(last_msg, &packet2);
9320 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9322 memset(&packet2, 0,
sizeof(packet2));
9323 mavlink_msg_setup_signing_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.secret_key , packet1.initial_timestamp );
9324 mavlink_msg_setup_signing_decode(last_msg, &packet2);
9325 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9327#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9328 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SETUP_SIGNING") != NULL);
9329 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SETUP_SIGNING) != NULL);
9333static void mavlink_test_button_change(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9335#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9336 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9337 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_BUTTON_CHANGE >= 256) {
9341 mavlink_message_t msg;
9342 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9344 mavlink_button_change_t packet_in = {
9345 963497464,963497672,29
9347 mavlink_button_change_t packet1, packet2;
9348 memset(&packet1, 0,
sizeof(packet1));
9349 packet1.time_boot_ms = packet_in.time_boot_ms;
9350 packet1.last_change_ms = packet_in.last_change_ms;
9351 packet1.state = packet_in.state;
9354#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9355 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9357 memset(MAVLINK_MSG_ID_BUTTON_CHANGE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_BUTTON_CHANGE_MIN_LEN);
9360 memset(&packet2, 0,
sizeof(packet2));
9361 mavlink_msg_button_change_encode(system_id, component_id, &msg, &packet1);
9362 mavlink_msg_button_change_decode(&msg, &packet2);
9363 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9365 memset(&packet2, 0,
sizeof(packet2));
9366 mavlink_msg_button_change_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.last_change_ms , packet1.state );
9367 mavlink_msg_button_change_decode(&msg, &packet2);
9368 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9370 memset(&packet2, 0,
sizeof(packet2));
9371 mavlink_msg_button_change_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.last_change_ms , packet1.state );
9372 mavlink_msg_button_change_decode(&msg, &packet2);
9373 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9375 memset(&packet2, 0,
sizeof(packet2));
9376 mavlink_msg_to_send_buffer(buffer, &msg);
9377 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9378 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9380 mavlink_msg_button_change_decode(last_msg, &packet2);
9381 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9383 memset(&packet2, 0,
sizeof(packet2));
9384 mavlink_msg_button_change_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.last_change_ms , packet1.state );
9385 mavlink_msg_button_change_decode(last_msg, &packet2);
9386 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9388#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9389 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"BUTTON_CHANGE") != NULL);
9390 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_BUTTON_CHANGE) != NULL);
9394static void mavlink_test_play_tune(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9396#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9397 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9398 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PLAY_TUNE >= 256) {
9402 mavlink_message_t msg;
9403 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9405 mavlink_play_tune_t packet_in = {
9406 5,72,
"CDEFGHIJKLMNOPQRSTUVWXYZABCDE",
"GHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVW"
9408 mavlink_play_tune_t packet1, packet2;
9409 memset(&packet1, 0,
sizeof(packet1));
9410 packet1.target_system = packet_in.target_system;
9411 packet1.target_component = packet_in.target_component;
9413 mav_array_memcpy(packet1.tune, packet_in.tune,
sizeof(
char)*30);
9414 mav_array_memcpy(packet1.tune2, packet_in.tune2,
sizeof(
char)*200);
9416#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9417 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9419 memset(MAVLINK_MSG_ID_PLAY_TUNE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_PLAY_TUNE_MIN_LEN);
9422 memset(&packet2, 0,
sizeof(packet2));
9423 mavlink_msg_play_tune_encode(system_id, component_id, &msg, &packet1);
9424 mavlink_msg_play_tune_decode(&msg, &packet2);
9425 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9427 memset(&packet2, 0,
sizeof(packet2));
9428 mavlink_msg_play_tune_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.tune , packet1.tune2 );
9429 mavlink_msg_play_tune_decode(&msg, &packet2);
9430 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9432 memset(&packet2, 0,
sizeof(packet2));
9433 mavlink_msg_play_tune_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.tune , packet1.tune2 );
9434 mavlink_msg_play_tune_decode(&msg, &packet2);
9435 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9437 memset(&packet2, 0,
sizeof(packet2));
9438 mavlink_msg_to_send_buffer(buffer, &msg);
9439 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9440 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9442 mavlink_msg_play_tune_decode(last_msg, &packet2);
9443 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9445 memset(&packet2, 0,
sizeof(packet2));
9446 mavlink_msg_play_tune_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.tune , packet1.tune2 );
9447 mavlink_msg_play_tune_decode(last_msg, &packet2);
9448 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9450#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9451 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"PLAY_TUNE") != NULL);
9452 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PLAY_TUNE) != NULL);
9456static void mavlink_test_camera_information(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9458#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9459 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9460 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_INFORMATION >= 256) {
9464 mavlink_message_t msg;
9465 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9467 mavlink_camera_information_t packet_in = {
9468 963497464,963497672,73.0,101.0,129.0,963498504,18483,18587,18691,{ 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254 },{ 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94 },159,
"RSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ",134,201
9470 mavlink_camera_information_t packet1, packet2;
9471 memset(&packet1, 0,
sizeof(packet1));
9472 packet1.time_boot_ms = packet_in.time_boot_ms;
9473 packet1.firmware_version = packet_in.firmware_version;
9474 packet1.focal_length = packet_in.focal_length;
9475 packet1.sensor_size_h = packet_in.sensor_size_h;
9476 packet1.sensor_size_v = packet_in.sensor_size_v;
9477 packet1.flags = packet_in.flags;
9478 packet1.resolution_h = packet_in.resolution_h;
9479 packet1.resolution_v = packet_in.resolution_v;
9480 packet1.cam_definition_version = packet_in.cam_definition_version;
9481 packet1.lens_id = packet_in.lens_id;
9482 packet1.gimbal_device_id = packet_in.gimbal_device_id;
9483 packet1.camera_device_id = packet_in.camera_device_id;
9485 mav_array_memcpy(packet1.vendor_name, packet_in.vendor_name,
sizeof(uint8_t)*32);
9486 mav_array_memcpy(packet1.model_name, packet_in.model_name,
sizeof(uint8_t)*32);
9487 mav_array_memcpy(packet1.cam_definition_uri, packet_in.cam_definition_uri,
sizeof(
char)*140);
9489#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9490 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9492 memset(MAVLINK_MSG_ID_CAMERA_INFORMATION_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_INFORMATION_MIN_LEN);
9495 memset(&packet2, 0,
sizeof(packet2));
9496 mavlink_msg_camera_information_encode(system_id, component_id, &msg, &packet1);
9497 mavlink_msg_camera_information_decode(&msg, &packet2);
9498 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9500 memset(&packet2, 0,
sizeof(packet2));
9501 mavlink_msg_camera_information_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.vendor_name , packet1.model_name , packet1.firmware_version , packet1.focal_length , packet1.sensor_size_h , packet1.sensor_size_v , packet1.resolution_h , packet1.resolution_v , packet1.lens_id , packet1.flags , packet1.cam_definition_version , packet1.cam_definition_uri , packet1.gimbal_device_id , packet1.camera_device_id );
9502 mavlink_msg_camera_information_decode(&msg, &packet2);
9503 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9505 memset(&packet2, 0,
sizeof(packet2));
9506 mavlink_msg_camera_information_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.vendor_name , packet1.model_name , packet1.firmware_version , packet1.focal_length , packet1.sensor_size_h , packet1.sensor_size_v , packet1.resolution_h , packet1.resolution_v , packet1.lens_id , packet1.flags , packet1.cam_definition_version , packet1.cam_definition_uri , packet1.gimbal_device_id , packet1.camera_device_id );
9507 mavlink_msg_camera_information_decode(&msg, &packet2);
9508 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9510 memset(&packet2, 0,
sizeof(packet2));
9511 mavlink_msg_to_send_buffer(buffer, &msg);
9512 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9513 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9515 mavlink_msg_camera_information_decode(last_msg, &packet2);
9516 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9518 memset(&packet2, 0,
sizeof(packet2));
9519 mavlink_msg_camera_information_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.vendor_name , packet1.model_name , packet1.firmware_version , packet1.focal_length , packet1.sensor_size_h , packet1.sensor_size_v , packet1.resolution_h , packet1.resolution_v , packet1.lens_id , packet1.flags , packet1.cam_definition_version , packet1.cam_definition_uri , packet1.gimbal_device_id , packet1.camera_device_id );
9520 mavlink_msg_camera_information_decode(last_msg, &packet2);
9521 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9523#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9524 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"CAMERA_INFORMATION") != NULL);
9525 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CAMERA_INFORMATION) != NULL);
9529static void mavlink_test_camera_settings(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9531#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9532 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9533 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_SETTINGS >= 256) {
9537 mavlink_message_t msg;
9538 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9540 mavlink_camera_settings_t packet_in = {
9541 963497464,17,52.0,80.0,108
9543 mavlink_camera_settings_t packet1, packet2;
9544 memset(&packet1, 0,
sizeof(packet1));
9545 packet1.time_boot_ms = packet_in.time_boot_ms;
9546 packet1.mode_id = packet_in.mode_id;
9547 packet1.zoomLevel = packet_in.zoomLevel;
9548 packet1.focusLevel = packet_in.focusLevel;
9549 packet1.camera_device_id = packet_in.camera_device_id;
9552#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9553 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9555 memset(MAVLINK_MSG_ID_CAMERA_SETTINGS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_SETTINGS_MIN_LEN);
9558 memset(&packet2, 0,
sizeof(packet2));
9559 mavlink_msg_camera_settings_encode(system_id, component_id, &msg, &packet1);
9560 mavlink_msg_camera_settings_decode(&msg, &packet2);
9561 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9563 memset(&packet2, 0,
sizeof(packet2));
9564 mavlink_msg_camera_settings_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.mode_id , packet1.zoomLevel , packet1.focusLevel , packet1.camera_device_id );
9565 mavlink_msg_camera_settings_decode(&msg, &packet2);
9566 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9568 memset(&packet2, 0,
sizeof(packet2));
9569 mavlink_msg_camera_settings_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.mode_id , packet1.zoomLevel , packet1.focusLevel , packet1.camera_device_id );
9570 mavlink_msg_camera_settings_decode(&msg, &packet2);
9571 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9573 memset(&packet2, 0,
sizeof(packet2));
9574 mavlink_msg_to_send_buffer(buffer, &msg);
9575 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9576 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9578 mavlink_msg_camera_settings_decode(last_msg, &packet2);
9579 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9581 memset(&packet2, 0,
sizeof(packet2));
9582 mavlink_msg_camera_settings_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.mode_id , packet1.zoomLevel , packet1.focusLevel , packet1.camera_device_id );
9583 mavlink_msg_camera_settings_decode(last_msg, &packet2);
9584 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9586#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9587 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"CAMERA_SETTINGS") != NULL);
9588 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CAMERA_SETTINGS) != NULL);
9592static void mavlink_test_storage_information(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9594#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9595 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9596 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_STORAGE_INFORMATION >= 256) {
9600 mavlink_message_t msg;
9601 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9603 mavlink_storage_information_t packet_in = {
9604 963497464,45.0,73.0,101.0,129.0,157.0,77,144,211,22,
"CDEFGHIJKLMNOPQRSTUVWXYZABCDEFG",185
9606 mavlink_storage_information_t packet1, packet2;
9607 memset(&packet1, 0,
sizeof(packet1));
9608 packet1.time_boot_ms = packet_in.time_boot_ms;
9609 packet1.total_capacity = packet_in.total_capacity;
9610 packet1.used_capacity = packet_in.used_capacity;
9611 packet1.available_capacity = packet_in.available_capacity;
9612 packet1.read_speed = packet_in.read_speed;
9613 packet1.write_speed = packet_in.write_speed;
9614 packet1.storage_id = packet_in.storage_id;
9615 packet1.storage_count = packet_in.storage_count;
9616 packet1.status = packet_in.status;
9617 packet1.type = packet_in.type;
9618 packet1.storage_usage = packet_in.storage_usage;
9620 mav_array_memcpy(packet1.name, packet_in.name,
sizeof(
char)*32);
9622#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9623 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9625 memset(MAVLINK_MSG_ID_STORAGE_INFORMATION_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_STORAGE_INFORMATION_MIN_LEN);
9628 memset(&packet2, 0,
sizeof(packet2));
9629 mavlink_msg_storage_information_encode(system_id, component_id, &msg, &packet1);
9630 mavlink_msg_storage_information_decode(&msg, &packet2);
9631 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9633 memset(&packet2, 0,
sizeof(packet2));
9634 mavlink_msg_storage_information_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.storage_id , packet1.storage_count , packet1.status , packet1.total_capacity , packet1.used_capacity , packet1.available_capacity , packet1.read_speed , packet1.write_speed , packet1.type , packet1.name , packet1.storage_usage );
9635 mavlink_msg_storage_information_decode(&msg, &packet2);
9636 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9638 memset(&packet2, 0,
sizeof(packet2));
9639 mavlink_msg_storage_information_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.storage_id , packet1.storage_count , packet1.status , packet1.total_capacity , packet1.used_capacity , packet1.available_capacity , packet1.read_speed , packet1.write_speed , packet1.type , packet1.name , packet1.storage_usage );
9640 mavlink_msg_storage_information_decode(&msg, &packet2);
9641 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9643 memset(&packet2, 0,
sizeof(packet2));
9644 mavlink_msg_to_send_buffer(buffer, &msg);
9645 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9646 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9648 mavlink_msg_storage_information_decode(last_msg, &packet2);
9649 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9651 memset(&packet2, 0,
sizeof(packet2));
9652 mavlink_msg_storage_information_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.storage_id , packet1.storage_count , packet1.status , packet1.total_capacity , packet1.used_capacity , packet1.available_capacity , packet1.read_speed , packet1.write_speed , packet1.type , packet1.name , packet1.storage_usage );
9653 mavlink_msg_storage_information_decode(last_msg, &packet2);
9654 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9656#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9657 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"STORAGE_INFORMATION") != NULL);
9658 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_STORAGE_INFORMATION) != NULL);
9662static void mavlink_test_camera_capture_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9664#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9665 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9666 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS >= 256) {
9670 mavlink_message_t msg;
9671 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9673 mavlink_camera_capture_status_t packet_in = {
9674 963497464,45.0,963497880,101.0,53,120,963498400,199
9676 mavlink_camera_capture_status_t packet1, packet2;
9677 memset(&packet1, 0,
sizeof(packet1));
9678 packet1.time_boot_ms = packet_in.time_boot_ms;
9679 packet1.image_interval = packet_in.image_interval;
9680 packet1.recording_time_ms = packet_in.recording_time_ms;
9681 packet1.available_capacity = packet_in.available_capacity;
9682 packet1.image_status = packet_in.image_status;
9683 packet1.video_status = packet_in.video_status;
9684 packet1.image_count = packet_in.image_count;
9685 packet1.camera_device_id = packet_in.camera_device_id;
9688#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9689 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9691 memset(MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS_MIN_LEN);
9694 memset(&packet2, 0,
sizeof(packet2));
9695 mavlink_msg_camera_capture_status_encode(system_id, component_id, &msg, &packet1);
9696 mavlink_msg_camera_capture_status_decode(&msg, &packet2);
9697 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9699 memset(&packet2, 0,
sizeof(packet2));
9700 mavlink_msg_camera_capture_status_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.image_status , packet1.video_status , packet1.image_interval , packet1.recording_time_ms , packet1.available_capacity , packet1.image_count , packet1.camera_device_id );
9701 mavlink_msg_camera_capture_status_decode(&msg, &packet2);
9702 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9704 memset(&packet2, 0,
sizeof(packet2));
9705 mavlink_msg_camera_capture_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.image_status , packet1.video_status , packet1.image_interval , packet1.recording_time_ms , packet1.available_capacity , packet1.image_count , packet1.camera_device_id );
9706 mavlink_msg_camera_capture_status_decode(&msg, &packet2);
9707 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9709 memset(&packet2, 0,
sizeof(packet2));
9710 mavlink_msg_to_send_buffer(buffer, &msg);
9711 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9712 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9714 mavlink_msg_camera_capture_status_decode(last_msg, &packet2);
9715 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9717 memset(&packet2, 0,
sizeof(packet2));
9718 mavlink_msg_camera_capture_status_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.image_status , packet1.video_status , packet1.image_interval , packet1.recording_time_ms , packet1.available_capacity , packet1.image_count , packet1.camera_device_id );
9719 mavlink_msg_camera_capture_status_decode(last_msg, &packet2);
9720 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9722#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9723 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"CAMERA_CAPTURE_STATUS") != NULL);
9724 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CAMERA_CAPTURE_STATUS) != NULL);
9728static void mavlink_test_camera_image_captured(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9730#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9731 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9732 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED >= 256) {
9736 mavlink_message_t msg;
9737 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9739 mavlink_camera_image_captured_t packet_in = {
9740 93372036854775807ULL,963497880,963498088,963498296,963498504,963498712,{ 213.0, 214.0, 215.0, 216.0 },963499752,149,216,
"YZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRST"
9742 mavlink_camera_image_captured_t packet1, packet2;
9743 memset(&packet1, 0,
sizeof(packet1));
9744 packet1.time_utc = packet_in.time_utc;
9745 packet1.time_boot_ms = packet_in.time_boot_ms;
9746 packet1.lat = packet_in.lat;
9747 packet1.lon = packet_in.lon;
9748 packet1.alt = packet_in.alt;
9749 packet1.relative_alt = packet_in.relative_alt;
9750 packet1.image_index = packet_in.image_index;
9751 packet1.camera_id = packet_in.camera_id;
9752 packet1.capture_result = packet_in.capture_result;
9754 mav_array_memcpy(packet1.q, packet_in.q,
sizeof(
float)*4);
9755 mav_array_memcpy(packet1.file_url, packet_in.file_url,
sizeof(
char)*205);
9757#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9758 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9760 memset(MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED_MIN_LEN);
9763 memset(&packet2, 0,
sizeof(packet2));
9764 mavlink_msg_camera_image_captured_encode(system_id, component_id, &msg, &packet1);
9765 mavlink_msg_camera_image_captured_decode(&msg, &packet2);
9766 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9768 memset(&packet2, 0,
sizeof(packet2));
9769 mavlink_msg_camera_image_captured_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.time_utc , packet1.camera_id , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.q , packet1.image_index , packet1.capture_result , packet1.file_url );
9770 mavlink_msg_camera_image_captured_decode(&msg, &packet2);
9771 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9773 memset(&packet2, 0,
sizeof(packet2));
9774 mavlink_msg_camera_image_captured_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.time_utc , packet1.camera_id , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.q , packet1.image_index , packet1.capture_result , packet1.file_url );
9775 mavlink_msg_camera_image_captured_decode(&msg, &packet2);
9776 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9778 memset(&packet2, 0,
sizeof(packet2));
9779 mavlink_msg_to_send_buffer(buffer, &msg);
9780 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9781 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9783 mavlink_msg_camera_image_captured_decode(last_msg, &packet2);
9784 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9786 memset(&packet2, 0,
sizeof(packet2));
9787 mavlink_msg_camera_image_captured_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.time_utc , packet1.camera_id , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.q , packet1.image_index , packet1.capture_result , packet1.file_url );
9788 mavlink_msg_camera_image_captured_decode(last_msg, &packet2);
9789 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9791#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9792 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"CAMERA_IMAGE_CAPTURED") != NULL);
9793 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CAMERA_IMAGE_CAPTURED) != NULL);
9797static void mavlink_test_flight_information(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9799#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9800 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9801 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FLIGHT_INFORMATION >= 256) {
9805 mavlink_message_t msg;
9806 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9808 mavlink_flight_information_t packet_in = {
9809 93372036854775807ULL,93372036854776311ULL,93372036854776815ULL,963498712,963498920
9811 mavlink_flight_information_t packet1, packet2;
9812 memset(&packet1, 0,
sizeof(packet1));
9813 packet1.arming_time_utc = packet_in.arming_time_utc;
9814 packet1.takeoff_time_utc = packet_in.takeoff_time_utc;
9815 packet1.flight_uuid = packet_in.flight_uuid;
9816 packet1.time_boot_ms = packet_in.time_boot_ms;
9817 packet1.landing_time = packet_in.landing_time;
9820#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9821 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9823 memset(MAVLINK_MSG_ID_FLIGHT_INFORMATION_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_FLIGHT_INFORMATION_MIN_LEN);
9826 memset(&packet2, 0,
sizeof(packet2));
9827 mavlink_msg_flight_information_encode(system_id, component_id, &msg, &packet1);
9828 mavlink_msg_flight_information_decode(&msg, &packet2);
9829 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9831 memset(&packet2, 0,
sizeof(packet2));
9832 mavlink_msg_flight_information_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.arming_time_utc , packet1.takeoff_time_utc , packet1.flight_uuid , packet1.landing_time );
9833 mavlink_msg_flight_information_decode(&msg, &packet2);
9834 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9836 memset(&packet2, 0,
sizeof(packet2));
9837 mavlink_msg_flight_information_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.arming_time_utc , packet1.takeoff_time_utc , packet1.flight_uuid , packet1.landing_time );
9838 mavlink_msg_flight_information_decode(&msg, &packet2);
9839 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9841 memset(&packet2, 0,
sizeof(packet2));
9842 mavlink_msg_to_send_buffer(buffer, &msg);
9843 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9844 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9846 mavlink_msg_flight_information_decode(last_msg, &packet2);
9847 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9849 memset(&packet2, 0,
sizeof(packet2));
9850 mavlink_msg_flight_information_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.arming_time_utc , packet1.takeoff_time_utc , packet1.flight_uuid , packet1.landing_time );
9851 mavlink_msg_flight_information_decode(last_msg, &packet2);
9852 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9854#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9855 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"FLIGHT_INFORMATION") != NULL);
9856 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_FLIGHT_INFORMATION) != NULL);
9860static void mavlink_test_mount_orientation(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9862#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9863 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9864 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MOUNT_ORIENTATION >= 256) {
9868 mavlink_message_t msg;
9869 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9871 mavlink_mount_orientation_t packet_in = {
9872 963497464,45.0,73.0,101.0,129.0
9874 mavlink_mount_orientation_t packet1, packet2;
9875 memset(&packet1, 0,
sizeof(packet1));
9876 packet1.time_boot_ms = packet_in.time_boot_ms;
9877 packet1.roll = packet_in.roll;
9878 packet1.pitch = packet_in.pitch;
9879 packet1.yaw = packet_in.yaw;
9880 packet1.yaw_absolute = packet_in.yaw_absolute;
9883#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9884 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9886 memset(MAVLINK_MSG_ID_MOUNT_ORIENTATION_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_MOUNT_ORIENTATION_MIN_LEN);
9889 memset(&packet2, 0,
sizeof(packet2));
9890 mavlink_msg_mount_orientation_encode(system_id, component_id, &msg, &packet1);
9891 mavlink_msg_mount_orientation_decode(&msg, &packet2);
9892 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9894 memset(&packet2, 0,
sizeof(packet2));
9895 mavlink_msg_mount_orientation_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.yaw_absolute );
9896 mavlink_msg_mount_orientation_decode(&msg, &packet2);
9897 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9899 memset(&packet2, 0,
sizeof(packet2));
9900 mavlink_msg_mount_orientation_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.yaw_absolute );
9901 mavlink_msg_mount_orientation_decode(&msg, &packet2);
9902 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9904 memset(&packet2, 0,
sizeof(packet2));
9905 mavlink_msg_to_send_buffer(buffer, &msg);
9906 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9907 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9909 mavlink_msg_mount_orientation_decode(last_msg, &packet2);
9910 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9912 memset(&packet2, 0,
sizeof(packet2));
9913 mavlink_msg_mount_orientation_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.roll , packet1.pitch , packet1.yaw , packet1.yaw_absolute );
9914 mavlink_msg_mount_orientation_decode(last_msg, &packet2);
9915 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9917#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9918 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"MOUNT_ORIENTATION") != NULL);
9919 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_MOUNT_ORIENTATION) != NULL);
9923static void mavlink_test_logging_data(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9925#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9926 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9927 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOGGING_DATA >= 256) {
9931 mavlink_message_t msg;
9932 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9934 mavlink_logging_data_t packet_in = {
9935 17235,139,206,17,84,{ 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 }
9937 mavlink_logging_data_t packet1, packet2;
9938 memset(&packet1, 0,
sizeof(packet1));
9939 packet1.sequence = packet_in.sequence;
9940 packet1.target_system = packet_in.target_system;
9941 packet1.target_component = packet_in.target_component;
9942 packet1.length = packet_in.length;
9943 packet1.first_message_offset = packet_in.first_message_offset;
9945 mav_array_memcpy(packet1.data, packet_in.data,
sizeof(uint8_t)*249);
9947#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9948 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
9950 memset(MAVLINK_MSG_ID_LOGGING_DATA_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_LOGGING_DATA_MIN_LEN);
9953 memset(&packet2, 0,
sizeof(packet2));
9954 mavlink_msg_logging_data_encode(system_id, component_id, &msg, &packet1);
9955 mavlink_msg_logging_data_decode(&msg, &packet2);
9956 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9958 memset(&packet2, 0,
sizeof(packet2));
9959 mavlink_msg_logging_data_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.sequence , packet1.length , packet1.first_message_offset , packet1.data );
9960 mavlink_msg_logging_data_decode(&msg, &packet2);
9961 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9963 memset(&packet2, 0,
sizeof(packet2));
9964 mavlink_msg_logging_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.sequence , packet1.length , packet1.first_message_offset , packet1.data );
9965 mavlink_msg_logging_data_decode(&msg, &packet2);
9966 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9968 memset(&packet2, 0,
sizeof(packet2));
9969 mavlink_msg_to_send_buffer(buffer, &msg);
9970 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
9971 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
9973 mavlink_msg_logging_data_decode(last_msg, &packet2);
9974 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9976 memset(&packet2, 0,
sizeof(packet2));
9977 mavlink_msg_logging_data_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.sequence , packet1.length , packet1.first_message_offset , packet1.data );
9978 mavlink_msg_logging_data_decode(last_msg, &packet2);
9979 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
9981#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
9982 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"LOGGING_DATA") != NULL);
9983 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOGGING_DATA) != NULL);
9987static void mavlink_test_logging_data_acked(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
9989#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
9990 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
9991 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOGGING_DATA_ACKED >= 256) {
9995 mavlink_message_t msg;
9996 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
9998 mavlink_logging_data_acked_t packet_in = {
9999 17235,139,206,17,84,{ 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143 }
10001 mavlink_logging_data_acked_t packet1, packet2;
10002 memset(&packet1, 0,
sizeof(packet1));
10003 packet1.sequence = packet_in.sequence;
10004 packet1.target_system = packet_in.target_system;
10005 packet1.target_component = packet_in.target_component;
10006 packet1.length = packet_in.length;
10007 packet1.first_message_offset = packet_in.first_message_offset;
10009 mav_array_memcpy(packet1.data, packet_in.data,
sizeof(uint8_t)*249);
10011#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10012 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10014 memset(MAVLINK_MSG_ID_LOGGING_DATA_ACKED_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_LOGGING_DATA_ACKED_MIN_LEN);
10017 memset(&packet2, 0,
sizeof(packet2));
10018 mavlink_msg_logging_data_acked_encode(system_id, component_id, &msg, &packet1);
10019 mavlink_msg_logging_data_acked_decode(&msg, &packet2);
10020 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10022 memset(&packet2, 0,
sizeof(packet2));
10023 mavlink_msg_logging_data_acked_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.sequence , packet1.length , packet1.first_message_offset , packet1.data );
10024 mavlink_msg_logging_data_acked_decode(&msg, &packet2);
10025 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10027 memset(&packet2, 0,
sizeof(packet2));
10028 mavlink_msg_logging_data_acked_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.sequence , packet1.length , packet1.first_message_offset , packet1.data );
10029 mavlink_msg_logging_data_acked_decode(&msg, &packet2);
10030 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10032 memset(&packet2, 0,
sizeof(packet2));
10033 mavlink_msg_to_send_buffer(buffer, &msg);
10034 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10035 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10037 mavlink_msg_logging_data_acked_decode(last_msg, &packet2);
10038 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10040 memset(&packet2, 0,
sizeof(packet2));
10041 mavlink_msg_logging_data_acked_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.sequence , packet1.length , packet1.first_message_offset , packet1.data );
10042 mavlink_msg_logging_data_acked_decode(last_msg, &packet2);
10043 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10045#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10046 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"LOGGING_DATA_ACKED") != NULL);
10047 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOGGING_DATA_ACKED) != NULL);
10051static void mavlink_test_logging_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10053#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10054 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10055 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LOGGING_ACK >= 256) {
10059 mavlink_message_t msg;
10060 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10062 mavlink_logging_ack_t packet_in = {
10065 mavlink_logging_ack_t packet1, packet2;
10066 memset(&packet1, 0,
sizeof(packet1));
10067 packet1.sequence = packet_in.sequence;
10068 packet1.target_system = packet_in.target_system;
10069 packet1.target_component = packet_in.target_component;
10072#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10073 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10075 memset(MAVLINK_MSG_ID_LOGGING_ACK_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_LOGGING_ACK_MIN_LEN);
10078 memset(&packet2, 0,
sizeof(packet2));
10079 mavlink_msg_logging_ack_encode(system_id, component_id, &msg, &packet1);
10080 mavlink_msg_logging_ack_decode(&msg, &packet2);
10081 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10083 memset(&packet2, 0,
sizeof(packet2));
10084 mavlink_msg_logging_ack_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.sequence );
10085 mavlink_msg_logging_ack_decode(&msg, &packet2);
10086 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10088 memset(&packet2, 0,
sizeof(packet2));
10089 mavlink_msg_logging_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.sequence );
10090 mavlink_msg_logging_ack_decode(&msg, &packet2);
10091 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10093 memset(&packet2, 0,
sizeof(packet2));
10094 mavlink_msg_to_send_buffer(buffer, &msg);
10095 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10096 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10098 mavlink_msg_logging_ack_decode(last_msg, &packet2);
10099 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10101 memset(&packet2, 0,
sizeof(packet2));
10102 mavlink_msg_logging_ack_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.sequence );
10103 mavlink_msg_logging_ack_decode(last_msg, &packet2);
10104 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10106#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10107 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"LOGGING_ACK") != NULL);
10108 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_LOGGING_ACK) != NULL);
10112static void mavlink_test_video_stream_information(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10114#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10115 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10116 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION >= 256) {
10120 mavlink_message_t msg;
10121 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10123 mavlink_video_stream_information_t packet_in = {
10124 17.0,963497672,17651,17755,17859,17963,18067,187,254,65,
"VWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ",
"BCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCD",196,7
10126 mavlink_video_stream_information_t packet1, packet2;
10127 memset(&packet1, 0,
sizeof(packet1));
10128 packet1.framerate = packet_in.framerate;
10129 packet1.bitrate = packet_in.bitrate;
10130 packet1.flags = packet_in.flags;
10131 packet1.resolution_h = packet_in.resolution_h;
10132 packet1.resolution_v = packet_in.resolution_v;
10133 packet1.rotation = packet_in.rotation;
10134 packet1.hfov = packet_in.hfov;
10135 packet1.stream_id = packet_in.stream_id;
10136 packet1.count = packet_in.count;
10137 packet1.type = packet_in.type;
10138 packet1.encoding = packet_in.encoding;
10139 packet1.camera_device_id = packet_in.camera_device_id;
10141 mav_array_memcpy(packet1.name, packet_in.name,
sizeof(
char)*32);
10142 mav_array_memcpy(packet1.uri, packet_in.uri,
sizeof(
char)*160);
10144#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10145 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10147 memset(MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION_MIN_LEN);
10150 memset(&packet2, 0,
sizeof(packet2));
10151 mavlink_msg_video_stream_information_encode(system_id, component_id, &msg, &packet1);
10152 mavlink_msg_video_stream_information_decode(&msg, &packet2);
10153 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10155 memset(&packet2, 0,
sizeof(packet2));
10156 mavlink_msg_video_stream_information_pack(system_id, component_id, &msg , packet1.stream_id , packet1.count , packet1.type , packet1.flags , packet1.framerate , packet1.resolution_h , packet1.resolution_v , packet1.bitrate , packet1.rotation , packet1.hfov , packet1.name , packet1.uri , packet1.encoding , packet1.camera_device_id );
10157 mavlink_msg_video_stream_information_decode(&msg, &packet2);
10158 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10160 memset(&packet2, 0,
sizeof(packet2));
10161 mavlink_msg_video_stream_information_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.stream_id , packet1.count , packet1.type , packet1.flags , packet1.framerate , packet1.resolution_h , packet1.resolution_v , packet1.bitrate , packet1.rotation , packet1.hfov , packet1.name , packet1.uri , packet1.encoding , packet1.camera_device_id );
10162 mavlink_msg_video_stream_information_decode(&msg, &packet2);
10163 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10165 memset(&packet2, 0,
sizeof(packet2));
10166 mavlink_msg_to_send_buffer(buffer, &msg);
10167 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10168 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10170 mavlink_msg_video_stream_information_decode(last_msg, &packet2);
10171 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10173 memset(&packet2, 0,
sizeof(packet2));
10174 mavlink_msg_video_stream_information_send(MAVLINK_COMM_1 , packet1.stream_id , packet1.count , packet1.type , packet1.flags , packet1.framerate , packet1.resolution_h , packet1.resolution_v , packet1.bitrate , packet1.rotation , packet1.hfov , packet1.name , packet1.uri , packet1.encoding , packet1.camera_device_id );
10175 mavlink_msg_video_stream_information_decode(last_msg, &packet2);
10176 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10178#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10179 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"VIDEO_STREAM_INFORMATION") != NULL);
10180 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_VIDEO_STREAM_INFORMATION) != NULL);
10184static void mavlink_test_video_stream_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_VIDEO_STREAM_STATUS >= 256) {
10192 mavlink_message_t msg;
10193 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10195 mavlink_video_stream_status_t packet_in = {
10196 17.0,963497672,17651,17755,17859,17963,18067,187,254
10198 mavlink_video_stream_status_t packet1, packet2;
10199 memset(&packet1, 0,
sizeof(packet1));
10200 packet1.framerate = packet_in.framerate;
10201 packet1.bitrate = packet_in.bitrate;
10202 packet1.flags = packet_in.flags;
10203 packet1.resolution_h = packet_in.resolution_h;
10204 packet1.resolution_v = packet_in.resolution_v;
10205 packet1.rotation = packet_in.rotation;
10206 packet1.hfov = packet_in.hfov;
10207 packet1.stream_id = packet_in.stream_id;
10208 packet1.camera_device_id = packet_in.camera_device_id;
10211#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10212 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10214 memset(MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_VIDEO_STREAM_STATUS_MIN_LEN);
10217 memset(&packet2, 0,
sizeof(packet2));
10218 mavlink_msg_video_stream_status_encode(system_id, component_id, &msg, &packet1);
10219 mavlink_msg_video_stream_status_decode(&msg, &packet2);
10220 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10222 memset(&packet2, 0,
sizeof(packet2));
10223 mavlink_msg_video_stream_status_pack(system_id, component_id, &msg , packet1.stream_id , packet1.flags , packet1.framerate , packet1.resolution_h , packet1.resolution_v , packet1.bitrate , packet1.rotation , packet1.hfov , packet1.camera_device_id );
10224 mavlink_msg_video_stream_status_decode(&msg, &packet2);
10225 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10227 memset(&packet2, 0,
sizeof(packet2));
10228 mavlink_msg_video_stream_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.stream_id , packet1.flags , packet1.framerate , packet1.resolution_h , packet1.resolution_v , packet1.bitrate , packet1.rotation , packet1.hfov , packet1.camera_device_id );
10229 mavlink_msg_video_stream_status_decode(&msg, &packet2);
10230 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
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_video_stream_status_decode(last_msg, &packet2);
10238 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10240 memset(&packet2, 0,
sizeof(packet2));
10241 mavlink_msg_video_stream_status_send(MAVLINK_COMM_1 , packet1.stream_id , packet1.flags , packet1.framerate , packet1.resolution_h , packet1.resolution_v , packet1.bitrate , packet1.rotation , packet1.hfov , packet1.camera_device_id );
10242 mavlink_msg_video_stream_status_decode(last_msg, &packet2);
10243 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10245#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10246 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"VIDEO_STREAM_STATUS") != NULL);
10247 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_VIDEO_STREAM_STATUS) != NULL);
10251static void mavlink_test_camera_fov_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10253#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10254 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10255 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_FOV_STATUS >= 256) {
10259 mavlink_message_t msg;
10260 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10262 mavlink_camera_fov_status_t packet_in = {
10263 963497464,963497672,963497880,963498088,963498296,963498504,963498712,{ 213.0, 214.0, 215.0, 216.0 },325.0,353.0,161
10265 mavlink_camera_fov_status_t packet1, packet2;
10266 memset(&packet1, 0,
sizeof(packet1));
10267 packet1.time_boot_ms = packet_in.time_boot_ms;
10268 packet1.lat_camera = packet_in.lat_camera;
10269 packet1.lon_camera = packet_in.lon_camera;
10270 packet1.alt_camera = packet_in.alt_camera;
10271 packet1.lat_image = packet_in.lat_image;
10272 packet1.lon_image = packet_in.lon_image;
10273 packet1.alt_image = packet_in.alt_image;
10274 packet1.hfov = packet_in.hfov;
10275 packet1.vfov = packet_in.vfov;
10276 packet1.camera_device_id = packet_in.camera_device_id;
10278 mav_array_memcpy(packet1.q, packet_in.q,
sizeof(
float)*4);
10280#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10281 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10283 memset(MAVLINK_MSG_ID_CAMERA_FOV_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_FOV_STATUS_MIN_LEN);
10286 memset(&packet2, 0,
sizeof(packet2));
10287 mavlink_msg_camera_fov_status_encode(system_id, component_id, &msg, &packet1);
10288 mavlink_msg_camera_fov_status_decode(&msg, &packet2);
10289 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10291 memset(&packet2, 0,
sizeof(packet2));
10292 mavlink_msg_camera_fov_status_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.lat_camera , packet1.lon_camera , packet1.alt_camera , packet1.lat_image , packet1.lon_image , packet1.alt_image , packet1.q , packet1.hfov , packet1.vfov , packet1.camera_device_id );
10293 mavlink_msg_camera_fov_status_decode(&msg, &packet2);
10294 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10296 memset(&packet2, 0,
sizeof(packet2));
10297 mavlink_msg_camera_fov_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.lat_camera , packet1.lon_camera , packet1.alt_camera , packet1.lat_image , packet1.lon_image , packet1.alt_image , packet1.q , packet1.hfov , packet1.vfov , packet1.camera_device_id );
10298 mavlink_msg_camera_fov_status_decode(&msg, &packet2);
10299 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10301 memset(&packet2, 0,
sizeof(packet2));
10302 mavlink_msg_to_send_buffer(buffer, &msg);
10303 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10304 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10306 mavlink_msg_camera_fov_status_decode(last_msg, &packet2);
10307 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10309 memset(&packet2, 0,
sizeof(packet2));
10310 mavlink_msg_camera_fov_status_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.lat_camera , packet1.lon_camera , packet1.alt_camera , packet1.lat_image , packet1.lon_image , packet1.alt_image , packet1.q , packet1.hfov , packet1.vfov , packet1.camera_device_id );
10311 mavlink_msg_camera_fov_status_decode(last_msg, &packet2);
10312 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10314#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10315 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"CAMERA_FOV_STATUS") != NULL);
10316 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CAMERA_FOV_STATUS) != NULL);
10320static void mavlink_test_camera_tracking_image_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10322#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10323 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10324 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS >= 256) {
10328 mavlink_message_t msg;
10329 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10331 mavlink_camera_tracking_image_status_t packet_in = {
10332 17.0,45.0,73.0,101.0,129.0,157.0,185.0,89,156,223,34
10334 mavlink_camera_tracking_image_status_t packet1, packet2;
10335 memset(&packet1, 0,
sizeof(packet1));
10336 packet1.point_x = packet_in.point_x;
10337 packet1.point_y = packet_in.point_y;
10338 packet1.radius = packet_in.radius;
10339 packet1.rec_top_x = packet_in.rec_top_x;
10340 packet1.rec_top_y = packet_in.rec_top_y;
10341 packet1.rec_bottom_x = packet_in.rec_bottom_x;
10342 packet1.rec_bottom_y = packet_in.rec_bottom_y;
10343 packet1.tracking_status = packet_in.tracking_status;
10344 packet1.tracking_mode = packet_in.tracking_mode;
10345 packet1.target_data = packet_in.target_data;
10346 packet1.camera_device_id = packet_in.camera_device_id;
10349#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10350 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10352 memset(MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS_MIN_LEN);
10355 memset(&packet2, 0,
sizeof(packet2));
10356 mavlink_msg_camera_tracking_image_status_encode(system_id, component_id, &msg, &packet1);
10357 mavlink_msg_camera_tracking_image_status_decode(&msg, &packet2);
10358 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10360 memset(&packet2, 0,
sizeof(packet2));
10361 mavlink_msg_camera_tracking_image_status_pack(system_id, component_id, &msg , packet1.tracking_status , packet1.tracking_mode , packet1.target_data , packet1.point_x , packet1.point_y , packet1.radius , packet1.rec_top_x , packet1.rec_top_y , packet1.rec_bottom_x , packet1.rec_bottom_y , packet1.camera_device_id );
10362 mavlink_msg_camera_tracking_image_status_decode(&msg, &packet2);
10363 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10365 memset(&packet2, 0,
sizeof(packet2));
10366 mavlink_msg_camera_tracking_image_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.tracking_status , packet1.tracking_mode , packet1.target_data , packet1.point_x , packet1.point_y , packet1.radius , packet1.rec_top_x , packet1.rec_top_y , packet1.rec_bottom_x , packet1.rec_bottom_y , packet1.camera_device_id );
10367 mavlink_msg_camera_tracking_image_status_decode(&msg, &packet2);
10368 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10370 memset(&packet2, 0,
sizeof(packet2));
10371 mavlink_msg_to_send_buffer(buffer, &msg);
10372 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10373 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10375 mavlink_msg_camera_tracking_image_status_decode(last_msg, &packet2);
10376 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10378 memset(&packet2, 0,
sizeof(packet2));
10379 mavlink_msg_camera_tracking_image_status_send(MAVLINK_COMM_1 , packet1.tracking_status , packet1.tracking_mode , packet1.target_data , packet1.point_x , packet1.point_y , packet1.radius , packet1.rec_top_x , packet1.rec_top_y , packet1.rec_bottom_x , packet1.rec_bottom_y , packet1.camera_device_id );
10380 mavlink_msg_camera_tracking_image_status_decode(last_msg, &packet2);
10381 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10383#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10384 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"CAMERA_TRACKING_IMAGE_STATUS") != NULL);
10385 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CAMERA_TRACKING_IMAGE_STATUS) != NULL);
10389static void mavlink_test_camera_tracking_geo_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10391#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10392 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10393 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_TRACKING_GEO_STATUS >= 256) {
10397 mavlink_message_t msg;
10398 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10400 mavlink_camera_tracking_geo_status_t packet_in = {
10401 963497464,963497672,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,149,216
10403 mavlink_camera_tracking_geo_status_t packet1, packet2;
10404 memset(&packet1, 0,
sizeof(packet1));
10405 packet1.lat = packet_in.lat;
10406 packet1.lon = packet_in.lon;
10407 packet1.alt = packet_in.alt;
10408 packet1.h_acc = packet_in.h_acc;
10409 packet1.v_acc = packet_in.v_acc;
10410 packet1.vel_n = packet_in.vel_n;
10411 packet1.vel_e = packet_in.vel_e;
10412 packet1.vel_d = packet_in.vel_d;
10413 packet1.vel_acc = packet_in.vel_acc;
10414 packet1.dist = packet_in.dist;
10415 packet1.hdg = packet_in.hdg;
10416 packet1.hdg_acc = packet_in.hdg_acc;
10417 packet1.tracking_status = packet_in.tracking_status;
10418 packet1.camera_device_id = packet_in.camera_device_id;
10421#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10422 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10424 memset(MAVLINK_MSG_ID_CAMERA_TRACKING_GEO_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_TRACKING_GEO_STATUS_MIN_LEN);
10427 memset(&packet2, 0,
sizeof(packet2));
10428 mavlink_msg_camera_tracking_geo_status_encode(system_id, component_id, &msg, &packet1);
10429 mavlink_msg_camera_tracking_geo_status_decode(&msg, &packet2);
10430 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10432 memset(&packet2, 0,
sizeof(packet2));
10433 mavlink_msg_camera_tracking_geo_status_pack(system_id, component_id, &msg , packet1.tracking_status , packet1.lat , packet1.lon , packet1.alt , packet1.h_acc , packet1.v_acc , packet1.vel_n , packet1.vel_e , packet1.vel_d , packet1.vel_acc , packet1.dist , packet1.hdg , packet1.hdg_acc , packet1.camera_device_id );
10434 mavlink_msg_camera_tracking_geo_status_decode(&msg, &packet2);
10435 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10437 memset(&packet2, 0,
sizeof(packet2));
10438 mavlink_msg_camera_tracking_geo_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.tracking_status , packet1.lat , packet1.lon , packet1.alt , packet1.h_acc , packet1.v_acc , packet1.vel_n , packet1.vel_e , packet1.vel_d , packet1.vel_acc , packet1.dist , packet1.hdg , packet1.hdg_acc , packet1.camera_device_id );
10439 mavlink_msg_camera_tracking_geo_status_decode(&msg, &packet2);
10440 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10442 memset(&packet2, 0,
sizeof(packet2));
10443 mavlink_msg_to_send_buffer(buffer, &msg);
10444 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10445 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10447 mavlink_msg_camera_tracking_geo_status_decode(last_msg, &packet2);
10448 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10450 memset(&packet2, 0,
sizeof(packet2));
10451 mavlink_msg_camera_tracking_geo_status_send(MAVLINK_COMM_1 , packet1.tracking_status , packet1.lat , packet1.lon , packet1.alt , packet1.h_acc , packet1.v_acc , packet1.vel_n , packet1.vel_e , packet1.vel_d , packet1.vel_acc , packet1.dist , packet1.hdg , packet1.hdg_acc , packet1.camera_device_id );
10452 mavlink_msg_camera_tracking_geo_status_decode(last_msg, &packet2);
10453 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10455#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10456 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"CAMERA_TRACKING_GEO_STATUS") != NULL);
10457 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CAMERA_TRACKING_GEO_STATUS) != NULL);
10461static void mavlink_test_camera_thermal_range(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10463#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10464 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10465 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_THERMAL_RANGE >= 256) {
10469 mavlink_message_t msg;
10470 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10472 mavlink_camera_thermal_range_t packet_in = {
10473 963497464,45.0,73.0,101.0,129.0,157.0,185.0,89,156
10475 mavlink_camera_thermal_range_t packet1, packet2;
10476 memset(&packet1, 0,
sizeof(packet1));
10477 packet1.time_boot_ms = packet_in.time_boot_ms;
10478 packet1.max = packet_in.max;
10479 packet1.max_point_x = packet_in.max_point_x;
10480 packet1.max_point_y = packet_in.max_point_y;
10481 packet1.min = packet_in.min;
10482 packet1.min_point_x = packet_in.min_point_x;
10483 packet1.min_point_y = packet_in.min_point_y;
10484 packet1.stream_id = packet_in.stream_id;
10485 packet1.camera_device_id = packet_in.camera_device_id;
10488#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10489 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10491 memset(MAVLINK_MSG_ID_CAMERA_THERMAL_RANGE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_THERMAL_RANGE_MIN_LEN);
10494 memset(&packet2, 0,
sizeof(packet2));
10495 mavlink_msg_camera_thermal_range_encode(system_id, component_id, &msg, &packet1);
10496 mavlink_msg_camera_thermal_range_decode(&msg, &packet2);
10497 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10499 memset(&packet2, 0,
sizeof(packet2));
10500 mavlink_msg_camera_thermal_range_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.stream_id , packet1.camera_device_id , packet1.max , packet1.max_point_x , packet1.max_point_y , packet1.min , packet1.min_point_x , packet1.min_point_y );
10501 mavlink_msg_camera_thermal_range_decode(&msg, &packet2);
10502 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10504 memset(&packet2, 0,
sizeof(packet2));
10505 mavlink_msg_camera_thermal_range_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.stream_id , packet1.camera_device_id , packet1.max , packet1.max_point_x , packet1.max_point_y , packet1.min , packet1.min_point_x , packet1.min_point_y );
10506 mavlink_msg_camera_thermal_range_decode(&msg, &packet2);
10507 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10509 memset(&packet2, 0,
sizeof(packet2));
10510 mavlink_msg_to_send_buffer(buffer, &msg);
10511 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10512 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10514 mavlink_msg_camera_thermal_range_decode(last_msg, &packet2);
10515 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10517 memset(&packet2, 0,
sizeof(packet2));
10518 mavlink_msg_camera_thermal_range_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.stream_id , packet1.camera_device_id , packet1.max , packet1.max_point_x , packet1.max_point_y , packet1.min , packet1.min_point_x , packet1.min_point_y );
10519 mavlink_msg_camera_thermal_range_decode(last_msg, &packet2);
10520 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10522#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10523 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"CAMERA_THERMAL_RANGE") != NULL);
10524 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CAMERA_THERMAL_RANGE) != NULL);
10528static void mavlink_test_gimbal_manager_information(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10530#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10531 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10532 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION >= 256) {
10536 mavlink_message_t msg;
10537 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10539 mavlink_gimbal_manager_information_t packet_in = {
10540 963497464,963497672,73.0,101.0,129.0,157.0,185.0,213.0,101
10542 mavlink_gimbal_manager_information_t packet1, packet2;
10543 memset(&packet1, 0,
sizeof(packet1));
10544 packet1.time_boot_ms = packet_in.time_boot_ms;
10545 packet1.cap_flags = packet_in.cap_flags;
10546 packet1.roll_min = packet_in.roll_min;
10547 packet1.roll_max = packet_in.roll_max;
10548 packet1.pitch_min = packet_in.pitch_min;
10549 packet1.pitch_max = packet_in.pitch_max;
10550 packet1.yaw_min = packet_in.yaw_min;
10551 packet1.yaw_max = packet_in.yaw_max;
10552 packet1.gimbal_device_id = packet_in.gimbal_device_id;
10555#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10556 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10558 memset(MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION_MIN_LEN);
10561 memset(&packet2, 0,
sizeof(packet2));
10562 mavlink_msg_gimbal_manager_information_encode(system_id, component_id, &msg, &packet1);
10563 mavlink_msg_gimbal_manager_information_decode(&msg, &packet2);
10564 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10566 memset(&packet2, 0,
sizeof(packet2));
10567 mavlink_msg_gimbal_manager_information_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.cap_flags , packet1.gimbal_device_id , packet1.roll_min , packet1.roll_max , packet1.pitch_min , packet1.pitch_max , packet1.yaw_min , packet1.yaw_max );
10568 mavlink_msg_gimbal_manager_information_decode(&msg, &packet2);
10569 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10571 memset(&packet2, 0,
sizeof(packet2));
10572 mavlink_msg_gimbal_manager_information_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.cap_flags , packet1.gimbal_device_id , packet1.roll_min , packet1.roll_max , packet1.pitch_min , packet1.pitch_max , packet1.yaw_min , packet1.yaw_max );
10573 mavlink_msg_gimbal_manager_information_decode(&msg, &packet2);
10574 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10576 memset(&packet2, 0,
sizeof(packet2));
10577 mavlink_msg_to_send_buffer(buffer, &msg);
10578 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10579 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10581 mavlink_msg_gimbal_manager_information_decode(last_msg, &packet2);
10582 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10584 memset(&packet2, 0,
sizeof(packet2));
10585 mavlink_msg_gimbal_manager_information_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.cap_flags , packet1.gimbal_device_id , packet1.roll_min , packet1.roll_max , packet1.pitch_min , packet1.pitch_max , packet1.yaw_min , packet1.yaw_max );
10586 mavlink_msg_gimbal_manager_information_decode(last_msg, &packet2);
10587 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10589#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10590 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"GIMBAL_MANAGER_INFORMATION") != NULL);
10591 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GIMBAL_MANAGER_INFORMATION) != NULL);
10595static void mavlink_test_gimbal_manager_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10597#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10598 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10599 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_MANAGER_STATUS >= 256) {
10603 mavlink_message_t msg;
10604 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10606 mavlink_gimbal_manager_status_t packet_in = {
10607 963497464,963497672,29,96,163,230,41
10609 mavlink_gimbal_manager_status_t packet1, packet2;
10610 memset(&packet1, 0,
sizeof(packet1));
10611 packet1.time_boot_ms = packet_in.time_boot_ms;
10612 packet1.flags = packet_in.flags;
10613 packet1.gimbal_device_id = packet_in.gimbal_device_id;
10614 packet1.primary_control_sysid = packet_in.primary_control_sysid;
10615 packet1.primary_control_compid = packet_in.primary_control_compid;
10616 packet1.secondary_control_sysid = packet_in.secondary_control_sysid;
10617 packet1.secondary_control_compid = packet_in.secondary_control_compid;
10620#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10621 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10623 memset(MAVLINK_MSG_ID_GIMBAL_MANAGER_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_MANAGER_STATUS_MIN_LEN);
10626 memset(&packet2, 0,
sizeof(packet2));
10627 mavlink_msg_gimbal_manager_status_encode(system_id, component_id, &msg, &packet1);
10628 mavlink_msg_gimbal_manager_status_decode(&msg, &packet2);
10629 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10631 memset(&packet2, 0,
sizeof(packet2));
10632 mavlink_msg_gimbal_manager_status_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.flags , packet1.gimbal_device_id , packet1.primary_control_sysid , packet1.primary_control_compid , packet1.secondary_control_sysid , packet1.secondary_control_compid );
10633 mavlink_msg_gimbal_manager_status_decode(&msg, &packet2);
10634 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10636 memset(&packet2, 0,
sizeof(packet2));
10637 mavlink_msg_gimbal_manager_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.flags , packet1.gimbal_device_id , packet1.primary_control_sysid , packet1.primary_control_compid , packet1.secondary_control_sysid , packet1.secondary_control_compid );
10638 mavlink_msg_gimbal_manager_status_decode(&msg, &packet2);
10639 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10641 memset(&packet2, 0,
sizeof(packet2));
10642 mavlink_msg_to_send_buffer(buffer, &msg);
10643 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10644 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10646 mavlink_msg_gimbal_manager_status_decode(last_msg, &packet2);
10647 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10649 memset(&packet2, 0,
sizeof(packet2));
10650 mavlink_msg_gimbal_manager_status_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.flags , packet1.gimbal_device_id , packet1.primary_control_sysid , packet1.primary_control_compid , packet1.secondary_control_sysid , packet1.secondary_control_compid );
10651 mavlink_msg_gimbal_manager_status_decode(last_msg, &packet2);
10652 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10654#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10655 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"GIMBAL_MANAGER_STATUS") != NULL);
10656 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GIMBAL_MANAGER_STATUS) != NULL);
10660static void mavlink_test_gimbal_manager_set_attitude(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10662#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10663 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10664 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_ATTITUDE >= 256) {
10668 mavlink_message_t msg;
10669 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10671 mavlink_gimbal_manager_set_attitude_t packet_in = {
10672 963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,101,168,235
10674 mavlink_gimbal_manager_set_attitude_t packet1, packet2;
10675 memset(&packet1, 0,
sizeof(packet1));
10676 packet1.flags = packet_in.flags;
10677 packet1.angular_velocity_x = packet_in.angular_velocity_x;
10678 packet1.angular_velocity_y = packet_in.angular_velocity_y;
10679 packet1.angular_velocity_z = packet_in.angular_velocity_z;
10680 packet1.target_system = packet_in.target_system;
10681 packet1.target_component = packet_in.target_component;
10682 packet1.gimbal_device_id = packet_in.gimbal_device_id;
10684 mav_array_memcpy(packet1.q, packet_in.q,
sizeof(
float)*4);
10686#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10687 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10689 memset(MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_ATTITUDE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_ATTITUDE_MIN_LEN);
10692 memset(&packet2, 0,
sizeof(packet2));
10693 mavlink_msg_gimbal_manager_set_attitude_encode(system_id, component_id, &msg, &packet1);
10694 mavlink_msg_gimbal_manager_set_attitude_decode(&msg, &packet2);
10695 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10697 memset(&packet2, 0,
sizeof(packet2));
10698 mavlink_msg_gimbal_manager_set_attitude_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.flags , packet1.gimbal_device_id , packet1.q , packet1.angular_velocity_x , packet1.angular_velocity_y , packet1.angular_velocity_z );
10699 mavlink_msg_gimbal_manager_set_attitude_decode(&msg, &packet2);
10700 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10702 memset(&packet2, 0,
sizeof(packet2));
10703 mavlink_msg_gimbal_manager_set_attitude_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.flags , packet1.gimbal_device_id , packet1.q , packet1.angular_velocity_x , packet1.angular_velocity_y , packet1.angular_velocity_z );
10704 mavlink_msg_gimbal_manager_set_attitude_decode(&msg, &packet2);
10705 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10707 memset(&packet2, 0,
sizeof(packet2));
10708 mavlink_msg_to_send_buffer(buffer, &msg);
10709 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10710 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10712 mavlink_msg_gimbal_manager_set_attitude_decode(last_msg, &packet2);
10713 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10715 memset(&packet2, 0,
sizeof(packet2));
10716 mavlink_msg_gimbal_manager_set_attitude_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.flags , packet1.gimbal_device_id , packet1.q , packet1.angular_velocity_x , packet1.angular_velocity_y , packet1.angular_velocity_z );
10717 mavlink_msg_gimbal_manager_set_attitude_decode(last_msg, &packet2);
10718 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10720#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10721 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"GIMBAL_MANAGER_SET_ATTITUDE") != NULL);
10722 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_ATTITUDE) != NULL);
10726static void mavlink_test_gimbal_device_information(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10728#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10729 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10730 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION >= 256) {
10734 mavlink_message_t msg;
10735 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10737 mavlink_gimbal_device_information_t packet_in = {
10738 93372036854775807ULL,963497880,963498088,963498296,157.0,185.0,213.0,241.0,269.0,297.0,19523,19627,
"WXYZABCDEFGHIJKLMNOPQRSTUVWXYZA",
"CDEFGHIJKLMNOPQRSTUVWXYZABCDEFG",
"IJKLMNOPQRSTUVWXYZABCDEFGHIJKLM",181,963505004
10740 mavlink_gimbal_device_information_t packet1, packet2;
10741 memset(&packet1, 0,
sizeof(packet1));
10742 packet1.uid = packet_in.uid;
10743 packet1.time_boot_ms = packet_in.time_boot_ms;
10744 packet1.firmware_version = packet_in.firmware_version;
10745 packet1.hardware_version = packet_in.hardware_version;
10746 packet1.roll_min = packet_in.roll_min;
10747 packet1.roll_max = packet_in.roll_max;
10748 packet1.pitch_min = packet_in.pitch_min;
10749 packet1.pitch_max = packet_in.pitch_max;
10750 packet1.yaw_min = packet_in.yaw_min;
10751 packet1.yaw_max = packet_in.yaw_max;
10752 packet1.cap_flags = packet_in.cap_flags;
10753 packet1.custom_cap_flags = packet_in.custom_cap_flags;
10754 packet1.gimbal_device_id = packet_in.gimbal_device_id;
10755 packet1.cap_flags2 = packet_in.cap_flags2;
10757 mav_array_memcpy(packet1.vendor_name, packet_in.vendor_name,
sizeof(
char)*32);
10758 mav_array_memcpy(packet1.model_name, packet_in.model_name,
sizeof(
char)*32);
10759 mav_array_memcpy(packet1.custom_name, packet_in.custom_name,
sizeof(
char)*32);
10761#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10762 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10764 memset(MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN);
10767 memset(&packet2, 0,
sizeof(packet2));
10768 mavlink_msg_gimbal_device_information_encode(system_id, component_id, &msg, &packet1);
10769 mavlink_msg_gimbal_device_information_decode(&msg, &packet2);
10770 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10772 memset(&packet2, 0,
sizeof(packet2));
10773 mavlink_msg_gimbal_device_information_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.vendor_name , packet1.model_name , packet1.custom_name , packet1.firmware_version , packet1.hardware_version , packet1.uid , packet1.cap_flags , packet1.custom_cap_flags , packet1.roll_min , packet1.roll_max , packet1.pitch_min , packet1.pitch_max , packet1.yaw_min , packet1.yaw_max , packet1.gimbal_device_id , packet1.cap_flags2 );
10774 mavlink_msg_gimbal_device_information_decode(&msg, &packet2);
10775 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10777 memset(&packet2, 0,
sizeof(packet2));
10778 mavlink_msg_gimbal_device_information_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.vendor_name , packet1.model_name , packet1.custom_name , packet1.firmware_version , packet1.hardware_version , packet1.uid , packet1.cap_flags , packet1.custom_cap_flags , packet1.roll_min , packet1.roll_max , packet1.pitch_min , packet1.pitch_max , packet1.yaw_min , packet1.yaw_max , packet1.gimbal_device_id , packet1.cap_flags2 );
10779 mavlink_msg_gimbal_device_information_decode(&msg, &packet2);
10780 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10782 memset(&packet2, 0,
sizeof(packet2));
10783 mavlink_msg_to_send_buffer(buffer, &msg);
10784 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10785 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10787 mavlink_msg_gimbal_device_information_decode(last_msg, &packet2);
10788 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10790 memset(&packet2, 0,
sizeof(packet2));
10791 mavlink_msg_gimbal_device_information_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.vendor_name , packet1.model_name , packet1.custom_name , packet1.firmware_version , packet1.hardware_version , packet1.uid , packet1.cap_flags , packet1.custom_cap_flags , packet1.roll_min , packet1.roll_max , packet1.pitch_min , packet1.pitch_max , packet1.yaw_min , packet1.yaw_max , packet1.gimbal_device_id , packet1.cap_flags2 );
10792 mavlink_msg_gimbal_device_information_decode(last_msg, &packet2);
10793 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10795#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10796 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"GIMBAL_DEVICE_INFORMATION") != NULL);
10797 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION) != NULL);
10801static void mavlink_test_gimbal_device_set_attitude(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_GIMBAL_DEVICE_SET_ATTITUDE >= 256) {
10809 mavlink_message_t msg;
10810 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10812 mavlink_gimbal_device_set_attitude_t packet_in = {
10813 { 17.0, 18.0, 19.0, 20.0 },129.0,157.0,185.0,18691,223,34
10815 mavlink_gimbal_device_set_attitude_t packet1, packet2;
10816 memset(&packet1, 0,
sizeof(packet1));
10817 packet1.angular_velocity_x = packet_in.angular_velocity_x;
10818 packet1.angular_velocity_y = packet_in.angular_velocity_y;
10819 packet1.angular_velocity_z = packet_in.angular_velocity_z;
10820 packet1.flags = packet_in.flags;
10821 packet1.target_system = packet_in.target_system;
10822 packet1.target_component = packet_in.target_component;
10824 mav_array_memcpy(packet1.q, packet_in.q,
sizeof(
float)*4);
10826#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10827 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10829 memset(MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE_MIN_LEN);
10832 memset(&packet2, 0,
sizeof(packet2));
10833 mavlink_msg_gimbal_device_set_attitude_encode(system_id, component_id, &msg, &packet1);
10834 mavlink_msg_gimbal_device_set_attitude_decode(&msg, &packet2);
10835 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10837 memset(&packet2, 0,
sizeof(packet2));
10838 mavlink_msg_gimbal_device_set_attitude_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.flags , packet1.q , packet1.angular_velocity_x , packet1.angular_velocity_y , packet1.angular_velocity_z );
10839 mavlink_msg_gimbal_device_set_attitude_decode(&msg, &packet2);
10840 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10842 memset(&packet2, 0,
sizeof(packet2));
10843 mavlink_msg_gimbal_device_set_attitude_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.flags , packet1.q , packet1.angular_velocity_x , packet1.angular_velocity_y , packet1.angular_velocity_z );
10844 mavlink_msg_gimbal_device_set_attitude_decode(&msg, &packet2);
10845 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10847 memset(&packet2, 0,
sizeof(packet2));
10848 mavlink_msg_to_send_buffer(buffer, &msg);
10849 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10850 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10852 mavlink_msg_gimbal_device_set_attitude_decode(last_msg, &packet2);
10853 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10855 memset(&packet2, 0,
sizeof(packet2));
10856 mavlink_msg_gimbal_device_set_attitude_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.flags , packet1.q , packet1.angular_velocity_x , packet1.angular_velocity_y , packet1.angular_velocity_z );
10857 mavlink_msg_gimbal_device_set_attitude_decode(last_msg, &packet2);
10858 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10860#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10861 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"GIMBAL_DEVICE_SET_ATTITUDE") != NULL);
10862 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GIMBAL_DEVICE_SET_ATTITUDE) != NULL);
10866static void mavlink_test_gimbal_device_attitude_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10868#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10869 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10870 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS >= 256) {
10874 mavlink_message_t msg;
10875 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10877 mavlink_gimbal_device_attitude_status_t packet_in = {
10878 963497464,{ 45.0, 46.0, 47.0, 48.0 },157.0,185.0,213.0,963499128,19107,247,58,297.0,325.0,149
10880 mavlink_gimbal_device_attitude_status_t packet1, packet2;
10881 memset(&packet1, 0,
sizeof(packet1));
10882 packet1.time_boot_ms = packet_in.time_boot_ms;
10883 packet1.angular_velocity_x = packet_in.angular_velocity_x;
10884 packet1.angular_velocity_y = packet_in.angular_velocity_y;
10885 packet1.angular_velocity_z = packet_in.angular_velocity_z;
10886 packet1.failure_flags = packet_in.failure_flags;
10887 packet1.flags = packet_in.flags;
10888 packet1.target_system = packet_in.target_system;
10889 packet1.target_component = packet_in.target_component;
10890 packet1.delta_yaw = packet_in.delta_yaw;
10891 packet1.delta_yaw_velocity = packet_in.delta_yaw_velocity;
10892 packet1.gimbal_device_id = packet_in.gimbal_device_id;
10894 mav_array_memcpy(packet1.q, packet_in.q,
sizeof(
float)*4);
10896#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10897 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10899 memset(MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS_MIN_LEN);
10902 memset(&packet2, 0,
sizeof(packet2));
10903 mavlink_msg_gimbal_device_attitude_status_encode(system_id, component_id, &msg, &packet1);
10904 mavlink_msg_gimbal_device_attitude_status_decode(&msg, &packet2);
10905 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10907 memset(&packet2, 0,
sizeof(packet2));
10908 mavlink_msg_gimbal_device_attitude_status_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.time_boot_ms , packet1.flags , packet1.q , packet1.angular_velocity_x , packet1.angular_velocity_y , packet1.angular_velocity_z , packet1.failure_flags , packet1.delta_yaw , packet1.delta_yaw_velocity , packet1.gimbal_device_id );
10909 mavlink_msg_gimbal_device_attitude_status_decode(&msg, &packet2);
10910 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10912 memset(&packet2, 0,
sizeof(packet2));
10913 mavlink_msg_gimbal_device_attitude_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.time_boot_ms , packet1.flags , packet1.q , packet1.angular_velocity_x , packet1.angular_velocity_y , packet1.angular_velocity_z , packet1.failure_flags , packet1.delta_yaw , packet1.delta_yaw_velocity , packet1.gimbal_device_id );
10914 mavlink_msg_gimbal_device_attitude_status_decode(&msg, &packet2);
10915 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10917 memset(&packet2, 0,
sizeof(packet2));
10918 mavlink_msg_to_send_buffer(buffer, &msg);
10919 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10920 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10922 mavlink_msg_gimbal_device_attitude_status_decode(last_msg, &packet2);
10923 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10925 memset(&packet2, 0,
sizeof(packet2));
10926 mavlink_msg_gimbal_device_attitude_status_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.time_boot_ms , packet1.flags , packet1.q , packet1.angular_velocity_x , packet1.angular_velocity_y , packet1.angular_velocity_z , packet1.failure_flags , packet1.delta_yaw , packet1.delta_yaw_velocity , packet1.gimbal_device_id );
10927 mavlink_msg_gimbal_device_attitude_status_decode(last_msg, &packet2);
10928 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10930#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
10931 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"GIMBAL_DEVICE_ATTITUDE_STATUS") != NULL);
10932 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GIMBAL_DEVICE_ATTITUDE_STATUS) != NULL);
10936static void mavlink_test_autopilot_state_for_gimbal_device(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
10938#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10939 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
10940 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE >= 256) {
10944 mavlink_message_t msg;
10945 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
10947 mavlink_autopilot_state_for_gimbal_device_t packet_in = {
10948 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0 },963498712,213.0,241.0,269.0,963499544,325.0,19731,27,94,161,388.0
10950 mavlink_autopilot_state_for_gimbal_device_t packet1, packet2;
10951 memset(&packet1, 0,
sizeof(packet1));
10952 packet1.time_boot_us = packet_in.time_boot_us;
10953 packet1.q_estimated_delay_us = packet_in.q_estimated_delay_us;
10954 packet1.vx = packet_in.vx;
10955 packet1.vy = packet_in.vy;
10956 packet1.vz = packet_in.vz;
10957 packet1.v_estimated_delay_us = packet_in.v_estimated_delay_us;
10958 packet1.feed_forward_angular_velocity_z = packet_in.feed_forward_angular_velocity_z;
10959 packet1.estimator_status = packet_in.estimator_status;
10960 packet1.target_system = packet_in.target_system;
10961 packet1.target_component = packet_in.target_component;
10962 packet1.landed_state = packet_in.landed_state;
10963 packet1.angular_velocity_z = packet_in.angular_velocity_z;
10965 mav_array_memcpy(packet1.q, packet_in.q,
sizeof(
float)*4);
10967#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
10968 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
10970 memset(MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE_MIN_LEN);
10973 memset(&packet2, 0,
sizeof(packet2));
10974 mavlink_msg_autopilot_state_for_gimbal_device_encode(system_id, component_id, &msg, &packet1);
10975 mavlink_msg_autopilot_state_for_gimbal_device_decode(&msg, &packet2);
10976 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10978 memset(&packet2, 0,
sizeof(packet2));
10979 mavlink_msg_autopilot_state_for_gimbal_device_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.time_boot_us , packet1.q , packet1.q_estimated_delay_us , packet1.vx , packet1.vy , packet1.vz , packet1.v_estimated_delay_us , packet1.feed_forward_angular_velocity_z , packet1.estimator_status , packet1.landed_state , packet1.angular_velocity_z );
10980 mavlink_msg_autopilot_state_for_gimbal_device_decode(&msg, &packet2);
10981 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10983 memset(&packet2, 0,
sizeof(packet2));
10984 mavlink_msg_autopilot_state_for_gimbal_device_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.time_boot_us , packet1.q , packet1.q_estimated_delay_us , packet1.vx , packet1.vy , packet1.vz , packet1.v_estimated_delay_us , packet1.feed_forward_angular_velocity_z , packet1.estimator_status , packet1.landed_state , packet1.angular_velocity_z );
10985 mavlink_msg_autopilot_state_for_gimbal_device_decode(&msg, &packet2);
10986 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10988 memset(&packet2, 0,
sizeof(packet2));
10989 mavlink_msg_to_send_buffer(buffer, &msg);
10990 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
10991 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
10993 mavlink_msg_autopilot_state_for_gimbal_device_decode(last_msg, &packet2);
10994 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
10996 memset(&packet2, 0,
sizeof(packet2));
10997 mavlink_msg_autopilot_state_for_gimbal_device_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.time_boot_us , packet1.q , packet1.q_estimated_delay_us , packet1.vx , packet1.vy , packet1.vz , packet1.v_estimated_delay_us , packet1.feed_forward_angular_velocity_z , packet1.estimator_status , packet1.landed_state , packet1.angular_velocity_z );
10998 mavlink_msg_autopilot_state_for_gimbal_device_decode(last_msg, &packet2);
10999 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11001#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11002 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"AUTOPILOT_STATE_FOR_GIMBAL_DEVICE") != NULL);
11003 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE) != NULL);
11007static void mavlink_test_gimbal_manager_set_pitchyaw(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11009#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11010 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11011 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_PITCHYAW >= 256) {
11015 mavlink_message_t msg;
11016 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11018 mavlink_gimbal_manager_set_pitchyaw_t packet_in = {
11019 963497464,45.0,73.0,101.0,129.0,65,132,199
11021 mavlink_gimbal_manager_set_pitchyaw_t packet1, packet2;
11022 memset(&packet1, 0,
sizeof(packet1));
11023 packet1.flags = packet_in.flags;
11024 packet1.pitch = packet_in.pitch;
11025 packet1.yaw = packet_in.yaw;
11026 packet1.pitch_rate = packet_in.pitch_rate;
11027 packet1.yaw_rate = packet_in.yaw_rate;
11028 packet1.target_system = packet_in.target_system;
11029 packet1.target_component = packet_in.target_component;
11030 packet1.gimbal_device_id = packet_in.gimbal_device_id;
11033#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11034 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11036 memset(MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_PITCHYAW_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_PITCHYAW_MIN_LEN);
11039 memset(&packet2, 0,
sizeof(packet2));
11040 mavlink_msg_gimbal_manager_set_pitchyaw_encode(system_id, component_id, &msg, &packet1);
11041 mavlink_msg_gimbal_manager_set_pitchyaw_decode(&msg, &packet2);
11042 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11044 memset(&packet2, 0,
sizeof(packet2));
11045 mavlink_msg_gimbal_manager_set_pitchyaw_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.flags , packet1.gimbal_device_id , packet1.pitch , packet1.yaw , packet1.pitch_rate , packet1.yaw_rate );
11046 mavlink_msg_gimbal_manager_set_pitchyaw_decode(&msg, &packet2);
11047 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11049 memset(&packet2, 0,
sizeof(packet2));
11050 mavlink_msg_gimbal_manager_set_pitchyaw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.flags , packet1.gimbal_device_id , packet1.pitch , packet1.yaw , packet1.pitch_rate , packet1.yaw_rate );
11051 mavlink_msg_gimbal_manager_set_pitchyaw_decode(&msg, &packet2);
11052 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11054 memset(&packet2, 0,
sizeof(packet2));
11055 mavlink_msg_to_send_buffer(buffer, &msg);
11056 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11057 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11059 mavlink_msg_gimbal_manager_set_pitchyaw_decode(last_msg, &packet2);
11060 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11062 memset(&packet2, 0,
sizeof(packet2));
11063 mavlink_msg_gimbal_manager_set_pitchyaw_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.flags , packet1.gimbal_device_id , packet1.pitch , packet1.yaw , packet1.pitch_rate , packet1.yaw_rate );
11064 mavlink_msg_gimbal_manager_set_pitchyaw_decode(last_msg, &packet2);
11065 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11067#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11068 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"GIMBAL_MANAGER_SET_PITCHYAW") != NULL);
11069 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_PITCHYAW) != NULL);
11073static void mavlink_test_gimbal_manager_set_manual_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11075#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11076 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11077 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_MANUAL_CONTROL >= 256) {
11081 mavlink_message_t msg;
11082 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11084 mavlink_gimbal_manager_set_manual_control_t packet_in = {
11085 963497464,45.0,73.0,101.0,129.0,65,132,199
11087 mavlink_gimbal_manager_set_manual_control_t packet1, packet2;
11088 memset(&packet1, 0,
sizeof(packet1));
11089 packet1.flags = packet_in.flags;
11090 packet1.pitch = packet_in.pitch;
11091 packet1.yaw = packet_in.yaw;
11092 packet1.pitch_rate = packet_in.pitch_rate;
11093 packet1.yaw_rate = packet_in.yaw_rate;
11094 packet1.target_system = packet_in.target_system;
11095 packet1.target_component = packet_in.target_component;
11096 packet1.gimbal_device_id = packet_in.gimbal_device_id;
11099#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11100 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11102 memset(MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_MANUAL_CONTROL_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_MANUAL_CONTROL_MIN_LEN);
11105 memset(&packet2, 0,
sizeof(packet2));
11106 mavlink_msg_gimbal_manager_set_manual_control_encode(system_id, component_id, &msg, &packet1);
11107 mavlink_msg_gimbal_manager_set_manual_control_decode(&msg, &packet2);
11108 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11110 memset(&packet2, 0,
sizeof(packet2));
11111 mavlink_msg_gimbal_manager_set_manual_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.flags , packet1.gimbal_device_id , packet1.pitch , packet1.yaw , packet1.pitch_rate , packet1.yaw_rate );
11112 mavlink_msg_gimbal_manager_set_manual_control_decode(&msg, &packet2);
11113 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11115 memset(&packet2, 0,
sizeof(packet2));
11116 mavlink_msg_gimbal_manager_set_manual_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.flags , packet1.gimbal_device_id , packet1.pitch , packet1.yaw , packet1.pitch_rate , packet1.yaw_rate );
11117 mavlink_msg_gimbal_manager_set_manual_control_decode(&msg, &packet2);
11118 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11120 memset(&packet2, 0,
sizeof(packet2));
11121 mavlink_msg_to_send_buffer(buffer, &msg);
11122 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11123 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11125 mavlink_msg_gimbal_manager_set_manual_control_decode(last_msg, &packet2);
11126 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11128 memset(&packet2, 0,
sizeof(packet2));
11129 mavlink_msg_gimbal_manager_set_manual_control_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.flags , packet1.gimbal_device_id , packet1.pitch , packet1.yaw , packet1.pitch_rate , packet1.yaw_rate );
11130 mavlink_msg_gimbal_manager_set_manual_control_decode(last_msg, &packet2);
11131 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11133#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11134 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"GIMBAL_MANAGER_SET_MANUAL_CONTROL") != NULL);
11135 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GIMBAL_MANAGER_SET_MANUAL_CONTROL) != NULL);
11139static void mavlink_test_esc_info(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11141#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11142 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11143 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ESC_INFO >= 256) {
11147 mavlink_message_t msg;
11148 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11150 mavlink_esc_info_t packet_in = {
11151 93372036854775807ULL,{ 963497880, 963497881, 963497882, 963497883 },18483,{ 18587, 18588, 18589, 18590 },{ 19003, 19004, 19005, 19006 },3,70,137,204
11153 mavlink_esc_info_t packet1, packet2;
11154 memset(&packet1, 0,
sizeof(packet1));
11155 packet1.time_usec = packet_in.time_usec;
11156 packet1.counter = packet_in.counter;
11157 packet1.index = packet_in.index;
11158 packet1.count = packet_in.count;
11159 packet1.connection_type = packet_in.connection_type;
11160 packet1.info = packet_in.info;
11162 mav_array_memcpy(packet1.error_count, packet_in.error_count,
sizeof(uint32_t)*4);
11163 mav_array_memcpy(packet1.failure_flags, packet_in.failure_flags,
sizeof(uint16_t)*4);
11164 mav_array_memcpy(packet1.temperature, packet_in.temperature,
sizeof(int16_t)*4);
11166#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11167 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11169 memset(MAVLINK_MSG_ID_ESC_INFO_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_ESC_INFO_MIN_LEN);
11172 memset(&packet2, 0,
sizeof(packet2));
11173 mavlink_msg_esc_info_encode(system_id, component_id, &msg, &packet1);
11174 mavlink_msg_esc_info_decode(&msg, &packet2);
11175 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11177 memset(&packet2, 0,
sizeof(packet2));
11178 mavlink_msg_esc_info_pack(system_id, component_id, &msg , packet1.index , packet1.time_usec , packet1.counter , packet1.count , packet1.connection_type , packet1.info , packet1.failure_flags , packet1.error_count , packet1.temperature );
11179 mavlink_msg_esc_info_decode(&msg, &packet2);
11180 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11182 memset(&packet2, 0,
sizeof(packet2));
11183 mavlink_msg_esc_info_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.index , packet1.time_usec , packet1.counter , packet1.count , packet1.connection_type , packet1.info , packet1.failure_flags , packet1.error_count , packet1.temperature );
11184 mavlink_msg_esc_info_decode(&msg, &packet2);
11185 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11187 memset(&packet2, 0,
sizeof(packet2));
11188 mavlink_msg_to_send_buffer(buffer, &msg);
11189 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11190 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11192 mavlink_msg_esc_info_decode(last_msg, &packet2);
11193 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11195 memset(&packet2, 0,
sizeof(packet2));
11196 mavlink_msg_esc_info_send(MAVLINK_COMM_1 , packet1.index , packet1.time_usec , packet1.counter , packet1.count , packet1.connection_type , packet1.info , packet1.failure_flags , packet1.error_count , packet1.temperature );
11197 mavlink_msg_esc_info_decode(last_msg, &packet2);
11198 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11200#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11201 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"ESC_INFO") != NULL);
11202 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ESC_INFO) != NULL);
11206static void mavlink_test_esc_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11208#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11209 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11210 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ESC_STATUS >= 256) {
11214 mavlink_message_t msg;
11215 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11217 mavlink_esc_status_t packet_in = {
11218 93372036854775807ULL,{ 963497880, 963497881, 963497882, 963497883 },{ 185.0, 186.0, 187.0, 188.0 },{ 297.0, 298.0, 299.0, 300.0 },173
11220 mavlink_esc_status_t packet1, packet2;
11221 memset(&packet1, 0,
sizeof(packet1));
11222 packet1.time_usec = packet_in.time_usec;
11223 packet1.index = packet_in.index;
11225 mav_array_memcpy(packet1.rpm, packet_in.rpm,
sizeof(int32_t)*4);
11226 mav_array_memcpy(packet1.voltage, packet_in.voltage,
sizeof(
float)*4);
11227 mav_array_memcpy(packet1.current, packet_in.current,
sizeof(
float)*4);
11229#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11230 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11232 memset(MAVLINK_MSG_ID_ESC_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_ESC_STATUS_MIN_LEN);
11235 memset(&packet2, 0,
sizeof(packet2));
11236 mavlink_msg_esc_status_encode(system_id, component_id, &msg, &packet1);
11237 mavlink_msg_esc_status_decode(&msg, &packet2);
11238 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11240 memset(&packet2, 0,
sizeof(packet2));
11241 mavlink_msg_esc_status_pack(system_id, component_id, &msg , packet1.index , packet1.time_usec , packet1.rpm , packet1.voltage , packet1.current );
11242 mavlink_msg_esc_status_decode(&msg, &packet2);
11243 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11245 memset(&packet2, 0,
sizeof(packet2));
11246 mavlink_msg_esc_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.index , packet1.time_usec , packet1.rpm , packet1.voltage , packet1.current );
11247 mavlink_msg_esc_status_decode(&msg, &packet2);
11248 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11250 memset(&packet2, 0,
sizeof(packet2));
11251 mavlink_msg_to_send_buffer(buffer, &msg);
11252 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11253 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11255 mavlink_msg_esc_status_decode(last_msg, &packet2);
11256 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11258 memset(&packet2, 0,
sizeof(packet2));
11259 mavlink_msg_esc_status_send(MAVLINK_COMM_1 , packet1.index , packet1.time_usec , packet1.rpm , packet1.voltage , packet1.current );
11260 mavlink_msg_esc_status_decode(last_msg, &packet2);
11261 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11263#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11264 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"ESC_STATUS") != NULL);
11265 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ESC_STATUS) != NULL);
11269static void mavlink_test_airspeed(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11271#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11272 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11273 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AIRSPEED >= 256) {
11277 mavlink_message_t msg;
11278 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11280 mavlink_airspeed_t packet_in = {
11281 17.0,45.0,17651,163,230
11283 mavlink_airspeed_t packet1, packet2;
11284 memset(&packet1, 0,
sizeof(packet1));
11285 packet1.airspeed = packet_in.airspeed;
11286 packet1.raw_press = packet_in.raw_press;
11287 packet1.temperature = packet_in.temperature;
11288 packet1.id = packet_in.id;
11289 packet1.flags = packet_in.flags;
11292#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11293 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11295 memset(MAVLINK_MSG_ID_AIRSPEED_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_AIRSPEED_MIN_LEN);
11298 memset(&packet2, 0,
sizeof(packet2));
11299 mavlink_msg_airspeed_encode(system_id, component_id, &msg, &packet1);
11300 mavlink_msg_airspeed_decode(&msg, &packet2);
11301 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11303 memset(&packet2, 0,
sizeof(packet2));
11304 mavlink_msg_airspeed_pack(system_id, component_id, &msg , packet1.id , packet1.airspeed , packet1.temperature , packet1.raw_press , packet1.flags );
11305 mavlink_msg_airspeed_decode(&msg, &packet2);
11306 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11308 memset(&packet2, 0,
sizeof(packet2));
11309 mavlink_msg_airspeed_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.airspeed , packet1.temperature , packet1.raw_press , packet1.flags );
11310 mavlink_msg_airspeed_decode(&msg, &packet2);
11311 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11313 memset(&packet2, 0,
sizeof(packet2));
11314 mavlink_msg_to_send_buffer(buffer, &msg);
11315 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11316 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11318 mavlink_msg_airspeed_decode(last_msg, &packet2);
11319 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11321 memset(&packet2, 0,
sizeof(packet2));
11322 mavlink_msg_airspeed_send(MAVLINK_COMM_1 , packet1.id , packet1.airspeed , packet1.temperature , packet1.raw_press , packet1.flags );
11323 mavlink_msg_airspeed_decode(last_msg, &packet2);
11324 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11326#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11327 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"AIRSPEED") != NULL);
11328 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_AIRSPEED) != NULL);
11332static void mavlink_test_global_position_sensor(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11334#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11335 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11336 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GLOBAL_POSITION_SENSOR >= 256) {
11340 mavlink_message_t msg;
11341 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11343 mavlink_global_position_sensor_t packet_in = {
11344 93372036854775807ULL,963497880,963498088,963498296,157.0,185.0,213.0,241.0,113,180,247,58,125
11346 mavlink_global_position_sensor_t packet1, packet2;
11347 memset(&packet1, 0,
sizeof(packet1));
11348 packet1.time_usec = packet_in.time_usec;
11349 packet1.processing_time = packet_in.processing_time;
11350 packet1.lat = packet_in.lat;
11351 packet1.lon = packet_in.lon;
11352 packet1.alt_ellipsoid = packet_in.alt_ellipsoid;
11353 packet1.alt = packet_in.alt;
11354 packet1.eph = packet_in.eph;
11355 packet1.epv = packet_in.epv;
11356 packet1.target_system = packet_in.target_system;
11357 packet1.target_component = packet_in.target_component;
11358 packet1.id = packet_in.id;
11359 packet1.source = packet_in.source;
11360 packet1.flags = packet_in.flags;
11363#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11364 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11366 memset(MAVLINK_MSG_ID_GLOBAL_POSITION_SENSOR_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_GLOBAL_POSITION_SENSOR_MIN_LEN);
11369 memset(&packet2, 0,
sizeof(packet2));
11370 mavlink_msg_global_position_sensor_encode(system_id, component_id, &msg, &packet1);
11371 mavlink_msg_global_position_sensor_decode(&msg, &packet2);
11372 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11374 memset(&packet2, 0,
sizeof(packet2));
11375 mavlink_msg_global_position_sensor_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id , packet1.time_usec , packet1.processing_time , packet1.source , packet1.flags , packet1.lat , packet1.lon , packet1.alt_ellipsoid , packet1.alt , packet1.eph , packet1.epv );
11376 mavlink_msg_global_position_sensor_decode(&msg, &packet2);
11377 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11379 memset(&packet2, 0,
sizeof(packet2));
11380 mavlink_msg_global_position_sensor_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.id , packet1.time_usec , packet1.processing_time , packet1.source , packet1.flags , packet1.lat , packet1.lon , packet1.alt_ellipsoid , packet1.alt , packet1.eph , packet1.epv );
11381 mavlink_msg_global_position_sensor_decode(&msg, &packet2);
11382 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11384 memset(&packet2, 0,
sizeof(packet2));
11385 mavlink_msg_to_send_buffer(buffer, &msg);
11386 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11387 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11389 mavlink_msg_global_position_sensor_decode(last_msg, &packet2);
11390 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11392 memset(&packet2, 0,
sizeof(packet2));
11393 mavlink_msg_global_position_sensor_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.id , packet1.time_usec , packet1.processing_time , packet1.source , packet1.flags , packet1.lat , packet1.lon , packet1.alt_ellipsoid , packet1.alt , packet1.eph , packet1.epv );
11394 mavlink_msg_global_position_sensor_decode(last_msg, &packet2);
11395 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11397#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11398 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"GLOBAL_POSITION_SENSOR") != NULL);
11399 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GLOBAL_POSITION_SENSOR) != NULL);
11403static void mavlink_test_wifi_config_ap(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11405#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11406 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11407 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_WIFI_CONFIG_AP >= 256) {
11411 mavlink_message_t msg;
11412 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11414 mavlink_wifi_config_ap_t packet_in = {
11415 "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDE",
"GHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQ",37,104
11417 mavlink_wifi_config_ap_t packet1, packet2;
11418 memset(&packet1, 0,
sizeof(packet1));
11419 packet1.mode = packet_in.mode;
11420 packet1.response = packet_in.response;
11422 mav_array_memcpy(packet1.ssid, packet_in.ssid,
sizeof(
char)*32);
11423 mav_array_memcpy(packet1.password, packet_in.password,
sizeof(
char)*64);
11425#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11426 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11428 memset(MAVLINK_MSG_ID_WIFI_CONFIG_AP_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_WIFI_CONFIG_AP_MIN_LEN);
11431 memset(&packet2, 0,
sizeof(packet2));
11432 mavlink_msg_wifi_config_ap_encode(system_id, component_id, &msg, &packet1);
11433 mavlink_msg_wifi_config_ap_decode(&msg, &packet2);
11434 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11436 memset(&packet2, 0,
sizeof(packet2));
11437 mavlink_msg_wifi_config_ap_pack(system_id, component_id, &msg , packet1.ssid , packet1.password , packet1.mode , packet1.response );
11438 mavlink_msg_wifi_config_ap_decode(&msg, &packet2);
11439 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11441 memset(&packet2, 0,
sizeof(packet2));
11442 mavlink_msg_wifi_config_ap_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.ssid , packet1.password , packet1.mode , packet1.response );
11443 mavlink_msg_wifi_config_ap_decode(&msg, &packet2);
11444 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11446 memset(&packet2, 0,
sizeof(packet2));
11447 mavlink_msg_to_send_buffer(buffer, &msg);
11448 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11449 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11451 mavlink_msg_wifi_config_ap_decode(last_msg, &packet2);
11452 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11454 memset(&packet2, 0,
sizeof(packet2));
11455 mavlink_msg_wifi_config_ap_send(MAVLINK_COMM_1 , packet1.ssid , packet1.password , packet1.mode , packet1.response );
11456 mavlink_msg_wifi_config_ap_decode(last_msg, &packet2);
11457 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11459#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11460 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"WIFI_CONFIG_AP") != NULL);
11461 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_WIFI_CONFIG_AP) != NULL);
11465static void mavlink_test_protocol_version(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11467#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11468 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11469 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PROTOCOL_VERSION >= 256) {
11473 mavlink_message_t msg;
11474 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11476 mavlink_protocol_version_t packet_in = {
11477 17235,17339,17443,{ 151, 152, 153, 154, 155, 156, 157, 158 },{ 175, 176, 177, 178, 179, 180, 181, 182 }
11479 mavlink_protocol_version_t packet1, packet2;
11480 memset(&packet1, 0,
sizeof(packet1));
11481 packet1.version = packet_in.version;
11482 packet1.min_version = packet_in.min_version;
11483 packet1.max_version = packet_in.max_version;
11485 mav_array_memcpy(packet1.spec_version_hash, packet_in.spec_version_hash,
sizeof(uint8_t)*8);
11486 mav_array_memcpy(packet1.library_version_hash, packet_in.library_version_hash,
sizeof(uint8_t)*8);
11488#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11489 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11491 memset(MAVLINK_MSG_ID_PROTOCOL_VERSION_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_PROTOCOL_VERSION_MIN_LEN);
11494 memset(&packet2, 0,
sizeof(packet2));
11495 mavlink_msg_protocol_version_encode(system_id, component_id, &msg, &packet1);
11496 mavlink_msg_protocol_version_decode(&msg, &packet2);
11497 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11499 memset(&packet2, 0,
sizeof(packet2));
11500 mavlink_msg_protocol_version_pack(system_id, component_id, &msg , packet1.version , packet1.min_version , packet1.max_version , packet1.spec_version_hash , packet1.library_version_hash );
11501 mavlink_msg_protocol_version_decode(&msg, &packet2);
11502 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11504 memset(&packet2, 0,
sizeof(packet2));
11505 mavlink_msg_protocol_version_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.version , packet1.min_version , packet1.max_version , packet1.spec_version_hash , packet1.library_version_hash );
11506 mavlink_msg_protocol_version_decode(&msg, &packet2);
11507 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11509 memset(&packet2, 0,
sizeof(packet2));
11510 mavlink_msg_to_send_buffer(buffer, &msg);
11511 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11512 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11514 mavlink_msg_protocol_version_decode(last_msg, &packet2);
11515 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11517 memset(&packet2, 0,
sizeof(packet2));
11518 mavlink_msg_protocol_version_send(MAVLINK_COMM_1 , packet1.version , packet1.min_version , packet1.max_version , packet1.spec_version_hash , packet1.library_version_hash );
11519 mavlink_msg_protocol_version_decode(last_msg, &packet2);
11520 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11522#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11523 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"PROTOCOL_VERSION") != NULL);
11524 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PROTOCOL_VERSION) != NULL);
11528static void mavlink_test_ais_vessel(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11530#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11531 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11532 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AIS_VESSEL >= 256) {
11536 mavlink_message_t msg;
11537 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11539 mavlink_ais_vessel_t packet_in = {
11540 963497464,963497672,963497880,17859,17963,18067,18171,18275,18379,18483,211,22,89,156,223,
"FGHIJK",
"MNOPQRSTUVWXYZABCDE"
11542 mavlink_ais_vessel_t packet1, packet2;
11543 memset(&packet1, 0,
sizeof(packet1));
11544 packet1.MMSI = packet_in.MMSI;
11545 packet1.lat = packet_in.lat;
11546 packet1.lon = packet_in.lon;
11547 packet1.COG = packet_in.COG;
11548 packet1.heading = packet_in.heading;
11549 packet1.velocity = packet_in.velocity;
11550 packet1.dimension_bow = packet_in.dimension_bow;
11551 packet1.dimension_stern = packet_in.dimension_stern;
11552 packet1.tslc = packet_in.tslc;
11553 packet1.flags = packet_in.flags;
11554 packet1.turn_rate = packet_in.turn_rate;
11555 packet1.navigational_status = packet_in.navigational_status;
11556 packet1.type = packet_in.type;
11557 packet1.dimension_port = packet_in.dimension_port;
11558 packet1.dimension_starboard = packet_in.dimension_starboard;
11560 mav_array_memcpy(packet1.callsign, packet_in.callsign,
sizeof(
char)*7);
11561 mav_array_memcpy(packet1.name, packet_in.name,
sizeof(
char)*20);
11563#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11564 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11566 memset(MAVLINK_MSG_ID_AIS_VESSEL_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_AIS_VESSEL_MIN_LEN);
11569 memset(&packet2, 0,
sizeof(packet2));
11570 mavlink_msg_ais_vessel_encode(system_id, component_id, &msg, &packet1);
11571 mavlink_msg_ais_vessel_decode(&msg, &packet2);
11572 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11574 memset(&packet2, 0,
sizeof(packet2));
11575 mavlink_msg_ais_vessel_pack(system_id, component_id, &msg , packet1.MMSI , packet1.lat , packet1.lon , packet1.COG , packet1.heading , packet1.velocity , packet1.turn_rate , packet1.navigational_status , packet1.type , packet1.dimension_bow , packet1.dimension_stern , packet1.dimension_port , packet1.dimension_starboard , packet1.callsign , packet1.name , packet1.tslc , packet1.flags );
11576 mavlink_msg_ais_vessel_decode(&msg, &packet2);
11577 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11579 memset(&packet2, 0,
sizeof(packet2));
11580 mavlink_msg_ais_vessel_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.MMSI , packet1.lat , packet1.lon , packet1.COG , packet1.heading , packet1.velocity , packet1.turn_rate , packet1.navigational_status , packet1.type , packet1.dimension_bow , packet1.dimension_stern , packet1.dimension_port , packet1.dimension_starboard , packet1.callsign , packet1.name , packet1.tslc , packet1.flags );
11581 mavlink_msg_ais_vessel_decode(&msg, &packet2);
11582 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11584 memset(&packet2, 0,
sizeof(packet2));
11585 mavlink_msg_to_send_buffer(buffer, &msg);
11586 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11587 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11589 mavlink_msg_ais_vessel_decode(last_msg, &packet2);
11590 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11592 memset(&packet2, 0,
sizeof(packet2));
11593 mavlink_msg_ais_vessel_send(MAVLINK_COMM_1 , packet1.MMSI , packet1.lat , packet1.lon , packet1.COG , packet1.heading , packet1.velocity , packet1.turn_rate , packet1.navigational_status , packet1.type , packet1.dimension_bow , packet1.dimension_stern , packet1.dimension_port , packet1.dimension_starboard , packet1.callsign , packet1.name , packet1.tslc , packet1.flags );
11594 mavlink_msg_ais_vessel_decode(last_msg, &packet2);
11595 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11597#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11598 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"AIS_VESSEL") != NULL);
11599 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_AIS_VESSEL) != NULL);
11603static void mavlink_test_uavcan_node_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11605#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11606 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11607 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_UAVCAN_NODE_STATUS >= 256) {
11611 mavlink_message_t msg;
11612 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11614 mavlink_uavcan_node_status_t packet_in = {
11615 93372036854775807ULL,963497880,17859,175,242,53
11617 mavlink_uavcan_node_status_t packet1, packet2;
11618 memset(&packet1, 0,
sizeof(packet1));
11619 packet1.time_usec = packet_in.time_usec;
11620 packet1.uptime_sec = packet_in.uptime_sec;
11621 packet1.vendor_specific_status_code = packet_in.vendor_specific_status_code;
11622 packet1.health = packet_in.health;
11623 packet1.mode = packet_in.mode;
11624 packet1.sub_mode = packet_in.sub_mode;
11627#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11628 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11630 memset(MAVLINK_MSG_ID_UAVCAN_NODE_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_UAVCAN_NODE_STATUS_MIN_LEN);
11633 memset(&packet2, 0,
sizeof(packet2));
11634 mavlink_msg_uavcan_node_status_encode(system_id, component_id, &msg, &packet1);
11635 mavlink_msg_uavcan_node_status_decode(&msg, &packet2);
11636 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11638 memset(&packet2, 0,
sizeof(packet2));
11639 mavlink_msg_uavcan_node_status_pack(system_id, component_id, &msg , packet1.time_usec , packet1.uptime_sec , packet1.health , packet1.mode , packet1.sub_mode , packet1.vendor_specific_status_code );
11640 mavlink_msg_uavcan_node_status_decode(&msg, &packet2);
11641 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11643 memset(&packet2, 0,
sizeof(packet2));
11644 mavlink_msg_uavcan_node_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.uptime_sec , packet1.health , packet1.mode , packet1.sub_mode , packet1.vendor_specific_status_code );
11645 mavlink_msg_uavcan_node_status_decode(&msg, &packet2);
11646 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11648 memset(&packet2, 0,
sizeof(packet2));
11649 mavlink_msg_to_send_buffer(buffer, &msg);
11650 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11651 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11653 mavlink_msg_uavcan_node_status_decode(last_msg, &packet2);
11654 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11656 memset(&packet2, 0,
sizeof(packet2));
11657 mavlink_msg_uavcan_node_status_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.uptime_sec , packet1.health , packet1.mode , packet1.sub_mode , packet1.vendor_specific_status_code );
11658 mavlink_msg_uavcan_node_status_decode(last_msg, &packet2);
11659 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11661#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11662 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"UAVCAN_NODE_STATUS") != NULL);
11663 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_UAVCAN_NODE_STATUS) != NULL);
11667static void mavlink_test_uavcan_node_info(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11669#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11670 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11671 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_UAVCAN_NODE_INFO >= 256) {
11675 mavlink_message_t msg;
11676 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11678 mavlink_uavcan_node_info_t packet_in = {
11679 93372036854775807ULL,963497880,963498088,
"QRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQ",37,104,{ 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186 },219,30
11681 mavlink_uavcan_node_info_t packet1, packet2;
11682 memset(&packet1, 0,
sizeof(packet1));
11683 packet1.time_usec = packet_in.time_usec;
11684 packet1.uptime_sec = packet_in.uptime_sec;
11685 packet1.sw_vcs_commit = packet_in.sw_vcs_commit;
11686 packet1.hw_version_major = packet_in.hw_version_major;
11687 packet1.hw_version_minor = packet_in.hw_version_minor;
11688 packet1.sw_version_major = packet_in.sw_version_major;
11689 packet1.sw_version_minor = packet_in.sw_version_minor;
11691 mav_array_memcpy(packet1.name, packet_in.name,
sizeof(
char)*80);
11692 mav_array_memcpy(packet1.hw_unique_id, packet_in.hw_unique_id,
sizeof(uint8_t)*16);
11694#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11695 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11697 memset(MAVLINK_MSG_ID_UAVCAN_NODE_INFO_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_UAVCAN_NODE_INFO_MIN_LEN);
11700 memset(&packet2, 0,
sizeof(packet2));
11701 mavlink_msg_uavcan_node_info_encode(system_id, component_id, &msg, &packet1);
11702 mavlink_msg_uavcan_node_info_decode(&msg, &packet2);
11703 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11705 memset(&packet2, 0,
sizeof(packet2));
11706 mavlink_msg_uavcan_node_info_pack(system_id, component_id, &msg , packet1.time_usec , packet1.uptime_sec , packet1.name , packet1.hw_version_major , packet1.hw_version_minor , packet1.hw_unique_id , packet1.sw_version_major , packet1.sw_version_minor , packet1.sw_vcs_commit );
11707 mavlink_msg_uavcan_node_info_decode(&msg, &packet2);
11708 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11710 memset(&packet2, 0,
sizeof(packet2));
11711 mavlink_msg_uavcan_node_info_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.uptime_sec , packet1.name , packet1.hw_version_major , packet1.hw_version_minor , packet1.hw_unique_id , packet1.sw_version_major , packet1.sw_version_minor , packet1.sw_vcs_commit );
11712 mavlink_msg_uavcan_node_info_decode(&msg, &packet2);
11713 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11715 memset(&packet2, 0,
sizeof(packet2));
11716 mavlink_msg_to_send_buffer(buffer, &msg);
11717 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11718 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11720 mavlink_msg_uavcan_node_info_decode(last_msg, &packet2);
11721 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11723 memset(&packet2, 0,
sizeof(packet2));
11724 mavlink_msg_uavcan_node_info_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.uptime_sec , packet1.name , packet1.hw_version_major , packet1.hw_version_minor , packet1.hw_unique_id , packet1.sw_version_major , packet1.sw_version_minor , packet1.sw_vcs_commit );
11725 mavlink_msg_uavcan_node_info_decode(last_msg, &packet2);
11726 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11728#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11729 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"UAVCAN_NODE_INFO") != NULL);
11730 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_UAVCAN_NODE_INFO) != NULL);
11734static void mavlink_test_param_ext_request_read(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11736#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11737 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11738 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_EXT_REQUEST_READ >= 256) {
11742 mavlink_message_t msg;
11743 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11745 mavlink_param_ext_request_read_t packet_in = {
11746 17235,139,206,
"EFGHIJKLMNOPQRS"
11748 mavlink_param_ext_request_read_t packet1, packet2;
11749 memset(&packet1, 0,
sizeof(packet1));
11750 packet1.param_index = packet_in.param_index;
11751 packet1.target_system = packet_in.target_system;
11752 packet1.target_component = packet_in.target_component;
11754 mav_array_memcpy(packet1.param_id, packet_in.param_id,
sizeof(
char)*16);
11756#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11757 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11759 memset(MAVLINK_MSG_ID_PARAM_EXT_REQUEST_READ_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_PARAM_EXT_REQUEST_READ_MIN_LEN);
11762 memset(&packet2, 0,
sizeof(packet2));
11763 mavlink_msg_param_ext_request_read_encode(system_id, component_id, &msg, &packet1);
11764 mavlink_msg_param_ext_request_read_decode(&msg, &packet2);
11765 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11767 memset(&packet2, 0,
sizeof(packet2));
11768 mavlink_msg_param_ext_request_read_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index );
11769 mavlink_msg_param_ext_request_read_decode(&msg, &packet2);
11770 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11772 memset(&packet2, 0,
sizeof(packet2));
11773 mavlink_msg_param_ext_request_read_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index );
11774 mavlink_msg_param_ext_request_read_decode(&msg, &packet2);
11775 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11777 memset(&packet2, 0,
sizeof(packet2));
11778 mavlink_msg_to_send_buffer(buffer, &msg);
11779 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11780 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11782 mavlink_msg_param_ext_request_read_decode(last_msg, &packet2);
11783 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11785 memset(&packet2, 0,
sizeof(packet2));
11786 mavlink_msg_param_ext_request_read_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index );
11787 mavlink_msg_param_ext_request_read_decode(last_msg, &packet2);
11788 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11790#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11791 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"PARAM_EXT_REQUEST_READ") != NULL);
11792 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PARAM_EXT_REQUEST_READ) != NULL);
11796static void mavlink_test_param_ext_request_list(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11798#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11799 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11800 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_EXT_REQUEST_LIST >= 256) {
11804 mavlink_message_t msg;
11805 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11807 mavlink_param_ext_request_list_t packet_in = {
11810 mavlink_param_ext_request_list_t packet1, packet2;
11811 memset(&packet1, 0,
sizeof(packet1));
11812 packet1.target_system = packet_in.target_system;
11813 packet1.target_component = packet_in.target_component;
11816#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11817 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11819 memset(MAVLINK_MSG_ID_PARAM_EXT_REQUEST_LIST_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_PARAM_EXT_REQUEST_LIST_MIN_LEN);
11822 memset(&packet2, 0,
sizeof(packet2));
11823 mavlink_msg_param_ext_request_list_encode(system_id, component_id, &msg, &packet1);
11824 mavlink_msg_param_ext_request_list_decode(&msg, &packet2);
11825 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11827 memset(&packet2, 0,
sizeof(packet2));
11828 mavlink_msg_param_ext_request_list_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
11829 mavlink_msg_param_ext_request_list_decode(&msg, &packet2);
11830 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11832 memset(&packet2, 0,
sizeof(packet2));
11833 mavlink_msg_param_ext_request_list_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
11834 mavlink_msg_param_ext_request_list_decode(&msg, &packet2);
11835 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11837 memset(&packet2, 0,
sizeof(packet2));
11838 mavlink_msg_to_send_buffer(buffer, &msg);
11839 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11840 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11842 mavlink_msg_param_ext_request_list_decode(last_msg, &packet2);
11843 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11845 memset(&packet2, 0,
sizeof(packet2));
11846 mavlink_msg_param_ext_request_list_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
11847 mavlink_msg_param_ext_request_list_decode(last_msg, &packet2);
11848 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11850#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11851 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"PARAM_EXT_REQUEST_LIST") != NULL);
11852 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PARAM_EXT_REQUEST_LIST) != NULL);
11856static void mavlink_test_param_ext_value(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11858#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11859 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11860 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_EXT_VALUE >= 256) {
11864 mavlink_message_t msg;
11865 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11867 mavlink_param_ext_value_t packet_in = {
11868 17235,17339,
"EFGHIJKLMNOPQRS",
"UVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQ",193
11870 mavlink_param_ext_value_t packet1, packet2;
11871 memset(&packet1, 0,
sizeof(packet1));
11872 packet1.param_count = packet_in.param_count;
11873 packet1.param_index = packet_in.param_index;
11874 packet1.param_type = packet_in.param_type;
11876 mav_array_memcpy(packet1.param_id, packet_in.param_id,
sizeof(
char)*16);
11877 mav_array_memcpy(packet1.param_value, packet_in.param_value,
sizeof(
char)*128);
11879#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11880 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11882 memset(MAVLINK_MSG_ID_PARAM_EXT_VALUE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_PARAM_EXT_VALUE_MIN_LEN);
11885 memset(&packet2, 0,
sizeof(packet2));
11886 mavlink_msg_param_ext_value_encode(system_id, component_id, &msg, &packet1);
11887 mavlink_msg_param_ext_value_decode(&msg, &packet2);
11888 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11890 memset(&packet2, 0,
sizeof(packet2));
11891 mavlink_msg_param_ext_value_pack(system_id, component_id, &msg , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_count , packet1.param_index );
11892 mavlink_msg_param_ext_value_decode(&msg, &packet2);
11893 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11895 memset(&packet2, 0,
sizeof(packet2));
11896 mavlink_msg_param_ext_value_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_count , packet1.param_index );
11897 mavlink_msg_param_ext_value_decode(&msg, &packet2);
11898 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11900 memset(&packet2, 0,
sizeof(packet2));
11901 mavlink_msg_to_send_buffer(buffer, &msg);
11902 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11903 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11905 mavlink_msg_param_ext_value_decode(last_msg, &packet2);
11906 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11908 memset(&packet2, 0,
sizeof(packet2));
11909 mavlink_msg_param_ext_value_send(MAVLINK_COMM_1 , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_count , packet1.param_index );
11910 mavlink_msg_param_ext_value_decode(last_msg, &packet2);
11911 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11913#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11914 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"PARAM_EXT_VALUE") != NULL);
11915 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PARAM_EXT_VALUE) != NULL);
11919static void mavlink_test_param_ext_set(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11921#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11922 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11923 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_EXT_SET >= 256) {
11927 mavlink_message_t msg;
11928 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11930 mavlink_param_ext_set_t packet_in = {
11931 5,72,
"CDEFGHIJKLMNOPQ",
"STUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNO",59
11933 mavlink_param_ext_set_t packet1, packet2;
11934 memset(&packet1, 0,
sizeof(packet1));
11935 packet1.target_system = packet_in.target_system;
11936 packet1.target_component = packet_in.target_component;
11937 packet1.param_type = packet_in.param_type;
11939 mav_array_memcpy(packet1.param_id, packet_in.param_id,
sizeof(
char)*16);
11940 mav_array_memcpy(packet1.param_value, packet_in.param_value,
sizeof(
char)*128);
11942#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11943 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
11945 memset(MAVLINK_MSG_ID_PARAM_EXT_SET_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_PARAM_EXT_SET_MIN_LEN);
11948 memset(&packet2, 0,
sizeof(packet2));
11949 mavlink_msg_param_ext_set_encode(system_id, component_id, &msg, &packet1);
11950 mavlink_msg_param_ext_set_decode(&msg, &packet2);
11951 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11953 memset(&packet2, 0,
sizeof(packet2));
11954 mavlink_msg_param_ext_set_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type );
11955 mavlink_msg_param_ext_set_decode(&msg, &packet2);
11956 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11958 memset(&packet2, 0,
sizeof(packet2));
11959 mavlink_msg_param_ext_set_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type );
11960 mavlink_msg_param_ext_set_decode(&msg, &packet2);
11961 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11963 memset(&packet2, 0,
sizeof(packet2));
11964 mavlink_msg_to_send_buffer(buffer, &msg);
11965 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
11966 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
11968 mavlink_msg_param_ext_set_decode(last_msg, &packet2);
11969 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11971 memset(&packet2, 0,
sizeof(packet2));
11972 mavlink_msg_param_ext_set_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_value , packet1.param_type );
11973 mavlink_msg_param_ext_set_decode(last_msg, &packet2);
11974 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
11976#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
11977 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"PARAM_EXT_SET") != NULL);
11978 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PARAM_EXT_SET) != NULL);
11982static void mavlink_test_param_ext_ack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
11984#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
11985 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
11986 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_EXT_ACK >= 256) {
11990 mavlink_message_t msg;
11991 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
11993 mavlink_param_ext_ack_t packet_in = {
11994 "ABCDEFGHIJKLMNO",
"QRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLM",181,248
11996 mavlink_param_ext_ack_t packet1, packet2;
11997 memset(&packet1, 0,
sizeof(packet1));
11998 packet1.param_type = packet_in.param_type;
11999 packet1.param_result = packet_in.param_result;
12001 mav_array_memcpy(packet1.param_id, packet_in.param_id,
sizeof(
char)*16);
12002 mav_array_memcpy(packet1.param_value, packet_in.param_value,
sizeof(
char)*128);
12004#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12005 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12007 memset(MAVLINK_MSG_ID_PARAM_EXT_ACK_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_PARAM_EXT_ACK_MIN_LEN);
12010 memset(&packet2, 0,
sizeof(packet2));
12011 mavlink_msg_param_ext_ack_encode(system_id, component_id, &msg, &packet1);
12012 mavlink_msg_param_ext_ack_decode(&msg, &packet2);
12013 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12015 memset(&packet2, 0,
sizeof(packet2));
12016 mavlink_msg_param_ext_ack_pack(system_id, component_id, &msg , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_result );
12017 mavlink_msg_param_ext_ack_decode(&msg, &packet2);
12018 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12020 memset(&packet2, 0,
sizeof(packet2));
12021 mavlink_msg_param_ext_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_result );
12022 mavlink_msg_param_ext_ack_decode(&msg, &packet2);
12023 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12025 memset(&packet2, 0,
sizeof(packet2));
12026 mavlink_msg_to_send_buffer(buffer, &msg);
12027 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12028 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12030 mavlink_msg_param_ext_ack_decode(last_msg, &packet2);
12031 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12033 memset(&packet2, 0,
sizeof(packet2));
12034 mavlink_msg_param_ext_ack_send(MAVLINK_COMM_1 , packet1.param_id , packet1.param_value , packet1.param_type , packet1.param_result );
12035 mavlink_msg_param_ext_ack_decode(last_msg, &packet2);
12036 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12038#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12039 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"PARAM_EXT_ACK") != NULL);
12040 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PARAM_EXT_ACK) != NULL);
12044static void mavlink_test_obstacle_distance(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12046#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12047 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12048 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OBSTACLE_DISTANCE >= 256) {
12052 mavlink_message_t msg;
12053 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12055 mavlink_obstacle_distance_t packet_in = {
12056 93372036854775807ULL,{ 17651, 17652, 17653, 17654, 17655, 17656, 17657, 17658, 17659, 17660, 17661, 17662, 17663, 17664, 17665, 17666, 17667, 17668, 17669, 17670, 17671, 17672, 17673, 17674, 17675, 17676, 17677, 17678, 17679, 17680, 17681, 17682, 17683, 17684, 17685, 17686, 17687, 17688, 17689, 17690, 17691, 17692, 17693, 17694, 17695, 17696, 17697, 17698, 17699, 17700, 17701, 17702, 17703, 17704, 17705, 17706, 17707, 17708, 17709, 17710, 17711, 17712, 17713, 17714, 17715, 17716, 17717, 17718, 17719, 17720, 17721, 17722 },25139,25243,217,28,1123.0,1151.0,119
12058 mavlink_obstacle_distance_t packet1, packet2;
12059 memset(&packet1, 0,
sizeof(packet1));
12060 packet1.time_usec = packet_in.time_usec;
12061 packet1.min_distance = packet_in.min_distance;
12062 packet1.max_distance = packet_in.max_distance;
12063 packet1.sensor_type = packet_in.sensor_type;
12064 packet1.increment = packet_in.increment;
12065 packet1.increment_f = packet_in.increment_f;
12066 packet1.angle_offset = packet_in.angle_offset;
12067 packet1.frame = packet_in.frame;
12069 mav_array_memcpy(packet1.distances, packet_in.distances,
sizeof(uint16_t)*72);
12071#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12072 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12074 memset(MAVLINK_MSG_ID_OBSTACLE_DISTANCE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_OBSTACLE_DISTANCE_MIN_LEN);
12077 memset(&packet2, 0,
sizeof(packet2));
12078 mavlink_msg_obstacle_distance_encode(system_id, component_id, &msg, &packet1);
12079 mavlink_msg_obstacle_distance_decode(&msg, &packet2);
12080 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12082 memset(&packet2, 0,
sizeof(packet2));
12083 mavlink_msg_obstacle_distance_pack(system_id, component_id, &msg , packet1.time_usec , packet1.sensor_type , packet1.distances , packet1.increment , packet1.min_distance , packet1.max_distance , packet1.increment_f , packet1.angle_offset , packet1.frame );
12084 mavlink_msg_obstacle_distance_decode(&msg, &packet2);
12085 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12087 memset(&packet2, 0,
sizeof(packet2));
12088 mavlink_msg_obstacle_distance_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.sensor_type , packet1.distances , packet1.increment , packet1.min_distance , packet1.max_distance , packet1.increment_f , packet1.angle_offset , packet1.frame );
12089 mavlink_msg_obstacle_distance_decode(&msg, &packet2);
12090 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12092 memset(&packet2, 0,
sizeof(packet2));
12093 mavlink_msg_to_send_buffer(buffer, &msg);
12094 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12095 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12097 mavlink_msg_obstacle_distance_decode(last_msg, &packet2);
12098 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12100 memset(&packet2, 0,
sizeof(packet2));
12101 mavlink_msg_obstacle_distance_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.sensor_type , packet1.distances , packet1.increment , packet1.min_distance , packet1.max_distance , packet1.increment_f , packet1.angle_offset , packet1.frame );
12102 mavlink_msg_obstacle_distance_decode(last_msg, &packet2);
12103 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12105#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12106 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"OBSTACLE_DISTANCE") != NULL);
12107 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OBSTACLE_DISTANCE) != NULL);
12111static void mavlink_test_odometry(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12113#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12114 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12115 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ODOMETRY >= 256) {
12119 mavlink_message_t msg;
12120 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12122 mavlink_odometry_t packet_in = {
12123 93372036854775807ULL,73.0,101.0,129.0,{ 157.0, 158.0, 159.0, 160.0 },269.0,297.0,325.0,353.0,381.0,409.0,{ 437.0, 438.0, 439.0, 440.0, 441.0, 442.0, 443.0, 444.0, 445.0, 446.0, 447.0, 448.0, 449.0, 450.0, 451.0, 452.0, 453.0, 454.0, 455.0, 456.0, 457.0 },{ 1025.0, 1026.0, 1027.0, 1028.0, 1029.0, 1030.0, 1031.0, 1032.0, 1033.0, 1034.0, 1035.0, 1036.0, 1037.0, 1038.0, 1039.0, 1040.0, 1041.0, 1042.0, 1043.0, 1044.0, 1045.0 },177,244,55,122,189
12125 mavlink_odometry_t packet1, packet2;
12126 memset(&packet1, 0,
sizeof(packet1));
12127 packet1.time_usec = packet_in.time_usec;
12128 packet1.x = packet_in.x;
12129 packet1.y = packet_in.y;
12130 packet1.z = packet_in.z;
12131 packet1.vx = packet_in.vx;
12132 packet1.vy = packet_in.vy;
12133 packet1.vz = packet_in.vz;
12134 packet1.rollspeed = packet_in.rollspeed;
12135 packet1.pitchspeed = packet_in.pitchspeed;
12136 packet1.yawspeed = packet_in.yawspeed;
12137 packet1.frame_id = packet_in.frame_id;
12138 packet1.child_frame_id = packet_in.child_frame_id;
12139 packet1.reset_counter = packet_in.reset_counter;
12140 packet1.estimator_type = packet_in.estimator_type;
12141 packet1.quality = packet_in.quality;
12143 mav_array_memcpy(packet1.q, packet_in.q,
sizeof(
float)*4);
12144 mav_array_memcpy(packet1.pose_covariance, packet_in.pose_covariance,
sizeof(
float)*21);
12145 mav_array_memcpy(packet1.velocity_covariance, packet_in.velocity_covariance,
sizeof(
float)*21);
12147#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12148 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12150 memset(MAVLINK_MSG_ID_ODOMETRY_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_ODOMETRY_MIN_LEN);
12153 memset(&packet2, 0,
sizeof(packet2));
12154 mavlink_msg_odometry_encode(system_id, component_id, &msg, &packet1);
12155 mavlink_msg_odometry_decode(&msg, &packet2);
12156 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12158 memset(&packet2, 0,
sizeof(packet2));
12159 mavlink_msg_odometry_pack(system_id, component_id, &msg , packet1.time_usec , packet1.frame_id , packet1.child_frame_id , packet1.x , packet1.y , packet1.z , packet1.q , packet1.vx , packet1.vy , packet1.vz , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.pose_covariance , packet1.velocity_covariance , packet1.reset_counter , packet1.estimator_type , packet1.quality );
12160 mavlink_msg_odometry_decode(&msg, &packet2);
12161 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12163 memset(&packet2, 0,
sizeof(packet2));
12164 mavlink_msg_odometry_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.frame_id , packet1.child_frame_id , packet1.x , packet1.y , packet1.z , packet1.q , packet1.vx , packet1.vy , packet1.vz , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.pose_covariance , packet1.velocity_covariance , packet1.reset_counter , packet1.estimator_type , packet1.quality );
12165 mavlink_msg_odometry_decode(&msg, &packet2);
12166 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12168 memset(&packet2, 0,
sizeof(packet2));
12169 mavlink_msg_to_send_buffer(buffer, &msg);
12170 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12171 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12173 mavlink_msg_odometry_decode(last_msg, &packet2);
12174 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12176 memset(&packet2, 0,
sizeof(packet2));
12177 mavlink_msg_odometry_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.frame_id , packet1.child_frame_id , packet1.x , packet1.y , packet1.z , packet1.q , packet1.vx , packet1.vy , packet1.vz , packet1.rollspeed , packet1.pitchspeed , packet1.yawspeed , packet1.pose_covariance , packet1.velocity_covariance , packet1.reset_counter , packet1.estimator_type , packet1.quality );
12178 mavlink_msg_odometry_decode(last_msg, &packet2);
12179 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12181#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12182 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"ODOMETRY") != NULL);
12183 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ODOMETRY) != NULL);
12187static void mavlink_test_trajectory_representation_waypoints(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12189#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12190 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12191 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS >= 256) {
12195 mavlink_message_t msg;
12196 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12198 mavlink_trajectory_representation_waypoints_t packet_in = {
12199 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0, 77.0 },{ 213.0, 214.0, 215.0, 216.0, 217.0 },{ 353.0, 354.0, 355.0, 356.0, 357.0 },{ 493.0, 494.0, 495.0, 496.0, 497.0 },{ 633.0, 634.0, 635.0, 636.0, 637.0 },{ 773.0, 774.0, 775.0, 776.0, 777.0 },{ 913.0, 914.0, 915.0, 916.0, 917.0 },{ 1053.0, 1054.0, 1055.0, 1056.0, 1057.0 },{ 1193.0, 1194.0, 1195.0, 1196.0, 1197.0 },{ 1333.0, 1334.0, 1335.0, 1336.0, 1337.0 },{ 1473.0, 1474.0, 1475.0, 1476.0, 1477.0 },{ 29091, 29092, 29093, 29094, 29095 },79
12201 mavlink_trajectory_representation_waypoints_t packet1, packet2;
12202 memset(&packet1, 0,
sizeof(packet1));
12203 packet1.time_usec = packet_in.time_usec;
12204 packet1.valid_points = packet_in.valid_points;
12206 mav_array_memcpy(packet1.pos_x, packet_in.pos_x,
sizeof(
float)*5);
12207 mav_array_memcpy(packet1.pos_y, packet_in.pos_y,
sizeof(
float)*5);
12208 mav_array_memcpy(packet1.pos_z, packet_in.pos_z,
sizeof(
float)*5);
12209 mav_array_memcpy(packet1.vel_x, packet_in.vel_x,
sizeof(
float)*5);
12210 mav_array_memcpy(packet1.vel_y, packet_in.vel_y,
sizeof(
float)*5);
12211 mav_array_memcpy(packet1.vel_z, packet_in.vel_z,
sizeof(
float)*5);
12212 mav_array_memcpy(packet1.acc_x, packet_in.acc_x,
sizeof(
float)*5);
12213 mav_array_memcpy(packet1.acc_y, packet_in.acc_y,
sizeof(
float)*5);
12214 mav_array_memcpy(packet1.acc_z, packet_in.acc_z,
sizeof(
float)*5);
12215 mav_array_memcpy(packet1.pos_yaw, packet_in.pos_yaw,
sizeof(
float)*5);
12216 mav_array_memcpy(packet1.vel_yaw, packet_in.vel_yaw,
sizeof(
float)*5);
12217 mav_array_memcpy(packet1.command, packet_in.command,
sizeof(uint16_t)*5);
12219#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12220 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12222 memset(MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS_MIN_LEN);
12225 memset(&packet2, 0,
sizeof(packet2));
12226 mavlink_msg_trajectory_representation_waypoints_encode(system_id, component_id, &msg, &packet1);
12227 mavlink_msg_trajectory_representation_waypoints_decode(&msg, &packet2);
12228 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12230 memset(&packet2, 0,
sizeof(packet2));
12231 mavlink_msg_trajectory_representation_waypoints_pack(system_id, component_id, &msg , packet1.time_usec , packet1.valid_points , packet1.pos_x , packet1.pos_y , packet1.pos_z , packet1.vel_x , packet1.vel_y , packet1.vel_z , packet1.acc_x , packet1.acc_y , packet1.acc_z , packet1.pos_yaw , packet1.vel_yaw , packet1.command );
12232 mavlink_msg_trajectory_representation_waypoints_decode(&msg, &packet2);
12233 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12235 memset(&packet2, 0,
sizeof(packet2));
12236 mavlink_msg_trajectory_representation_waypoints_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.valid_points , packet1.pos_x , packet1.pos_y , packet1.pos_z , packet1.vel_x , packet1.vel_y , packet1.vel_z , packet1.acc_x , packet1.acc_y , packet1.acc_z , packet1.pos_yaw , packet1.vel_yaw , packet1.command );
12237 mavlink_msg_trajectory_representation_waypoints_decode(&msg, &packet2);
12238 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12240 memset(&packet2, 0,
sizeof(packet2));
12241 mavlink_msg_to_send_buffer(buffer, &msg);
12242 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12243 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12245 mavlink_msg_trajectory_representation_waypoints_decode(last_msg, &packet2);
12246 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12248 memset(&packet2, 0,
sizeof(packet2));
12249 mavlink_msg_trajectory_representation_waypoints_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.valid_points , packet1.pos_x , packet1.pos_y , packet1.pos_z , packet1.vel_x , packet1.vel_y , packet1.vel_z , packet1.acc_x , packet1.acc_y , packet1.acc_z , packet1.pos_yaw , packet1.vel_yaw , packet1.command );
12250 mavlink_msg_trajectory_representation_waypoints_decode(last_msg, &packet2);
12251 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12253#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12254 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"TRAJECTORY_REPRESENTATION_WAYPOINTS") != NULL);
12255 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_WAYPOINTS) != NULL);
12259static void mavlink_test_trajectory_representation_bezier(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_TRAJECTORY_REPRESENTATION_BEZIER >= 256) {
12267 mavlink_message_t msg;
12268 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12270 mavlink_trajectory_representation_bezier_t packet_in = {
12271 93372036854775807ULL,{ 73.0, 74.0, 75.0, 76.0, 77.0 },{ 213.0, 214.0, 215.0, 216.0, 217.0 },{ 353.0, 354.0, 355.0, 356.0, 357.0 },{ 493.0, 494.0, 495.0, 496.0, 497.0 },{ 633.0, 634.0, 635.0, 636.0, 637.0 },73
12273 mavlink_trajectory_representation_bezier_t packet1, packet2;
12274 memset(&packet1, 0,
sizeof(packet1));
12275 packet1.time_usec = packet_in.time_usec;
12276 packet1.valid_points = packet_in.valid_points;
12278 mav_array_memcpy(packet1.pos_x, packet_in.pos_x,
sizeof(
float)*5);
12279 mav_array_memcpy(packet1.pos_y, packet_in.pos_y,
sizeof(
float)*5);
12280 mav_array_memcpy(packet1.pos_z, packet_in.pos_z,
sizeof(
float)*5);
12281 mav_array_memcpy(packet1.delta, packet_in.delta,
sizeof(
float)*5);
12282 mav_array_memcpy(packet1.pos_yaw, packet_in.pos_yaw,
sizeof(
float)*5);
12284#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12285 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12287 memset(MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER_MIN_LEN);
12290 memset(&packet2, 0,
sizeof(packet2));
12291 mavlink_msg_trajectory_representation_bezier_encode(system_id, component_id, &msg, &packet1);
12292 mavlink_msg_trajectory_representation_bezier_decode(&msg, &packet2);
12293 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12295 memset(&packet2, 0,
sizeof(packet2));
12296 mavlink_msg_trajectory_representation_bezier_pack(system_id, component_id, &msg , packet1.time_usec , packet1.valid_points , packet1.pos_x , packet1.pos_y , packet1.pos_z , packet1.delta , packet1.pos_yaw );
12297 mavlink_msg_trajectory_representation_bezier_decode(&msg, &packet2);
12298 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12300 memset(&packet2, 0,
sizeof(packet2));
12301 mavlink_msg_trajectory_representation_bezier_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.valid_points , packet1.pos_x , packet1.pos_y , packet1.pos_z , packet1.delta , packet1.pos_yaw );
12302 mavlink_msg_trajectory_representation_bezier_decode(&msg, &packet2);
12303 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12305 memset(&packet2, 0,
sizeof(packet2));
12306 mavlink_msg_to_send_buffer(buffer, &msg);
12307 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12308 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12310 mavlink_msg_trajectory_representation_bezier_decode(last_msg, &packet2);
12311 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12313 memset(&packet2, 0,
sizeof(packet2));
12314 mavlink_msg_trajectory_representation_bezier_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.valid_points , packet1.pos_x , packet1.pos_y , packet1.pos_z , packet1.delta , packet1.pos_yaw );
12315 mavlink_msg_trajectory_representation_bezier_decode(last_msg, &packet2);
12316 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12318#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12319 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"TRAJECTORY_REPRESENTATION_BEZIER") != NULL);
12320 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_TRAJECTORY_REPRESENTATION_BEZIER) != NULL);
12324static void mavlink_test_cellular_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12326#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12327 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12328 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CELLULAR_STATUS >= 256) {
12332 mavlink_message_t msg;
12333 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12335 mavlink_cellular_status_t packet_in = {
12336 17235,17339,17443,151,218,29,96
12338 mavlink_cellular_status_t packet1, packet2;
12339 memset(&packet1, 0,
sizeof(packet1));
12340 packet1.mcc = packet_in.mcc;
12341 packet1.mnc = packet_in.mnc;
12342 packet1.lac = packet_in.lac;
12343 packet1.status = packet_in.status;
12344 packet1.failure_reason = packet_in.failure_reason;
12345 packet1.type = packet_in.type;
12346 packet1.quality = packet_in.quality;
12349#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12350 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12352 memset(MAVLINK_MSG_ID_CELLULAR_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_CELLULAR_STATUS_MIN_LEN);
12355 memset(&packet2, 0,
sizeof(packet2));
12356 mavlink_msg_cellular_status_encode(system_id, component_id, &msg, &packet1);
12357 mavlink_msg_cellular_status_decode(&msg, &packet2);
12358 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12360 memset(&packet2, 0,
sizeof(packet2));
12361 mavlink_msg_cellular_status_pack(system_id, component_id, &msg , packet1.status , packet1.failure_reason , packet1.type , packet1.quality , packet1.mcc , packet1.mnc , packet1.lac );
12362 mavlink_msg_cellular_status_decode(&msg, &packet2);
12363 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12365 memset(&packet2, 0,
sizeof(packet2));
12366 mavlink_msg_cellular_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.status , packet1.failure_reason , packet1.type , packet1.quality , packet1.mcc , packet1.mnc , packet1.lac );
12367 mavlink_msg_cellular_status_decode(&msg, &packet2);
12368 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12370 memset(&packet2, 0,
sizeof(packet2));
12371 mavlink_msg_to_send_buffer(buffer, &msg);
12372 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12373 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12375 mavlink_msg_cellular_status_decode(last_msg, &packet2);
12376 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12378 memset(&packet2, 0,
sizeof(packet2));
12379 mavlink_msg_cellular_status_send(MAVLINK_COMM_1 , packet1.status , packet1.failure_reason , packet1.type , packet1.quality , packet1.mcc , packet1.mnc , packet1.lac );
12380 mavlink_msg_cellular_status_decode(last_msg, &packet2);
12381 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12383#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12384 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"CELLULAR_STATUS") != NULL);
12385 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CELLULAR_STATUS) != NULL);
12389static void mavlink_test_isbd_link_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12391#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12392 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12393 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ISBD_LINK_STATUS >= 256) {
12397 mavlink_message_t msg;
12398 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12400 mavlink_isbd_link_status_t packet_in = {
12401 93372036854775807ULL,93372036854776311ULL,18067,18171,65,132,199,10
12403 mavlink_isbd_link_status_t packet1, packet2;
12404 memset(&packet1, 0,
sizeof(packet1));
12405 packet1.timestamp = packet_in.timestamp;
12406 packet1.last_heartbeat = packet_in.last_heartbeat;
12407 packet1.failed_sessions = packet_in.failed_sessions;
12408 packet1.successful_sessions = packet_in.successful_sessions;
12409 packet1.signal_quality = packet_in.signal_quality;
12410 packet1.ring_pending = packet_in.ring_pending;
12411 packet1.tx_session_pending = packet_in.tx_session_pending;
12412 packet1.rx_session_pending = packet_in.rx_session_pending;
12415#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12416 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12418 memset(MAVLINK_MSG_ID_ISBD_LINK_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_ISBD_LINK_STATUS_MIN_LEN);
12421 memset(&packet2, 0,
sizeof(packet2));
12422 mavlink_msg_isbd_link_status_encode(system_id, component_id, &msg, &packet1);
12423 mavlink_msg_isbd_link_status_decode(&msg, &packet2);
12424 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12426 memset(&packet2, 0,
sizeof(packet2));
12427 mavlink_msg_isbd_link_status_pack(system_id, component_id, &msg , packet1.timestamp , packet1.last_heartbeat , packet1.failed_sessions , packet1.successful_sessions , packet1.signal_quality , packet1.ring_pending , packet1.tx_session_pending , packet1.rx_session_pending );
12428 mavlink_msg_isbd_link_status_decode(&msg, &packet2);
12429 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12431 memset(&packet2, 0,
sizeof(packet2));
12432 mavlink_msg_isbd_link_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.last_heartbeat , packet1.failed_sessions , packet1.successful_sessions , packet1.signal_quality , packet1.ring_pending , packet1.tx_session_pending , packet1.rx_session_pending );
12433 mavlink_msg_isbd_link_status_decode(&msg, &packet2);
12434 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12436 memset(&packet2, 0,
sizeof(packet2));
12437 mavlink_msg_to_send_buffer(buffer, &msg);
12438 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12439 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12441 mavlink_msg_isbd_link_status_decode(last_msg, &packet2);
12442 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12444 memset(&packet2, 0,
sizeof(packet2));
12445 mavlink_msg_isbd_link_status_send(MAVLINK_COMM_1 , packet1.timestamp , packet1.last_heartbeat , packet1.failed_sessions , packet1.successful_sessions , packet1.signal_quality , packet1.ring_pending , packet1.tx_session_pending , packet1.rx_session_pending );
12446 mavlink_msg_isbd_link_status_decode(last_msg, &packet2);
12447 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12449#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12450 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"ISBD_LINK_STATUS") != NULL);
12451 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ISBD_LINK_STATUS) != NULL);
12455static void mavlink_test_cellular_config(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12457#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12458 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12459 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CELLULAR_CONFIG >= 256) {
12463 mavlink_message_t msg;
12464 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12466 mavlink_cellular_config_t packet_in = {
12467 5,72,
"CDEFGHIJKLMNOPQ",
"STUVWXYZABCDEFG",
"IJKLMNOPQRSTUVWXYZABCDEFGHIJKLM",
"OPQRSTUVWXYZABC",123,190
12469 mavlink_cellular_config_t packet1, packet2;
12470 memset(&packet1, 0,
sizeof(packet1));
12471 packet1.enable_lte = packet_in.enable_lte;
12472 packet1.enable_pin = packet_in.enable_pin;
12473 packet1.roaming = packet_in.roaming;
12474 packet1.response = packet_in.response;
12476 mav_array_memcpy(packet1.pin, packet_in.pin,
sizeof(
char)*16);
12477 mav_array_memcpy(packet1.new_pin, packet_in.new_pin,
sizeof(
char)*16);
12478 mav_array_memcpy(packet1.apn, packet_in.apn,
sizeof(
char)*32);
12479 mav_array_memcpy(packet1.puk, packet_in.puk,
sizeof(
char)*16);
12481#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12482 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12484 memset(MAVLINK_MSG_ID_CELLULAR_CONFIG_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_CELLULAR_CONFIG_MIN_LEN);
12487 memset(&packet2, 0,
sizeof(packet2));
12488 mavlink_msg_cellular_config_encode(system_id, component_id, &msg, &packet1);
12489 mavlink_msg_cellular_config_decode(&msg, &packet2);
12490 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12492 memset(&packet2, 0,
sizeof(packet2));
12493 mavlink_msg_cellular_config_pack(system_id, component_id, &msg , packet1.enable_lte , packet1.enable_pin , packet1.pin , packet1.new_pin , packet1.apn , packet1.puk , packet1.roaming , packet1.response );
12494 mavlink_msg_cellular_config_decode(&msg, &packet2);
12495 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12497 memset(&packet2, 0,
sizeof(packet2));
12498 mavlink_msg_cellular_config_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.enable_lte , packet1.enable_pin , packet1.pin , packet1.new_pin , packet1.apn , packet1.puk , packet1.roaming , packet1.response );
12499 mavlink_msg_cellular_config_decode(&msg, &packet2);
12500 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12502 memset(&packet2, 0,
sizeof(packet2));
12503 mavlink_msg_to_send_buffer(buffer, &msg);
12504 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12505 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12507 mavlink_msg_cellular_config_decode(last_msg, &packet2);
12508 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12510 memset(&packet2, 0,
sizeof(packet2));
12511 mavlink_msg_cellular_config_send(MAVLINK_COMM_1 , packet1.enable_lte , packet1.enable_pin , packet1.pin , packet1.new_pin , packet1.apn , packet1.puk , packet1.roaming , packet1.response );
12512 mavlink_msg_cellular_config_decode(last_msg, &packet2);
12513 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12515#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12516 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"CELLULAR_CONFIG") != NULL);
12517 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CELLULAR_CONFIG) != NULL);
12521static void mavlink_test_raw_rpm(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12523#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12524 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12525 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RAW_RPM >= 256) {
12529 mavlink_message_t msg;
12530 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12532 mavlink_raw_rpm_t packet_in = {
12535 mavlink_raw_rpm_t packet1, packet2;
12536 memset(&packet1, 0,
sizeof(packet1));
12537 packet1.frequency = packet_in.frequency;
12538 packet1.index = packet_in.index;
12541#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12542 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12544 memset(MAVLINK_MSG_ID_RAW_RPM_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_RAW_RPM_MIN_LEN);
12547 memset(&packet2, 0,
sizeof(packet2));
12548 mavlink_msg_raw_rpm_encode(system_id, component_id, &msg, &packet1);
12549 mavlink_msg_raw_rpm_decode(&msg, &packet2);
12550 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12552 memset(&packet2, 0,
sizeof(packet2));
12553 mavlink_msg_raw_rpm_pack(system_id, component_id, &msg , packet1.index , packet1.frequency );
12554 mavlink_msg_raw_rpm_decode(&msg, &packet2);
12555 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12557 memset(&packet2, 0,
sizeof(packet2));
12558 mavlink_msg_raw_rpm_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.index , packet1.frequency );
12559 mavlink_msg_raw_rpm_decode(&msg, &packet2);
12560 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12562 memset(&packet2, 0,
sizeof(packet2));
12563 mavlink_msg_to_send_buffer(buffer, &msg);
12564 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12565 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12567 mavlink_msg_raw_rpm_decode(last_msg, &packet2);
12568 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12570 memset(&packet2, 0,
sizeof(packet2));
12571 mavlink_msg_raw_rpm_send(MAVLINK_COMM_1 , packet1.index , packet1.frequency );
12572 mavlink_msg_raw_rpm_decode(last_msg, &packet2);
12573 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12575#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12576 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"RAW_RPM") != NULL);
12577 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_RAW_RPM) != NULL);
12581static void mavlink_test_utm_global_position(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12583#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12584 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12585 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_UTM_GLOBAL_POSITION >= 256) {
12589 mavlink_message_t msg;
12590 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12592 mavlink_utm_global_position_t packet_in = {
12593 93372036854775807ULL,963497880,963498088,963498296,963498504,963498712,963498920,963499128,19107,19211,19315,19419,19523,19627,19731,{ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44 },209,20
12595 mavlink_utm_global_position_t packet1, packet2;
12596 memset(&packet1, 0,
sizeof(packet1));
12597 packet1.time = packet_in.time;
12598 packet1.lat = packet_in.lat;
12599 packet1.lon = packet_in.lon;
12600 packet1.alt = packet_in.alt;
12601 packet1.relative_alt = packet_in.relative_alt;
12602 packet1.next_lat = packet_in.next_lat;
12603 packet1.next_lon = packet_in.next_lon;
12604 packet1.next_alt = packet_in.next_alt;
12605 packet1.vx = packet_in.vx;
12606 packet1.vy = packet_in.vy;
12607 packet1.vz = packet_in.vz;
12608 packet1.h_acc = packet_in.h_acc;
12609 packet1.v_acc = packet_in.v_acc;
12610 packet1.vel_acc = packet_in.vel_acc;
12611 packet1.update_rate = packet_in.update_rate;
12612 packet1.flight_state = packet_in.flight_state;
12613 packet1.flags = packet_in.flags;
12615 mav_array_memcpy(packet1.uas_id, packet_in.uas_id,
sizeof(uint8_t)*18);
12617#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12618 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12620 memset(MAVLINK_MSG_ID_UTM_GLOBAL_POSITION_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_UTM_GLOBAL_POSITION_MIN_LEN);
12623 memset(&packet2, 0,
sizeof(packet2));
12624 mavlink_msg_utm_global_position_encode(system_id, component_id, &msg, &packet1);
12625 mavlink_msg_utm_global_position_decode(&msg, &packet2);
12626 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12628 memset(&packet2, 0,
sizeof(packet2));
12629 mavlink_msg_utm_global_position_pack(system_id, component_id, &msg , packet1.time , packet1.uas_id , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.h_acc , packet1.v_acc , packet1.vel_acc , packet1.next_lat , packet1.next_lon , packet1.next_alt , packet1.update_rate , packet1.flight_state , packet1.flags );
12630 mavlink_msg_utm_global_position_decode(&msg, &packet2);
12631 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12633 memset(&packet2, 0,
sizeof(packet2));
12634 mavlink_msg_utm_global_position_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time , packet1.uas_id , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.h_acc , packet1.v_acc , packet1.vel_acc , packet1.next_lat , packet1.next_lon , packet1.next_alt , packet1.update_rate , packet1.flight_state , packet1.flags );
12635 mavlink_msg_utm_global_position_decode(&msg, &packet2);
12636 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12638 memset(&packet2, 0,
sizeof(packet2));
12639 mavlink_msg_to_send_buffer(buffer, &msg);
12640 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12641 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12643 mavlink_msg_utm_global_position_decode(last_msg, &packet2);
12644 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12646 memset(&packet2, 0,
sizeof(packet2));
12647 mavlink_msg_utm_global_position_send(MAVLINK_COMM_1 , packet1.time , packet1.uas_id , packet1.lat , packet1.lon , packet1.alt , packet1.relative_alt , packet1.vx , packet1.vy , packet1.vz , packet1.h_acc , packet1.v_acc , packet1.vel_acc , packet1.next_lat , packet1.next_lon , packet1.next_alt , packet1.update_rate , packet1.flight_state , packet1.flags );
12648 mavlink_msg_utm_global_position_decode(last_msg, &packet2);
12649 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12651#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12652 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"UTM_GLOBAL_POSITION") != NULL);
12653 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_UTM_GLOBAL_POSITION) != NULL);
12657static void mavlink_test_param_error(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12659#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12660 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12661 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PARAM_ERROR >= 256) {
12665 mavlink_message_t msg;
12666 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12668 mavlink_param_error_t packet_in = {
12669 17235,139,206,
"EFGHIJKLMNOPQRS",65
12671 mavlink_param_error_t packet1, packet2;
12672 memset(&packet1, 0,
sizeof(packet1));
12673 packet1.param_index = packet_in.param_index;
12674 packet1.target_system = packet_in.target_system;
12675 packet1.target_component = packet_in.target_component;
12676 packet1.error = packet_in.error;
12678 mav_array_memcpy(packet1.param_id, packet_in.param_id,
sizeof(
char)*16);
12680#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12681 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12683 memset(MAVLINK_MSG_ID_PARAM_ERROR_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_PARAM_ERROR_MIN_LEN);
12686 memset(&packet2, 0,
sizeof(packet2));
12687 mavlink_msg_param_error_encode(system_id, component_id, &msg, &packet1);
12688 mavlink_msg_param_error_decode(&msg, &packet2);
12689 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12691 memset(&packet2, 0,
sizeof(packet2));
12692 mavlink_msg_param_error_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.error );
12693 mavlink_msg_param_error_decode(&msg, &packet2);
12694 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12696 memset(&packet2, 0,
sizeof(packet2));
12697 mavlink_msg_param_error_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.error );
12698 mavlink_msg_param_error_decode(&msg, &packet2);
12699 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12701 memset(&packet2, 0,
sizeof(packet2));
12702 mavlink_msg_to_send_buffer(buffer, &msg);
12703 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12704 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12706 mavlink_msg_param_error_decode(last_msg, &packet2);
12707 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12709 memset(&packet2, 0,
sizeof(packet2));
12710 mavlink_msg_param_error_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.param_id , packet1.param_index , packet1.error );
12711 mavlink_msg_param_error_decode(last_msg, &packet2);
12712 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12714#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12715 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"PARAM_ERROR") != NULL);
12716 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PARAM_ERROR) != NULL);
12720static void mavlink_test_debug_float_array(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12722#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12723 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12724 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY >= 256) {
12728 mavlink_message_t msg;
12729 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12731 mavlink_debug_float_array_t packet_in = {
12732 93372036854775807ULL,17651,
"KLMNOPQRS",{ 157.0, 158.0, 159.0, 160.0, 161.0, 162.0, 163.0, 164.0, 165.0, 166.0, 167.0, 168.0, 169.0, 170.0, 171.0, 172.0, 173.0, 174.0, 175.0, 176.0, 177.0, 178.0, 179.0, 180.0, 181.0, 182.0, 183.0, 184.0, 185.0, 186.0, 187.0, 188.0, 189.0, 190.0, 191.0, 192.0, 193.0, 194.0, 195.0, 196.0, 197.0, 198.0, 199.0, 200.0, 201.0, 202.0, 203.0, 204.0, 205.0, 206.0, 207.0, 208.0, 209.0, 210.0, 211.0, 212.0, 213.0, 214.0 }
12734 mavlink_debug_float_array_t packet1, packet2;
12735 memset(&packet1, 0,
sizeof(packet1));
12736 packet1.time_usec = packet_in.time_usec;
12737 packet1.array_id = packet_in.array_id;
12739 mav_array_memcpy(packet1.name, packet_in.name,
sizeof(
char)*10);
12740 mav_array_memcpy(packet1.data, packet_in.data,
sizeof(
float)*58);
12742#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12743 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12745 memset(MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY_MIN_LEN);
12748 memset(&packet2, 0,
sizeof(packet2));
12749 mavlink_msg_debug_float_array_encode(system_id, component_id, &msg, &packet1);
12750 mavlink_msg_debug_float_array_decode(&msg, &packet2);
12751 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12753 memset(&packet2, 0,
sizeof(packet2));
12754 mavlink_msg_debug_float_array_pack(system_id, component_id, &msg , packet1.time_usec , packet1.name , packet1.array_id , packet1.data );
12755 mavlink_msg_debug_float_array_decode(&msg, &packet2);
12756 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12758 memset(&packet2, 0,
sizeof(packet2));
12759 mavlink_msg_debug_float_array_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.name , packet1.array_id , packet1.data );
12760 mavlink_msg_debug_float_array_decode(&msg, &packet2);
12761 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12763 memset(&packet2, 0,
sizeof(packet2));
12764 mavlink_msg_to_send_buffer(buffer, &msg);
12765 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12766 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12768 mavlink_msg_debug_float_array_decode(last_msg, &packet2);
12769 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12771 memset(&packet2, 0,
sizeof(packet2));
12772 mavlink_msg_debug_float_array_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.name , packet1.array_id , packet1.data );
12773 mavlink_msg_debug_float_array_decode(last_msg, &packet2);
12774 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12776#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12777 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"DEBUG_FLOAT_ARRAY") != NULL);
12778 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_DEBUG_FLOAT_ARRAY) != NULL);
12782static void mavlink_test_orbit_execution_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12784#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12785 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12786 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS >= 256) {
12790 mavlink_message_t msg;
12791 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12793 mavlink_orbit_execution_status_t packet_in = {
12794 93372036854775807ULL,73.0,963498088,963498296,157.0,77
12796 mavlink_orbit_execution_status_t packet1, packet2;
12797 memset(&packet1, 0,
sizeof(packet1));
12798 packet1.time_usec = packet_in.time_usec;
12799 packet1.radius = packet_in.radius;
12800 packet1.x = packet_in.x;
12801 packet1.y = packet_in.y;
12802 packet1.z = packet_in.z;
12803 packet1.frame = packet_in.frame;
12806#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12807 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12809 memset(MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS_MIN_LEN);
12812 memset(&packet2, 0,
sizeof(packet2));
12813 mavlink_msg_orbit_execution_status_encode(system_id, component_id, &msg, &packet1);
12814 mavlink_msg_orbit_execution_status_decode(&msg, &packet2);
12815 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12817 memset(&packet2, 0,
sizeof(packet2));
12818 mavlink_msg_orbit_execution_status_pack(system_id, component_id, &msg , packet1.time_usec , packet1.radius , packet1.frame , packet1.x , packet1.y , packet1.z );
12819 mavlink_msg_orbit_execution_status_decode(&msg, &packet2);
12820 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12822 memset(&packet2, 0,
sizeof(packet2));
12823 mavlink_msg_orbit_execution_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.radius , packet1.frame , packet1.x , packet1.y , packet1.z );
12824 mavlink_msg_orbit_execution_status_decode(&msg, &packet2);
12825 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12827 memset(&packet2, 0,
sizeof(packet2));
12828 mavlink_msg_to_send_buffer(buffer, &msg);
12829 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12830 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12832 mavlink_msg_orbit_execution_status_decode(last_msg, &packet2);
12833 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12835 memset(&packet2, 0,
sizeof(packet2));
12836 mavlink_msg_orbit_execution_status_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.radius , packet1.frame , packet1.x , packet1.y , packet1.z );
12837 mavlink_msg_orbit_execution_status_decode(last_msg, &packet2);
12838 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12840#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12841 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"ORBIT_EXECUTION_STATUS") != NULL);
12842 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ORBIT_EXECUTION_STATUS) != NULL);
12846static void mavlink_test_smart_battery_info(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12848#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12849 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12850 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SMART_BATTERY_INFO >= 256) {
12854 mavlink_message_t msg;
12855 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12857 mavlink_smart_battery_info_t packet_in = {
12858 963497464,963497672,17651,17755,17859,17963,18067,187,254,65,
"VWXYZABCDEFGHIJ",
"LMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGH",21759,80,963502144,963502352,
"UVWXYZABCD"
12860 mavlink_smart_battery_info_t packet1, packet2;
12861 memset(&packet1, 0,
sizeof(packet1));
12862 packet1.capacity_full_specification = packet_in.capacity_full_specification;
12863 packet1.capacity_full = packet_in.capacity_full;
12864 packet1.cycle_count = packet_in.cycle_count;
12865 packet1.weight = packet_in.weight;
12866 packet1.discharge_minimum_voltage = packet_in.discharge_minimum_voltage;
12867 packet1.charging_minimum_voltage = packet_in.charging_minimum_voltage;
12868 packet1.resting_minimum_voltage = packet_in.resting_minimum_voltage;
12869 packet1.id = packet_in.id;
12870 packet1.battery_function = packet_in.battery_function;
12871 packet1.type = packet_in.type;
12872 packet1.charging_maximum_voltage = packet_in.charging_maximum_voltage;
12873 packet1.cells_in_series = packet_in.cells_in_series;
12874 packet1.discharge_maximum_current = packet_in.discharge_maximum_current;
12875 packet1.discharge_maximum_burst_current = packet_in.discharge_maximum_burst_current;
12877 mav_array_memcpy(packet1.serial_number, packet_in.serial_number,
sizeof(
char)*16);
12878 mav_array_memcpy(packet1.device_name, packet_in.device_name,
sizeof(
char)*50);
12879 mav_array_memcpy(packet1.manufacture_date, packet_in.manufacture_date,
sizeof(
char)*11);
12881#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12882 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12884 memset(MAVLINK_MSG_ID_SMART_BATTERY_INFO_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SMART_BATTERY_INFO_MIN_LEN);
12887 memset(&packet2, 0,
sizeof(packet2));
12888 mavlink_msg_smart_battery_info_encode(system_id, component_id, &msg, &packet1);
12889 mavlink_msg_smart_battery_info_decode(&msg, &packet2);
12890 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12892 memset(&packet2, 0,
sizeof(packet2));
12893 mavlink_msg_smart_battery_info_pack(system_id, component_id, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.capacity_full_specification , packet1.capacity_full , packet1.cycle_count , packet1.serial_number , packet1.device_name , packet1.weight , packet1.discharge_minimum_voltage , packet1.charging_minimum_voltage , packet1.resting_minimum_voltage , packet1.charging_maximum_voltage , packet1.cells_in_series , packet1.discharge_maximum_current , packet1.discharge_maximum_burst_current , packet1.manufacture_date );
12894 mavlink_msg_smart_battery_info_decode(&msg, &packet2);
12895 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12897 memset(&packet2, 0,
sizeof(packet2));
12898 mavlink_msg_smart_battery_info_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.capacity_full_specification , packet1.capacity_full , packet1.cycle_count , packet1.serial_number , packet1.device_name , packet1.weight , packet1.discharge_minimum_voltage , packet1.charging_minimum_voltage , packet1.resting_minimum_voltage , packet1.charging_maximum_voltage , packet1.cells_in_series , packet1.discharge_maximum_current , packet1.discharge_maximum_burst_current , packet1.manufacture_date );
12899 mavlink_msg_smart_battery_info_decode(&msg, &packet2);
12900 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12902 memset(&packet2, 0,
sizeof(packet2));
12903 mavlink_msg_to_send_buffer(buffer, &msg);
12904 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12905 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12907 mavlink_msg_smart_battery_info_decode(last_msg, &packet2);
12908 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12910 memset(&packet2, 0,
sizeof(packet2));
12911 mavlink_msg_smart_battery_info_send(MAVLINK_COMM_1 , packet1.id , packet1.battery_function , packet1.type , packet1.capacity_full_specification , packet1.capacity_full , packet1.cycle_count , packet1.serial_number , packet1.device_name , packet1.weight , packet1.discharge_minimum_voltage , packet1.charging_minimum_voltage , packet1.resting_minimum_voltage , packet1.charging_maximum_voltage , packet1.cells_in_series , packet1.discharge_maximum_current , packet1.discharge_maximum_burst_current , packet1.manufacture_date );
12912 mavlink_msg_smart_battery_info_decode(last_msg, &packet2);
12913 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12915#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12916 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SMART_BATTERY_INFO") != NULL);
12917 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SMART_BATTERY_INFO) != NULL);
12921static void mavlink_test_figure_eight_execution_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12923#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12924 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12925 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FIGURE_EIGHT_EXECUTION_STATUS >= 256) {
12929 mavlink_message_t msg;
12930 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12932 mavlink_figure_eight_execution_status_t packet_in = {
12933 93372036854775807ULL,73.0,101.0,129.0,963498504,963498712,213.0,101
12935 mavlink_figure_eight_execution_status_t packet1, packet2;
12936 memset(&packet1, 0,
sizeof(packet1));
12937 packet1.time_usec = packet_in.time_usec;
12938 packet1.major_radius = packet_in.major_radius;
12939 packet1.minor_radius = packet_in.minor_radius;
12940 packet1.orientation = packet_in.orientation;
12941 packet1.x = packet_in.x;
12942 packet1.y = packet_in.y;
12943 packet1.z = packet_in.z;
12944 packet1.frame = packet_in.frame;
12947#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12948 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
12950 memset(MAVLINK_MSG_ID_FIGURE_EIGHT_EXECUTION_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_FIGURE_EIGHT_EXECUTION_STATUS_MIN_LEN);
12953 memset(&packet2, 0,
sizeof(packet2));
12954 mavlink_msg_figure_eight_execution_status_encode(system_id, component_id, &msg, &packet1);
12955 mavlink_msg_figure_eight_execution_status_decode(&msg, &packet2);
12956 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12958 memset(&packet2, 0,
sizeof(packet2));
12959 mavlink_msg_figure_eight_execution_status_pack(system_id, component_id, &msg , packet1.time_usec , packet1.major_radius , packet1.minor_radius , packet1.orientation , packet1.frame , packet1.x , packet1.y , packet1.z );
12960 mavlink_msg_figure_eight_execution_status_decode(&msg, &packet2);
12961 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12963 memset(&packet2, 0,
sizeof(packet2));
12964 mavlink_msg_figure_eight_execution_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.major_radius , packet1.minor_radius , packet1.orientation , packet1.frame , packet1.x , packet1.y , packet1.z );
12965 mavlink_msg_figure_eight_execution_status_decode(&msg, &packet2);
12966 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12968 memset(&packet2, 0,
sizeof(packet2));
12969 mavlink_msg_to_send_buffer(buffer, &msg);
12970 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
12971 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
12973 mavlink_msg_figure_eight_execution_status_decode(last_msg, &packet2);
12974 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12976 memset(&packet2, 0,
sizeof(packet2));
12977 mavlink_msg_figure_eight_execution_status_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.major_radius , packet1.minor_radius , packet1.orientation , packet1.frame , packet1.x , packet1.y , packet1.z );
12978 mavlink_msg_figure_eight_execution_status_decode(last_msg, &packet2);
12979 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
12981#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
12982 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"FIGURE_EIGHT_EXECUTION_STATUS") != NULL);
12983 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_FIGURE_EIGHT_EXECUTION_STATUS) != NULL);
12987static void mavlink_test_fuel_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
12989#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
12990 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
12991 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FUEL_STATUS >= 256) {
12995 mavlink_message_t msg;
12996 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
12998 mavlink_fuel_status_t packet_in = {
12999 17.0,45.0,73.0,101.0,129.0,963498504,77,144
13001 mavlink_fuel_status_t packet1, packet2;
13002 memset(&packet1, 0,
sizeof(packet1));
13003 packet1.maximum_fuel = packet_in.maximum_fuel;
13004 packet1.consumed_fuel = packet_in.consumed_fuel;
13005 packet1.remaining_fuel = packet_in.remaining_fuel;
13006 packet1.flow_rate = packet_in.flow_rate;
13007 packet1.temperature = packet_in.temperature;
13008 packet1.fuel_type = packet_in.fuel_type;
13009 packet1.id = packet_in.id;
13010 packet1.percent_remaining = packet_in.percent_remaining;
13013#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13014 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13016 memset(MAVLINK_MSG_ID_FUEL_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_FUEL_STATUS_MIN_LEN);
13019 memset(&packet2, 0,
sizeof(packet2));
13020 mavlink_msg_fuel_status_encode(system_id, component_id, &msg, &packet1);
13021 mavlink_msg_fuel_status_decode(&msg, &packet2);
13022 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13024 memset(&packet2, 0,
sizeof(packet2));
13025 mavlink_msg_fuel_status_pack(system_id, component_id, &msg , packet1.id , packet1.maximum_fuel , packet1.consumed_fuel , packet1.remaining_fuel , packet1.percent_remaining , packet1.flow_rate , packet1.temperature , packet1.fuel_type );
13026 mavlink_msg_fuel_status_decode(&msg, &packet2);
13027 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13029 memset(&packet2, 0,
sizeof(packet2));
13030 mavlink_msg_fuel_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.maximum_fuel , packet1.consumed_fuel , packet1.remaining_fuel , packet1.percent_remaining , packet1.flow_rate , packet1.temperature , packet1.fuel_type );
13031 mavlink_msg_fuel_status_decode(&msg, &packet2);
13032 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13034 memset(&packet2, 0,
sizeof(packet2));
13035 mavlink_msg_to_send_buffer(buffer, &msg);
13036 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13037 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13039 mavlink_msg_fuel_status_decode(last_msg, &packet2);
13040 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13042 memset(&packet2, 0,
sizeof(packet2));
13043 mavlink_msg_fuel_status_send(MAVLINK_COMM_1 , packet1.id , packet1.maximum_fuel , packet1.consumed_fuel , packet1.remaining_fuel , packet1.percent_remaining , packet1.flow_rate , packet1.temperature , packet1.fuel_type );
13044 mavlink_msg_fuel_status_decode(last_msg, &packet2);
13045 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13047#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13048 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"FUEL_STATUS") != NULL);
13049 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_FUEL_STATUS) != NULL);
13053static void mavlink_test_battery_info(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13055#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13056 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13057 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_BATTERY_INFO >= 256) {
13061 mavlink_message_t msg;
13062 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13064 mavlink_battery_info_t packet_in = {
13065 17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,19315,19419,137,204,15,82,149,
"XYZABCDE",
"GHIJKLMNOPQRSTUVWXYZABCDEFGHIJK",
"MNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHI"
13067 mavlink_battery_info_t packet1, packet2;
13068 memset(&packet1, 0,
sizeof(packet1));
13069 packet1.discharge_minimum_voltage = packet_in.discharge_minimum_voltage;
13070 packet1.charging_minimum_voltage = packet_in.charging_minimum_voltage;
13071 packet1.resting_minimum_voltage = packet_in.resting_minimum_voltage;
13072 packet1.charging_maximum_voltage = packet_in.charging_maximum_voltage;
13073 packet1.charging_maximum_current = packet_in.charging_maximum_current;
13074 packet1.nominal_voltage = packet_in.nominal_voltage;
13075 packet1.discharge_maximum_current = packet_in.discharge_maximum_current;
13076 packet1.discharge_maximum_burst_current = packet_in.discharge_maximum_burst_current;
13077 packet1.design_capacity = packet_in.design_capacity;
13078 packet1.full_charge_capacity = packet_in.full_charge_capacity;
13079 packet1.cycle_count = packet_in.cycle_count;
13080 packet1.weight = packet_in.weight;
13081 packet1.id = packet_in.id;
13082 packet1.battery_function = packet_in.battery_function;
13083 packet1.type = packet_in.type;
13084 packet1.state_of_health = packet_in.state_of_health;
13085 packet1.cells_in_series = packet_in.cells_in_series;
13087 mav_array_memcpy(packet1.manufacture_date, packet_in.manufacture_date,
sizeof(
char)*9);
13088 mav_array_memcpy(packet1.serial_number, packet_in.serial_number,
sizeof(
char)*32);
13089 mav_array_memcpy(packet1.name, packet_in.name,
sizeof(
char)*50);
13091#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13092 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13094 memset(MAVLINK_MSG_ID_BATTERY_INFO_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_BATTERY_INFO_MIN_LEN);
13097 memset(&packet2, 0,
sizeof(packet2));
13098 mavlink_msg_battery_info_encode(system_id, component_id, &msg, &packet1);
13099 mavlink_msg_battery_info_decode(&msg, &packet2);
13100 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13102 memset(&packet2, 0,
sizeof(packet2));
13103 mavlink_msg_battery_info_pack(system_id, component_id, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.state_of_health , packet1.cells_in_series , packet1.cycle_count , packet1.weight , packet1.discharge_minimum_voltage , packet1.charging_minimum_voltage , packet1.resting_minimum_voltage , packet1.charging_maximum_voltage , packet1.charging_maximum_current , packet1.nominal_voltage , packet1.discharge_maximum_current , packet1.discharge_maximum_burst_current , packet1.design_capacity , packet1.full_charge_capacity , packet1.manufacture_date , packet1.serial_number , packet1.name );
13104 mavlink_msg_battery_info_decode(&msg, &packet2);
13105 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13107 memset(&packet2, 0,
sizeof(packet2));
13108 mavlink_msg_battery_info_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.battery_function , packet1.type , packet1.state_of_health , packet1.cells_in_series , packet1.cycle_count , packet1.weight , packet1.discharge_minimum_voltage , packet1.charging_minimum_voltage , packet1.resting_minimum_voltage , packet1.charging_maximum_voltage , packet1.charging_maximum_current , packet1.nominal_voltage , packet1.discharge_maximum_current , packet1.discharge_maximum_burst_current , packet1.design_capacity , packet1.full_charge_capacity , packet1.manufacture_date , packet1.serial_number , packet1.name );
13109 mavlink_msg_battery_info_decode(&msg, &packet2);
13110 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13112 memset(&packet2, 0,
sizeof(packet2));
13113 mavlink_msg_to_send_buffer(buffer, &msg);
13114 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13115 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13117 mavlink_msg_battery_info_decode(last_msg, &packet2);
13118 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13120 memset(&packet2, 0,
sizeof(packet2));
13121 mavlink_msg_battery_info_send(MAVLINK_COMM_1 , packet1.id , packet1.battery_function , packet1.type , packet1.state_of_health , packet1.cells_in_series , packet1.cycle_count , packet1.weight , packet1.discharge_minimum_voltage , packet1.charging_minimum_voltage , packet1.resting_minimum_voltage , packet1.charging_maximum_voltage , packet1.charging_maximum_current , packet1.nominal_voltage , packet1.discharge_maximum_current , packet1.discharge_maximum_burst_current , packet1.design_capacity , packet1.full_charge_capacity , packet1.manufacture_date , packet1.serial_number , packet1.name );
13122 mavlink_msg_battery_info_decode(last_msg, &packet2);
13123 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13125#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13126 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"BATTERY_INFO") != NULL);
13127 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_BATTERY_INFO) != NULL);
13131static void mavlink_test_generator_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13133#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13134 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13135 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GENERATOR_STATUS >= 256) {
13139 mavlink_message_t msg;
13140 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13142 mavlink_generator_status_t packet_in = {
13143 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,963498920,963499128,19107,19211,19315
13145 mavlink_generator_status_t packet1, packet2;
13146 memset(&packet1, 0,
sizeof(packet1));
13147 packet1.status = packet_in.status;
13148 packet1.battery_current = packet_in.battery_current;
13149 packet1.load_current = packet_in.load_current;
13150 packet1.power_generated = packet_in.power_generated;
13151 packet1.bus_voltage = packet_in.bus_voltage;
13152 packet1.bat_current_setpoint = packet_in.bat_current_setpoint;
13153 packet1.runtime = packet_in.runtime;
13154 packet1.time_until_maintenance = packet_in.time_until_maintenance;
13155 packet1.generator_speed = packet_in.generator_speed;
13156 packet1.rectifier_temperature = packet_in.rectifier_temperature;
13157 packet1.generator_temperature = packet_in.generator_temperature;
13160#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13161 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13163 memset(MAVLINK_MSG_ID_GENERATOR_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_GENERATOR_STATUS_MIN_LEN);
13166 memset(&packet2, 0,
sizeof(packet2));
13167 mavlink_msg_generator_status_encode(system_id, component_id, &msg, &packet1);
13168 mavlink_msg_generator_status_decode(&msg, &packet2);
13169 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13171 memset(&packet2, 0,
sizeof(packet2));
13172 mavlink_msg_generator_status_pack(system_id, component_id, &msg , packet1.status , packet1.generator_speed , packet1.battery_current , packet1.load_current , packet1.power_generated , packet1.bus_voltage , packet1.rectifier_temperature , packet1.bat_current_setpoint , packet1.generator_temperature , packet1.runtime , packet1.time_until_maintenance );
13173 mavlink_msg_generator_status_decode(&msg, &packet2);
13174 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13176 memset(&packet2, 0,
sizeof(packet2));
13177 mavlink_msg_generator_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.status , packet1.generator_speed , packet1.battery_current , packet1.load_current , packet1.power_generated , packet1.bus_voltage , packet1.rectifier_temperature , packet1.bat_current_setpoint , packet1.generator_temperature , packet1.runtime , packet1.time_until_maintenance );
13178 mavlink_msg_generator_status_decode(&msg, &packet2);
13179 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13181 memset(&packet2, 0,
sizeof(packet2));
13182 mavlink_msg_to_send_buffer(buffer, &msg);
13183 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13184 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13186 mavlink_msg_generator_status_decode(last_msg, &packet2);
13187 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13189 memset(&packet2, 0,
sizeof(packet2));
13190 mavlink_msg_generator_status_send(MAVLINK_COMM_1 , packet1.status , packet1.generator_speed , packet1.battery_current , packet1.load_current , packet1.power_generated , packet1.bus_voltage , packet1.rectifier_temperature , packet1.bat_current_setpoint , packet1.generator_temperature , packet1.runtime , packet1.time_until_maintenance );
13191 mavlink_msg_generator_status_decode(last_msg, &packet2);
13192 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13194#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13195 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"GENERATOR_STATUS") != NULL);
13196 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_GENERATOR_STATUS) != NULL);
13200static void mavlink_test_actuator_output_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13202#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13203 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13204 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS >= 256) {
13208 mavlink_message_t msg;
13209 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13211 mavlink_actuator_output_status_t packet_in = {
13212 93372036854775807ULL,963497880,{ 101.0, 102.0, 103.0, 104.0, 105.0, 106.0, 107.0, 108.0, 109.0, 110.0, 111.0, 112.0, 113.0, 114.0, 115.0, 116.0, 117.0, 118.0, 119.0, 120.0, 121.0, 122.0, 123.0, 124.0, 125.0, 126.0, 127.0, 128.0, 129.0, 130.0, 131.0, 132.0 }
13214 mavlink_actuator_output_status_t packet1, packet2;
13215 memset(&packet1, 0,
sizeof(packet1));
13216 packet1.time_usec = packet_in.time_usec;
13217 packet1.active = packet_in.active;
13219 mav_array_memcpy(packet1.actuator, packet_in.actuator,
sizeof(
float)*32);
13221#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13222 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13224 memset(MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS_MIN_LEN);
13227 memset(&packet2, 0,
sizeof(packet2));
13228 mavlink_msg_actuator_output_status_encode(system_id, component_id, &msg, &packet1);
13229 mavlink_msg_actuator_output_status_decode(&msg, &packet2);
13230 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13232 memset(&packet2, 0,
sizeof(packet2));
13233 mavlink_msg_actuator_output_status_pack(system_id, component_id, &msg , packet1.time_usec , packet1.active , packet1.actuator );
13234 mavlink_msg_actuator_output_status_decode(&msg, &packet2);
13235 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13237 memset(&packet2, 0,
sizeof(packet2));
13238 mavlink_msg_actuator_output_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.active , packet1.actuator );
13239 mavlink_msg_actuator_output_status_decode(&msg, &packet2);
13240 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13242 memset(&packet2, 0,
sizeof(packet2));
13243 mavlink_msg_to_send_buffer(buffer, &msg);
13244 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13245 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13247 mavlink_msg_actuator_output_status_decode(last_msg, &packet2);
13248 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13250 memset(&packet2, 0,
sizeof(packet2));
13251 mavlink_msg_actuator_output_status_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.active , packet1.actuator );
13252 mavlink_msg_actuator_output_status_decode(last_msg, &packet2);
13253 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13255#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13256 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"ACTUATOR_OUTPUT_STATUS") != NULL);
13257 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ACTUATOR_OUTPUT_STATUS) != NULL);
13261static void mavlink_test_relay_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13263#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13264 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13265 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RELAY_STATUS >= 256) {
13269 mavlink_message_t msg;
13270 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13272 mavlink_relay_status_t packet_in = {
13273 963497464,17443,17547
13275 mavlink_relay_status_t packet1, packet2;
13276 memset(&packet1, 0,
sizeof(packet1));
13277 packet1.time_boot_ms = packet_in.time_boot_ms;
13278 packet1.on = packet_in.on;
13279 packet1.present = packet_in.present;
13282#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13283 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13285 memset(MAVLINK_MSG_ID_RELAY_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_RELAY_STATUS_MIN_LEN);
13288 memset(&packet2, 0,
sizeof(packet2));
13289 mavlink_msg_relay_status_encode(system_id, component_id, &msg, &packet1);
13290 mavlink_msg_relay_status_decode(&msg, &packet2);
13291 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13293 memset(&packet2, 0,
sizeof(packet2));
13294 mavlink_msg_relay_status_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.on , packet1.present );
13295 mavlink_msg_relay_status_decode(&msg, &packet2);
13296 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13298 memset(&packet2, 0,
sizeof(packet2));
13299 mavlink_msg_relay_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.on , packet1.present );
13300 mavlink_msg_relay_status_decode(&msg, &packet2);
13301 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13303 memset(&packet2, 0,
sizeof(packet2));
13304 mavlink_msg_to_send_buffer(buffer, &msg);
13305 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13306 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13308 mavlink_msg_relay_status_decode(last_msg, &packet2);
13309 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13311 memset(&packet2, 0,
sizeof(packet2));
13312 mavlink_msg_relay_status_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.on , packet1.present );
13313 mavlink_msg_relay_status_decode(last_msg, &packet2);
13314 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13316#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13317 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"RELAY_STATUS") != NULL);
13318 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_RELAY_STATUS) != NULL);
13322static void mavlink_test_time_estimate_to_target(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13324#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13325 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13326 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET >= 256) {
13330 mavlink_message_t msg;
13331 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13333 mavlink_time_estimate_to_target_t packet_in = {
13334 963497464,963497672,963497880,963498088,963498296
13336 mavlink_time_estimate_to_target_t packet1, packet2;
13337 memset(&packet1, 0,
sizeof(packet1));
13338 packet1.safe_return = packet_in.safe_return;
13339 packet1.land = packet_in.land;
13340 packet1.mission_next_item = packet_in.mission_next_item;
13341 packet1.mission_end = packet_in.mission_end;
13342 packet1.commanded_action = packet_in.commanded_action;
13345#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13346 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13348 memset(MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_MIN_LEN);
13351 memset(&packet2, 0,
sizeof(packet2));
13352 mavlink_msg_time_estimate_to_target_encode(system_id, component_id, &msg, &packet1);
13353 mavlink_msg_time_estimate_to_target_decode(&msg, &packet2);
13354 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13356 memset(&packet2, 0,
sizeof(packet2));
13357 mavlink_msg_time_estimate_to_target_pack(system_id, component_id, &msg , packet1.safe_return , packet1.land , packet1.mission_next_item , packet1.mission_end , packet1.commanded_action );
13358 mavlink_msg_time_estimate_to_target_decode(&msg, &packet2);
13359 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13361 memset(&packet2, 0,
sizeof(packet2));
13362 mavlink_msg_time_estimate_to_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.safe_return , packet1.land , packet1.mission_next_item , packet1.mission_end , packet1.commanded_action );
13363 mavlink_msg_time_estimate_to_target_decode(&msg, &packet2);
13364 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13366 memset(&packet2, 0,
sizeof(packet2));
13367 mavlink_msg_to_send_buffer(buffer, &msg);
13368 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13369 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13371 mavlink_msg_time_estimate_to_target_decode(last_msg, &packet2);
13372 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13374 memset(&packet2, 0,
sizeof(packet2));
13375 mavlink_msg_time_estimate_to_target_send(MAVLINK_COMM_1 , packet1.safe_return , packet1.land , packet1.mission_next_item , packet1.mission_end , packet1.commanded_action );
13376 mavlink_msg_time_estimate_to_target_decode(last_msg, &packet2);
13377 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13379#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13380 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"TIME_ESTIMATE_TO_TARGET") != NULL);
13381 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET) != NULL);
13385static void mavlink_test_tunnel(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13387#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13388 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13389 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_TUNNEL >= 256) {
13393 mavlink_message_t msg;
13394 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13396 mavlink_tunnel_t packet_in = {
13397 17235,139,206,17,{ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211 }
13399 mavlink_tunnel_t packet1, packet2;
13400 memset(&packet1, 0,
sizeof(packet1));
13401 packet1.payload_type = packet_in.payload_type;
13402 packet1.target_system = packet_in.target_system;
13403 packet1.target_component = packet_in.target_component;
13404 packet1.payload_length = packet_in.payload_length;
13406 mav_array_memcpy(packet1.payload, packet_in.payload,
sizeof(uint8_t)*128);
13408#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13409 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13411 memset(MAVLINK_MSG_ID_TUNNEL_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_TUNNEL_MIN_LEN);
13414 memset(&packet2, 0,
sizeof(packet2));
13415 mavlink_msg_tunnel_encode(system_id, component_id, &msg, &packet1);
13416 mavlink_msg_tunnel_decode(&msg, &packet2);
13417 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13419 memset(&packet2, 0,
sizeof(packet2));
13420 mavlink_msg_tunnel_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.payload_type , packet1.payload_length , packet1.payload );
13421 mavlink_msg_tunnel_decode(&msg, &packet2);
13422 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13424 memset(&packet2, 0,
sizeof(packet2));
13425 mavlink_msg_tunnel_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.payload_type , packet1.payload_length , packet1.payload );
13426 mavlink_msg_tunnel_decode(&msg, &packet2);
13427 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13429 memset(&packet2, 0,
sizeof(packet2));
13430 mavlink_msg_to_send_buffer(buffer, &msg);
13431 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13432 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13434 mavlink_msg_tunnel_decode(last_msg, &packet2);
13435 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13437 memset(&packet2, 0,
sizeof(packet2));
13438 mavlink_msg_tunnel_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.payload_type , packet1.payload_length , packet1.payload );
13439 mavlink_msg_tunnel_decode(last_msg, &packet2);
13440 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13442#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13443 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"TUNNEL") != NULL);
13444 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_TUNNEL) != NULL);
13448static void mavlink_test_can_frame(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13450#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13451 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13452 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAN_FRAME >= 256) {
13456 mavlink_message_t msg;
13457 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13459 mavlink_can_frame_t packet_in = {
13460 963497464,17,84,151,218,{ 29, 30, 31, 32, 33, 34, 35, 36 }
13462 mavlink_can_frame_t packet1, packet2;
13463 memset(&packet1, 0,
sizeof(packet1));
13464 packet1.id = packet_in.id;
13465 packet1.target_system = packet_in.target_system;
13466 packet1.target_component = packet_in.target_component;
13467 packet1.bus = packet_in.bus;
13468 packet1.len = packet_in.len;
13470 mav_array_memcpy(packet1.data, packet_in.data,
sizeof(uint8_t)*8);
13472#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13473 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13475 memset(MAVLINK_MSG_ID_CAN_FRAME_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_CAN_FRAME_MIN_LEN);
13478 memset(&packet2, 0,
sizeof(packet2));
13479 mavlink_msg_can_frame_encode(system_id, component_id, &msg, &packet1);
13480 mavlink_msg_can_frame_decode(&msg, &packet2);
13481 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13483 memset(&packet2, 0,
sizeof(packet2));
13484 mavlink_msg_can_frame_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.bus , packet1.len , packet1.id , packet1.data );
13485 mavlink_msg_can_frame_decode(&msg, &packet2);
13486 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13488 memset(&packet2, 0,
sizeof(packet2));
13489 mavlink_msg_can_frame_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.bus , packet1.len , packet1.id , packet1.data );
13490 mavlink_msg_can_frame_decode(&msg, &packet2);
13491 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13493 memset(&packet2, 0,
sizeof(packet2));
13494 mavlink_msg_to_send_buffer(buffer, &msg);
13495 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13496 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13498 mavlink_msg_can_frame_decode(last_msg, &packet2);
13499 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13501 memset(&packet2, 0,
sizeof(packet2));
13502 mavlink_msg_can_frame_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.bus , packet1.len , packet1.id , packet1.data );
13503 mavlink_msg_can_frame_decode(last_msg, &packet2);
13504 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13506#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13507 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"CAN_FRAME") != NULL);
13508 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CAN_FRAME) != NULL);
13512static void mavlink_test_onboard_computer_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13514#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13515 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13516 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS >= 256) {
13520 mavlink_message_t msg;
13521 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13523 mavlink_onboard_computer_status_t packet_in = {
13524 93372036854775807ULL,963497880,963498088,963498296,{ 963498504, 963498505, 963498506, 963498507 },{ 963499336, 963499337, 963499338, 963499339 },{ 963500168, 963500169, 963500170, 963500171 },{ 963501000, 963501001, 963501002, 963501003, 963501004, 963501005 },{ 963502248, 963502249, 963502250, 963502251, 963502252, 963502253 },{ 963503496, 963503497, 963503498, 963503499, 963503500, 963503501 },{ 963504744, 963504745, 963504746, 963504747, 963504748, 963504749 },{ 963505992, 963505993, 963505994, 963505995, 963505996, 963505997 },{ 27011, 27012, 27013, 27014 },81,{ 148, 149, 150, 151, 152, 153, 154, 155 },{ 172, 173, 174, 175, 176, 177, 178, 179, 180, 181 },{ 74, 75, 76, 77 },{ 86, 87, 88, 89, 90, 91, 92, 93, 94, 95 },244,{ 55, 56, 57, 58, 59, 60, 61, 62 },29611
13526 mavlink_onboard_computer_status_t packet1, packet2;
13527 memset(&packet1, 0,
sizeof(packet1));
13528 packet1.time_usec = packet_in.time_usec;
13529 packet1.uptime = packet_in.uptime;
13530 packet1.ram_usage = packet_in.ram_usage;
13531 packet1.ram_total = packet_in.ram_total;
13532 packet1.type = packet_in.type;
13533 packet1.temperature_board = packet_in.temperature_board;
13534 packet1.status_flags = packet_in.status_flags;
13536 mav_array_memcpy(packet1.storage_type, packet_in.storage_type,
sizeof(uint32_t)*4);
13537 mav_array_memcpy(packet1.storage_usage, packet_in.storage_usage,
sizeof(uint32_t)*4);
13538 mav_array_memcpy(packet1.storage_total, packet_in.storage_total,
sizeof(uint32_t)*4);
13539 mav_array_memcpy(packet1.link_type, packet_in.link_type,
sizeof(uint32_t)*6);
13540 mav_array_memcpy(packet1.link_tx_rate, packet_in.link_tx_rate,
sizeof(uint32_t)*6);
13541 mav_array_memcpy(packet1.link_rx_rate, packet_in.link_rx_rate,
sizeof(uint32_t)*6);
13542 mav_array_memcpy(packet1.link_tx_max, packet_in.link_tx_max,
sizeof(uint32_t)*6);
13543 mav_array_memcpy(packet1.link_rx_max, packet_in.link_rx_max,
sizeof(uint32_t)*6);
13544 mav_array_memcpy(packet1.fan_speed, packet_in.fan_speed,
sizeof(int16_t)*4);
13545 mav_array_memcpy(packet1.cpu_cores, packet_in.cpu_cores,
sizeof(uint8_t)*8);
13546 mav_array_memcpy(packet1.cpu_combined, packet_in.cpu_combined,
sizeof(uint8_t)*10);
13547 mav_array_memcpy(packet1.gpu_cores, packet_in.gpu_cores,
sizeof(uint8_t)*4);
13548 mav_array_memcpy(packet1.gpu_combined, packet_in.gpu_combined,
sizeof(uint8_t)*10);
13549 mav_array_memcpy(packet1.temperature_core, packet_in.temperature_core,
sizeof(int8_t)*8);
13551#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13552 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13554 memset(MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_MIN_LEN);
13557 memset(&packet2, 0,
sizeof(packet2));
13558 mavlink_msg_onboard_computer_status_encode(system_id, component_id, &msg, &packet1);
13559 mavlink_msg_onboard_computer_status_decode(&msg, &packet2);
13560 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13562 memset(&packet2, 0,
sizeof(packet2));
13563 mavlink_msg_onboard_computer_status_pack(system_id, component_id, &msg , packet1.time_usec , packet1.uptime , packet1.type , packet1.cpu_cores , packet1.cpu_combined , packet1.gpu_cores , packet1.gpu_combined , packet1.temperature_board , packet1.temperature_core , packet1.fan_speed , packet1.ram_usage , packet1.ram_total , packet1.storage_type , packet1.storage_usage , packet1.storage_total , packet1.link_type , packet1.link_tx_rate , packet1.link_rx_rate , packet1.link_tx_max , packet1.link_rx_max , packet1.status_flags );
13564 mavlink_msg_onboard_computer_status_decode(&msg, &packet2);
13565 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13567 memset(&packet2, 0,
sizeof(packet2));
13568 mavlink_msg_onboard_computer_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.uptime , packet1.type , packet1.cpu_cores , packet1.cpu_combined , packet1.gpu_cores , packet1.gpu_combined , packet1.temperature_board , packet1.temperature_core , packet1.fan_speed , packet1.ram_usage , packet1.ram_total , packet1.storage_type , packet1.storage_usage , packet1.storage_total , packet1.link_type , packet1.link_tx_rate , packet1.link_rx_rate , packet1.link_tx_max , packet1.link_rx_max , packet1.status_flags );
13569 mavlink_msg_onboard_computer_status_decode(&msg, &packet2);
13570 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13572 memset(&packet2, 0,
sizeof(packet2));
13573 mavlink_msg_to_send_buffer(buffer, &msg);
13574 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13575 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13577 mavlink_msg_onboard_computer_status_decode(last_msg, &packet2);
13578 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13580 memset(&packet2, 0,
sizeof(packet2));
13581 mavlink_msg_onboard_computer_status_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.uptime , packet1.type , packet1.cpu_cores , packet1.cpu_combined , packet1.gpu_cores , packet1.gpu_combined , packet1.temperature_board , packet1.temperature_core , packet1.fan_speed , packet1.ram_usage , packet1.ram_total , packet1.storage_type , packet1.storage_usage , packet1.storage_total , packet1.link_type , packet1.link_tx_rate , packet1.link_rx_rate , packet1.link_tx_max , packet1.link_rx_max , packet1.status_flags );
13582 mavlink_msg_onboard_computer_status_decode(last_msg, &packet2);
13583 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13585#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13586 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"ONBOARD_COMPUTER_STATUS") != NULL);
13587 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS) != NULL);
13591static void mavlink_test_component_information(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13593#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13594 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13595 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMPONENT_INFORMATION >= 256) {
13599 mavlink_message_t msg;
13600 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13602 mavlink_component_information_t packet_in = {
13603 963497464,963497672,963497880,
"MNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFG",
"IJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABC"
13605 mavlink_component_information_t packet1, packet2;
13606 memset(&packet1, 0,
sizeof(packet1));
13607 packet1.time_boot_ms = packet_in.time_boot_ms;
13608 packet1.general_metadata_file_crc = packet_in.general_metadata_file_crc;
13609 packet1.peripherals_metadata_file_crc = packet_in.peripherals_metadata_file_crc;
13611 mav_array_memcpy(packet1.general_metadata_uri, packet_in.general_metadata_uri,
sizeof(
char)*100);
13612 mav_array_memcpy(packet1.peripherals_metadata_uri, packet_in.peripherals_metadata_uri,
sizeof(
char)*100);
13614#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13615 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13617 memset(MAVLINK_MSG_ID_COMPONENT_INFORMATION_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_COMPONENT_INFORMATION_MIN_LEN);
13620 memset(&packet2, 0,
sizeof(packet2));
13621 mavlink_msg_component_information_encode(system_id, component_id, &msg, &packet1);
13622 mavlink_msg_component_information_decode(&msg, &packet2);
13623 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13625 memset(&packet2, 0,
sizeof(packet2));
13626 mavlink_msg_component_information_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.general_metadata_file_crc , packet1.general_metadata_uri , packet1.peripherals_metadata_file_crc , packet1.peripherals_metadata_uri );
13627 mavlink_msg_component_information_decode(&msg, &packet2);
13628 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13630 memset(&packet2, 0,
sizeof(packet2));
13631 mavlink_msg_component_information_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.general_metadata_file_crc , packet1.general_metadata_uri , packet1.peripherals_metadata_file_crc , packet1.peripherals_metadata_uri );
13632 mavlink_msg_component_information_decode(&msg, &packet2);
13633 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13635 memset(&packet2, 0,
sizeof(packet2));
13636 mavlink_msg_to_send_buffer(buffer, &msg);
13637 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13638 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13640 mavlink_msg_component_information_decode(last_msg, &packet2);
13641 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13643 memset(&packet2, 0,
sizeof(packet2));
13644 mavlink_msg_component_information_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.general_metadata_file_crc , packet1.general_metadata_uri , packet1.peripherals_metadata_file_crc , packet1.peripherals_metadata_uri );
13645 mavlink_msg_component_information_decode(last_msg, &packet2);
13646 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13648#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13649 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"COMPONENT_INFORMATION") != NULL);
13650 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_COMPONENT_INFORMATION) != NULL);
13654static void mavlink_test_component_information_basic(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13656#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13657 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13658 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC >= 256) {
13662 mavlink_message_t msg;
13663 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13665 mavlink_component_information_basic_t packet_in = {
13666 93372036854775807ULL,963497880,963498088,
"QRSTUVWXYZABCDEFGHIJKLMNOPQRSTU",
"WXYZABCDEFGHIJKLMNOPQRSTUVWXYZA",
"CDEFGHIJKLMNOPQRSTUVWXY",
"ABCDEFGHIJKLMNOPQRSTUVW",
"YZABCDEFGHIJKLMNOPQRSTUVWXYZABC"
13668 mavlink_component_information_basic_t packet1, packet2;
13669 memset(&packet1, 0,
sizeof(packet1));
13670 packet1.capabilities = packet_in.capabilities;
13671 packet1.time_boot_ms = packet_in.time_boot_ms;
13672 packet1.time_manufacture_s = packet_in.time_manufacture_s;
13674 mav_array_memcpy(packet1.vendor_name, packet_in.vendor_name,
sizeof(
char)*32);
13675 mav_array_memcpy(packet1.model_name, packet_in.model_name,
sizeof(
char)*32);
13676 mav_array_memcpy(packet1.software_version, packet_in.software_version,
sizeof(
char)*24);
13677 mav_array_memcpy(packet1.hardware_version, packet_in.hardware_version,
sizeof(
char)*24);
13678 mav_array_memcpy(packet1.serial_number, packet_in.serial_number,
sizeof(
char)*32);
13680#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13681 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13683 memset(MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_MIN_LEN);
13686 memset(&packet2, 0,
sizeof(packet2));
13687 mavlink_msg_component_information_basic_encode(system_id, component_id, &msg, &packet1);
13688 mavlink_msg_component_information_basic_decode(&msg, &packet2);
13689 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13691 memset(&packet2, 0,
sizeof(packet2));
13692 mavlink_msg_component_information_basic_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.capabilities , packet1.time_manufacture_s , packet1.vendor_name , packet1.model_name , packet1.software_version , packet1.hardware_version , packet1.serial_number );
13693 mavlink_msg_component_information_basic_decode(&msg, &packet2);
13694 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13696 memset(&packet2, 0,
sizeof(packet2));
13697 mavlink_msg_component_information_basic_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.capabilities , packet1.time_manufacture_s , packet1.vendor_name , packet1.model_name , packet1.software_version , packet1.hardware_version , packet1.serial_number );
13698 mavlink_msg_component_information_basic_decode(&msg, &packet2);
13699 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13701 memset(&packet2, 0,
sizeof(packet2));
13702 mavlink_msg_to_send_buffer(buffer, &msg);
13703 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13704 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13706 mavlink_msg_component_information_basic_decode(last_msg, &packet2);
13707 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13709 memset(&packet2, 0,
sizeof(packet2));
13710 mavlink_msg_component_information_basic_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.capabilities , packet1.time_manufacture_s , packet1.vendor_name , packet1.model_name , packet1.software_version , packet1.hardware_version , packet1.serial_number );
13711 mavlink_msg_component_information_basic_decode(last_msg, &packet2);
13712 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13714#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13715 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"COMPONENT_INFORMATION_BASIC") != NULL);
13716 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC) != NULL);
13720static void mavlink_test_component_metadata(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13722#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13723 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13724 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMPONENT_METADATA >= 256) {
13728 mavlink_message_t msg;
13729 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13731 mavlink_component_metadata_t packet_in = {
13732 963497464,963497672,
"IJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABC"
13734 mavlink_component_metadata_t packet1, packet2;
13735 memset(&packet1, 0,
sizeof(packet1));
13736 packet1.time_boot_ms = packet_in.time_boot_ms;
13737 packet1.file_crc = packet_in.file_crc;
13739 mav_array_memcpy(packet1.uri, packet_in.uri,
sizeof(
char)*100);
13741#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13742 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13744 memset(MAVLINK_MSG_ID_COMPONENT_METADATA_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_COMPONENT_METADATA_MIN_LEN);
13747 memset(&packet2, 0,
sizeof(packet2));
13748 mavlink_msg_component_metadata_encode(system_id, component_id, &msg, &packet1);
13749 mavlink_msg_component_metadata_decode(&msg, &packet2);
13750 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13752 memset(&packet2, 0,
sizeof(packet2));
13753 mavlink_msg_component_metadata_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.file_crc , packet1.uri );
13754 mavlink_msg_component_metadata_decode(&msg, &packet2);
13755 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13757 memset(&packet2, 0,
sizeof(packet2));
13758 mavlink_msg_component_metadata_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.file_crc , packet1.uri );
13759 mavlink_msg_component_metadata_decode(&msg, &packet2);
13760 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13762 memset(&packet2, 0,
sizeof(packet2));
13763 mavlink_msg_to_send_buffer(buffer, &msg);
13764 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13765 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13767 mavlink_msg_component_metadata_decode(last_msg, &packet2);
13768 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13770 memset(&packet2, 0,
sizeof(packet2));
13771 mavlink_msg_component_metadata_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.file_crc , packet1.uri );
13772 mavlink_msg_component_metadata_decode(last_msg, &packet2);
13773 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13775#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13776 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"COMPONENT_METADATA") != NULL);
13777 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_COMPONENT_METADATA) != NULL);
13781static void mavlink_test_play_tune_v2(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13783#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13784 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13785 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PLAY_TUNE_V2 >= 256) {
13789 mavlink_message_t msg;
13790 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13792 mavlink_play_tune_v2_t packet_in = {
13793 963497464,17,84,
"GHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRS"
13795 mavlink_play_tune_v2_t packet1, packet2;
13796 memset(&packet1, 0,
sizeof(packet1));
13797 packet1.format = packet_in.format;
13798 packet1.target_system = packet_in.target_system;
13799 packet1.target_component = packet_in.target_component;
13801 mav_array_memcpy(packet1.tune, packet_in.tune,
sizeof(
char)*248);
13803#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13804 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13806 memset(MAVLINK_MSG_ID_PLAY_TUNE_V2_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_PLAY_TUNE_V2_MIN_LEN);
13809 memset(&packet2, 0,
sizeof(packet2));
13810 mavlink_msg_play_tune_v2_encode(system_id, component_id, &msg, &packet1);
13811 mavlink_msg_play_tune_v2_decode(&msg, &packet2);
13812 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13814 memset(&packet2, 0,
sizeof(packet2));
13815 mavlink_msg_play_tune_v2_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.format , packet1.tune );
13816 mavlink_msg_play_tune_v2_decode(&msg, &packet2);
13817 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13819 memset(&packet2, 0,
sizeof(packet2));
13820 mavlink_msg_play_tune_v2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.format , packet1.tune );
13821 mavlink_msg_play_tune_v2_decode(&msg, &packet2);
13822 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13824 memset(&packet2, 0,
sizeof(packet2));
13825 mavlink_msg_to_send_buffer(buffer, &msg);
13826 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13827 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13829 mavlink_msg_play_tune_v2_decode(last_msg, &packet2);
13830 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13832 memset(&packet2, 0,
sizeof(packet2));
13833 mavlink_msg_play_tune_v2_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.format , packet1.tune );
13834 mavlink_msg_play_tune_v2_decode(last_msg, &packet2);
13835 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13837#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13838 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"PLAY_TUNE_V2") != NULL);
13839 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_PLAY_TUNE_V2) != NULL);
13843static void mavlink_test_supported_tunes(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13845#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13846 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13847 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SUPPORTED_TUNES >= 256) {
13851 mavlink_message_t msg;
13852 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13854 mavlink_supported_tunes_t packet_in = {
13857 mavlink_supported_tunes_t packet1, packet2;
13858 memset(&packet1, 0,
sizeof(packet1));
13859 packet1.format = packet_in.format;
13860 packet1.target_system = packet_in.target_system;
13861 packet1.target_component = packet_in.target_component;
13864#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13865 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13867 memset(MAVLINK_MSG_ID_SUPPORTED_TUNES_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_SUPPORTED_TUNES_MIN_LEN);
13870 memset(&packet2, 0,
sizeof(packet2));
13871 mavlink_msg_supported_tunes_encode(system_id, component_id, &msg, &packet1);
13872 mavlink_msg_supported_tunes_decode(&msg, &packet2);
13873 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13875 memset(&packet2, 0,
sizeof(packet2));
13876 mavlink_msg_supported_tunes_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.format );
13877 mavlink_msg_supported_tunes_decode(&msg, &packet2);
13878 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13880 memset(&packet2, 0,
sizeof(packet2));
13881 mavlink_msg_supported_tunes_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.format );
13882 mavlink_msg_supported_tunes_decode(&msg, &packet2);
13883 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13885 memset(&packet2, 0,
sizeof(packet2));
13886 mavlink_msg_to_send_buffer(buffer, &msg);
13887 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13888 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13890 mavlink_msg_supported_tunes_decode(last_msg, &packet2);
13891 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13893 memset(&packet2, 0,
sizeof(packet2));
13894 mavlink_msg_supported_tunes_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.format );
13895 mavlink_msg_supported_tunes_decode(last_msg, &packet2);
13896 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13898#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13899 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"SUPPORTED_TUNES") != NULL);
13900 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_SUPPORTED_TUNES) != NULL);
13904static void mavlink_test_event(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13906#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13907 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13908 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_EVENT >= 256) {
13912 mavlink_message_t msg;
13913 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13915 mavlink_event_t packet_in = {
13916 963497464,963497672,17651,163,230,41,{ 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147 }
13918 mavlink_event_t packet1, packet2;
13919 memset(&packet1, 0,
sizeof(packet1));
13920 packet1.id = packet_in.id;
13921 packet1.event_time_boot_ms = packet_in.event_time_boot_ms;
13922 packet1.sequence = packet_in.sequence;
13923 packet1.destination_component = packet_in.destination_component;
13924 packet1.destination_system = packet_in.destination_system;
13925 packet1.log_levels = packet_in.log_levels;
13927 mav_array_memcpy(packet1.arguments, packet_in.arguments,
sizeof(uint8_t)*40);
13929#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13930 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13932 memset(MAVLINK_MSG_ID_EVENT_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_EVENT_MIN_LEN);
13935 memset(&packet2, 0,
sizeof(packet2));
13936 mavlink_msg_event_encode(system_id, component_id, &msg, &packet1);
13937 mavlink_msg_event_decode(&msg, &packet2);
13938 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13940 memset(&packet2, 0,
sizeof(packet2));
13941 mavlink_msg_event_pack(system_id, component_id, &msg , packet1.destination_component , packet1.destination_system , packet1.id , packet1.event_time_boot_ms , packet1.sequence , packet1.log_levels , packet1.arguments );
13942 mavlink_msg_event_decode(&msg, &packet2);
13943 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13945 memset(&packet2, 0,
sizeof(packet2));
13946 mavlink_msg_event_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.destination_component , packet1.destination_system , packet1.id , packet1.event_time_boot_ms , packet1.sequence , packet1.log_levels , packet1.arguments );
13947 mavlink_msg_event_decode(&msg, &packet2);
13948 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13950 memset(&packet2, 0,
sizeof(packet2));
13951 mavlink_msg_to_send_buffer(buffer, &msg);
13952 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
13953 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
13955 mavlink_msg_event_decode(last_msg, &packet2);
13956 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13958 memset(&packet2, 0,
sizeof(packet2));
13959 mavlink_msg_event_send(MAVLINK_COMM_1 , packet1.destination_component , packet1.destination_system , packet1.id , packet1.event_time_boot_ms , packet1.sequence , packet1.log_levels , packet1.arguments );
13960 mavlink_msg_event_decode(last_msg, &packet2);
13961 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
13963#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
13964 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"EVENT") != NULL);
13965 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_EVENT) != NULL);
13969static void mavlink_test_current_event_sequence(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
13971#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13972 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
13973 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CURRENT_EVENT_SEQUENCE >= 256) {
13977 mavlink_message_t msg;
13978 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
13980 mavlink_current_event_sequence_t packet_in = {
13983 mavlink_current_event_sequence_t packet1, packet2;
13984 memset(&packet1, 0,
sizeof(packet1));
13985 packet1.sequence = packet_in.sequence;
13986 packet1.flags = packet_in.flags;
13989#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
13990 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
13992 memset(MAVLINK_MSG_ID_CURRENT_EVENT_SEQUENCE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_CURRENT_EVENT_SEQUENCE_MIN_LEN);
13995 memset(&packet2, 0,
sizeof(packet2));
13996 mavlink_msg_current_event_sequence_encode(system_id, component_id, &msg, &packet1);
13997 mavlink_msg_current_event_sequence_decode(&msg, &packet2);
13998 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14000 memset(&packet2, 0,
sizeof(packet2));
14001 mavlink_msg_current_event_sequence_pack(system_id, component_id, &msg , packet1.sequence , packet1.flags );
14002 mavlink_msg_current_event_sequence_decode(&msg, &packet2);
14003 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14005 memset(&packet2, 0,
sizeof(packet2));
14006 mavlink_msg_current_event_sequence_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.sequence , packet1.flags );
14007 mavlink_msg_current_event_sequence_decode(&msg, &packet2);
14008 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14010 memset(&packet2, 0,
sizeof(packet2));
14011 mavlink_msg_to_send_buffer(buffer, &msg);
14012 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14013 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14015 mavlink_msg_current_event_sequence_decode(last_msg, &packet2);
14016 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14018 memset(&packet2, 0,
sizeof(packet2));
14019 mavlink_msg_current_event_sequence_send(MAVLINK_COMM_1 , packet1.sequence , packet1.flags );
14020 mavlink_msg_current_event_sequence_decode(last_msg, &packet2);
14021 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14023#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14024 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"CURRENT_EVENT_SEQUENCE") != NULL);
14025 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CURRENT_EVENT_SEQUENCE) != NULL);
14029static void mavlink_test_request_event(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14031#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14032 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14033 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_REQUEST_EVENT >= 256) {
14037 mavlink_message_t msg;
14038 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14040 mavlink_request_event_t packet_in = {
14043 mavlink_request_event_t packet1, packet2;
14044 memset(&packet1, 0,
sizeof(packet1));
14045 packet1.first_sequence = packet_in.first_sequence;
14046 packet1.last_sequence = packet_in.last_sequence;
14047 packet1.target_system = packet_in.target_system;
14048 packet1.target_component = packet_in.target_component;
14051#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14052 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14054 memset(MAVLINK_MSG_ID_REQUEST_EVENT_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_REQUEST_EVENT_MIN_LEN);
14057 memset(&packet2, 0,
sizeof(packet2));
14058 mavlink_msg_request_event_encode(system_id, component_id, &msg, &packet1);
14059 mavlink_msg_request_event_decode(&msg, &packet2);
14060 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14062 memset(&packet2, 0,
sizeof(packet2));
14063 mavlink_msg_request_event_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.first_sequence , packet1.last_sequence );
14064 mavlink_msg_request_event_decode(&msg, &packet2);
14065 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14067 memset(&packet2, 0,
sizeof(packet2));
14068 mavlink_msg_request_event_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.first_sequence , packet1.last_sequence );
14069 mavlink_msg_request_event_decode(&msg, &packet2);
14070 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14072 memset(&packet2, 0,
sizeof(packet2));
14073 mavlink_msg_to_send_buffer(buffer, &msg);
14074 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14075 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14077 mavlink_msg_request_event_decode(last_msg, &packet2);
14078 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14080 memset(&packet2, 0,
sizeof(packet2));
14081 mavlink_msg_request_event_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.first_sequence , packet1.last_sequence );
14082 mavlink_msg_request_event_decode(last_msg, &packet2);
14083 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14085#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14086 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"REQUEST_EVENT") != NULL);
14087 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_REQUEST_EVENT) != NULL);
14091static void mavlink_test_response_event_error(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14093#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14094 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14095 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RESPONSE_EVENT_ERROR >= 256) {
14099 mavlink_message_t msg;
14100 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14102 mavlink_response_event_error_t packet_in = {
14103 17235,17339,17,84,151
14105 mavlink_response_event_error_t packet1, packet2;
14106 memset(&packet1, 0,
sizeof(packet1));
14107 packet1.sequence = packet_in.sequence;
14108 packet1.sequence_oldest_available = packet_in.sequence_oldest_available;
14109 packet1.target_system = packet_in.target_system;
14110 packet1.target_component = packet_in.target_component;
14111 packet1.reason = packet_in.reason;
14114#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14115 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14117 memset(MAVLINK_MSG_ID_RESPONSE_EVENT_ERROR_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_RESPONSE_EVENT_ERROR_MIN_LEN);
14120 memset(&packet2, 0,
sizeof(packet2));
14121 mavlink_msg_response_event_error_encode(system_id, component_id, &msg, &packet1);
14122 mavlink_msg_response_event_error_decode(&msg, &packet2);
14123 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14125 memset(&packet2, 0,
sizeof(packet2));
14126 mavlink_msg_response_event_error_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.sequence , packet1.sequence_oldest_available , packet1.reason );
14127 mavlink_msg_response_event_error_decode(&msg, &packet2);
14128 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14130 memset(&packet2, 0,
sizeof(packet2));
14131 mavlink_msg_response_event_error_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.sequence , packet1.sequence_oldest_available , packet1.reason );
14132 mavlink_msg_response_event_error_decode(&msg, &packet2);
14133 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14135 memset(&packet2, 0,
sizeof(packet2));
14136 mavlink_msg_to_send_buffer(buffer, &msg);
14137 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14138 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14140 mavlink_msg_response_event_error_decode(last_msg, &packet2);
14141 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14143 memset(&packet2, 0,
sizeof(packet2));
14144 mavlink_msg_response_event_error_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.sequence , packet1.sequence_oldest_available , packet1.reason );
14145 mavlink_msg_response_event_error_decode(last_msg, &packet2);
14146 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14148#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14149 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"RESPONSE_EVENT_ERROR") != NULL);
14150 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_RESPONSE_EVENT_ERROR) != NULL);
14154static void mavlink_test_available_modes(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14156#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14157 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14158 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AVAILABLE_MODES >= 256) {
14162 mavlink_message_t msg;
14163 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14165 mavlink_available_modes_t packet_in = {
14166 963497464,963497672,29,96,163,
"LMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRS"
14168 mavlink_available_modes_t packet1, packet2;
14169 memset(&packet1, 0,
sizeof(packet1));
14170 packet1.custom_mode = packet_in.custom_mode;
14171 packet1.properties = packet_in.properties;
14172 packet1.number_modes = packet_in.number_modes;
14173 packet1.mode_index = packet_in.mode_index;
14174 packet1.standard_mode = packet_in.standard_mode;
14176 mav_array_memcpy(packet1.mode_name, packet_in.mode_name,
sizeof(
char)*35);
14178#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14179 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14181 memset(MAVLINK_MSG_ID_AVAILABLE_MODES_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_AVAILABLE_MODES_MIN_LEN);
14184 memset(&packet2, 0,
sizeof(packet2));
14185 mavlink_msg_available_modes_encode(system_id, component_id, &msg, &packet1);
14186 mavlink_msg_available_modes_decode(&msg, &packet2);
14187 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14189 memset(&packet2, 0,
sizeof(packet2));
14190 mavlink_msg_available_modes_pack(system_id, component_id, &msg , packet1.number_modes , packet1.mode_index , packet1.standard_mode , packet1.custom_mode , packet1.properties , packet1.mode_name );
14191 mavlink_msg_available_modes_decode(&msg, &packet2);
14192 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14194 memset(&packet2, 0,
sizeof(packet2));
14195 mavlink_msg_available_modes_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.number_modes , packet1.mode_index , packet1.standard_mode , packet1.custom_mode , packet1.properties , packet1.mode_name );
14196 mavlink_msg_available_modes_decode(&msg, &packet2);
14197 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14199 memset(&packet2, 0,
sizeof(packet2));
14200 mavlink_msg_to_send_buffer(buffer, &msg);
14201 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14202 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14204 mavlink_msg_available_modes_decode(last_msg, &packet2);
14205 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14207 memset(&packet2, 0,
sizeof(packet2));
14208 mavlink_msg_available_modes_send(MAVLINK_COMM_1 , packet1.number_modes , packet1.mode_index , packet1.standard_mode , packet1.custom_mode , packet1.properties , packet1.mode_name );
14209 mavlink_msg_available_modes_decode(last_msg, &packet2);
14210 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14212#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14213 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"AVAILABLE_MODES") != NULL);
14214 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_AVAILABLE_MODES) != NULL);
14218static void mavlink_test_current_mode(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14220#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14221 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14222 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CURRENT_MODE >= 256) {
14226 mavlink_message_t msg;
14227 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14229 mavlink_current_mode_t packet_in = {
14230 963497464,963497672,29
14232 mavlink_current_mode_t packet1, packet2;
14233 memset(&packet1, 0,
sizeof(packet1));
14234 packet1.custom_mode = packet_in.custom_mode;
14235 packet1.intended_custom_mode = packet_in.intended_custom_mode;
14236 packet1.standard_mode = packet_in.standard_mode;
14239#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14240 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14242 memset(MAVLINK_MSG_ID_CURRENT_MODE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_CURRENT_MODE_MIN_LEN);
14245 memset(&packet2, 0,
sizeof(packet2));
14246 mavlink_msg_current_mode_encode(system_id, component_id, &msg, &packet1);
14247 mavlink_msg_current_mode_decode(&msg, &packet2);
14248 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14250 memset(&packet2, 0,
sizeof(packet2));
14251 mavlink_msg_current_mode_pack(system_id, component_id, &msg , packet1.standard_mode , packet1.custom_mode , packet1.intended_custom_mode );
14252 mavlink_msg_current_mode_decode(&msg, &packet2);
14253 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14255 memset(&packet2, 0,
sizeof(packet2));
14256 mavlink_msg_current_mode_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.standard_mode , packet1.custom_mode , packet1.intended_custom_mode );
14257 mavlink_msg_current_mode_decode(&msg, &packet2);
14258 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14260 memset(&packet2, 0,
sizeof(packet2));
14261 mavlink_msg_to_send_buffer(buffer, &msg);
14262 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14263 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14265 mavlink_msg_current_mode_decode(last_msg, &packet2);
14266 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14268 memset(&packet2, 0,
sizeof(packet2));
14269 mavlink_msg_current_mode_send(MAVLINK_COMM_1 , packet1.standard_mode , packet1.custom_mode , packet1.intended_custom_mode );
14270 mavlink_msg_current_mode_decode(last_msg, &packet2);
14271 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14273#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14274 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"CURRENT_MODE") != NULL);
14275 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CURRENT_MODE) != NULL);
14279static void mavlink_test_available_modes_monitor(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14281#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14282 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14283 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR >= 256) {
14287 mavlink_message_t msg;
14288 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14290 mavlink_available_modes_monitor_t packet_in = {
14293 mavlink_available_modes_monitor_t packet1, packet2;
14294 memset(&packet1, 0,
sizeof(packet1));
14295 packet1.seq = packet_in.seq;
14298#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14299 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14301 memset(MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR_MIN_LEN);
14304 memset(&packet2, 0,
sizeof(packet2));
14305 mavlink_msg_available_modes_monitor_encode(system_id, component_id, &msg, &packet1);
14306 mavlink_msg_available_modes_monitor_decode(&msg, &packet2);
14307 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14309 memset(&packet2, 0,
sizeof(packet2));
14310 mavlink_msg_available_modes_monitor_pack(system_id, component_id, &msg , packet1.seq );
14311 mavlink_msg_available_modes_monitor_decode(&msg, &packet2);
14312 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14314 memset(&packet2, 0,
sizeof(packet2));
14315 mavlink_msg_available_modes_monitor_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.seq );
14316 mavlink_msg_available_modes_monitor_decode(&msg, &packet2);
14317 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14319 memset(&packet2, 0,
sizeof(packet2));
14320 mavlink_msg_to_send_buffer(buffer, &msg);
14321 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14322 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14324 mavlink_msg_available_modes_monitor_decode(last_msg, &packet2);
14325 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14327 memset(&packet2, 0,
sizeof(packet2));
14328 mavlink_msg_available_modes_monitor_send(MAVLINK_COMM_1 , packet1.seq );
14329 mavlink_msg_available_modes_monitor_decode(last_msg, &packet2);
14330 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14332#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14333 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"AVAILABLE_MODES_MONITOR") != NULL);
14334 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_AVAILABLE_MODES_MONITOR) != NULL);
14338static void mavlink_test_illuminator_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14340#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14341 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14342 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ILLUMINATOR_STATUS >= 256) {
14346 mavlink_message_t msg;
14347 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14349 mavlink_illuminator_status_t packet_in = {
14350 963497464,963497672,73.0,101.0,129.0,157.0,185.0,213.0,101,168,235
14352 mavlink_illuminator_status_t packet1, packet2;
14353 memset(&packet1, 0,
sizeof(packet1));
14354 packet1.uptime_ms = packet_in.uptime_ms;
14355 packet1.error_status = packet_in.error_status;
14356 packet1.brightness = packet_in.brightness;
14357 packet1.strobe_period = packet_in.strobe_period;
14358 packet1.strobe_duty_cycle = packet_in.strobe_duty_cycle;
14359 packet1.temp_c = packet_in.temp_c;
14360 packet1.min_strobe_period = packet_in.min_strobe_period;
14361 packet1.max_strobe_period = packet_in.max_strobe_period;
14362 packet1.enable = packet_in.enable;
14363 packet1.mode_bitmask = packet_in.mode_bitmask;
14364 packet1.mode = packet_in.mode;
14367#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14368 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14370 memset(MAVLINK_MSG_ID_ILLUMINATOR_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_ILLUMINATOR_STATUS_MIN_LEN);
14373 memset(&packet2, 0,
sizeof(packet2));
14374 mavlink_msg_illuminator_status_encode(system_id, component_id, &msg, &packet1);
14375 mavlink_msg_illuminator_status_decode(&msg, &packet2);
14376 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14378 memset(&packet2, 0,
sizeof(packet2));
14379 mavlink_msg_illuminator_status_pack(system_id, component_id, &msg , packet1.uptime_ms , packet1.enable , packet1.mode_bitmask , packet1.error_status , packet1.mode , packet1.brightness , packet1.strobe_period , packet1.strobe_duty_cycle , packet1.temp_c , packet1.min_strobe_period , packet1.max_strobe_period );
14380 mavlink_msg_illuminator_status_decode(&msg, &packet2);
14381 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14383 memset(&packet2, 0,
sizeof(packet2));
14384 mavlink_msg_illuminator_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.uptime_ms , packet1.enable , packet1.mode_bitmask , packet1.error_status , packet1.mode , packet1.brightness , packet1.strobe_period , packet1.strobe_duty_cycle , packet1.temp_c , packet1.min_strobe_period , packet1.max_strobe_period );
14385 mavlink_msg_illuminator_status_decode(&msg, &packet2);
14386 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14388 memset(&packet2, 0,
sizeof(packet2));
14389 mavlink_msg_to_send_buffer(buffer, &msg);
14390 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14391 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14393 mavlink_msg_illuminator_status_decode(last_msg, &packet2);
14394 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14396 memset(&packet2, 0,
sizeof(packet2));
14397 mavlink_msg_illuminator_status_send(MAVLINK_COMM_1 , packet1.uptime_ms , packet1.enable , packet1.mode_bitmask , packet1.error_status , packet1.mode , packet1.brightness , packet1.strobe_period , packet1.strobe_duty_cycle , packet1.temp_c , packet1.min_strobe_period , packet1.max_strobe_period );
14398 mavlink_msg_illuminator_status_decode(last_msg, &packet2);
14399 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14401#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14402 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"ILLUMINATOR_STATUS") != NULL);
14403 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_ILLUMINATOR_STATUS) != NULL);
14407static void mavlink_test_canfd_frame(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14409#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14410 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14411 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CANFD_FRAME >= 256) {
14415 mavlink_message_t msg;
14416 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14418 mavlink_canfd_frame_t packet_in = {
14419 963497464,17,84,151,218,{ 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92 }
14421 mavlink_canfd_frame_t packet1, packet2;
14422 memset(&packet1, 0,
sizeof(packet1));
14423 packet1.id = packet_in.id;
14424 packet1.target_system = packet_in.target_system;
14425 packet1.target_component = packet_in.target_component;
14426 packet1.bus = packet_in.bus;
14427 packet1.len = packet_in.len;
14429 mav_array_memcpy(packet1.data, packet_in.data,
sizeof(uint8_t)*64);
14431#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14432 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14434 memset(MAVLINK_MSG_ID_CANFD_FRAME_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_CANFD_FRAME_MIN_LEN);
14437 memset(&packet2, 0,
sizeof(packet2));
14438 mavlink_msg_canfd_frame_encode(system_id, component_id, &msg, &packet1);
14439 mavlink_msg_canfd_frame_decode(&msg, &packet2);
14440 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14442 memset(&packet2, 0,
sizeof(packet2));
14443 mavlink_msg_canfd_frame_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.bus , packet1.len , packet1.id , packet1.data );
14444 mavlink_msg_canfd_frame_decode(&msg, &packet2);
14445 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14447 memset(&packet2, 0,
sizeof(packet2));
14448 mavlink_msg_canfd_frame_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.bus , packet1.len , packet1.id , packet1.data );
14449 mavlink_msg_canfd_frame_decode(&msg, &packet2);
14450 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14452 memset(&packet2, 0,
sizeof(packet2));
14453 mavlink_msg_to_send_buffer(buffer, &msg);
14454 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14455 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14457 mavlink_msg_canfd_frame_decode(last_msg, &packet2);
14458 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14460 memset(&packet2, 0,
sizeof(packet2));
14461 mavlink_msg_canfd_frame_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.bus , packet1.len , packet1.id , packet1.data );
14462 mavlink_msg_canfd_frame_decode(last_msg, &packet2);
14463 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14465#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14466 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"CANFD_FRAME") != NULL);
14467 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CANFD_FRAME) != NULL);
14471static void mavlink_test_can_filter_modify(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14473#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14474 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14475 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAN_FILTER_MODIFY >= 256) {
14479 mavlink_message_t msg;
14480 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14482 mavlink_can_filter_modify_t packet_in = {
14483 { 17235, 17236, 17237, 17238, 17239, 17240, 17241, 17242, 17243, 17244, 17245, 17246, 17247, 17248, 17249, 17250 },101,168,235,46,113
14485 mavlink_can_filter_modify_t packet1, packet2;
14486 memset(&packet1, 0,
sizeof(packet1));
14487 packet1.target_system = packet_in.target_system;
14488 packet1.target_component = packet_in.target_component;
14489 packet1.bus = packet_in.bus;
14490 packet1.operation = packet_in.operation;
14491 packet1.num_ids = packet_in.num_ids;
14493 mav_array_memcpy(packet1.ids, packet_in.ids,
sizeof(uint16_t)*16);
14495#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14496 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14498 memset(MAVLINK_MSG_ID_CAN_FILTER_MODIFY_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_CAN_FILTER_MODIFY_MIN_LEN);
14501 memset(&packet2, 0,
sizeof(packet2));
14502 mavlink_msg_can_filter_modify_encode(system_id, component_id, &msg, &packet1);
14503 mavlink_msg_can_filter_modify_decode(&msg, &packet2);
14504 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14506 memset(&packet2, 0,
sizeof(packet2));
14507 mavlink_msg_can_filter_modify_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.bus , packet1.operation , packet1.num_ids , packet1.ids );
14508 mavlink_msg_can_filter_modify_decode(&msg, &packet2);
14509 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14511 memset(&packet2, 0,
sizeof(packet2));
14512 mavlink_msg_can_filter_modify_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.bus , packet1.operation , packet1.num_ids , packet1.ids );
14513 mavlink_msg_can_filter_modify_decode(&msg, &packet2);
14514 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14516 memset(&packet2, 0,
sizeof(packet2));
14517 mavlink_msg_to_send_buffer(buffer, &msg);
14518 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14519 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14521 mavlink_msg_can_filter_modify_decode(last_msg, &packet2);
14522 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14524 memset(&packet2, 0,
sizeof(packet2));
14525 mavlink_msg_can_filter_modify_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.bus , packet1.operation , packet1.num_ids , packet1.ids );
14526 mavlink_msg_can_filter_modify_decode(last_msg, &packet2);
14527 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14529#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14530 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"CAN_FILTER_MODIFY") != NULL);
14531 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_CAN_FILTER_MODIFY) != NULL);
14535static void mavlink_test_wheel_distance(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14537#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14538 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14539 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_WHEEL_DISTANCE >= 256) {
14543 mavlink_message_t msg;
14544 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14546 mavlink_wheel_distance_t packet_in = {
14547 93372036854775807ULL,{ 179.0, 180.0, 181.0, 182.0, 183.0, 184.0, 185.0, 186.0, 187.0, 188.0, 189.0, 190.0, 191.0, 192.0, 193.0, 194.0 },157
14549 mavlink_wheel_distance_t packet1, packet2;
14550 memset(&packet1, 0,
sizeof(packet1));
14551 packet1.time_usec = packet_in.time_usec;
14552 packet1.count = packet_in.count;
14554 mav_array_memcpy(packet1.distance, packet_in.distance,
sizeof(
double)*16);
14556#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14557 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14559 memset(MAVLINK_MSG_ID_WHEEL_DISTANCE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_WHEEL_DISTANCE_MIN_LEN);
14562 memset(&packet2, 0,
sizeof(packet2));
14563 mavlink_msg_wheel_distance_encode(system_id, component_id, &msg, &packet1);
14564 mavlink_msg_wheel_distance_decode(&msg, &packet2);
14565 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14567 memset(&packet2, 0,
sizeof(packet2));
14568 mavlink_msg_wheel_distance_pack(system_id, component_id, &msg , packet1.time_usec , packet1.count , packet1.distance );
14569 mavlink_msg_wheel_distance_decode(&msg, &packet2);
14570 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14572 memset(&packet2, 0,
sizeof(packet2));
14573 mavlink_msg_wheel_distance_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.count , packet1.distance );
14574 mavlink_msg_wheel_distance_decode(&msg, &packet2);
14575 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14577 memset(&packet2, 0,
sizeof(packet2));
14578 mavlink_msg_to_send_buffer(buffer, &msg);
14579 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14580 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14582 mavlink_msg_wheel_distance_decode(last_msg, &packet2);
14583 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14585 memset(&packet2, 0,
sizeof(packet2));
14586 mavlink_msg_wheel_distance_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.count , packet1.distance );
14587 mavlink_msg_wheel_distance_decode(last_msg, &packet2);
14588 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14590#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14591 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"WHEEL_DISTANCE") != NULL);
14592 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_WHEEL_DISTANCE) != NULL);
14596static void mavlink_test_winch_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14598#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14599 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14600 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_WINCH_STATUS >= 256) {
14604 mavlink_message_t msg;
14605 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14607 mavlink_winch_status_t packet_in = {
14608 93372036854775807ULL,73.0,101.0,129.0,157.0,185.0,963498920,18899
14610 mavlink_winch_status_t packet1, packet2;
14611 memset(&packet1, 0,
sizeof(packet1));
14612 packet1.time_usec = packet_in.time_usec;
14613 packet1.line_length = packet_in.line_length;
14614 packet1.speed = packet_in.speed;
14615 packet1.tension = packet_in.tension;
14616 packet1.voltage = packet_in.voltage;
14617 packet1.current = packet_in.current;
14618 packet1.status = packet_in.status;
14619 packet1.temperature = packet_in.temperature;
14622#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14623 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14625 memset(MAVLINK_MSG_ID_WINCH_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_WINCH_STATUS_MIN_LEN);
14628 memset(&packet2, 0,
sizeof(packet2));
14629 mavlink_msg_winch_status_encode(system_id, component_id, &msg, &packet1);
14630 mavlink_msg_winch_status_decode(&msg, &packet2);
14631 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14633 memset(&packet2, 0,
sizeof(packet2));
14634 mavlink_msg_winch_status_pack(system_id, component_id, &msg , packet1.time_usec , packet1.line_length , packet1.speed , packet1.tension , packet1.voltage , packet1.current , packet1.temperature , packet1.status );
14635 mavlink_msg_winch_status_decode(&msg, &packet2);
14636 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14638 memset(&packet2, 0,
sizeof(packet2));
14639 mavlink_msg_winch_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.line_length , packet1.speed , packet1.tension , packet1.voltage , packet1.current , packet1.temperature , packet1.status );
14640 mavlink_msg_winch_status_decode(&msg, &packet2);
14641 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14643 memset(&packet2, 0,
sizeof(packet2));
14644 mavlink_msg_to_send_buffer(buffer, &msg);
14645 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14646 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14648 mavlink_msg_winch_status_decode(last_msg, &packet2);
14649 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14651 memset(&packet2, 0,
sizeof(packet2));
14652 mavlink_msg_winch_status_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.line_length , packet1.speed , packet1.tension , packet1.voltage , packet1.current , packet1.temperature , packet1.status );
14653 mavlink_msg_winch_status_decode(last_msg, &packet2);
14654 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14656#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14657 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"WINCH_STATUS") != NULL);
14658 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_WINCH_STATUS) != NULL);
14662static void mavlink_test_open_drone_id_basic_id(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14664#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14665 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14666 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID >= 256) {
14670 mavlink_message_t msg;
14671 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14673 mavlink_open_drone_id_basic_id_t packet_in = {
14674 5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158 },199,10,{ 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 }
14676 mavlink_open_drone_id_basic_id_t packet1, packet2;
14677 memset(&packet1, 0,
sizeof(packet1));
14678 packet1.target_system = packet_in.target_system;
14679 packet1.target_component = packet_in.target_component;
14680 packet1.id_type = packet_in.id_type;
14681 packet1.ua_type = packet_in.ua_type;
14683 mav_array_memcpy(packet1.id_or_mac, packet_in.id_or_mac,
sizeof(uint8_t)*20);
14684 mav_array_memcpy(packet1.uas_id, packet_in.uas_id,
sizeof(uint8_t)*20);
14686#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14687 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14689 memset(MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_MIN_LEN);
14692 memset(&packet2, 0,
sizeof(packet2));
14693 mavlink_msg_open_drone_id_basic_id_encode(system_id, component_id, &msg, &packet1);
14694 mavlink_msg_open_drone_id_basic_id_decode(&msg, &packet2);
14695 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14697 memset(&packet2, 0,
sizeof(packet2));
14698 mavlink_msg_open_drone_id_basic_id_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.id_type , packet1.ua_type , packet1.uas_id );
14699 mavlink_msg_open_drone_id_basic_id_decode(&msg, &packet2);
14700 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14702 memset(&packet2, 0,
sizeof(packet2));
14703 mavlink_msg_open_drone_id_basic_id_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.id_type , packet1.ua_type , packet1.uas_id );
14704 mavlink_msg_open_drone_id_basic_id_decode(&msg, &packet2);
14705 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14707 memset(&packet2, 0,
sizeof(packet2));
14708 mavlink_msg_to_send_buffer(buffer, &msg);
14709 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14710 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14712 mavlink_msg_open_drone_id_basic_id_decode(last_msg, &packet2);
14713 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14715 memset(&packet2, 0,
sizeof(packet2));
14716 mavlink_msg_open_drone_id_basic_id_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.id_type , packet1.ua_type , packet1.uas_id );
14717 mavlink_msg_open_drone_id_basic_id_decode(last_msg, &packet2);
14718 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14720#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14721 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"OPEN_DRONE_ID_BASIC_ID") != NULL);
14722 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID) != NULL);
14726static void mavlink_test_open_drone_id_location(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14728#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14729 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14730 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION >= 256) {
14734 mavlink_message_t msg;
14735 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14737 mavlink_open_drone_id_location_t packet_in = {
14738 963497464,963497672,73.0,101.0,129.0,157.0,18483,18587,18691,223,34,{ 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120 },161,228,39,106,173,240,51
14740 mavlink_open_drone_id_location_t packet1, packet2;
14741 memset(&packet1, 0,
sizeof(packet1));
14742 packet1.latitude = packet_in.latitude;
14743 packet1.longitude = packet_in.longitude;
14744 packet1.altitude_barometric = packet_in.altitude_barometric;
14745 packet1.altitude_geodetic = packet_in.altitude_geodetic;
14746 packet1.height = packet_in.height;
14747 packet1.timestamp = packet_in.timestamp;
14748 packet1.direction = packet_in.direction;
14749 packet1.speed_horizontal = packet_in.speed_horizontal;
14750 packet1.speed_vertical = packet_in.speed_vertical;
14751 packet1.target_system = packet_in.target_system;
14752 packet1.target_component = packet_in.target_component;
14753 packet1.status = packet_in.status;
14754 packet1.height_reference = packet_in.height_reference;
14755 packet1.horizontal_accuracy = packet_in.horizontal_accuracy;
14756 packet1.vertical_accuracy = packet_in.vertical_accuracy;
14757 packet1.barometer_accuracy = packet_in.barometer_accuracy;
14758 packet1.speed_accuracy = packet_in.speed_accuracy;
14759 packet1.timestamp_accuracy = packet_in.timestamp_accuracy;
14761 mav_array_memcpy(packet1.id_or_mac, packet_in.id_or_mac,
sizeof(uint8_t)*20);
14763#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14764 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14766 memset(MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_MIN_LEN);
14769 memset(&packet2, 0,
sizeof(packet2));
14770 mavlink_msg_open_drone_id_location_encode(system_id, component_id, &msg, &packet1);
14771 mavlink_msg_open_drone_id_location_decode(&msg, &packet2);
14772 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14774 memset(&packet2, 0,
sizeof(packet2));
14775 mavlink_msg_open_drone_id_location_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.status , packet1.direction , packet1.speed_horizontal , packet1.speed_vertical , packet1.latitude , packet1.longitude , packet1.altitude_barometric , packet1.altitude_geodetic , packet1.height_reference , packet1.height , packet1.horizontal_accuracy , packet1.vertical_accuracy , packet1.barometer_accuracy , packet1.speed_accuracy , packet1.timestamp , packet1.timestamp_accuracy );
14776 mavlink_msg_open_drone_id_location_decode(&msg, &packet2);
14777 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14779 memset(&packet2, 0,
sizeof(packet2));
14780 mavlink_msg_open_drone_id_location_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.status , packet1.direction , packet1.speed_horizontal , packet1.speed_vertical , packet1.latitude , packet1.longitude , packet1.altitude_barometric , packet1.altitude_geodetic , packet1.height_reference , packet1.height , packet1.horizontal_accuracy , packet1.vertical_accuracy , packet1.barometer_accuracy , packet1.speed_accuracy , packet1.timestamp , packet1.timestamp_accuracy );
14781 mavlink_msg_open_drone_id_location_decode(&msg, &packet2);
14782 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14784 memset(&packet2, 0,
sizeof(packet2));
14785 mavlink_msg_to_send_buffer(buffer, &msg);
14786 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14787 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14789 mavlink_msg_open_drone_id_location_decode(last_msg, &packet2);
14790 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14792 memset(&packet2, 0,
sizeof(packet2));
14793 mavlink_msg_open_drone_id_location_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.status , packet1.direction , packet1.speed_horizontal , packet1.speed_vertical , packet1.latitude , packet1.longitude , packet1.altitude_barometric , packet1.altitude_geodetic , packet1.height_reference , packet1.height , packet1.horizontal_accuracy , packet1.vertical_accuracy , packet1.barometer_accuracy , packet1.speed_accuracy , packet1.timestamp , packet1.timestamp_accuracy );
14794 mavlink_msg_open_drone_id_location_decode(last_msg, &packet2);
14795 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14797#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14798 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"OPEN_DRONE_ID_LOCATION") != NULL);
14799 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION) != NULL);
14803static void mavlink_test_open_drone_id_authentication(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14805#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14806 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14807 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION >= 256) {
14811 mavlink_message_t msg;
14812 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14814 mavlink_open_drone_id_authentication_t packet_in = {
14815 963497464,17,84,{ 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170 },211,22,89,156,{ 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245 }
14817 mavlink_open_drone_id_authentication_t packet1, packet2;
14818 memset(&packet1, 0,
sizeof(packet1));
14819 packet1.timestamp = packet_in.timestamp;
14820 packet1.target_system = packet_in.target_system;
14821 packet1.target_component = packet_in.target_component;
14822 packet1.authentication_type = packet_in.authentication_type;
14823 packet1.data_page = packet_in.data_page;
14824 packet1.last_page_index = packet_in.last_page_index;
14825 packet1.length = packet_in.length;
14827 mav_array_memcpy(packet1.id_or_mac, packet_in.id_or_mac,
sizeof(uint8_t)*20);
14828 mav_array_memcpy(packet1.authentication_data, packet_in.authentication_data,
sizeof(uint8_t)*23);
14830#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14831 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14833 memset(MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_MIN_LEN);
14836 memset(&packet2, 0,
sizeof(packet2));
14837 mavlink_msg_open_drone_id_authentication_encode(system_id, component_id, &msg, &packet1);
14838 mavlink_msg_open_drone_id_authentication_decode(&msg, &packet2);
14839 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14841 memset(&packet2, 0,
sizeof(packet2));
14842 mavlink_msg_open_drone_id_authentication_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.authentication_type , packet1.data_page , packet1.last_page_index , packet1.length , packet1.timestamp , packet1.authentication_data );
14843 mavlink_msg_open_drone_id_authentication_decode(&msg, &packet2);
14844 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14846 memset(&packet2, 0,
sizeof(packet2));
14847 mavlink_msg_open_drone_id_authentication_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.authentication_type , packet1.data_page , packet1.last_page_index , packet1.length , packet1.timestamp , packet1.authentication_data );
14848 mavlink_msg_open_drone_id_authentication_decode(&msg, &packet2);
14849 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14851 memset(&packet2, 0,
sizeof(packet2));
14852 mavlink_msg_to_send_buffer(buffer, &msg);
14853 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14854 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14856 mavlink_msg_open_drone_id_authentication_decode(last_msg, &packet2);
14857 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14859 memset(&packet2, 0,
sizeof(packet2));
14860 mavlink_msg_open_drone_id_authentication_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.authentication_type , packet1.data_page , packet1.last_page_index , packet1.length , packet1.timestamp , packet1.authentication_data );
14861 mavlink_msg_open_drone_id_authentication_decode(last_msg, &packet2);
14862 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14864#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14865 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"OPEN_DRONE_ID_AUTHENTICATION") != NULL);
14866 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION) != NULL);
14870static void mavlink_test_open_drone_id_self_id(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14872#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14873 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14874 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_SELF_ID >= 256) {
14878 mavlink_message_t msg;
14879 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14881 mavlink_open_drone_id_self_id_t packet_in = {
14882 5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158 },199,
"XYZABCDEFGHIJKLMNOPQRS"
14884 mavlink_open_drone_id_self_id_t packet1, packet2;
14885 memset(&packet1, 0,
sizeof(packet1));
14886 packet1.target_system = packet_in.target_system;
14887 packet1.target_component = packet_in.target_component;
14888 packet1.description_type = packet_in.description_type;
14890 mav_array_memcpy(packet1.id_or_mac, packet_in.id_or_mac,
sizeof(uint8_t)*20);
14891 mav_array_memcpy(packet1.description, packet_in.description,
sizeof(
char)*23);
14893#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14894 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14896 memset(MAVLINK_MSG_ID_OPEN_DRONE_ID_SELF_ID_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_OPEN_DRONE_ID_SELF_ID_MIN_LEN);
14899 memset(&packet2, 0,
sizeof(packet2));
14900 mavlink_msg_open_drone_id_self_id_encode(system_id, component_id, &msg, &packet1);
14901 mavlink_msg_open_drone_id_self_id_decode(&msg, &packet2);
14902 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14904 memset(&packet2, 0,
sizeof(packet2));
14905 mavlink_msg_open_drone_id_self_id_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.description_type , packet1.description );
14906 mavlink_msg_open_drone_id_self_id_decode(&msg, &packet2);
14907 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14909 memset(&packet2, 0,
sizeof(packet2));
14910 mavlink_msg_open_drone_id_self_id_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.description_type , packet1.description );
14911 mavlink_msg_open_drone_id_self_id_decode(&msg, &packet2);
14912 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14914 memset(&packet2, 0,
sizeof(packet2));
14915 mavlink_msg_to_send_buffer(buffer, &msg);
14916 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14917 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14919 mavlink_msg_open_drone_id_self_id_decode(last_msg, &packet2);
14920 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14922 memset(&packet2, 0,
sizeof(packet2));
14923 mavlink_msg_open_drone_id_self_id_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.description_type , packet1.description );
14924 mavlink_msg_open_drone_id_self_id_decode(last_msg, &packet2);
14925 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14927#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
14928 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"OPEN_DRONE_ID_SELF_ID") != NULL);
14929 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OPEN_DRONE_ID_SELF_ID) != NULL);
14933static void mavlink_test_open_drone_id_system(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
14935#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14936 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
14937 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM >= 256) {
14941 mavlink_message_t msg;
14942 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
14944 mavlink_open_drone_id_system_t packet_in = {
14945 963497464,963497672,73.0,101.0,129.0,963498504,18483,18587,89,156,{ 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242 },27,94,161,228
14947 mavlink_open_drone_id_system_t packet1, packet2;
14948 memset(&packet1, 0,
sizeof(packet1));
14949 packet1.operator_latitude = packet_in.operator_latitude;
14950 packet1.operator_longitude = packet_in.operator_longitude;
14951 packet1.area_ceiling = packet_in.area_ceiling;
14952 packet1.area_floor = packet_in.area_floor;
14953 packet1.operator_altitude_geo = packet_in.operator_altitude_geo;
14954 packet1.timestamp = packet_in.timestamp;
14955 packet1.area_count = packet_in.area_count;
14956 packet1.area_radius = packet_in.area_radius;
14957 packet1.target_system = packet_in.target_system;
14958 packet1.target_component = packet_in.target_component;
14959 packet1.operator_location_type = packet_in.operator_location_type;
14960 packet1.classification_type = packet_in.classification_type;
14961 packet1.category_eu = packet_in.category_eu;
14962 packet1.class_eu = packet_in.class_eu;
14964 mav_array_memcpy(packet1.id_or_mac, packet_in.id_or_mac,
sizeof(uint8_t)*20);
14966#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
14967 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
14969 memset(MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_MIN_LEN);
14972 memset(&packet2, 0,
sizeof(packet2));
14973 mavlink_msg_open_drone_id_system_encode(system_id, component_id, &msg, &packet1);
14974 mavlink_msg_open_drone_id_system_decode(&msg, &packet2);
14975 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14977 memset(&packet2, 0,
sizeof(packet2));
14978 mavlink_msg_open_drone_id_system_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.operator_location_type , packet1.classification_type , packet1.operator_latitude , packet1.operator_longitude , packet1.area_count , packet1.area_radius , packet1.area_ceiling , packet1.area_floor , packet1.category_eu , packet1.class_eu , packet1.operator_altitude_geo , packet1.timestamp );
14979 mavlink_msg_open_drone_id_system_decode(&msg, &packet2);
14980 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14982 memset(&packet2, 0,
sizeof(packet2));
14983 mavlink_msg_open_drone_id_system_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.operator_location_type , packet1.classification_type , packet1.operator_latitude , packet1.operator_longitude , packet1.area_count , packet1.area_radius , packet1.area_ceiling , packet1.area_floor , packet1.category_eu , packet1.class_eu , packet1.operator_altitude_geo , packet1.timestamp );
14984 mavlink_msg_open_drone_id_system_decode(&msg, &packet2);
14985 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14987 memset(&packet2, 0,
sizeof(packet2));
14988 mavlink_msg_to_send_buffer(buffer, &msg);
14989 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
14990 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
14992 mavlink_msg_open_drone_id_system_decode(last_msg, &packet2);
14993 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
14995 memset(&packet2, 0,
sizeof(packet2));
14996 mavlink_msg_open_drone_id_system_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.operator_location_type , packet1.classification_type , packet1.operator_latitude , packet1.operator_longitude , packet1.area_count , packet1.area_radius , packet1.area_ceiling , packet1.area_floor , packet1.category_eu , packet1.class_eu , packet1.operator_altitude_geo , packet1.timestamp );
14997 mavlink_msg_open_drone_id_system_decode(last_msg, &packet2);
14998 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15000#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
15001 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"OPEN_DRONE_ID_SYSTEM") != NULL);
15002 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM) != NULL);
15006static void mavlink_test_open_drone_id_operator_id(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
15008#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
15009 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
15010 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_OPERATOR_ID >= 256) {
15014 mavlink_message_t msg;
15015 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
15017 mavlink_open_drone_id_operator_id_t packet_in = {
15018 5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158 },199,
"XYZABCDEFGHIJKLMNOP"
15020 mavlink_open_drone_id_operator_id_t packet1, packet2;
15021 memset(&packet1, 0,
sizeof(packet1));
15022 packet1.target_system = packet_in.target_system;
15023 packet1.target_component = packet_in.target_component;
15024 packet1.operator_id_type = packet_in.operator_id_type;
15026 mav_array_memcpy(packet1.id_or_mac, packet_in.id_or_mac,
sizeof(uint8_t)*20);
15027 mav_array_memcpy(packet1.operator_id, packet_in.operator_id,
sizeof(
char)*20);
15029#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
15030 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
15032 memset(MAVLINK_MSG_ID_OPEN_DRONE_ID_OPERATOR_ID_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_OPEN_DRONE_ID_OPERATOR_ID_MIN_LEN);
15035 memset(&packet2, 0,
sizeof(packet2));
15036 mavlink_msg_open_drone_id_operator_id_encode(system_id, component_id, &msg, &packet1);
15037 mavlink_msg_open_drone_id_operator_id_decode(&msg, &packet2);
15038 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15040 memset(&packet2, 0,
sizeof(packet2));
15041 mavlink_msg_open_drone_id_operator_id_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.operator_id_type , packet1.operator_id );
15042 mavlink_msg_open_drone_id_operator_id_decode(&msg, &packet2);
15043 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15045 memset(&packet2, 0,
sizeof(packet2));
15046 mavlink_msg_open_drone_id_operator_id_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.operator_id_type , packet1.operator_id );
15047 mavlink_msg_open_drone_id_operator_id_decode(&msg, &packet2);
15048 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15050 memset(&packet2, 0,
sizeof(packet2));
15051 mavlink_msg_to_send_buffer(buffer, &msg);
15052 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
15053 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
15055 mavlink_msg_open_drone_id_operator_id_decode(last_msg, &packet2);
15056 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15058 memset(&packet2, 0,
sizeof(packet2));
15059 mavlink_msg_open_drone_id_operator_id_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.operator_id_type , packet1.operator_id );
15060 mavlink_msg_open_drone_id_operator_id_decode(last_msg, &packet2);
15061 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15063#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
15064 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"OPEN_DRONE_ID_OPERATOR_ID") != NULL);
15065 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OPEN_DRONE_ID_OPERATOR_ID) != NULL);
15069static void mavlink_test_open_drone_id_message_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
15071#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
15072 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
15073 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_MESSAGE_PACK >= 256) {
15077 mavlink_message_t msg;
15078 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
15080 mavlink_open_drone_id_message_pack_t packet_in = {
15081 5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158 },199,10,{ 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45 }
15083 mavlink_open_drone_id_message_pack_t packet1, packet2;
15084 memset(&packet1, 0,
sizeof(packet1));
15085 packet1.target_system = packet_in.target_system;
15086 packet1.target_component = packet_in.target_component;
15087 packet1.single_message_size = packet_in.single_message_size;
15088 packet1.msg_pack_size = packet_in.msg_pack_size;
15090 mav_array_memcpy(packet1.id_or_mac, packet_in.id_or_mac,
sizeof(uint8_t)*20);
15091 mav_array_memcpy(packet1.messages, packet_in.messages,
sizeof(uint8_t)*225);
15093#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
15094 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
15096 memset(MAVLINK_MSG_ID_OPEN_DRONE_ID_MESSAGE_PACK_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_OPEN_DRONE_ID_MESSAGE_PACK_MIN_LEN);
15099 memset(&packet2, 0,
sizeof(packet2));
15100 mavlink_msg_open_drone_id_message_pack_encode(system_id, component_id, &msg, &packet1);
15101 mavlink_msg_open_drone_id_message_pack_decode(&msg, &packet2);
15102 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15104 memset(&packet2, 0,
sizeof(packet2));
15105 mavlink_msg_open_drone_id_message_pack_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.single_message_size , packet1.msg_pack_size , packet1.messages );
15106 mavlink_msg_open_drone_id_message_pack_decode(&msg, &packet2);
15107 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15109 memset(&packet2, 0,
sizeof(packet2));
15110 mavlink_msg_open_drone_id_message_pack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.single_message_size , packet1.msg_pack_size , packet1.messages );
15111 mavlink_msg_open_drone_id_message_pack_decode(&msg, &packet2);
15112 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15114 memset(&packet2, 0,
sizeof(packet2));
15115 mavlink_msg_to_send_buffer(buffer, &msg);
15116 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
15117 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
15119 mavlink_msg_open_drone_id_message_pack_decode(last_msg, &packet2);
15120 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15122 memset(&packet2, 0,
sizeof(packet2));
15123 mavlink_msg_open_drone_id_message_pack_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.id_or_mac , packet1.single_message_size , packet1.msg_pack_size , packet1.messages );
15124 mavlink_msg_open_drone_id_message_pack_decode(last_msg, &packet2);
15125 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15127#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
15128 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"OPEN_DRONE_ID_MESSAGE_PACK") != NULL);
15129 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OPEN_DRONE_ID_MESSAGE_PACK) != NULL);
15133static void mavlink_test_open_drone_id_arm_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
15135#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
15136 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
15137 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS >= 256) {
15141 mavlink_message_t msg;
15142 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
15144 mavlink_open_drone_id_arm_status_t packet_in = {
15145 5,
"BCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX"
15147 mavlink_open_drone_id_arm_status_t packet1, packet2;
15148 memset(&packet1, 0,
sizeof(packet1));
15149 packet1.status = packet_in.status;
15151 mav_array_memcpy(packet1.error, packet_in.error,
sizeof(
char)*50);
15153#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
15154 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
15156 memset(MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS_MIN_LEN);
15159 memset(&packet2, 0,
sizeof(packet2));
15160 mavlink_msg_open_drone_id_arm_status_encode(system_id, component_id, &msg, &packet1);
15161 mavlink_msg_open_drone_id_arm_status_decode(&msg, &packet2);
15162 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15164 memset(&packet2, 0,
sizeof(packet2));
15165 mavlink_msg_open_drone_id_arm_status_pack(system_id, component_id, &msg , packet1.status , packet1.error );
15166 mavlink_msg_open_drone_id_arm_status_decode(&msg, &packet2);
15167 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15169 memset(&packet2, 0,
sizeof(packet2));
15170 mavlink_msg_open_drone_id_arm_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.status , packet1.error );
15171 mavlink_msg_open_drone_id_arm_status_decode(&msg, &packet2);
15172 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15174 memset(&packet2, 0,
sizeof(packet2));
15175 mavlink_msg_to_send_buffer(buffer, &msg);
15176 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
15177 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
15179 mavlink_msg_open_drone_id_arm_status_decode(last_msg, &packet2);
15180 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15182 memset(&packet2, 0,
sizeof(packet2));
15183 mavlink_msg_open_drone_id_arm_status_send(MAVLINK_COMM_1 , packet1.status , packet1.error );
15184 mavlink_msg_open_drone_id_arm_status_decode(last_msg, &packet2);
15185 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15187#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
15188 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"OPEN_DRONE_ID_ARM_STATUS") != NULL);
15189 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OPEN_DRONE_ID_ARM_STATUS) != NULL);
15193static void mavlink_test_open_drone_id_system_update(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
15195#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
15196 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
15197 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_UPDATE >= 256) {
15201 mavlink_message_t msg;
15202 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
15204 mavlink_open_drone_id_system_update_t packet_in = {
15205 963497464,963497672,73.0,963498088,53,120
15207 mavlink_open_drone_id_system_update_t packet1, packet2;
15208 memset(&packet1, 0,
sizeof(packet1));
15209 packet1.operator_latitude = packet_in.operator_latitude;
15210 packet1.operator_longitude = packet_in.operator_longitude;
15211 packet1.operator_altitude_geo = packet_in.operator_altitude_geo;
15212 packet1.timestamp = packet_in.timestamp;
15213 packet1.target_system = packet_in.target_system;
15214 packet1.target_component = packet_in.target_component;
15217#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
15218 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
15220 memset(MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_UPDATE_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_UPDATE_MIN_LEN);
15223 memset(&packet2, 0,
sizeof(packet2));
15224 mavlink_msg_open_drone_id_system_update_encode(system_id, component_id, &msg, &packet1);
15225 mavlink_msg_open_drone_id_system_update_decode(&msg, &packet2);
15226 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15228 memset(&packet2, 0,
sizeof(packet2));
15229 mavlink_msg_open_drone_id_system_update_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.operator_latitude , packet1.operator_longitude , packet1.operator_altitude_geo , packet1.timestamp );
15230 mavlink_msg_open_drone_id_system_update_decode(&msg, &packet2);
15231 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15233 memset(&packet2, 0,
sizeof(packet2));
15234 mavlink_msg_open_drone_id_system_update_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.operator_latitude , packet1.operator_longitude , packet1.operator_altitude_geo , packet1.timestamp );
15235 mavlink_msg_open_drone_id_system_update_decode(&msg, &packet2);
15236 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15238 memset(&packet2, 0,
sizeof(packet2));
15239 mavlink_msg_to_send_buffer(buffer, &msg);
15240 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
15241 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
15243 mavlink_msg_open_drone_id_system_update_decode(last_msg, &packet2);
15244 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15246 memset(&packet2, 0,
sizeof(packet2));
15247 mavlink_msg_open_drone_id_system_update_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.operator_latitude , packet1.operator_longitude , packet1.operator_altitude_geo , packet1.timestamp );
15248 mavlink_msg_open_drone_id_system_update_decode(last_msg, &packet2);
15249 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15251#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
15252 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"OPEN_DRONE_ID_SYSTEM_UPDATE") != NULL);
15253 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_UPDATE) != NULL);
15257static void mavlink_test_hygrometer_sensor(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
15259#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
15260 mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
15261 if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HYGROMETER_SENSOR >= 256) {
15265 mavlink_message_t msg;
15266 uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
15268 mavlink_hygrometer_sensor_t packet_in = {
15271 mavlink_hygrometer_sensor_t packet1, packet2;
15272 memset(&packet1, 0,
sizeof(packet1));
15273 packet1.temperature = packet_in.temperature;
15274 packet1.humidity = packet_in.humidity;
15275 packet1.id = packet_in.id;
15278#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
15279 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
15281 memset(MAVLINK_MSG_ID_HYGROMETER_SENSOR_MIN_LEN + (
char *)&packet1, 0,
sizeof(packet1)-MAVLINK_MSG_ID_HYGROMETER_SENSOR_MIN_LEN);
15284 memset(&packet2, 0,
sizeof(packet2));
15285 mavlink_msg_hygrometer_sensor_encode(system_id, component_id, &msg, &packet1);
15286 mavlink_msg_hygrometer_sensor_decode(&msg, &packet2);
15287 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15289 memset(&packet2, 0,
sizeof(packet2));
15290 mavlink_msg_hygrometer_sensor_pack(system_id, component_id, &msg , packet1.id , packet1.temperature , packet1.humidity );
15291 mavlink_msg_hygrometer_sensor_decode(&msg, &packet2);
15292 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15294 memset(&packet2, 0,
sizeof(packet2));
15295 mavlink_msg_hygrometer_sensor_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.id , packet1.temperature , packet1.humidity );
15296 mavlink_msg_hygrometer_sensor_decode(&msg, &packet2);
15297 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15299 memset(&packet2, 0,
sizeof(packet2));
15300 mavlink_msg_to_send_buffer(buffer, &msg);
15301 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
15302 comm_send_ch(MAVLINK_COMM_0, buffer[i]);
15304 mavlink_msg_hygrometer_sensor_decode(last_msg, &packet2);
15305 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15307 memset(&packet2, 0,
sizeof(packet2));
15308 mavlink_msg_hygrometer_sensor_send(MAVLINK_COMM_1 , packet1.id , packet1.temperature , packet1.humidity );
15309 mavlink_msg_hygrometer_sensor_decode(last_msg, &packet2);
15310 MAVLINK_ASSERT(memcmp(&packet1, &packet2,
sizeof(packet1)) == 0);
15312#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
15313 MAVLINK_ASSERT(mavlink_get_message_info_by_name(
"HYGROMETER_SENSOR") != NULL);
15314 MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_HYGROMETER_SENSOR) != NULL);
15318static void mavlink_test_common(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
15320 mavlink_test_sys_status(system_id, component_id, last_msg);
15321 mavlink_test_system_time(system_id, component_id, last_msg);
15322 mavlink_test_ping(system_id, component_id, last_msg);
15323 mavlink_test_change_operator_control(system_id, component_id, last_msg);
15324 mavlink_test_change_operator_control_ack(system_id, component_id, last_msg);
15325 mavlink_test_auth_key(system_id, component_id, last_msg);
15326 mavlink_test_link_node_status(system_id, component_id, last_msg);
15327 mavlink_test_set_mode(system_id, component_id, last_msg);
15328 mavlink_test_param_request_read(system_id, component_id, last_msg);
15329 mavlink_test_param_request_list(system_id, component_id, last_msg);
15330 mavlink_test_param_value(system_id, component_id, last_msg);
15331 mavlink_test_param_set(system_id, component_id, last_msg);
15332 mavlink_test_gps_raw_int(system_id, component_id, last_msg);
15333 mavlink_test_gps_status(system_id, component_id, last_msg);
15334 mavlink_test_scaled_imu(system_id, component_id, last_msg);
15335 mavlink_test_raw_imu(system_id, component_id, last_msg);
15336 mavlink_test_raw_pressure(system_id, component_id, last_msg);
15337 mavlink_test_scaled_pressure(system_id, component_id, last_msg);
15338 mavlink_test_attitude(system_id, component_id, last_msg);
15339 mavlink_test_attitude_quaternion(system_id, component_id, last_msg);
15340 mavlink_test_local_position_ned(system_id, component_id, last_msg);
15341 mavlink_test_rc_channels_scaled(system_id, component_id, last_msg);
15342 mavlink_test_rc_channels_raw(system_id, component_id, last_msg);
15343 mavlink_test_servo_output_raw(system_id, component_id, last_msg);
15344 mavlink_test_mission_request_partial_list(system_id, component_id, last_msg);
15345 mavlink_test_mission_write_partial_list(system_id, component_id, last_msg);
15346 mavlink_test_mission_item(system_id, component_id, last_msg);
15347 mavlink_test_mission_request(system_id, component_id, last_msg);
15348 mavlink_test_mission_set_current(system_id, component_id, last_msg);
15349 mavlink_test_mission_current(system_id, component_id, last_msg);
15350 mavlink_test_mission_request_list(system_id, component_id, last_msg);
15351 mavlink_test_mission_count(system_id, component_id, last_msg);
15352 mavlink_test_mission_clear_all(system_id, component_id, last_msg);
15353 mavlink_test_mission_item_reached(system_id, component_id, last_msg);
15354 mavlink_test_mission_ack(system_id, component_id, last_msg);
15355 mavlink_test_set_gps_global_origin(system_id, component_id, last_msg);
15356 mavlink_test_gps_global_origin(system_id, component_id, last_msg);
15357 mavlink_test_param_map_rc(system_id, component_id, last_msg);
15358 mavlink_test_mission_request_int(system_id, component_id, last_msg);
15359 mavlink_test_safety_set_allowed_area(system_id, component_id, last_msg);
15360 mavlink_test_safety_allowed_area(system_id, component_id, last_msg);
15361 mavlink_test_attitude_quaternion_cov(system_id, component_id, last_msg);
15362 mavlink_test_nav_controller_output(system_id, component_id, last_msg);
15363 mavlink_test_global_position_int_cov(system_id, component_id, last_msg);
15364 mavlink_test_local_position_ned_cov(system_id, component_id, last_msg);
15365 mavlink_test_rc_channels(system_id, component_id, last_msg);
15366 mavlink_test_request_data_stream(system_id, component_id, last_msg);
15367 mavlink_test_data_stream(system_id, component_id, last_msg);
15368 mavlink_test_manual_control(system_id, component_id, last_msg);
15369 mavlink_test_rc_channels_override(system_id, component_id, last_msg);
15370 mavlink_test_mission_item_int(system_id, component_id, last_msg);
15371 mavlink_test_vfr_hud(system_id, component_id, last_msg);
15372 mavlink_test_command_int(system_id, component_id, last_msg);
15373 mavlink_test_command_long(system_id, component_id, last_msg);
15374 mavlink_test_command_ack(system_id, component_id, last_msg);
15375 mavlink_test_command_cancel(system_id, component_id, last_msg);
15376 mavlink_test_manual_setpoint(system_id, component_id, last_msg);
15377 mavlink_test_set_attitude_target(system_id, component_id, last_msg);
15378 mavlink_test_attitude_target(system_id, component_id, last_msg);
15379 mavlink_test_set_position_target_local_ned(system_id, component_id, last_msg);
15380 mavlink_test_position_target_local_ned(system_id, component_id, last_msg);
15381 mavlink_test_set_position_target_global_int(system_id, component_id, last_msg);
15382 mavlink_test_position_target_global_int(system_id, component_id, last_msg);
15383 mavlink_test_local_position_ned_system_global_offset(system_id, component_id, last_msg);
15384 mavlink_test_hil_state(system_id, component_id, last_msg);
15385 mavlink_test_hil_controls(system_id, component_id, last_msg);
15386 mavlink_test_hil_rc_inputs_raw(system_id, component_id, last_msg);
15387 mavlink_test_hil_actuator_controls(system_id, component_id, last_msg);
15388 mavlink_test_optical_flow(system_id, component_id, last_msg);
15389 mavlink_test_global_vision_position_estimate(system_id, component_id, last_msg);
15390 mavlink_test_vision_position_estimate(system_id, component_id, last_msg);
15391 mavlink_test_vision_speed_estimate(system_id, component_id, last_msg);
15392 mavlink_test_vicon_position_estimate(system_id, component_id, last_msg);
15393 mavlink_test_highres_imu(system_id, component_id, last_msg);
15394 mavlink_test_optical_flow_rad(system_id, component_id, last_msg);
15395 mavlink_test_hil_sensor(system_id, component_id, last_msg);
15396 mavlink_test_sim_state(system_id, component_id, last_msg);
15397 mavlink_test_radio_status(system_id, component_id, last_msg);
15398 mavlink_test_file_transfer_protocol(system_id, component_id, last_msg);
15399 mavlink_test_timesync(system_id, component_id, last_msg);
15400 mavlink_test_camera_trigger(system_id, component_id, last_msg);
15401 mavlink_test_hil_gps(system_id, component_id, last_msg);
15402 mavlink_test_hil_optical_flow(system_id, component_id, last_msg);
15403 mavlink_test_hil_state_quaternion(system_id, component_id, last_msg);
15404 mavlink_test_scaled_imu2(system_id, component_id, last_msg);
15405 mavlink_test_log_request_list(system_id, component_id, last_msg);
15406 mavlink_test_log_entry(system_id, component_id, last_msg);
15407 mavlink_test_log_request_data(system_id, component_id, last_msg);
15408 mavlink_test_log_data(system_id, component_id, last_msg);
15409 mavlink_test_log_erase(system_id, component_id, last_msg);
15410 mavlink_test_log_request_end(system_id, component_id, last_msg);
15411 mavlink_test_gps_inject_data(system_id, component_id, last_msg);
15412 mavlink_test_gps2_raw(system_id, component_id, last_msg);
15413 mavlink_test_power_status(system_id, component_id, last_msg);
15414 mavlink_test_serial_control(system_id, component_id, last_msg);
15415 mavlink_test_gps_rtk(system_id, component_id, last_msg);
15416 mavlink_test_gps2_rtk(system_id, component_id, last_msg);
15417 mavlink_test_scaled_imu3(system_id, component_id, last_msg);
15418 mavlink_test_data_transmission_handshake(system_id, component_id, last_msg);
15419 mavlink_test_encapsulated_data(system_id, component_id, last_msg);
15420 mavlink_test_distance_sensor(system_id, component_id, last_msg);
15421 mavlink_test_terrain_request(system_id, component_id, last_msg);
15422 mavlink_test_terrain_data(system_id, component_id, last_msg);
15423 mavlink_test_terrain_check(system_id, component_id, last_msg);
15424 mavlink_test_terrain_report(system_id, component_id, last_msg);
15425 mavlink_test_scaled_pressure2(system_id, component_id, last_msg);
15426 mavlink_test_att_pos_mocap(system_id, component_id, last_msg);
15427 mavlink_test_set_actuator_control_target(system_id, component_id, last_msg);
15428 mavlink_test_actuator_control_target(system_id, component_id, last_msg);
15429 mavlink_test_altitude(system_id, component_id, last_msg);
15430 mavlink_test_resource_request(system_id, component_id, last_msg);
15431 mavlink_test_scaled_pressure3(system_id, component_id, last_msg);
15432 mavlink_test_follow_target(system_id, component_id, last_msg);
15433 mavlink_test_control_system_state(system_id, component_id, last_msg);
15434 mavlink_test_battery_status(system_id, component_id, last_msg);
15435 mavlink_test_landing_target(system_id, component_id, last_msg);
15436 mavlink_test_fence_status(system_id, component_id, last_msg);
15437 mavlink_test_mag_cal_report(system_id, component_id, last_msg);
15438 mavlink_test_efi_status(system_id, component_id, last_msg);
15439 mavlink_test_estimator_status(system_id, component_id, last_msg);
15440 mavlink_test_wind_cov(system_id, component_id, last_msg);
15441 mavlink_test_gps_input(system_id, component_id, last_msg);
15442 mavlink_test_gps_rtcm_data(system_id, component_id, last_msg);
15443 mavlink_test_high_latency(system_id, component_id, last_msg);
15444 mavlink_test_high_latency2(system_id, component_id, last_msg);
15445 mavlink_test_vibration(system_id, component_id, last_msg);
15446 mavlink_test_home_position(system_id, component_id, last_msg);
15447 mavlink_test_set_home_position(system_id, component_id, last_msg);
15448 mavlink_test_message_interval(system_id, component_id, last_msg);
15449 mavlink_test_extended_sys_state(system_id, component_id, last_msg);
15450 mavlink_test_adsb_vehicle(system_id, component_id, last_msg);
15451 mavlink_test_collision(system_id, component_id, last_msg);
15452 mavlink_test_v2_extension(system_id, component_id, last_msg);
15453 mavlink_test_memory_vect(system_id, component_id, last_msg);
15454 mavlink_test_debug_vect(system_id, component_id, last_msg);
15455 mavlink_test_named_value_float(system_id, component_id, last_msg);
15456 mavlink_test_named_value_int(system_id, component_id, last_msg);
15457 mavlink_test_statustext(system_id, component_id, last_msg);
15458 mavlink_test_debug(system_id, component_id, last_msg);
15459 mavlink_test_setup_signing(system_id, component_id, last_msg);
15460 mavlink_test_button_change(system_id, component_id, last_msg);
15461 mavlink_test_play_tune(system_id, component_id, last_msg);
15462 mavlink_test_camera_information(system_id, component_id, last_msg);
15463 mavlink_test_camera_settings(system_id, component_id, last_msg);
15464 mavlink_test_storage_information(system_id, component_id, last_msg);
15465 mavlink_test_camera_capture_status(system_id, component_id, last_msg);
15466 mavlink_test_camera_image_captured(system_id, component_id, last_msg);
15467 mavlink_test_flight_information(system_id, component_id, last_msg);
15468 mavlink_test_mount_orientation(system_id, component_id, last_msg);
15469 mavlink_test_logging_data(system_id, component_id, last_msg);
15470 mavlink_test_logging_data_acked(system_id, component_id, last_msg);
15471 mavlink_test_logging_ack(system_id, component_id, last_msg);
15472 mavlink_test_video_stream_information(system_id, component_id, last_msg);
15473 mavlink_test_video_stream_status(system_id, component_id, last_msg);
15474 mavlink_test_camera_fov_status(system_id, component_id, last_msg);
15475 mavlink_test_camera_tracking_image_status(system_id, component_id, last_msg);
15476 mavlink_test_camera_tracking_geo_status(system_id, component_id, last_msg);
15477 mavlink_test_camera_thermal_range(system_id, component_id, last_msg);
15478 mavlink_test_gimbal_manager_information(system_id, component_id, last_msg);
15479 mavlink_test_gimbal_manager_status(system_id, component_id, last_msg);
15480 mavlink_test_gimbal_manager_set_attitude(system_id, component_id, last_msg);
15481 mavlink_test_gimbal_device_information(system_id, component_id, last_msg);
15482 mavlink_test_gimbal_device_set_attitude(system_id, component_id, last_msg);
15483 mavlink_test_gimbal_device_attitude_status(system_id, component_id, last_msg);
15484 mavlink_test_autopilot_state_for_gimbal_device(system_id, component_id, last_msg);
15485 mavlink_test_gimbal_manager_set_pitchyaw(system_id, component_id, last_msg);
15486 mavlink_test_gimbal_manager_set_manual_control(system_id, component_id, last_msg);
15487 mavlink_test_esc_info(system_id, component_id, last_msg);
15488 mavlink_test_esc_status(system_id, component_id, last_msg);
15489 mavlink_test_airspeed(system_id, component_id, last_msg);
15490 mavlink_test_global_position_sensor(system_id, component_id, last_msg);
15491 mavlink_test_wifi_config_ap(system_id, component_id, last_msg);
15492 mavlink_test_protocol_version(system_id, component_id, last_msg);
15493 mavlink_test_ais_vessel(system_id, component_id, last_msg);
15494 mavlink_test_uavcan_node_status(system_id, component_id, last_msg);
15495 mavlink_test_uavcan_node_info(system_id, component_id, last_msg);
15496 mavlink_test_param_ext_request_read(system_id, component_id, last_msg);
15497 mavlink_test_param_ext_request_list(system_id, component_id, last_msg);
15498 mavlink_test_param_ext_value(system_id, component_id, last_msg);
15499 mavlink_test_param_ext_set(system_id, component_id, last_msg);
15500 mavlink_test_param_ext_ack(system_id, component_id, last_msg);
15501 mavlink_test_obstacle_distance(system_id, component_id, last_msg);
15502 mavlink_test_odometry(system_id, component_id, last_msg);
15503 mavlink_test_trajectory_representation_waypoints(system_id, component_id, last_msg);
15504 mavlink_test_trajectory_representation_bezier(system_id, component_id, last_msg);
15505 mavlink_test_cellular_status(system_id, component_id, last_msg);
15506 mavlink_test_isbd_link_status(system_id, component_id, last_msg);
15507 mavlink_test_cellular_config(system_id, component_id, last_msg);
15508 mavlink_test_raw_rpm(system_id, component_id, last_msg);
15509 mavlink_test_utm_global_position(system_id, component_id, last_msg);
15510 mavlink_test_param_error(system_id, component_id, last_msg);
15511 mavlink_test_debug_float_array(system_id, component_id, last_msg);
15512 mavlink_test_orbit_execution_status(system_id, component_id, last_msg);
15513 mavlink_test_smart_battery_info(system_id, component_id, last_msg);
15514 mavlink_test_figure_eight_execution_status(system_id, component_id, last_msg);
15515 mavlink_test_fuel_status(system_id, component_id, last_msg);
15516 mavlink_test_battery_info(system_id, component_id, last_msg);
15517 mavlink_test_generator_status(system_id, component_id, last_msg);
15518 mavlink_test_actuator_output_status(system_id, component_id, last_msg);
15519 mavlink_test_relay_status(system_id, component_id, last_msg);
15520 mavlink_test_time_estimate_to_target(system_id, component_id, last_msg);
15521 mavlink_test_tunnel(system_id, component_id, last_msg);
15522 mavlink_test_can_frame(system_id, component_id, last_msg);
15523 mavlink_test_onboard_computer_status(system_id, component_id, last_msg);
15524 mavlink_test_component_information(system_id, component_id, last_msg);
15525 mavlink_test_component_information_basic(system_id, component_id, last_msg);
15526 mavlink_test_component_metadata(system_id, component_id, last_msg);
15527 mavlink_test_play_tune_v2(system_id, component_id, last_msg);
15528 mavlink_test_supported_tunes(system_id, component_id, last_msg);
15529 mavlink_test_event(system_id, component_id, last_msg);
15530 mavlink_test_current_event_sequence(system_id, component_id, last_msg);
15531 mavlink_test_request_event(system_id, component_id, last_msg);
15532 mavlink_test_response_event_error(system_id, component_id, last_msg);
15533 mavlink_test_available_modes(system_id, component_id, last_msg);
15534 mavlink_test_current_mode(system_id, component_id, last_msg);
15535 mavlink_test_available_modes_monitor(system_id, component_id, last_msg);
15536 mavlink_test_illuminator_status(system_id, component_id, last_msg);
15537 mavlink_test_canfd_frame(system_id, component_id, last_msg);
15538 mavlink_test_can_filter_modify(system_id, component_id, last_msg);
15539 mavlink_test_wheel_distance(system_id, component_id, last_msg);
15540 mavlink_test_winch_status(system_id, component_id, last_msg);
15541 mavlink_test_open_drone_id_basic_id(system_id, component_id, last_msg);
15542 mavlink_test_open_drone_id_location(system_id, component_id, last_msg);
15543 mavlink_test_open_drone_id_authentication(system_id, component_id, last_msg);
15544 mavlink_test_open_drone_id_self_id(system_id, component_id, last_msg);
15545 mavlink_test_open_drone_id_system(system_id, component_id, last_msg);
15546 mavlink_test_open_drone_id_operator_id(system_id, component_id, last_msg);
15547 mavlink_test_open_drone_id_message_pack(system_id, component_id, last_msg);
15548 mavlink_test_open_drone_id_arm_status(system_id, component_id, last_msg);
15549 mavlink_test_open_drone_id_system_update(system_id, component_id, last_msg);
15550 mavlink_test_hygrometer_sensor(system_id, component_id, last_msg);