Go to the documentation of this file. 1 #ifndef __TCPSERVER_H__
2 #define __TCPSERVER_H__
6 #include <condition_variable>
9 #include <netinet/in.h>
22 bool send(
const uint8_t* buffer, uint16_t length)
override;
24 bool receive(uint8_t* buffer, uint16_t length)
override;
49 #endif // __TCPSERVER_H__
ConnectionType getType() const override
Tells the type of the connection interface.
Definition: TCPServer.cpp:93
Definition: TCPServer.h:43
ConnectionType
Definition: ICommInterface.h:6
void closeClient()
Definition: TCPServer.cpp:116
int m_addressLength
Definition: TCPServer.h:42
bool receive(uint8_t *buffer, uint16_t length) override
Definition: TCPServer.cpp:71
bool send(const uint8_t *buffer, uint16_t length) override
Definition: TCPServer.cpp:61
int m_port
Definition: TCPServer.h:40
bool isConnected() const override
Tells if interface is connected and functionning.
Definition: TCPServer.cpp:82
bool m_connected
Definition: TCPServer.h:36
A logger class with basic logging capabilities.
Definition: ILogger.h:35
Definition: ICommInterface.h:8
Definition: TCPServer.h:12
static void listenTask(void *param)
Definition: TCPServer.cpp:7
void close()
Definition: TCPServer.cpp:84
ILogger & m_logger
Definition: TCPServer.h:35
void waitForClient()
Definition: TCPServer.cpp:95
int m_serverFd
Definition: TCPServer.h:40
bool openSocket(int port)
opens the socket on a certain port
Definition: TCPServer.cpp:20
BaseTask< configMINIMAL_STACK_SIZE *2 > m_listenTask
Definition: TCPServer.h:38
~TCPServer() override
Definition: TCPServer.cpp:18
std::optional< int > m_clientFd
Definition: TCPServer.h:41
TCPServer(ILogger &logger)
Definition: TCPServer.cpp:12