Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
slipif.c File Reference
SLIP Interface. More...
Go to the source code of this file.
Functions | |
err_t | slipif_output (struct netif *netif, struct pbuf *p, ip_addr_t *ipaddr) |
Send a pbuf doing the necessary SLIP encapsulation. | |
static u32_t | slip_sio_read (sio_fd_t fd, u8_t *data, u32_t len, u8_t block) |
Static function for easy use of blockig or non-blocking sio_read. | |
static struct pbuf * | slipif_input (struct netif *netif, u8_t block) |
Handle the incoming SLIP stream character by character. | |
static void | slipif_loop_thread (void *nf) |
The SLIP input thread. | |
err_t | slipif_init (struct netif *netif) |
SLIP netif initialization. | |
void | slipif_poll (struct netif *netif) |
Polls the serial device and feeds the IP layer with incoming packets. |
Detailed Description
SLIP Interface.
Definition in file slipif.c.
Function Documentation
static u32_t slip_sio_read | ( | sio_fd_t | fd, |
u8_t * | data, | ||
u32_t | len, | ||
u8_t | block | ||
) | [static] |
Static function for easy use of blockig or non-blocking sio_read.
- Parameters:
-
fd serial device handle data pointer to data buffer for receiving len maximum length (in bytes) of data to receive block if 1, call sio_read; if 0, call sio_tryread
- Returns:
- return value of sio_read of sio_tryread
SLIP netif initialization.
Call the arch specific sio_open and remember the opened device in the state field of the netif.
- Parameters:
-
netif the 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)
Handle the incoming SLIP stream character by character.
Poll the serial layer by calling sio_read() or sio_tryread().
- Parameters:
-
netif the lwip network interface structure for this slipif block if 1, block until data is received; if 0, return when all data from the buffer is received (multiple calls to this function will return a complete packet, NULL is returned before - used for polling)
- Returns:
- The IP packet when SLIP_END is received
static void slipif_loop_thread | ( | void * | nf ) | [static] |
Send a pbuf doing the necessary SLIP encapsulation.
Uses the serial layer's sio_send()
- Parameters:
-
netif the lwip network interface structure for this slipif p the pbuf chaing packet to send ipaddr the ip address to send the packet to (not used for slipif)
- Returns:
- always returns ERR_OK since the serial layer does not provide return values
Generated on Tue Jul 12 2022 17:35:04 by
