lwIP  2.0.2
Lightweight IP stack
slipif.c File Reference
#include "netif/slipif.h"
#include "lwip/opt.h"
#include "lwip/def.h"
#include "lwip/pbuf.h"
#include "lwip/stats.h"
#include "lwip/snmp.h"
#include "lwip/sys.h"
#include "lwip/sio.h"

Macros

#define SLIP_MAX_SIZE   1500
 
#define SLIP_SIO_SPEED(sio_fd)   0
 

Functions

err_t slipif_init (struct netif *netif)
 
void slipif_poll (struct netif *netif)
 

Detailed Description

SLIP Interface

Macro Definition Documentation

◆ SLIP_MAX_SIZE

#define SLIP_MAX_SIZE   1500

Maximum packet size that is received by this netif

◆ SLIP_SIO_SPEED

#define SLIP_SIO_SPEED (   sio_fd)    0

Define this to the interface speed for SNMP (sio_fd is the sio_fd_t returned by sio_open). The default value of zero means 'unknown'.

Function Documentation

◆ slipif_init()

err_t slipif_init ( struct netif netif)

SLIP netif initialization

Call the arch specific sio_open and remember the opened device in the state field of the netif.

Parameters
netifthe lwip network interface structure for this slipif
Returns
ERR_OK if serial line could be opened, ERR_MEM if no memory could be allocated, ERR_IF is serial line couldn't be opened
Note
netif->num must contain the number of the serial port to open (0 by default). If netif->state is != NULL, it is interpreted as an u8_t pointer pointing to the serial port number instead of netif->num.

◆ slipif_poll()

void slipif_poll ( struct netif netif)

Polls the serial device and feeds the IP layer with incoming packets.

Parameters
netifThe lwip network interface structure for this slipif