Arduino Mavlink
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Functions
mavlink_types.h File Reference
#include <stdbool.h>
#include <stdint.h>
Include dependency graph for mavlink_types.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  __mavlink_field_info
 
struct  __mavlink_message_info
 
struct  __mavlink_status
 
struct  __mavlink_signing
 
struct  __mavlink_signing_streams
 
struct  __mavlink_signing_streams::__mavlink_signing_stream
 
struct  __mavlink_msg_entry
 

Macros

#define MAVPACKED(__Declaration__)   __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) )
 
#define MAVLINK_MAX_PAYLOAD_LEN   255
 Maximum payload length.
 
#define MAVLINK_CORE_HEADER_LEN   9
 Length of core header (of the comm. layer)
 
#define MAVLINK_CORE_HEADER_MAVLINK1_LEN   5
 Length of MAVLink1 core header (of the comm. layer)
 
#define MAVLINK_NUM_HEADER_BYTES   (MAVLINK_CORE_HEADER_LEN + 1)
 Length of all header bytes, including core and stx.
 
#define MAVLINK_NUM_CHECKSUM_BYTES   2
 
#define MAVLINK_NUM_NON_PAYLOAD_BYTES   (MAVLINK_NUM_HEADER_BYTES + MAVLINK_NUM_CHECKSUM_BYTES)
 
#define MAVLINK_SIGNATURE_BLOCK_LEN   13
 
#define MAVLINK_MAX_PACKET_LEN   (MAVLINK_MAX_PAYLOAD_LEN + MAVLINK_NUM_NON_PAYLOAD_BYTES + MAVLINK_SIGNATURE_BLOCK_LEN)
 Maximum packet length.
 
#define MAVLINK_MAX_FIELDS   64
 
#define _MAV_PAYLOAD(msg)   ((const char *)(&((msg)->payload64[0])))
 
#define _MAV_PAYLOAD_NON_CONST(msg)   ((char *)(&((msg)->payload64[0])))
 
#define mavlink_ck_a(msg)   *((msg)->len + (uint8_t *)_MAV_PAYLOAD_NON_CONST(msg))
 
#define mavlink_ck_b(msg)   *(((msg)->len+(uint16_t)1) + (uint8_t *)_MAV_PAYLOAD_NON_CONST(msg))
 
#define MAVLINK_COMM_NUM_BUFFERS   4
 
#define MAVLINK_STATUS_FLAG_IN_MAVLINK1   1
 
#define MAVLINK_STATUS_FLAG_OUT_MAVLINK1   2
 
#define MAVLINK_STATUS_FLAG_IN_SIGNED   4
 
#define MAVLINK_STATUS_FLAG_IN_BADSIG   8
 
#define MAVLINK_STX_MAVLINK1   0xFE
 
#define MAVLINK_SIGNING_FLAG_SIGN_OUTGOING   1
 Enable outgoing signing.
 
#define MAVLINK_MAX_SIGNING_STREAMS   16
 
#define MAVLINK_BIG_ENDIAN   0
 
#define MAVLINK_LITTLE_ENDIAN   1
 
#define MAV_MSG_ENTRY_FLAG_HAVE_TARGET_SYSTEM   1
 
#define MAV_MSG_ENTRY_FLAG_HAVE_TARGET_COMPONENT   2
 
#define MAVLINK_IFLAG_SIGNED   0x01
 
#define MAVLINK_IFLAG_MASK   0x01
 

Typedefs

typedef struct __mavlink_field_info mavlink_field_info_t
 
typedef struct __mavlink_message_info mavlink_message_info_t
 
typedef struct __mavlink_status mavlink_status_t
 
typedef bool(* mavlink_accept_unsigned_t) (const mavlink_status_t *status, uint32_t msgid)
 
typedef struct __mavlink_signing mavlink_signing_t
 
typedef struct __mavlink_signing_streams mavlink_signing_streams_t
 
typedef struct __mavlink_msg_entry mavlink_msg_entry_t
 

Enumerations

enum  mavlink_message_type_t {
  MAVLINK_TYPE_CHAR = 0 , MAVLINK_TYPE_UINT8_T = 1 , MAVLINK_TYPE_INT8_T = 2 , MAVLINK_TYPE_UINT16_T = 3 ,
  MAVLINK_TYPE_INT16_T = 4 , MAVLINK_TYPE_UINT32_T = 5 , MAVLINK_TYPE_INT32_T = 6 , MAVLINK_TYPE_UINT64_T = 7 ,
  MAVLINK_TYPE_INT64_T = 8 , MAVLINK_TYPE_FLOAT = 9 , MAVLINK_TYPE_DOUBLE = 10
}
 
enum  mavlink_channel_t { MAVLINK_COMM_0 , MAVLINK_COMM_1 , MAVLINK_COMM_2 , MAVLINK_COMM_3 }
 
enum  mavlink_parse_state_t {
  MAVLINK_PARSE_STATE_UNINIT =0 , MAVLINK_PARSE_STATE_IDLE , MAVLINK_PARSE_STATE_GOT_STX , MAVLINK_PARSE_STATE_GOT_LENGTH ,
  MAVLINK_PARSE_STATE_GOT_INCOMPAT_FLAGS , MAVLINK_PARSE_STATE_GOT_COMPAT_FLAGS , MAVLINK_PARSE_STATE_GOT_SEQ , MAVLINK_PARSE_STATE_GOT_SYSID ,
  MAVLINK_PARSE_STATE_GOT_COMPID , MAVLINK_PARSE_STATE_GOT_MSGID1 , MAVLINK_PARSE_STATE_GOT_MSGID2 , MAVLINK_PARSE_STATE_GOT_MSGID3 ,
  MAVLINK_PARSE_STATE_GOT_PAYLOAD , MAVLINK_PARSE_STATE_GOT_CRC1 , MAVLINK_PARSE_STATE_GOT_BAD_CRC1 , MAVLINK_PARSE_STATE_SIGNATURE_WAIT ,
  MAVLINK_PARSE_STATE_SIGNATURE_WAIT_BAD_CRC
}
 
enum  mavlink_framing_t { MAVLINK_FRAMING_INCOMPLETE =0 , MAVLINK_FRAMING_OK =1 , MAVLINK_FRAMING_BAD_CRC =2 , MAVLINK_FRAMING_BAD_SIGNATURE =3 }
 
enum  mavlink_signing_status_t {
  MAVLINK_SIGNING_STATUS_NONE =0 , MAVLINK_SIGNING_STATUS_OK =1 , MAVLINK_SIGNING_STATUS_BAD_SIGNATURE =2 , MAVLINK_SIGNING_STATUS_NO_STREAMS =3 ,
  MAVLINK_SIGNING_STATUS_TOO_MANY_STREAMS =4 , MAVLINK_SIGNING_STATUS_OLD_TIMESTAMP =5 , MAVLINK_SIGNING_STATUS_REPLAY =6
}
 

Functions

 __pragma (pack(push, 1)) typedef struct param_union
 
 __pragma (pack(pop)) mavlink_system_t
 incoming checksum bytes
 

Macro Definition Documentation

◆ _MAV_PAYLOAD

#define _MAV_PAYLOAD (   msg)    ((const char *)(&((msg)->payload64[0])))

◆ _MAV_PAYLOAD_NON_CONST

#define _MAV_PAYLOAD_NON_CONST (   msg)    ((char *)(&((msg)->payload64[0])))

◆ MAV_MSG_ENTRY_FLAG_HAVE_TARGET_COMPONENT

#define MAV_MSG_ENTRY_FLAG_HAVE_TARGET_COMPONENT   2

◆ MAV_MSG_ENTRY_FLAG_HAVE_TARGET_SYSTEM

#define MAV_MSG_ENTRY_FLAG_HAVE_TARGET_SYSTEM   1

◆ MAVLINK_BIG_ENDIAN

#define MAVLINK_BIG_ENDIAN   0

◆ mavlink_ck_a

#define mavlink_ck_a (   msg)    *((msg)->len + (uint8_t *)_MAV_PAYLOAD_NON_CONST(msg))

◆ mavlink_ck_b

#define mavlink_ck_b (   msg)    *(((msg)->len+(uint16_t)1) + (uint8_t *)_MAV_PAYLOAD_NON_CONST(msg))

◆ MAVLINK_COMM_NUM_BUFFERS

#define MAVLINK_COMM_NUM_BUFFERS   4

◆ MAVLINK_CORE_HEADER_LEN

#define MAVLINK_CORE_HEADER_LEN   9

Length of core header (of the comm. layer)

◆ MAVLINK_CORE_HEADER_MAVLINK1_LEN

#define MAVLINK_CORE_HEADER_MAVLINK1_LEN   5

Length of MAVLink1 core header (of the comm. layer)

◆ MAVLINK_IFLAG_MASK

#define MAVLINK_IFLAG_MASK   0x01

◆ MAVLINK_IFLAG_SIGNED

#define MAVLINK_IFLAG_SIGNED   0x01

◆ MAVLINK_LITTLE_ENDIAN

#define MAVLINK_LITTLE_ENDIAN   1

◆ MAVLINK_MAX_FIELDS

#define MAVLINK_MAX_FIELDS   64

◆ MAVLINK_MAX_PACKET_LEN

Maximum packet length.

◆ MAVLINK_MAX_PAYLOAD_LEN

#define MAVLINK_MAX_PAYLOAD_LEN   255

Maximum payload length.

◆ MAVLINK_MAX_SIGNING_STREAMS

#define MAVLINK_MAX_SIGNING_STREAMS   16

◆ MAVLINK_NUM_CHECKSUM_BYTES

#define MAVLINK_NUM_CHECKSUM_BYTES   2

◆ MAVLINK_NUM_HEADER_BYTES

#define MAVLINK_NUM_HEADER_BYTES   (MAVLINK_CORE_HEADER_LEN + 1)

Length of all header bytes, including core and stx.

◆ MAVLINK_NUM_NON_PAYLOAD_BYTES

#define MAVLINK_NUM_NON_PAYLOAD_BYTES   (MAVLINK_NUM_HEADER_BYTES + MAVLINK_NUM_CHECKSUM_BYTES)

◆ MAVLINK_SIGNATURE_BLOCK_LEN

#define MAVLINK_SIGNATURE_BLOCK_LEN   13

◆ MAVLINK_SIGNING_FLAG_SIGN_OUTGOING

#define MAVLINK_SIGNING_FLAG_SIGN_OUTGOING   1

Enable outgoing signing.

◆ MAVLINK_STATUS_FLAG_IN_BADSIG

#define MAVLINK_STATUS_FLAG_IN_BADSIG   8

◆ MAVLINK_STATUS_FLAG_IN_MAVLINK1

#define MAVLINK_STATUS_FLAG_IN_MAVLINK1   1

◆ MAVLINK_STATUS_FLAG_IN_SIGNED

#define MAVLINK_STATUS_FLAG_IN_SIGNED   4

◆ MAVLINK_STATUS_FLAG_OUT_MAVLINK1

#define MAVLINK_STATUS_FLAG_OUT_MAVLINK1   2

◆ MAVLINK_STX_MAVLINK1

#define MAVLINK_STX_MAVLINK1   0xFE

◆ MAVPACKED

#define MAVPACKED (   __Declaration__)    __pragma( pack(push, 1) ) __Declaration__ __pragma( pack(pop) )

Typedef Documentation

◆ mavlink_accept_unsigned_t

typedef bool(* mavlink_accept_unsigned_t) (const mavlink_status_t *status, uint32_t msgid)

◆ mavlink_field_info_t

◆ mavlink_message_info_t

◆ mavlink_msg_entry_t

◆ mavlink_signing_streams_t

◆ mavlink_signing_t

◆ mavlink_status_t

Enumeration Type Documentation

◆ mavlink_channel_t

Enumerator
MAVLINK_COMM_0 
MAVLINK_COMM_1 
MAVLINK_COMM_2 
MAVLINK_COMM_3 

◆ mavlink_framing_t

Enumerator
MAVLINK_FRAMING_INCOMPLETE 
MAVLINK_FRAMING_OK 
MAVLINK_FRAMING_BAD_CRC 
MAVLINK_FRAMING_BAD_SIGNATURE 

◆ mavlink_message_type_t

Enumerator
MAVLINK_TYPE_CHAR 
MAVLINK_TYPE_UINT8_T 
MAVLINK_TYPE_INT8_T 
MAVLINK_TYPE_UINT16_T 
MAVLINK_TYPE_INT16_T 
MAVLINK_TYPE_UINT32_T 
MAVLINK_TYPE_INT32_T 
MAVLINK_TYPE_UINT64_T 
MAVLINK_TYPE_INT64_T 
MAVLINK_TYPE_FLOAT 
MAVLINK_TYPE_DOUBLE 

◆ mavlink_parse_state_t

Enumerator
MAVLINK_PARSE_STATE_UNINIT 
MAVLINK_PARSE_STATE_IDLE 
MAVLINK_PARSE_STATE_GOT_STX 
MAVLINK_PARSE_STATE_GOT_LENGTH 
MAVLINK_PARSE_STATE_GOT_INCOMPAT_FLAGS 
MAVLINK_PARSE_STATE_GOT_COMPAT_FLAGS 
MAVLINK_PARSE_STATE_GOT_SEQ 
MAVLINK_PARSE_STATE_GOT_SYSID 
MAVLINK_PARSE_STATE_GOT_COMPID 
MAVLINK_PARSE_STATE_GOT_MSGID1 
MAVLINK_PARSE_STATE_GOT_MSGID2 
MAVLINK_PARSE_STATE_GOT_MSGID3 
MAVLINK_PARSE_STATE_GOT_PAYLOAD 
MAVLINK_PARSE_STATE_GOT_CRC1 
MAVLINK_PARSE_STATE_GOT_BAD_CRC1 
MAVLINK_PARSE_STATE_SIGNATURE_WAIT 
MAVLINK_PARSE_STATE_SIGNATURE_WAIT_BAD_CRC 

◆ mavlink_signing_status_t

Enumerator
MAVLINK_SIGNING_STATUS_NONE 
MAVLINK_SIGNING_STATUS_OK 
MAVLINK_SIGNING_STATUS_BAD_SIGNATURE 
MAVLINK_SIGNING_STATUS_NO_STREAMS 
MAVLINK_SIGNING_STATUS_TOO_MANY_STREAMS 
MAVLINK_SIGNING_STATUS_OLD_TIMESTAMP 
MAVLINK_SIGNING_STATUS_REPLAY 

Function Documentation

◆ __pragma() [1/2]

__pragma ( pack(pop)  )

incoming checksum bytes

sent at end of packet protocol magic marker Length of payload flags that must be understood flags that can be ignored if not understood Sequence of packet ID of message sender system/aircraft ID of the message sender component ID of message in payload

◆ __pragma() [2/2]

__pragma ( pack(push, 1)  )

Old-style 4 byte param union

This struct is the data format to be used when sending parameters. The parameter should be copied to the native type (without type conversion) and re-instanted on the receiving side using the native type as well.

New-style 8 byte param union mavlink_param_union_double_t will be 8 bytes long, and treated as needing 8 byte alignment for the purposes of MAVLink 1.0 field ordering. The mavlink_param_union_double_t will be treated as a little-endian structure.

If is_double is 1 then the type is a double, and the remaining 63 bits are the double, with the lowest bit of the mantissa zero. The intention is that by replacing the is_double bit with 0 the type can be directly used as a double (as the is_double bit corresponds to the lowest mantissa bit of a double). If is_double is 0 then mavlink_type gives the type in the union. The mavlink_types.h header will also need to have shifts/masks to define the bit boundaries in the above, as bitfield ordering isn't consistent between platforms. The above is intended to be for gcc on x86, which should be the same as gcc on little-endian arm. When using shifts/masks the value will be treated as a 64 bit unsigned number, and the bits pulled out using the shifts/masks.

This structure is required to make the mavlink_send_xxx convenience functions work, as it tells the library what the current system and component ID are. < Used by the MAVLink message_xx_send() convenience function Used by the MAVLink message_xx_send() convenience function