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.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
This is an arch independent SLIP netif. More...
Functions | |
| 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. | |
| void | slipif_process_rxqueue (struct netif *netif) |
| Feeds the IP layer with incoming packets that were receive. | |
| void | slipif_received_byte (struct netif *netif, u8_t data) |
| Process a received byte, completed packets are put on a queue that is fed into IP through slipif_process_rxqueue(). | |
| void | slipif_received_bytes (struct netif *netif, u8_t *data, u8_t len) |
| Process multiple received byte, completed packets are put on a queue that is fed into IP through slipif_process_rxqueue(). | |
Detailed Description
This is an arch independent SLIP netif.
The specific serial hooks must be provided by another file. They are sio_open, sio_read/sio_tryread and sio_send
Usage: This netif can be used in three ways:
1) For NO_SYS==0, an RX thread can be used which blocks on sio_read() until data is received.
2) In your main loop, call slipif_poll() to check for new RX bytes, completed packets are fed into netif->input().
3) Call slipif_received_byte[s]() from your serial RX ISR and slipif_process_rxqueue() from your main loop. ISR level decodes packets and puts completed packets on a queue which is fed into the stack from the main loop (needs SYS_LIGHTWEIGHT_PROT for pbuf_alloc to work on ISR level!).
Function Documentation
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:
- If netif->state is interpreted as an u8_t serial port number.
Definition at line 360 of file lwip_slipif.c.
| void slipif_poll | ( | struct netif * | netif ) |
Polls the serial device and feeds the IP layer with incoming packets.
- Parameters:
-
netif The lwip network interface structure for this slipif
Definition at line 426 of file lwip_slipif.c.
| void slipif_process_rxqueue | ( | struct netif * | netif ) |
Feeds the IP layer with incoming packets that were receive.
- Parameters:
-
netif The lwip network interface structure for this slipif
Definition at line 449 of file lwip_slipif.c.
| void slipif_received_byte | ( | struct netif * | netif, |
| u8_t | data | ||
| ) |
Process a received byte, completed packets are put on a queue that is fed into IP through slipif_process_rxqueue().
This function can be called from ISR if SYS_LIGHTWEIGHT_PROT is enabled.
- Parameters:
-
netif The lwip network interface structure for this slipif data received character
Definition at line 528 of file lwip_slipif.c.
| void slipif_received_bytes | ( | struct netif * | netif, |
| u8_t * | data, | ||
| u8_t | len | ||
| ) |
Process multiple received byte, completed packets are put on a queue that is fed into IP through slipif_process_rxqueue().
This function can be called from ISR if SYS_LIGHTWEIGHT_PROT is enabled.
- Parameters:
-
netif The lwip network interface structure for this slipif data received character len Number of received characters
Definition at line 547 of file lwip_slipif.c.
Generated on Tue Jul 12 2022 13:55:24 by
1.7.2