11 #define MAVLINK_USE_CONVENIENCE_FUNCTIONS 12 #define MAVLINK_USE_MESSAGE_INFO 13 #define MAVLINK_COMM_NUM_BUFFERS 2 18 #define MAVLINK_MAX_PAYLOAD_LEN MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 20 #include <mavlink_types.h> 23 #define MAVLINK_ASSERT(x) assert(x) 29 #include <testsuite.h> 33 #ifndef MAVLINK_HAVE_EXPECTED_MESSAGE_LENGTH 35 #define mavlink_expected_message_length(msg) message_lengths[(msg)->msgid] 38 #ifndef MAVLINK_HAVE_GET_MESSAGE_INFO 40 #define mavlink_get_message_info(msg) &message_info[(msg)->msgid] 48 #define PRINT_FORMAT(f, def) (f->print_format?f->print_format:def) 88 printf(
"%s: ", f->
name);
103 if (i < f->array_length) {
117 printf(
"ERROR: no message info for %u\n", msg->
msgid);
123 printf(
"%s { ", m->
name);
130 #ifdef MAVLINK_SIGNING_FLAG_SIGN_OUTGOING 138 memset(&status, 0,
sizeof(status));
139 #ifdef MAVLINK_SIGNING_FLAG_SIGN_OUTGOING 140 status.
signing = &signing_in[chan];
149 printf(
"Channel 0 sequence mismatch error at packet %u (rx_seq=%u)\n",
153 printf(
"Channel %u sequence mismatch error at packet %u (rx_seq=%u)\n",
159 printf(
"Incorrect message length %u for message %u - expected %u\n",
160 (
unsigned)last_msg.
len, (
unsigned)last_msg.
msgid,
166 printf(
"Parse error at packet %u\n",
chan_counts[chan]);
177 printf(
"Received %u messages on channel %u OK\n",
184 printf(
"No errors detected\n");
186 #ifdef MAVLINK_SIGNING_FLAG_SIGN_OUTGOING 189 printf(
"Testing signing\n");
192 memset(&signing, 0,
sizeof(signing));
193 memset(&signing_streams, 0,
sizeof(signing_streams));
205 printf(
"Received %u messages on channel %u OK\n",
212 printf(
"No errors detected\n");
215 #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 222 printf(
"Testing sending as MAVLink1\n");
226 printf(
"Received %u messages on channel %u OK\n",
233 printf(
"No errors detected\n");
struct __mavlink_signing_streams * signing_streams
global record of stream timestamps
uint8_t magic
sent at end of packet
unsigned int array_length
#define _MAV_RETURN_uint8_t(msg, wire_offset)
uint8_t msgid
ID of message in payload.
static const uint8_t message_lengths[]
#define mavlink_get_message_info(msg)
static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
static void print_field(mavlink_message_t *msg, const mavlink_field_info_t *f)
#define MAVLINK_MESSAGE_LENGTHS
mavlink_field_info_t fields[MAVLINK_MAX_FIELDS]
mavlink_message_type_t type
static void comm_send_ch(mavlink_channel_t chan, uint8_t c)
#define _MAV_RETURN_int8_t(msg, wire_offset)
#define PRINT_FORMAT(f, def)
#define _MAV_RETURN_char(msg, wire_offset)
uint16_t packet_rx_drop_count
Number of packet drops.
uint8_t flags
MAVLINK_SIGNING_FLAG_*.
#define MAVLINK_COMM_NUM_BUFFERS
static void print_one_field(mavlink_message_t *msg, const mavlink_field_info_t *f, int idx)
#define MAVLINK_STATUS_FLAG_OUT_MAVLINK1
uint8_t flags
MAVLINK_STATUS_FLAG_*.
#define mavlink_expected_message_length(msg)
MAVLINK_HELPER mavlink_status_t * mavlink_get_channel_status(uint8_t chan)
uint64_t timestamp
Timestamp, in microseconds since UNIX epoch GMT.
static mavlink_message_t last_msg
#define _MAV_PAYLOAD(msg)
uint8_t len
Length of payload.
uint8_t current_rx_seq
Sequence number of last packet received.
static unsigned error_count
uint8_t link_id
Same as MAVLINK_CHANNEL.
static mavlink_system_t mavlink_system
static const mavlink_message_info_t message_info[]
MAVLINK_HELPER uint8_t mavlink_parse_char(uint8_t chan, uint8_t c, mavlink_message_t *r_message, mavlink_status_t *r_mavlink_status)
static unsigned chan_counts[MAVLINK_COMM_NUM_BUFFERS]
#define MAVLINK_MESSAGE_INFO
#define MAVLINK_SIGNING_FLAG_SIGN_OUTGOING
Enable outgoing signing.
struct __mavlink_signing * signing
optional signing state
static void print_message(mavlink_message_t *msg)