VSM C++ SDK
Vehicle Specific Modules SDK
ugcs::vsm::Mavlink_stream< Mavlink_kind > Class Template 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< Mavlink_kind >:

Public Types

typedef std::shared_ptr< Mavlink_streamPtr
 Pointer type.
 
typedef std::weak_ptr< Mavlink_streamWeak_ptr
 Pointer type.
 
typedef Mavlink_decoder< Mavlink_kind > 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 Send_message (const mavlink::Payload_base &payload, typename Mavlink_kind::System_id 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_response_message (const mavlink::Payload_base &payload, typename Mavlink_kind::System_id system_id, uint8_t component_id, uint32_t request_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 Disable ()
 Disable the class. More...
 

Static Public Member Functions

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

Detailed Description

template<typename Mavlink_kind>
class ugcs::vsm::Mavlink_stream< Mavlink_kind >

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

template<typename Mavlink_kind >
typedef Mavlink_decoder<Mavlink_kind> ugcs::vsm::Mavlink_stream< Mavlink_kind >::Decoder

Type of the appropriate Mavlink decoder.

Constructor & Destructor Documentation

template<typename Mavlink_kind >
ugcs::vsm::Mavlink_stream< Mavlink_kind >::Mavlink_stream ( Io_stream::Ref  stream)
inline

Construct Mavlink stream using a I/O stream.

template<typename Mavlink_kind >
ugcs::vsm::Mavlink_stream< Mavlink_kind >::Mavlink_stream ( const Mavlink_stream< Mavlink_kind > &  )
delete

Disable copy constructor.

Member Function Documentation

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

Create an instance.

template<typename Mavlink_kind >
void ugcs::vsm::Mavlink_stream< Mavlink_kind >::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.

template<typename Mavlink_kind >
Decoder& ugcs::vsm::Mavlink_stream< Mavlink_kind >::Get_decoder ( )
inline

Get underlying decoder.

template<typename Mavlink_kind >
Mavlink_demuxer& ugcs::vsm::Mavlink_stream< Mavlink_kind >::Get_demuxer ( )
inline

Get underlying demuxer.

template<typename Mavlink_kind >
Io_stream::Ref& ugcs::vsm::Mavlink_stream< Mavlink_kind >::Get_stream ( )
inline

Get underlying I/O stream.

template<typename Mavlink_kind >
void ugcs::vsm::Mavlink_stream< Mavlink_kind >::Send_message ( const mavlink::Payload_base payload,
typename Mavlink_kind::System_id  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.

template<typename Mavlink_kind >
void ugcs::vsm::Mavlink_stream< Mavlink_kind >::Send_response_message ( const mavlink::Payload_base payload,
typename Mavlink_kind::System_id  system_id,
uint8_t  component_id,
uint32_t  request_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.


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