72#define SLIP_ESC_END 0xDC
73#define SLIP_ESC_ESC 0xDD
77#define SLIP_MAX_SIZE 1500
85#define SLIP_SIO_SPEED(sio_fd) 0
88enum slipif_recv_state {
100 struct pbuf *rxpackets;
117 struct slipif_priv *priv;
136 for (
i = 0;
i <
q->len;
i++) {
172 struct slipif_priv *priv;
180 switch (priv->state) {
181 case SLIP_RECV_NORMAL:
184 if (priv->recved > 0) {
193 priv->p = priv->q =
NULL;
194 priv->i = priv->recved = 0;
199 priv->state = SLIP_RECV_ESCAPE;
203 case SLIP_RECV_ESCAPE:
214 priv->state = SLIP_RECV_NORMAL;
219 if (priv->p ==
NULL) {
224 if (priv->p ==
NULL) {
231 if (priv->q !=
NULL) {
241 if ((priv->p !=
NULL) && (priv->recved <= SLIP_MAX_SIZE)) {
242 ((
u8_t *)priv->p->payload)[priv->i] =
c;
245 if (priv->i >= priv->p->len) {
248 if (priv->p->next !=
NULL && priv->p->
next->len > 0) {
250 priv->p = priv->p->
next;
278#if SLIP_USE_RX_THREAD
287slipif_loop_thread(
void *nf)
291 struct slipif_priv *priv = (
struct slipif_priv *)
netif->
state;
295 slipif_rxbyte_input(
netif,
c);
320 struct slipif_priv *priv;
326 priv = (
struct slipif_priv *)
mem_malloc(
sizeof(
struct slipif_priv));
354 priv->state = SLIP_RECV_NORMAL;
358 priv->rxpackets =
NULL;
366#if SLIP_USE_RX_THREAD
383 struct slipif_priv *priv;
391 slipif_rxbyte_input(
netif,
c);
404 struct slipif_priv *priv;
413 while (priv->rxpackets !=
NULL) {
414 struct pbuf *
p = priv->rxpackets;
418 while ((
q->len !=
q->tot_len) && (
q->next !=
NULL)) {
421 priv->rxpackets =
q->next;
424 priv->rxpackets =
NULL;
443 struct slipif_priv *priv = (
struct slipif_priv *)
netif->
state;
449 if (priv->rxpackets !=
NULL) {
453 while(
q->next !=
NULL) {
504 for (
i = 0;
i <
len;
i++, rxdata++) {
505 slipif_rxbyte_enqueue(
netif, *rxdata);
#define LWIP_UNUSED_ARG(x)
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
#define mem_free(ptr, bsize)
#define SYS_ARCH_UNPROTECT(lev)
#define SYS_ARCH_PROTECT(lev)
#define SYS_ARCH_DECL_PROTECT(lev)
void * mem_malloc(mem_size_t size)
#define LWIP_DEBUGF(debug, message)
#define LWIP_ASSERT(message, assertion)
sio_fd_t sio_open(u8_t devnum)
void sio_send(u8_t c, sio_fd_t fd)
u32_t sio_tryread(sio_fd_t fd, u8_t *data, u32_t len)
u32_t sio_read(sio_fd_t fd, u8_t *data, u32_t len)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLdouble GLdouble GLdouble GLdouble q
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
typedefPACK_STRUCT_END struct ip_addr ip_addr_t
#define NETIF_FLAG_POINTTOPOINT
#define NETIF_INIT_SNMP(netif, type, speed)
#define SLIPIF_THREAD_PRIO
#define PBUF_POOL_BUFSIZE
#define SLIPIF_THREAD_STACKSIZE
#define SLIPIF_THREAD_NAME
void pbuf_realloc(struct pbuf *p, u16_t new_len)
void pbuf_cat(struct pbuf *h, struct pbuf *t)
struct pbuf * pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
u8_t pbuf_free(struct pbuf *p)
err_t slipif_init(struct netif *netif)
void slipif_poll(struct netif *netif)
#define LINK_STATS_INC(x)
sys_thread_t sys_thread_new(const char *name, lwip_thread_fn thread, void *arg, int stacksize, int prio)