MIP_SDK
v3.0.0
MicroStrain Communications Library for embedded systems
|
Go to the documentation of this file.
3 #include "../connection.hpp"
24 static constexpr
auto TYPE =
"TCP";
33 bool sendToDevice(
const uint8_t* data,
size_t length)
override;
41 host_name = mHostname;
47 std::string mHostname;
51 const char*
interfaceName()
const override {
return mHostname.c_str(); }
52 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:59
bool sendToDevice(const uint8_t *data, size_t length) override
Sends bytes to the device.
Definition: tcp_connection.cpp:69
uint32_t parameter() const override
Definition: tcp_connection.hpp:52
bool isConnected() const override
Check if the socket is connected.
Definition: tcp_connection.cpp:34
bool disconnect() override
Disconnect from the socket.
Definition: tcp_connection.cpp:50
TcpConnection(const std::string &hostname, uint16_t port)
Creates a TcpConnection that will communicate with a device over TCP.
Definition: tcp_connection.cpp:17
void connectionInfo(std::string &host_name, uint32_t &port) const
Definition: tcp_connection.hpp:39
bool connect() override
Connect to the socket.
Definition: tcp_connection.cpp:40
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
~TcpConnection()
Closes the underlying TCP socket.
Definition: tcp_connection.cpp:27
Definition: tcp_socket.h:35
const char * interfaceName() const override
Definition: tcp_connection.hpp:51
C::microstrain_embedded_timestamp EmbeddedTimestamp
Definition: embedded_time.hpp:9
Represents a type of connection.
Definition: connection.hpp:25
static constexpr auto TYPE
Definition: tcp_connection.hpp:24
Definition: embedded_time.h:8