Can be used on Windows, OSX, or linux to communicate with a MIP device over TCP.  
 More...
#include <tcp_connection.hpp>
|  | 
|  | TcpConnection ()=default | 
|  | 
|  | TcpConnection (const std::string &hostname, uint16_t port) | 
|  | Creates a TcpConnection that will communicate with a device over TCP.  More... 
 | 
|  | 
|  | ~TcpConnection () override | 
|  | Closes the underlying TCP socket.  More... 
 | 
|  | 
|  | TcpConnection (const TcpConnection &)=delete | 
|  | 
| TcpConnection & | operator= (const TcpConnection &)=delete | 
|  | 
| 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.  More... 
 | 
|  | 
| bool | sendToDevice (const uint8_t *data, size_t length) override | 
|  | Sends bytes to the device.  More... 
 | 
|  | 
| bool | isConnected () const override | 
|  | Check if the socket is connected.  More... 
 | 
|  | 
| bool | connect () override | 
|  | Connect to the socket.  More... 
 | 
|  | 
| bool | disconnect () override | 
|  | Disconnect from the socket.  More... 
 | 
|  | 
| void | connectionInfo (std::string &host_name, uint32_t &port) const | 
|  | 
| const char * | interfaceName () const override | 
|  | 
| uint32_t | parameter () const override | 
|  | 
|  | Connection () | 
|  | 
| virtual | ~Connection () | 
|  | 
| bool | sendBufferToDevice (microstrain::ConstU8ArrayView data) | 
|  | 
| bool | recvBufferFromDevice (microstrain::U8ArrayView buffer, unsigned int wait_time_ms, size_t *length_out, EmbeddedTimestamp *timestamp_out) | 
|  | 
| bool | recvFromDeviceAndUpdateUint8ArrayView (microstrain::U8ArrayView &buffer, unsigned int wait_time_ms, EmbeddedTimestamp *timestamp_out) | 
|  | 
| const char * | type () const | 
|  | 
|  | 
| static constexpr const char * | TYPE = "TCP" | 
|  | 
| static constexpr const char * | TYPE = "None" | 
|  | 
◆ TcpConnection() [1/3]
  
  | 
        
          | microstrain::connections::TcpConnection::TcpConnection | ( |  | ) |  |  | default | 
 
 
◆ TcpConnection() [2/3]
      
        
          | microstrain::connections::TcpConnection::TcpConnection | ( | const std::string & | hostname, | 
        
          |  |  | uint16_t | port | 
        
          |  | ) |  |  | 
      
 
- Parameters
- 
  
    | hostname | Host name or IP address to connect to |  | port | Port on hostName to connect to |  
 
 
 
◆ ~TcpConnection()
  
  | 
        
          | microstrain::connections::TcpConnection::~TcpConnection | ( |  | ) |  |  | override | 
 
 
◆ TcpConnection() [3/3]
  
  | 
        
          | microstrain::connections::TcpConnection::TcpConnection | ( | const TcpConnection & |  | ) |  |  | delete | 
 
 
◆ operator=()
◆ 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 | 
 
- 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 | 
 
 
◆ isConnected()
  
  | 
        
          | bool microstrain::connections::TcpConnection::isConnected | ( |  | ) | const |  | overridevirtual | 
 
 
◆ connect()
  
  | 
        
          | bool microstrain::connections::TcpConnection::connect | ( |  | ) |  |  | overridevirtual | 
 
 
◆ disconnect()
  
  | 
        
          | bool microstrain::connections::TcpConnection::disconnect | ( |  | ) |  |  | overridevirtual | 
 
 
◆ connectionInfo()
  
  | 
        
          | void microstrain::connections::TcpConnection::connectionInfo | ( | std::string & | host_name, |  
          |  |  | uint32_t & | port |  
          |  | ) |  | const |  | inline | 
 
 
◆ interfaceName()
  
  | 
        
          | const char* microstrain::connections::TcpConnection::interfaceName | ( |  | ) | const |  | inlineoverridevirtual | 
 
 
◆ parameter()
  
  | 
        
          | uint32_t microstrain::connections::TcpConnection::parameter | ( |  | ) | const |  | inlineoverridevirtual | 
 
 
◆ TYPE
  
  | 
        
          | constexpr const char* microstrain::connections::TcpConnection::TYPE = "TCP" |  | staticconstexpr | 
 
 
The documentation for this class was generated from the following files: