Rtos API example
lwip_api_msg.c File Reference
Sequential API Internal module. More...
Go to the source code of this file.
Functions | |
static u8_t | recv_raw (void *arg, struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *addr) |
Receive callback function for RAW netconns. | |
static void | recv_udp (void *arg, struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *addr, u16_t port) |
Receive callback function for UDP netconns. |
Detailed Description
Sequential API Internal module.
Definition in file lwip_api_msg.c.
Function Documentation
static u8_t recv_raw | ( | void * | arg, |
struct raw_pcb * | pcb, | ||
struct pbuf * | p, | ||
const ip_addr_t * | addr | ||
) | [static] |
Receive callback function for RAW netconns.
Doesn't 'eat' the packet, only copies it and sends it to conn->recvmbox
- See also:
- raw.h (struct raw_pcb.recv) for parameters and return value
Definition at line 100 of file lwip_api_msg.c.
static void recv_udp | ( | void * | arg, |
struct udp_pcb * | pcb, | ||
struct pbuf * | p, | ||
const ip_addr_t * | addr, | ||
u16_t | port | ||
) | [static] |
Receive callback function for UDP netconns.
Posts the packet to conn->recvmbox or deletes it on memory error.
- See also:
- udp.h (struct udp_pcb.recv) for parameters
Receive callback function for TCP netconns. Posts the packet to conn->recvmbox, but doesn't delete it on errors.
- See also:
- tcp.h (struct tcp_pcb.recv) for parameters and return value
Poll callback function for TCP netconns. Wakes up an application thread that waits for a connection to close or data to be sent. The application thread then takes the appropriate action to go on.
Signals the conn->sem. netconn_close waits for conn->sem if closing failed.
- See also:
- tcp.h (struct tcp_pcb.poll) for parameters and return value
Sent callback function for TCP netconns. Signals the conn->sem and calls API_EVENT. netconn_write waits for conn->sem if send buffer is low.
- See also:
- tcp.h (struct tcp_pcb.sent) for parameters and return value
Error callback function for TCP netconns. Signals conn->sem, posts to all conn mboxes and calls API_EVENT. The application thread has then to decide what to do.
- See also:
- tcp.h (struct tcp_pcb.err) for parameters
Setup a tcp_pcb with the correct callback function pointers and their arguments.
- Parameters:
-
conn the TCP netconn to setup
Accept callback function for TCP netconns. Allocates a new netconn and posts that to conn->acceptmbox.
- See also:
- tcp.h (struct tcp_pcb_listen.accept) for parameters and return value
Create a new pcb of a specific type. Called from lwip_netconn_do_newconn().
- Parameters:
-
msg the api_msg_msg describing the connection type
Create a new pcb of a specific type inside a netconn. Called from netconn_new_with_proto_and_callback.
- Parameters:
-
m the api_msg_msg describing the connection type
Create a new netconn (of a specific type) that has a callback function. The corresponding pcb is NOT created!
- Parameters:
-
t the type of 'connection' to create (
- See also:
- enum netconn_type)
- Parameters:
-
callback a function to call on status changes (RX available, TX'ed)
- Returns:
- a newly allocated struct netconn or NULL on memory error
Delete a netconn and all its resources. The pcb is NOT freed (since we might not be in the right thread context do this).
- Parameters:
-
conn the netconn to free
Delete rcvmbox and acceptmbox of a netconn and free the left-over data in these mboxes
- Parameters:
-
conn the netconn to free bytes drained from recvmbox pending connections drained from acceptmbox
Internal helper function to close a TCP netconn: since this sometimes doesn't work at the first attempt, this function is called from multiple places.
- Parameters:
-
conn the TCP netconn to close
Delete the pcb inside a netconn. Called from netconn_delete.
- Parameters:
-
m the api_msg_msg pointing to the connection
Bind a pcb contained in a netconn Called from netconn_bind.
- Parameters:
-
m the api_msg_msg pointing to the connection and containing the IP address and port to bind to
TCP callback function if a connection (opened by tcp_connect/lwip_netconn_do_connect) has been established (or reset by the remote host).
- See also:
- tcp.h (struct tcp_pcb.connected) for parameters and return values
Connect a pcb contained inside a netconn Called from netconn_connect.
- Parameters:
-
m the api_msg_msg pointing to the connection and containing the IP address and port to connect to
Disconnect a pcb contained inside a netconn Only used for UDP netconns. Called from netconn_disconnect.
- Parameters:
-
m the api_msg_msg pointing to the connection to disconnect
Set a TCP pcb contained in a netconn into listen mode Called from netconn_listen.
- Parameters:
-
m the api_msg_msg pointing to the connection
Send some data on a RAW or UDP pcb contained in a netconn Called from netconn_send
- Parameters:
-
m the api_msg_msg pointing to the connection
Indicate data has been received from a TCP pcb contained in a netconn Called from netconn_recv
- Parameters:
-
m the api_msg_msg pointing to the connection
Indicate that a TCP pcb has been accepted Called from netconn_accept
- Parameters:
-
m the api_msg_msg pointing to the connection
See if more data needs to be written from a previous call to netconn_write. Called initially from lwip_netconn_do_write. If the first call can't send all data (because of low memory or empty send-buffer), this function is called again from sent_tcp() or poll_tcp() to send more data. If all data is sent, the blocking application thread (waiting in netconn_write) is released.
- Parameters:
-
conn netconn (that is currently in state NETCONN_WRITE) to process
- Returns:
- ERR_OK ERR_MEM if LWIP_TCPIP_CORE_LOCKING=1 and sending hasn't yet finished
Send some data on a TCP pcb contained in a netconn Called from netconn_write
- Parameters:
-
m the api_msg_msg pointing to the connection
Return a connection's local or remote address Called from netconn_getaddr
- Parameters:
-
m the api_msg_msg pointing to the connection
Close or half-shutdown a TCP pcb contained in a netconn Called from netconn_close In contrast to closing sockets, the netconn is not deallocated.
- Parameters:
-
m the api_msg_msg pointing to the connection
Join multicast groups for UDP netconns. Called from netconn_join_leave_group
- Parameters:
-
m the api_msg_msg pointing to the connection
Callback function that is called when DNS name is resolved (or on timeout). A waiting application thread is waked up by signaling the semaphore.
Execute a DNS query Called from netconn_gethostbyname
- Parameters:
-
arg the dns_api_msg pointing to the query
Definition at line 166 of file lwip_api_msg.c.
Generated on Sun Jul 17 2022 08:25:34 by 1.7.2