![]() |
VSM C++ SDK
Vehicle Specific Modules SDK
|
Convenience class for interpreting an I/O stream as a stream of Mavlink messages. More...
#include <mavlink_stream.h>
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::Ref & | Get_stream () |
Get underlying I/O stream. More... | |
Decoder & | Get_decoder () |
Get underlying decoder. More... | |
Mavlink_demuxer & | Get_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... | |
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.
Type of the appropriate Mavlink decoder.
|
inline |
Construct Mavlink stream using a I/O stream.
|
delete |
Disable copy constructor.
|
inlinestatic |
Create an instance.
|
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.
|
inline |
Get underlying decoder.
|
inline |
Get underlying demuxer.
|
inline |
Get underlying I/O stream.
|
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.
|
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.
|
inline |
Toggle mavlink protocol v1/v2 for outgoing messages.