ConOpSys V2970
P004.07
ANVILEX control operating system
|
#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"
Classes | |
struct | slipif_priv |
Macros | |
#define | SLIP_END 0xC0 /* 0300: start and end of every packet */ |
#define | SLIP_ESC 0xDB /* 0333: escape start (one byte escaped data follows) */ |
#define | SLIP_ESC_END 0xDC /* 0334: following escape: original byte is 0xC0 (END) */ |
#define | SLIP_ESC_ESC 0xDD /* 0335: following escape: original byte is 0xDB (ESC) */ |
#define | SLIP_MAX_SIZE 1500 |
#define | SLIP_SIO_SPEED(sio_fd) 0 |
Enumerations | |
enum | slipif_recv_state { SLIP_RECV_NORMAL , SLIP_RECV_ESCAPE } |
Functions | |
static err_t | slipif_output (struct netif *netif, struct pbuf *p) |
static struct pbuf * | slipif_rxbyte (struct netif *netif, u8_t c) |
static void | slipif_rxbyte_input (struct netif *netif, u8_t c) |
err_t | slipif_init (struct netif *netif) |
void | slipif_poll (struct netif *netif) |
SLIP Interface
#define SLIP_END 0xC0 /* 0300: start and end of every packet */ |
#define SLIP_ESC 0xDB /* 0333: escape start (one byte escaped data follows) */ |
#define SLIP_ESC_END 0xDC /* 0334: following escape: original byte is 0xC0 (END) */ |
#define SLIP_ESC_ESC 0xDD /* 0335: following escape: original byte is 0xDB (ESC) */ |
#define SLIP_MAX_SIZE 1500 |
Maximum packet size that is received by this netif
#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'.
enum slipif_recv_state |
Send a pbuf doing the necessary SLIP encapsulation
Uses the serial layer's sio_send()
netif | the lwip network interface structure for this slipif |
p | the pbuf chain packet to send |
References ERR_OK, slipif_priv::i, pbuf::len, LWIP_ASSERT, LWIP_DEBUGF, pbuf::next, NULL, slipif_priv::p, pbuf::payload, slipif_priv::q, slipif_priv::sd, sio_send(), SLIP_DEBUG, SLIP_END, SLIP_ESC, SLIP_ESC_END, SLIP_ESC_ESC, netif::state, pbuf::tot_len, and U16_F.
Handle the incoming SLIP stream character by character
netif | the lwip network interface structure for this slipif |
c | received character (multiple calls to this function will return a complete packet, NULL is returned before - used for polling) |
References slipif_priv::i, pbuf::len, LINK_STATS_INC, LWIP_ASSERT, LWIP_DEBUGF, pbuf::next, NULL, slipif_priv::p, pbuf::payload, pbuf_alloc(), pbuf_cat(), PBUF_LINK, PBUF_LINK_ENCAPSULATION_HLEN, PBUF_LINK_HLEN, PBUF_POOL, PBUF_POOL_BUFSIZE, pbuf_realloc(), slipif_priv::q, slipif_priv::recved, SLIP_DEBUG, SLIP_END, SLIP_ESC, SLIP_ESC_END, SLIP_ESC_ESC, SLIP_MAX_SIZE, SLIP_RECV_ESCAPE, SLIP_RECV_NORMAL, netif::state, slipif_priv::state, and U16_F.
Referenced by slipif_rxbyte_input().
Like slipif_rxbyte, but passes completed packets to netif->input
netif | The lwip network interface structure for this slipif |
c | received character |
References ERR_OK, netif::input, NULL, pbuf_free(), and slipif_rxbyte().
Referenced by slipif_poll().