Class MAVConnTCPClient
Defined in File tcp.hpp
Inheritance Relationships
Base Types
public mavconn::MAVConnInterface
(Class MAVConnInterface)public std::enable_shared_from_this< MAVConnTCPClient >
Class Documentation
-
class MAVConnTCPClient : public mavconn::MAVConnInterface, public std::enable_shared_from_this<MAVConnTCPClient>
TCP client interface.
Note
IPv4 only
Public Functions
-
MAVConnTCPClient(uint8_t system_id = 1, uint8_t component_id = MAV_COMP_ID_UDP_BRIDGE, std::string server_host = DEFAULT_SERVER_HOST, uint16_t server_port = DEFAULT_SERVER_PORT)
Create generic TCP client (connect to the server)
- Parameters:
[id] – server_addr remote host
[id] – server_port remote port
-
explicit MAVConnTCPClient(uint8_t system_id, uint8_t component_id, asio::io_service &server_io)
Special client variation for use in MAVConnTCPServer
-
virtual ~MAVConnTCPClient()
-
virtual void connect(const ReceivedCb &cb_handle_message, const ClosedCb &cb_handle_closed_port = ClosedCb()) override
Establish connection, automatically called by open_url()
-
virtual void close() override
Close connection.
-
virtual void send_message(const mavlink::mavlink_message_t *message) override
Send message (mavlink_message_t)
Can be used to forward messages from other connection channel.
Note
Does not do finalization!
- Throws:
std::length_error – On exceeding Tx queue limit (MAX_TXQ_SIZE)
- Parameters:
*message – [in] not changed
-
virtual void send_message(const mavlink::Message &message, const uint8_t source_compid) override
Send message (child of mavlink::Message)
Does serialization inside. System ID = from this object. Component ID passed by argument.
- Throws:
std::length_error – On exceeding Tx queue limit (MAX_TXQ_SIZE)
- Parameters:
&message – [in] not changed
src_compid – [in] sets the component ID of the message source
-
virtual void send_bytes(const uint8_t *bytes, size_t length) override
Send raw bytes (for some quirks)
- Throws:
std::length_error – On exceeding Tx queue limit (MAX_TXQ_SIZE)
-
inline virtual bool is_open() override
-
MAVConnTCPClient(uint8_t system_id = 1, uint8_t component_id = MAV_COMP_ID_UDP_BRIDGE, std::string server_host = DEFAULT_SERVER_HOST, uint16_t server_port = DEFAULT_SERVER_PORT)