Rtos API example

Embed: (wiki syntax)

« Back to documentation index

Mainloop mode ("NO_SYS")

Mainloop mode ("NO_SYS")
[lwIP]

Use this mode if you do not run an OS on your system. More...

Functions

void lwip_init (void)
 Initialize all modules.
err_t ip_input (struct pbuf *p, struct netif *inp)
 If both IP versions are enabled, this function can dispatch packets to the correct one.
err_t netif_input (struct pbuf *p, struct netif *inp)
 Forwards a received packet for input processing with ethernet_input() or ip_input() depending on netif flags.

Detailed Description

Use this mode if you do not run an OS on your system.

#define NO_SYS to 1. Feed incoming packets to netif->input(pbuf, netif) function from mainloop, *not* *from* *interrupt* *context*. You can allocate a Packet buffers (PBUF) in interrupt context and put them into a queue which is processed from mainloop.
Call sys_check_timeouts() periodically in the mainloop.
Porting: implement all functions in Time, Critical sections and Compiler/platform abstraction.
You can only use Callback-style APIs in this mode.
Sample code:


Function Documentation

err_t ip_input ( struct pbuf p,
struct netif inp 
)

If both IP versions are enabled, this function can dispatch packets to the correct one.

Don't call directly, pass to netif_add() and call netif->input().

Definition at line 111 of file lwip_ip.c.

void lwip_init ( void   )

Initialize all modules.

Use this in NO_SYS mode. Use tcpip_init() otherwise.

Definition at line 337 of file lwip_init.c.

err_t netif_input ( struct pbuf p,
struct netif inp 
)

Forwards a received packet for input processing with ethernet_input() or ip_input() depending on netif flags.

Don't call directly, pass to netif_add() and call netif->input(). Only works if the netif driver correctly sets NETIF_FLAG_ETHARP and/or NETIF_FLAG_ETHERNET flag!

Definition at line 203 of file lwip_netif.c.