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

Convenience class for interpreting an I/O stream as a stream of Mavlink messages. More...

#include <mavlink_stream.h>

Inheritance diagram for ugcs::vsm::Mavlink_stream:

Public Types

typedef std::shared_ptr
< Mavlink_stream
Ptr
 Pointer type.
 
typedef std::weak_ptr
< Mavlink_stream
Weak_ptr
 Pointer type.
 
typedef Mavlink_decoder Decoder
 Type of the appropriate Mavlink decoder. More...
 

Public Member Functions

 Mavlink_stream (Io_stream::Ref stream)
 Construct Mavlink stream using a I/O stream. More...
 
 Mavlink_stream (const Mavlink_stream &)=delete
 Disable copy constructor. More...
 
Io_stream::RefGet_stream ()
 Get underlying I/O stream. More...
 
DecoderGet_decoder ()
 Get underlying decoder. More...
 
Mavlink_demuxerGet_demuxer ()
 Get underlying demuxer. More...
 
void Bind_decoder_demuxer ()
 Bind decoder and demuxer, so that output of the decoder is automatically passed to the demuxer.
 
void Set_mavlink_v2 (bool enable=true)
 Toggle mavlink protocol v1/v2 for outgoing messages. More...
 
bool Is_mavlink_v2 ()
 Return true if this stream supports mavlink2.
 
void Send_message (const mavlink::Payload_base &payload, uint8_t system_id, uint8_t component_id, const std::chrono::milliseconds &timeout, Operation_waiter::Timeout_handler timeout_handler, const Request_completion_context::Ptr &completion_ctx)
 Send Mavlink message to other end asynchronously. More...
 
void Send_message (const mavlink::Payload_base &payload, uint8_t system_id, uint8_t component_id, const std::chrono::milliseconds &timeout, Operation_waiter::Timeout_handler timeout_handler, const Request_completion_context::Ptr &completion_ctx, bool mav2)
 Send Mavlink message to other end asynchronously. More...
 
void Disable ()
 Disable the class. More...
 

Static Public Member Functions

template<typename... Args>
static Ptr Create (Args &&...args)
 Create an instance. More...
 

Detailed Description

Convenience class for interpreting an I/O stream as a stream of Mavlink messages.

It is assumed, that only one such class at a time is used with a given I/O stream.

Member Typedef Documentation

Type of the appropriate Mavlink decoder.

Constructor & Destructor Documentation

ugcs::vsm::Mavlink_stream::Mavlink_stream ( Io_stream::Ref  stream)
inline

Construct Mavlink stream using a I/O stream.

ugcs::vsm::Mavlink_stream::Mavlink_stream ( const Mavlink_stream )
delete

Disable copy constructor.

Member Function Documentation

template<typename... Args>
static Ptr ugcs::vsm::Mavlink_stream::Create ( Args &&...  args)
inlinestatic

Create an instance.

void ugcs::vsm::Mavlink_stream::Disable ( )
inline

Disable the class.

Underlying I/O stream is freed, but not explicitly closed, because this stream could be passed for further processing. Unfinished write operations are aborted.

Decoder& ugcs::vsm::Mavlink_stream::Get_decoder ( )
inline

Get underlying decoder.

Mavlink_demuxer& ugcs::vsm::Mavlink_stream::Get_demuxer ( )
inline

Get underlying demuxer.

Io_stream::Ref& ugcs::vsm::Mavlink_stream::Get_stream ( )
inline

Get underlying I/O stream.

void ugcs::vsm::Mavlink_stream::Send_message ( const mavlink::Payload_base payload,
uint8_t  system_id,
uint8_t  component_id,
const std::chrono::milliseconds &  timeout,
Operation_waiter::Timeout_handler  timeout_handler,
const Request_completion_context::Ptr completion_ctx 
)
inline

Send Mavlink message to other end asynchronously.

Timeout should be always present, otherwise there is a chance to overflow the write queue if underlying stream is write-blocked. Only non-temporal completion contexts are allowed.

void ugcs::vsm::Mavlink_stream::Send_message ( const mavlink::Payload_base payload,
uint8_t  system_id,
uint8_t  component_id,
const std::chrono::milliseconds &  timeout,
Operation_waiter::Timeout_handler  timeout_handler,
const Request_completion_context::Ptr completion_ctx,
bool  mav2 
)
inline

Send Mavlink message to other end asynchronously.

Timeout should be always present, otherwise there is a chance to overflow the write queue if underlying stream is write-blocked. Only non-temporal completion contexts are allowed.

void ugcs::vsm::Mavlink_stream::Set_mavlink_v2 ( bool  enable = true)
inline

Toggle mavlink protocol v1/v2 for outgoing messages.


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