Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
FreeRTOSTCP.hxx
Go to the documentation of this file.
1
35#ifndef _FREERTOS_DRIVERS_NET_FREERTOSTCP_FREERTOSTCP_HXX_
36#define _FREERTOS_DRIVERS_NET_FREERTOSTCP_FREERTOSTCP_HXX_
37
38#include "os/OS.hxx"
39#include "utils/Singleton.hxx"
40
42
44typedef void *Socket_t;
45
50class FreeRTOSTCP : public Singleton<FreeRTOSTCP>
51{
52public:
56
60 {
61 }
62
65 void start();
66
67private:
71 static void *net_task_entry(void *context)
72 {
73 instance()->net_task();
74 return nullptr;
75 }
76
79 void net_task();
80
85 void select_wakeup(Socket_t data = nullptr);
86
91
96
98 uint32_t ipAddress;
103 friend class FreeRTOSTCPSocket;
104
106};
107
108#endif /* _FREERTOS_DRIVERS_NET_FREERTOSTCP_FREERTOSTCP_HXX_ */
void * Socket_t
local declaraction of Socket_t to avoid dependency on FreeRTOSTCP headers
int socket(int domain, int type, int protocol)
Create an unbound socket in a communications domain.
Definition Socket.cxx:144
Provides the startup and mantainance methods for configuring and using the FreeRTOSTCP stack.
Socket_t wakeup
signal socket to wakeup select()
FreeRTOSTCP()
Constructor.
void net_task()
Thread that will manage the net connection inside object context.
void start()
Startup the networking processes.
static FreeRTOSTCP * instance_
singleton instance pointer.
void fd_set_read(Socket_t socket)
Add socket to the read fd set.
static void * net_task_entry(void *context)
Thread that will manage the network connection.
void select_wakeup(Socket_t data=nullptr)
Asynchronously wakeup the select call.
~FreeRTOSTCP()
Destructor.
uint32_t ipAddress
assigned IP adress
void fd_set_write(Socket_t socket)
Add socket to the write fd set.
Singleton class.
Definition Singleton.hxx:65
static FreeRTOSTCP * instance()
Definition Singleton.hxx:77
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Removes default copy-constructor and assignment added by C++.
Definition macros.h:171