5 #ifndef TEST_TESTSUITE_H
6 #define TEST_TESTSUITE_H
12 #ifndef MAVLINK_TEST_ALL
13 #define MAVLINK_TEST_ALL
15 static void mavlink_test_test(uint8_t, uint8_t, mavlink_message_t *last_msg);
17 static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
20 mavlink_test_test(system_id, component_id, last_msg);
27 static void mavlink_test_test_types(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
29 mavlink_message_t msg;
33 93372036854775807ULL,93372036854776311LL,235.0,{ 93372036854777319, 93372036854777320, 93372036854777321 },{ 93372036854778831, 93372036854778832, 93372036854778833 },{ 627.0, 628.0, 629.0 },963502456,963502664,745.0,{ 963503080, 963503081, 963503082 },{ 963503704, 963503705, 963503706 },{ 941.0, 942.0, 943.0 },24723,24827,{ 24931, 24932, 24933 },{ 25243, 25244, 25245 },
'E',
"FGHIJKLMN",198,9,{ 76, 77, 78 },{ 21, 22, 23 }
36 memset(&packet1, 0,
sizeof(packet1));
37 packet1.
u64 = packet_in.
u64;
38 packet1.
s64 = packet_in.
s64;
39 packet1.
d = packet_in.
d;
40 packet1.
u32 = packet_in.
u32;
41 packet1.
s32 = packet_in.
s32;
42 packet1.
f = packet_in.
f;
43 packet1.
u16 = packet_in.
u16;
44 packet1.
s16 = packet_in.
s16;
45 packet1.
c = packet_in.
c;
46 packet1.
u8 = packet_in.
u8;
47 packet1.
s8 = packet_in.
s8;
51 mav_array_memcpy(packet1.
d_array, packet_in.
d_array,
sizeof(
double)*3);
54 mav_array_memcpy(packet1.
f_array, packet_in.
f_array,
sizeof(
float)*3);
57 mav_array_memcpy(packet1.
s, packet_in.
s,
sizeof(
char)*10);
62 memset(&packet2, 0,
sizeof(packet2));
63 mavlink_msg_test_types_encode(system_id, component_id, &msg, &packet1);
64 mavlink_msg_test_types_decode(&msg, &packet2);
67 memset(&packet2, 0,
sizeof(packet2));
68 mavlink_msg_test_types_pack(system_id, component_id, &msg , packet1.
c , packet1.
s , packet1.
u8 , packet1.
u16 , packet1.
u32 , packet1.
u64 , packet1.
s8 , packet1.
s16 , packet1.
s32 , packet1.
s64 , packet1.
f , packet1.
d , packet1.
u8_array , packet1.
u16_array , packet1.
u32_array , packet1.
u64_array , packet1.
s8_array , packet1.
s16_array , packet1.
s32_array , packet1.
s64_array , packet1.
f_array , packet1.
d_array );
69 mavlink_msg_test_types_decode(&msg, &packet2);
72 memset(&packet2, 0,
sizeof(packet2));
73 mavlink_msg_test_types_pack_chan(system_id, component_id,
MAVLINK_COMM_0, &msg , packet1.
c , packet1.
s , packet1.
u8 , packet1.
u16 , packet1.
u32 , packet1.
u64 , packet1.
s8 , packet1.
s16 , packet1.
s32 , packet1.
s64 , packet1.
f , packet1.
d , packet1.
u8_array , packet1.
u16_array , packet1.
u32_array , packet1.
u64_array , packet1.
s8_array , packet1.
s16_array , packet1.
s32_array , packet1.
s64_array , packet1.
f_array , packet1.
d_array );
74 mavlink_msg_test_types_decode(&msg, &packet2);
77 memset(&packet2, 0,
sizeof(packet2));
79 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
82 mavlink_msg_test_types_decode(last_msg, &packet2);
85 memset(&packet2, 0,
sizeof(packet2));
86 mavlink_msg_test_types_send(
MAVLINK_COMM_1 , packet1.
c , packet1.
s , packet1.
u8 , packet1.
u16 , packet1.
u32 , packet1.
u64 , packet1.
s8 , packet1.
s16 , packet1.
s32 , packet1.
s64 , packet1.
f , packet1.
d , packet1.
u8_array , packet1.
u16_array , packet1.
u32_array , packet1.
u64_array , packet1.
s8_array , packet1.
s16_array , packet1.
s32_array , packet1.
s64_array , packet1.
f_array , packet1.
d_array );
87 mavlink_msg_test_types_decode(last_msg, &packet2);
91 static void mavlink_test_test(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
93 mavlink_test_test_types(system_id, component_id, last_msg);
99 #endif // TEST_TESTSUITE_H
Definition: mavlink_types.h:180
uint64_t u64_array[3]
uint64_t_array
Definition: mavlink_msg_test_types.h:10
uint32_t u32_array[3]
uint32_t_array
Definition: mavlink_msg_test_types.h:16
Definition: mavlink_types.h:179
int8_t s8_array[3]
int8_t_array
Definition: mavlink_msg_test_types.h:28
int16_t s16_array[3]
int16_t_array
Definition: mavlink_msg_test_types.h:22
char c
char
Definition: mavlink_msg_test_types.h:23
Definition: mavlink_msg_test_types.h:5
int8_t s8
int8_t
Definition: mavlink_msg_test_types.h:26
int64_t s64
int64_t
Definition: mavlink_msg_test_types.h:8
float f_array[3]
float_array
Definition: mavlink_msg_test_types.h:18
uint32_t u32
uint32_t
Definition: mavlink_msg_test_types.h:13
uint16_t u16
uint16_t
Definition: mavlink_msg_test_types.h:19
int32_t s32
int32_t
Definition: mavlink_msg_test_types.h:14
int16_t s16
int16_t
Definition: mavlink_msg_test_types.h:20
#define MAVLINK_ASSERT(x)
Definition: protocol.h:26
uint8_t u8
uint8_t
Definition: mavlink_msg_test_types.h:25
#define MAVLINK_MAX_PACKET_LEN
Maximum packet length.
Definition: mavlink_types.h:33
double d
double
Definition: mavlink_msg_test_types.h:9
uint8_t u8_array[3]
uint8_t_array
Definition: mavlink_msg_test_types.h:27
uint16_t u16_array[3]
uint16_t_array
Definition: mavlink_msg_test_types.h:21
int32_t s32_array[3]
int32_t_array
Definition: mavlink_msg_test_types.h:17
MAVLINK_HELPER uint16_t mavlink_msg_to_send_buffer(uint8_t *buffer, const mavlink_message_t *msg)
Pack a message to send it over a serial byte stream.
Definition: mavlink_helpers.h:174
uint64_t u64
uint64_t
Definition: mavlink_msg_test_types.h:7
char s[10]
string
Definition: mavlink_msg_test_types.h:24
int64_t s64_array[3]
int64_t_array
Definition: mavlink_msg_test_types.h:11
double d_array[3]
double_array
Definition: mavlink_msg_test_types.h:12
float f
float
Definition: mavlink_msg_test_types.h:15