VSM C++ SDK
Vehicle Specific Modules SDK
mavlink.h File Reference

MAVLink protocol messages. More...

#include <ugcs/vsm/endian.h>
#include <ugcs/vsm/io_buffer.h>
#include <cstring>
#include <map>
#include <cmath>
#include <ugcs/vsm/auto_mavlink_enums.h>
#include <ugcs/vsm/auto_mavlink_messages.h>

Go to the source code of this file.

Classes

struct  ugcs::vsm::mavlink::Field_default_value< T, class >
 Default value for a Mavlink field. More...
 
struct  ugcs::vsm::mavlink::Field_default_value< T, typename std::enable_if< std::is_integral< T >::value >::type >
 Partial specialization for integer types. More...
 
struct  ugcs::vsm::mavlink::Field_default_value< T, typename std::enable_if< std::is_floating_point< T >::value >::type >
 Partial specialization for floating point types. More...
 
class  ugcs::vsm::mavlink::Value< T, id, initial_value >
 Field value in MAVLink message. More...
 
class  ugcs::vsm::mavlink::Value_array< TValue, size >
 Field in MAVLink message which is array of MAVLink values. More...
 
class  ugcs::vsm::mavlink::Value_array< Char, size >
 Partial specialization for characters array so it can be conveniently used with string semantic. More...
 
struct  ugcs::vsm::mavlink::internal::Field_descriptor
 Descriptor field in a MAVLink message. More...
 
struct  ugcs::vsm::mavlink::Mavlink_kind_standard
 Standard kind of Mavlink protocol. More...
 
struct  ugcs::vsm::mavlink::Mavlink_kind_ugcs
 UgCS flavor of Mavlink protocol. More...
 
class  ugcs::vsm::mavlink::Extension
 This class defines properties of particular protocol extension. More...
 
class  ugcs::vsm::mavlink::Payload_base
 Base class for MAVLink message payloads. More...
 
class  ugcs::vsm::mavlink::Payload< TData, fields, msg_name, msg_id, extra_byte >
 Generalized MAVLink message payload. More...
 
struct  ugcs::vsm::mavlink::Payload_type_mapper< message_id, Extension_type >
 Helper for static (compile time) mapping from Mavlink message ID to corresponding payload type. More...
 
class  ugcs::vsm::mavlink::Message< message_id, Extension_type >
 Specific Mavlink message with sender information from the header. More...
 
class  ugcs::vsm::mavlink::Checksum
 Mavlink compatible checksum (ITU X.25/SAE AS-4 hash) calculation class. More...
 
struct  ugcs::vsm::mavlink::Checksum::Exception_dummy_struct
 Base class for exceptions thrown by this class. More...
 
struct  ugcs::vsm::mavlink::Checksum::Invalid_id_exception_dummy_struct
 Exception for unknown message ID. More...
 
struct  ugcs::vsm::mavlink::Header< Mavlink_kind >
 Fixed Mavlink header. More...
 

Namespaces

 ugcs
 UGCS root namespace.
 
 ugcs::vsm
 All VSM SDK functionality resides in this namespace.
 
 

Typedefs

typedef std::pair< uint8_t, uint16_t > ugcs::vsm::mavlink::Extra_byte_length_pair
 A pair of values representing CRC extra byte and length of the Mavlink message payload. More...
 
typedef uint8_t ugcs::vsm::mavlink::MESSAGE_ID_TYPE
 Message id implementation type capable to hold a message id value from any extension (i.e. More...
 
typedef uint32_t ugcs::vsm::mavlink::System_id_common
 Common type for Mavlink system id which is able to hold system id values from any kind of Mavlink, currently Mavlink_kind_standard, Mavlink_kind_ugcs.
 
typedef Value< int8_t, CHAR > ugcs::vsm::mavlink::Char
 Value containers for all MAVLink types. More...
 
typedef Value< int8_t, INT8 > ugcs::vsm::mavlink::Int8
 
typedef Value< uint8_t, UINT8 > ugcs::vsm::mavlink::Uint8
 
typedef Value< int16_t, INT16 > ugcs::vsm::mavlink::Int16
 
typedef Value< uint16_t, UINT16 > ugcs::vsm::mavlink::Uint16
 
typedef Value< int32_t, INT32 > ugcs::vsm::mavlink::Int32
 
typedef Value< uint32_t, UINT32 > ugcs::vsm::mavlink::Uint32
 
typedef Value< int64_t, INT64 > ugcs::vsm::mavlink::Int64
 
typedef Value< uint64_t, UINT64 > ugcs::vsm::mavlink::Uint64
 
typedef Value< float, FLOAT > ugcs::vsm::mavlink::Float
 
typedef Value< double, DOUBLE > ugcs::vsm::mavlink::Double
 
typedef Value< uint8_t, UINT8_VERSION, VERSION > ugcs::vsm::mavlink::Uint8_version
 

Enumerations

enum  { ugcs::vsm::mavlink::VERSION = 3, ugcs::vsm::mavlink::START_SIGN = 0xfe, ugcs::vsm::mavlink::SYSTEM_ID_NONE = 0, ugcs::vsm::mavlink::MAX_MAVLINK_PACKET_SIZE = 263 }
 
enum  ugcs::vsm::mavlink::Field_type_id {
  ugcs::vsm::mavlink::NONE, CHAR, INT8, UINT8,
  INT16, UINT16, INT32, UINT32,
  INT64, UINT64, FLOAT, DOUBLE,
  UINT8_VERSION, ugcs::vsm::mavlink::FIELD_TYPE_MAX
}
 ID for field type in MAVLink message. More...
 

Functions

 Value (T value=initial_value)
 Construct value. More...
 
Valueoperator= (T value)
 Assign new value. More...
 
 operator T () const
 Cast to underlying type. More...
 
Get () const
 Get the value of underlying type. More...
 
constexpr Field_type_id Get_type_id ()
 Get type ID for this value. More...
 
void Reset ()
 Reset to default value used in UgCS as a "not present" indication. More...
 
bool Is_reset () const
 Check, if the field is reset. More...
 
TValue & operator[] (size_t index)
 Access operator. More...
 
size_t Get_length () const
 Get string length. More...
 
std::string Get_string () const
 Get string value for the characters array. More...
 
bool operator== (const char *str)
 Compare with string. More...
 
bool operator!= (const char *str)
 Compare with string. More...
 
Value_array & operator= (const char *str)
 Assign string to the characters array. More...
 
Value_array & operator= (const std::string &str)
 Assign string to the characters array. More...
 

Variables

Uint8 start_sign
 Packet start signature, should have ugcs::vsm::mavlink::START_SIGN value. More...
 
Uint8 payload_len
 Size of payload which follows this header. More...
 
Uint8 seq
 Sequence number for the message. More...
 
Mavlink_kind::System_id_wire system_id
 Sender system ID. More...
 
Uint8 component_id
 Sender component ID. More...
 
Uint8 message_id
 Type ID for the payload which follows this header. More...
 

Detailed Description

MAVLink protocol messages.

Function Documentation

T __attribute__::Get ( ) const

Get the value of underlying type.

Returns
Value in host byte order.
size_t __attribute__::Get_length ( ) const

Get string length.

In MAVLink character string may be NULL terminated or may not be if it fully occupies the array.

Returns
String length in bytes.
std::string __attribute__::Get_string ( ) const

Get string value for the characters array.

constexpr Field_type_id __attribute__::Get_type_id ( )

Get type ID for this value.

bool __attribute__::Is_reset ( ) const

Check, if the field is reset.

__attribute__::operator T ( ) const

Cast to underlying type.

Returns
Value in host byte order.
bool __attribute__::operator!= ( const char *  str)

Compare with string.

Value& __attribute__::operator= ( value)

Assign new value.

Parameters
valueValue in host byte order.
Value_array& __attribute__::operator= ( const char *  str)

Assign string to the characters array.

In case the string exceeds the array size it is truncated without terminated NULL character (as per MAVLink strings description).

Parameters
strString to assign.
Value_array& __attribute__::operator= ( const std::string &  str)

Assign string to the characters array.

In case the string exceeds the array size it is truncated without terminated NULL character (as per MAVLink strings description).

Parameters
strString to assign.
bool __attribute__::operator== ( const char *  str)

Compare with string.

Char & operator[] ( size_t  index)

Access operator.

void Reset ( )

Reset to default value used in UgCS as a "not present" indication.

Reset all array values to UgCS default values (zeros for string).

Reset all array values to UgCS default values.

__attribute__::Value ( value = initial_value)

Construct value.

Parameters
valueValue in host byte order.

Variable Documentation

Uint8 component_id

Sender component ID.

Uint8 message_id

Type ID for the payload which follows this header.

Uint8 payload_len

Size of payload which follows this header.

Uint8 seq

Sequence number for the message.

Uint8 start_sign

Packet start signature, should have ugcs::vsm::mavlink::START_SIGN value.

Mavlink_kind::System_id_wire system_id

Sender system ID.