38#ifndef _FREERTOS_DRIVERS_NET_FREERTOSTCP_FREERTOSTCPSOCKET_HXX_
39#define _FREERTOS_DRIVERS_NET_FREERTOSTCP_FREERTOSTCPSOCKET_HXX_
45static const int MAX_SOCKETS = 20;
62 static int socket(
int domain,
int type,
int protocol);
126 static ssize_t
recv(
int socket,
void *buffer,
size_t length,
int flags);
137 int socket,
const void *buffer,
size_t length,
int flags);
150 const void *option_value,
socklen_t option_len);
163 void *option_value,
socklen_t *option_len);
194 int fcntl(
File *file,
int cmd,
unsigned long data)
override;
void * Socket_t
local declaraction of Socket_t to avoid dependency on FreeRTOSTCP headers
static int setsockopt(int socket, int level, int option_name, const void *option_value, socklen_t option_len)
Set the socket options.
bool writeActive
indicates our "best guess" at current socket's write active status
FreeRTOSTCPSocket()
Constructor.
static int socket(int domain, int type, int protocol)
Create an unbound socket in a communications domain.
int close(File *file) override
Close method.
static FreeRTOSTCPSocket * get_sd_by_index(int inx)
Get the socket descriptor assoicated with socket index.
static void remove_instance_from_sd(Socket_t sd)
Remove the FreeRTOSTCP instance from the active FreeRTOSTCP list.
static int listen(int socket, int backlog)
Mark a connection-mode socket, specified by the socket argument, as accepting connections.
static int accept(int socket, struct sockaddr *address, socklen_t *address_len)
Accept a new connection on a socket.
bool readActive
indicates our "best guess" at current socket's read active status
bool select(File *file, int mode) override
Device select method.
static FreeRTOSTCPSocket * get_instance_from_sd(Socket_t sd)
Get the FreeRTOSTCP instance given a specific socket descriptor.
static int getsockopt(int socket, int level, int option_name, void *option_value, socklen_t *option_len)
Get the socket options.
static ssize_t recv(int socket, void *buffer, size_t length, int flags)
Receive a message from a connection-mode or connectionless-mode socket.
static ssize_t send(int socket, const void *buffer, size_t length, int flags)
Initiate transmission of a message from the specified socket.
static int connect(int socket, const struct sockaddr *address, socklen_t address_len)
Connect a socket.
Socket_t sd
FreeRTOS socket descriptor.
int fcntl(File *file, int cmd, unsigned long data) override
Manipulate a file descriptor.
static int alloc_instance(Socket_t sd)
Allocate a new FreeRTOSTCPSocket and related structures.
bool listenActive
This is a listen socket.
~FreeRTOSTCPSocket()
Destructor.
static int bind(int socket, const struct sockaddr *address, socklen_t address_len)
Bind a name to a socket.
Provides the startup and mantainance methods for configuring and using the FreeRTOSTCP stack.
Implement a BSD compatible socket device.
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
Removes default copy-constructor and assignment added by C++.
uint32_t socklen_t
type of sockaddr lenth