VSM C++ SDK
Vehicle Specific Modules SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ugcs::vsm::Mavlink_demuxer Class Reference

Mavlink message demultiplexer based on message, system and component identifiers. More...

#include <mavlink_demuxer.h>

Classes

class  Hasher
 Hasher class for a key type. More...
 

Public Types

typedef signed Message_id
 Helper type for Mavlink message id which is able to hold special values.
 
typedef int64_t System_id
 Helper type for Mavlink system id which is able to hold special values.
 
typedef signed Component_id
 Helper type for Mavlink component id which is able to hold special values.
 
template<mavlink::MESSAGE_ID_TYPE message_id, class Extention_type = mavlink::Extension>
using Handler = Callback_proxy< void, typename mavlink::Message< message_id, Extention_type >::Ptr >
 Handler type for the specific demultiplexed Mavlink message. More...
 
typedef Callback_proxy< bool,
Io_buffer::Ptr,
mavlink::MESSAGE_ID_TYPE,
System_id, uint8_t, uint32_t > 
Default_handler
 Default handler which is called for all Mavlink messages which does not have a handler. More...
 

Public Member Functions

 VSM_DEFINE_EXCEPTION (Duplicate_handler)
 Thrown when handler with a given filtering criteria is already registered. More...
 
template<class __Callable , typename... __Args>
 __DEFINE_CALLBACK_BUILDER_BODY (Make_default_handler,(Io_buffer::Ptr, mavlink::MESSAGE_ID_TYPE, System_id, uint8_t, uint32_t),(Io_buffer::Ptr(nullptr), mavlink::MESSAGE_ID::DEBUG_VALUE, mavlink::SYSTEM_ID_NONE, 0, 0)) template< mavlink
 Convenience builder for Mavlink demuxer default handlers. More...
 
 Key ()
 Construct empty key. More...
 
void Reset ()
 Invalidate key. More...
 
 operator bool () const
 Check for key validness. More...
 
bool operator== (const Key &key) const
 Equality operator. More...
 

Static Public Attributes

static constexpr Message_id MESSAGE_ID_ANY = -1
 Special value representing any Mavlink message id. More...
 
static constexpr System_id SYSTEM_ID_ANY = -1
 Special value representing any Mavlink system id. More...
 
static constexpr Component_id COMPONENT_ID_ANY = -1
 Special value representing any Mavlink component id. More...
 

Friends

class Mavlink_demuxer
 

Detailed Description

Mavlink message demultiplexer based on message, system and component identifiers.

Supposed to be conveniently used with Mavlink_decoder. Messages from different mavlink extensions but with same identifiers can not be demultiplexed simultaneously.

Member Typedef Documentation

Default handler which is called for all Mavlink messages which does not have a handler.

Io_buffer contains the raw payload data.

Returns
true message will be resubmitted to demuxer for further processing, otherwise false.
template<mavlink::MESSAGE_ID_TYPE message_id, class Extention_type = mavlink::Extension>
using ugcs::vsm::Mavlink_demuxer::Handler = Callback_proxy< void, typename mavlink::Message<message_id, Extention_type>::Ptr>

Handler type for the specific demultiplexed Mavlink message.

Member Function Documentation

template<class __Callable , typename... __Args>
ugcs::vsm::Mavlink_demuxer::__DEFINE_CALLBACK_BUILDER_BODY ( Make_default_handler  ,
(Io_buffer::Ptr, mavlink::MESSAGE_ID_TYPE, System_id, uint8_t, uint32_t)  ,
(Io_buffer::Ptr(nullptr), mavlink::MESSAGE_ID::DEBUG_VALUE, mavlink::SYSTEM_ID_NONE, 0, 0)   
)
inline

Convenience builder for Mavlink demuxer default handlers.

Convenience builder for Mavlink demuxer handlers. Mavlink message handler key. Extention type is not taken into account. Construct non-empty key.

ugcs::vsm::Mavlink_demuxer::Key ( )
inline

Construct empty key.

ugcs::vsm::Mavlink_demuxer::operator bool ( ) const
inlineexplicit

Check for key validness.

bool ugcs::vsm::Mavlink_demuxer::operator== ( const Key key) const
inline

Equality operator.

void ugcs::vsm::Mavlink_demuxer::Reset ( )
inline

Invalidate key.

ugcs::vsm::Mavlink_demuxer::VSM_DEFINE_EXCEPTION ( Duplicate_handler  )

Thrown when handler with a given filtering criteria is already registered.

Member Data Documentation

constexpr Component_id ugcs::vsm::Mavlink_demuxer::COMPONENT_ID_ANY = -1
static

Special value representing any Mavlink component id.

constexpr Message_id ugcs::vsm::Mavlink_demuxer::MESSAGE_ID_ANY = -1
static

Special value representing any Mavlink message id.

constexpr System_id ugcs::vsm::Mavlink_demuxer::SYSTEM_ID_ANY = -1
static

Special value representing any Mavlink system id.


The documentation for this class was generated from the following file: