MIP_SDK
latest-2-g34f3e39
MicroStrain Communications Library for embedded systems
|
Go to the documentation of this file.
24 static constexpr
const char*
TYPE =
"TCP";
34 bool sendToDevice(
const uint8_t* data,
size_t length)
override;
42 host_name = mHostname;
48 std::string mHostname;
52 const char*
interfaceName()
const override {
return mHostname.c_str(); }
53 uint32_t
parameter()
const override {
return mPort; }
bool recvFromDevice(uint8_t *buffer, size_t max_length, unsigned int wait_time_ms, size_t *length_out, EmbeddedTimestamp *timestamp_out) override
Receives bytes from the device.
Definition: tcp_connection.cpp:67
bool sendToDevice(const uint8_t *data, size_t length) override
Sends bytes to the device.
Definition: tcp_connection.cpp:77
uint32_t parameter() const override
Definition: tcp_connection.hpp:53
static constexpr const char * TYPE
Definition: tcp_connection.hpp:24
bool isConnected() const override
Check if the socket is connected.
Definition: tcp_connection.cpp:39
bool disconnect() override
Disconnect from the socket.
Definition: tcp_connection.cpp:58
void connectionInfo(std::string &host_name, uint32_t &port) const
Definition: tcp_connection.hpp:40
bool connect() override
Connect to the socket.
Definition: tcp_connection.cpp:47
TcpConnection & operator=(const TcpConnection &)=delete
Can be used on Windows, OSX, or linux to communicate with a MIP device over TCP.
Definition: tcp_connection.hpp:21
Definition: tcp_socket.h:35
const char * interfaceName() const override
Definition: tcp_connection.hpp:52
C::microstrain_embedded_timestamp EmbeddedTimestamp
Definition: embedded_time.hpp:9
Represents a type of connection.
Definition: connection.hpp:24
~TcpConnection() override
Closes the underlying TCP socket.
Definition: tcp_connection.cpp:30
Definition: embedded_time.h:8