Can be used on Windows, OSX, or linux to communicate with a MIP device over TCP.
More...
#include <tcp_connection.hpp>
|
static constexpr const char * | TYPE = "TCP" |
|
static constexpr const char * | TYPE = "None" |
|
Can be used on Windows, OSX, or linux to communicate with a MIP device over TCP.
◆ TcpConnection() [1/3]
microstrain::connections::TcpConnection::TcpConnection |
( |
| ) |
|
|
default |
◆ TcpConnection() [2/3]
microstrain::connections::TcpConnection::TcpConnection |
( |
const std::string & |
hostname, |
|
|
uint16_t |
port |
|
) |
| |
Creates a TcpConnection that will communicate with a device over TCP.
- Parameters
-
hostname | Host name or IP address to connect to |
port | Port on hostName to connect to |
◆ ~TcpConnection()
microstrain::connections::TcpConnection::~TcpConnection |
( |
| ) |
|
|
override |
Closes the underlying TCP socket.
◆ TcpConnection() [3/3]
microstrain::connections::TcpConnection::TcpConnection |
( |
const TcpConnection & |
| ) |
|
|
delete |
◆ connect()
bool microstrain::connections::TcpConnection::connect |
( |
| ) |
|
|
overridevirtual |
◆ connectionInfo()
void microstrain::connections::TcpConnection::connectionInfo |
( |
std::string & |
host_name, |
|
|
uint32_t & |
port |
|
) |
| const |
|
inline |
◆ disconnect()
bool microstrain::connections::TcpConnection::disconnect |
( |
| ) |
|
|
overridevirtual |
◆ interfaceName()
const char* microstrain::connections::TcpConnection::interfaceName |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ isConnected()
bool microstrain::connections::TcpConnection::isConnected |
( |
| ) |
const |
|
overridevirtual |
◆ operator=()
◆ parameter()
uint32_t microstrain::connections::TcpConnection::parameter |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ recvFromDevice()
bool microstrain::connections::TcpConnection::recvFromDevice |
( |
uint8_t * |
buffer, |
|
|
size_t |
max_length, |
|
|
unsigned int |
wait_time_ms, |
|
|
size_t * |
length_out, |
|
|
EmbeddedTimestamp * |
timestamp_out |
|
) |
| |
|
overridevirtual |
Receives bytes from the device.
- Parameters
-
buffer | Buffer to store the received data in |
max_length | Max number of bytes that can be read. Should be at most the length of buffer. |
wait_time_ms | Time to wait for data in milliseconds. |
length_out | Number of bytes actually read. |
timestamp_out | Timestamp of when the data was received |
Implements microstrain::Connection.
◆ sendToDevice()
bool microstrain::connections::TcpConnection::sendToDevice |
( |
const uint8_t * |
data, |
|
|
size_t |
length |
|
) |
| |
|
overridevirtual |
Sends bytes to the device.
- Parameters
-
data | The data to send to the device |
length | Length of data in bytes |
Implements microstrain::Connection.
◆ TYPE
constexpr const char* microstrain::connections::TcpConnection::TYPE = "TCP" |
|
staticconstexpr |
The documentation for this class was generated from the following files: