HiveMind
Public Member Functions | Private Attributes | Friends | List of all members
TCPClient Class Reference

#include <TCPClient.h>

Inheritance diagram for TCPClient:
Inheritance graph
Collaboration diagram for TCPClient:
Collaboration graph

Public Member Functions

 TCPClient (int socket, sockaddr_in address, ILogger &logger)
 
 ~TCPClient () override=default
 
bool receive (uint8_t *data, uint16_t length) override
 
bool send (const uint8_t *data, uint16_t length) override
 
bool isConnected () const override
 Tells if interface is connected and functionning. More...
 
bool close ()
 
ConnectionType getType () const override
 Tells the type of the connection interface. More...
 
- Public Member Functions inherited from ICommInterface
virtual ~ICommInterface ()=default
 

Private Attributes

ILoggerm_logger
 
const int m_socketFd {}
 
const sockaddr_in m_address {}
 
bool m_connected
 

Friends

void rxThread (TCPClient *context)
 

Constructor & Destructor Documentation

◆ TCPClient()

TCPClient::TCPClient ( int  socket,
sockaddr_in  address,
ILogger logger 
)

◆ ~TCPClient()

TCPClient::~TCPClient ( )
overridedefault

Member Function Documentation

◆ close()

bool TCPClient::close ( )
Here is the call graph for this function:

◆ getType()

ConnectionType TCPClient::getType ( ) const
overridevirtual

Tells the type of the connection interface.

Returns
the type of connection

Implements ICommInterface.

◆ isConnected()

bool TCPClient::isConnected ( ) const
overridevirtual

Tells if interface is connected and functionning.

Returns
true if connected, false otherwise

Implements ICommInterface.

◆ receive()

bool TCPClient::receive ( uint8_t *  data,
uint16_t  length 
)
override

◆ send()

bool TCPClient::send ( const uint8_t *  data,
uint16_t  length 
)
override

Friends And Related Function Documentation

◆ rxThread

void rxThread ( TCPClient context)
friend

Member Data Documentation

◆ m_address

const sockaddr_in TCPClient::m_address {}
private

◆ m_connected

bool TCPClient::m_connected
private

◆ m_logger

ILogger& TCPClient::m_logger
private

◆ m_socketFd

const int TCPClient::m_socketFd {}
private

The documentation for this class was generated from the following files: