1 #ifndef MAVLINK_TYPES_H_
2 #define MAVLINK_TYPES_H_
5 #if (defined _MSC_VER) && (_MSC_VER < 1800)
13 #define PACKED( __Declaration__ ) __Declaration__ __attribute__((packed))
15 #define PACKED( __Declaration__ ) __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) )
18 #ifndef MAVLINK_MAX_PAYLOAD_LEN
20 #define MAVLINK_MAX_PAYLOAD_LEN 255
23 #define MAVLINK_CORE_HEADER_LEN 5
24 #define MAVLINK_NUM_HEADER_BYTES (MAVLINK_CORE_HEADER_LEN + 1)
25 #define MAVLINK_NUM_CHECKSUM_BYTES 2
26 #define MAVLINK_NUM_NON_PAYLOAD_BYTES (MAVLINK_NUM_HEADER_BYTES + MAVLINK_NUM_CHECKSUM_BYTES)
28 #define MAVLINK_MAX_PACKET_LEN (MAVLINK_MAX_PAYLOAD_LEN + MAVLINK_NUM_NON_PAYLOAD_BYTES)
30 #define MAVLINK_MSG_ID_EXTENDED_MESSAGE 255
31 #define MAVLINK_EXTENDED_HEADER_LEN 14
33 #if (defined _MSC_VER) || ((defined __APPLE__) && (defined __MACH__)) || (defined __linux__)
35 #define MAVLINK_MAX_EXTENDED_PACKET_LEN 65507
38 #define MAVLINK_MAX_EXTENDED_PACKET_LEN 2048
41 #define MAVLINK_MAX_EXTENDED_PAYLOAD_LEN (MAVLINK_MAX_EXTENDED_PACKET_LEN - MAVLINK_EXTENDED_HEADER_LEN - MAVLINK_NUM_NON_PAYLOAD_BYTES)
54 typedef struct param_union {
58 uint32_t param_uint32;
60 uint16_t param_uint16;
66 }) mavlink_param_union_t;
86 uint8_t mavlink_type:7;
100 }) mavlink_param_union_double_t;
103 typedef struct __mavlink_system {
113 typedef struct __mavlink_message {
121 uint64_t payload64[(MAVLINK_MAX_PAYLOAD_LEN+MAVLINK_NUM_CHECKSUM_BYTES+7)/8];
122 }) mavlink_message_t;
125 typedef struct __mavlink_extended_message {
126 mavlink_message_t base_msg;
127 int32_t extended_payload_len;
128 uint8_t extended_payload[MAVLINK_MAX_EXTENDED_PAYLOAD_LEN];
129 }) mavlink_extended_message_t;
132 MAVLINK_TYPE_CHAR = 0,
133 MAVLINK_TYPE_UINT8_T = 1,
134 MAVLINK_TYPE_INT8_T = 2,
135 MAVLINK_TYPE_UINT16_T = 3,
136 MAVLINK_TYPE_INT16_T = 4,
137 MAVLINK_TYPE_UINT32_T = 5,
138 MAVLINK_TYPE_INT32_T = 6,
139 MAVLINK_TYPE_UINT64_T = 7,
140 MAVLINK_TYPE_INT64_T = 8,
141 MAVLINK_TYPE_FLOAT = 9,
142 MAVLINK_TYPE_DOUBLE = 10
143 } mavlink_message_type_t;
145 #define MAVLINK_MAX_FIELDS 64
149 const char *print_format;
150 mavlink_message_type_t type;
151 unsigned int array_length;
152 unsigned int wire_offset;
153 unsigned int structure_offset;
164 #define _MAV_PAYLOAD(msg) ((const char *)(&((msg)->payload64[0])))
165 #define _MAV_PAYLOAD_NON_CONST(msg) ((char *)(&((msg)->payload64[0])))
168 #define mavlink_ck_a(msg) *((msg)->len + (uint8_t *)_MAV_PAYLOAD_NON_CONST(msg))
169 #define mavlink_ck_b(msg) *(((msg)->len+(uint16_t)1) + (uint8_t *)_MAV_PAYLOAD_NON_CONST(msg))
183 #ifndef MAVLINK_COMM_NUM_BUFFERS
184 #if (defined linux) | (defined __linux) | (defined __MACH__) | (defined _WIN32)
185 # define MAVLINK_COMM_NUM_BUFFERS 16
187 # define MAVLINK_COMM_NUM_BUFFERS 4
192 MAVLINK_PARSE_STATE_UNINIT=0,
193 MAVLINK_PARSE_STATE_IDLE,
194 MAVLINK_PARSE_STATE_GOT_STX,
195 MAVLINK_PARSE_STATE_GOT_SEQ,
196 MAVLINK_PARSE_STATE_GOT_LENGTH,
197 MAVLINK_PARSE_STATE_GOT_SYSID,
198 MAVLINK_PARSE_STATE_GOT_COMPID,
199 MAVLINK_PARSE_STATE_GOT_MSGID,
200 MAVLINK_PARSE_STATE_GOT_PAYLOAD,
201 MAVLINK_PARSE_STATE_GOT_CRC1
202 } mavlink_parse_state_t;
216 #define MAVLINK_BIG_ENDIAN 0
217 #define MAVLINK_LITTLE_ENDIAN 1
Definition: mavlink_types.h:204
Definition: mavlink_types.h:147
uint8_t msg_received
Number of received messages.
Definition: mavlink_types.h:205
mavlink_parse_state_t parse_state
Parsing state machine.
Definition: mavlink_types.h:208
uint8_t parse_error
Number of parse errors.
Definition: mavlink_types.h:207
uint16_t packet_rx_drop_count
Number of packet drops.
Definition: mavlink_types.h:213
Definition: mavlink_types.h:158
uint16_t packet_rx_success_count
Received packets.
Definition: mavlink_types.h:212
uint8_t packet_idx
Index in current packet.
Definition: mavlink_types.h:209
uint8_t current_rx_seq
Sequence number of last packet received.
Definition: mavlink_types.h:210
uint8_t buffer_overrun
Number of buffer overruns.
Definition: mavlink_types.h:206
uint8_t current_tx_seq
Sequence number of last packet sent.
Definition: mavlink_types.h:211