您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ uip_poll函数代码示例

51自学网 2021-06-03 09:08:31
  C++
这篇教程C++ uip_poll函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中uip_poll函数的典型用法代码示例。如果您正苦于以下问题:C++ uip_poll函数的具体用法?C++ uip_poll怎么用?C++ uip_poll使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了uip_poll函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: yport_net_main

void yport_net_main(void){  if(uip_connected()) {    if (yport_conn == NULL) {      yport_conn = uip_conn;      uip_conn->wnd = YPORT_BUFFER_LEN - 1;    }    else       /* if we have already an connection, send an error */      uip_send("ERROR: Connection blocked/n", 27);  } else if (uip_acked()) {    /* If the peer is not our connection, close it */    if (yport_conn != uip_conn)       uip_close();    else {      /* Some data we have sent was acked, jipphie */      /* disable interrupts */      uint8_t sreg = SREG; cli();      yport_recv_buffer.len -= yport_recv_buffer.sent;      /* We should use memmove, because the data may overlap */      memmove(yport_recv_buffer.data,               yport_recv_buffer.data + yport_recv_buffer.sent,              yport_recv_buffer.len);      /* enable interrupts again */      SREG = sreg;    }  } else if (uip_closed() || uip_aborted() || uip_timedout()) {    /* if the closed connection was our connection, clean yport_conn */    if (yport_conn == uip_conn)      yport_conn = NULL;  } else if (uip_newdata()) {    if (uip_len <= YPORT_BUFFER_LEN && yport_rxstart(uip_appdata, uip_len) != 0) {      /* Prevent the other side from sending more data */      uip_stop();    }  }   if (uip_poll()       && uip_conn == yport_conn       && uip_stopped(yport_conn)      && yport_send_buffer.sent == yport_send_buffer.len)    uip_restart();  /* Send data */  if ((uip_poll()        || uip_acked()       || uip_rexmit())      && yport_conn == uip_conn       && yport_recv_buffer.len > 0) {    /* We have recieved data, lets propagade it */    /* disable interrupts */    uint8_t sreg = SREG; cli();    /* Send the data */    uip_send(yport_recv_buffer.data, yport_recv_buffer.len);    /* so many data was send */    yport_recv_buffer.sent = yport_recv_buffer.len;    /* enable interrupts again */    SREG = sreg;  }}
开发者ID:muccc,项目名称:matemat,代码行数:58,


示例2: telnetd_appcall

/*---------------------------------------------------------------------------*/voidtelnetd_appcall(void *ts){  if(uip_connected()) {    if(!connected) {      buf_init(&buf);      s.bufptr = 0;      s.state = STATE_NORMAL;      connected = 1;      shell_start();      timer_set(&s.silence_timer, MAX_SILENCE_TIME);      ts = (char *)0;    } else {      uip_send(telnetd_reject_text, strlen(telnetd_reject_text));      ts = (char *)1;    }    tcp_markconn(uip_conn, ts);  }  if(!ts) {    if(s.state == STATE_CLOSE) {      s.state = STATE_NORMAL;      uip_close();      return;    }    if(uip_closed() ||       uip_aborted() ||       uip_timedout()) {      shell_stop();      connected = 0;    }    if(uip_acked()) {      timer_set(&s.silence_timer, MAX_SILENCE_TIME);      acked();    }    if(uip_newdata()) {      timer_set(&s.silence_timer, MAX_SILENCE_TIME);      newdata();    }    if(uip_rexmit() ||       uip_newdata() ||       uip_acked() ||       uip_connected() ||       uip_poll()) {      senddata();      if(s.numsent > 0) {	timer_set(&s.silence_timer, MAX_SILENCE_TIME);      }    }    if(uip_poll()) {      if(timer_expired(&s.silence_timer)) {        uip_close();        tcp_markconn(uip_conn, NULL);      }    }  }}
开发者ID:Abdellazizhammami,项目名称:contiki,代码行数:58,


示例3: uip_modbus_appcall

void uip_modbus_appcall(void){    if(uip_connected())    {        PRINTF("connected!/r/n");    }    if(uip_closed())    {        PRINTF("closed/r/n");    }    if(uip_newdata())    {        PRINTF("request!/r/n");        // 获得modbus请求        memcpy(ucTCPRequestFrame, uip_appdata, uip_len );        ucTCPRequestLen = uip_len;        // 向 modbus poll发送消息        xMBPortEventPost( EV_FRAME_RECEIVED );    }    if(uip_poll())    {        if(bFrameSent)        {            bFrameSent = FALSE;            // uIP发送Modbus应答数据包            uip_send( ucTCPResponseFrame , ucTCPResponseLen );        }    }}
开发者ID:kc87654321,项目名称:uip_freemodbus_tcp,代码行数:32,


示例4: httpd_appcall

/*---------------------------------------------------------------------------*/voidhttpd_appcall(void *state){  struct httpd_state *s = (struct httpd_state *)state;  if(uip_closed() || uip_aborted() || uip_timedout()) {    if(s != NULL) {      memb_free(&conns, s);    }  } else if(uip_connected()) {    s = (struct httpd_state *)memb_alloc(&conns);    if(s == NULL) {      uip_abort();      return;    }    tcp_markconn(uip_conn, s);    PSOCK_INIT(&s->sin, s->inputbuf, sizeof(s->inputbuf) - 1);    PSOCK_INIT(&s->sout, s->inputbuf, sizeof(s->inputbuf) - 1);    PT_INIT(&s->outputpt);    s->state = STATE_WAITING;    timer_set(&s->timer, CLOCK_SECOND * 10);    handle_connection(s);  } else if(s != NULL) {    if(uip_poll()) {      if(timer_expired(&s->timer)) {	uip_abort();      }    } else {      timer_reset(&s->timer);    }    handle_connection(s);  } else {    uip_abort();  }}
开发者ID:EDAyele,项目名称:ptunes,代码行数:36,


示例5: telnetd_appcall

/*---------------------------------------------------------------------------*/voidtelnetd_appcall(void *ts){  if(uip_connected()) {    tcp_markconn(uip_conn, &s);    buf_init(&buf);    s.bufptr = 0;    s.state = STATE_NORMAL;    shell_start();  }  if(s.state == STATE_CLOSE) {    s.state = STATE_NORMAL;    uip_close();    return;  }  if(uip_closed() ||     uip_aborted() ||     uip_timedout()) {    closed();  }  if(uip_acked()) {    acked();  }  if(uip_newdata()) {    newdata();  }  if(uip_rexmit() ||     uip_newdata() ||     uip_acked() ||     uip_connected() ||     uip_poll()) {    senddata();  }}
开发者ID:EDAyele,项目名称:ptunes,代码行数:36,


示例6: smtp_appcall

/*DISPATCHER_UIPCALL(smtp_appcall, state)*/voidsmtp_appcall(void *state){  if(uip_connected()) {    /*    senddata();*/    return;  }  if(uip_acked()) {    acked();  }  if(uip_newdata()) {    newdata();  }  if(uip_rexmit() ||     uip_newdata() ||     uip_acked()) {    senddata();  } else if(uip_poll()) {        senddata();  }  /*  if(uip_closed()) {    printf("Dnoe/n");    }*/}
开发者ID:ZhepingYang,项目名称:contiki-1.x,代码行数:27,


示例7: tty_vt100_main

static voidtty_vt100_main (void){  if (uip_connected())    STATE->send_all = 1;  if (uip_acked())    {      if (STATE->send_all)	STATE->send_all = 0;      STATE->acked = STATE->sent;    }  if (uip_newdata ())    {      uint8_t len = uip_len;      for (uint8_t i = 0; i < len; i ++)	{	  int8_t ch = ((char *) uip_appdata)[i];	  if (ch == 12)		/* C-l, retransmit everything. */	    {	      STATE->send_all = 1;	      continue;	    }	  _getch_queue (ch);	}    }  if (uip_rexmit() || uip_newdata() || uip_acked() || uip_connected()      || uip_poll())    {      /* Send new data, if any. */      if (STATE->send_all)	tty_vt100_send_all ();      else	{	  /* we're just sending an update, ... */	  if (vt100_head > STATE->acked)	    {	      uint8_t len = vt100_head - STATE->acked;	      memcpy (uip_sappdata, STATE->acked, len);	      uip_send (uip_sappdata, len);	    }	  else if (vt100_head < STATE->acked)	    {	      /* vt100_head wrapped around, let's be careful. */	      uint8_t len = vt100_end - STATE->acked;	      memcpy (uip_sappdata, STATE->acked, len);	      uint8_t len2 = vt100_head - vt100_buf;	      memcpy (uip_sappdata + len, vt100_buf, len2);	      uip_send (uip_sappdata, len + len2);	    }	  STATE->sent = vt100_head;	}    }}
开发者ID:simeonfelis,项目名称:ethersex,代码行数:60,


示例8: skel_txavail

static int skel_txavail(struct uip_driver_s *dev){  FAR struct skel_driver_s *skel = (FAR struct skel_driver_s *)dev->d_private;  irqstate_t flags;  /* Disable interrupts because this function may be called from interrupt   * level processing.   */  flags = irqsave();  /* Ignore the notification if the interface is not yet up */  if (skel->sk_bifup)    {      /* Check if there is room in the hardware to hold another outgoing packet. */      /* If so, then poll uIP for new XMIT data */      (void)uip_poll(&skel->sk_dev, skel_uiptxpoll);    }  irqrestore(flags);  return OK;}
开发者ID:grissiom,项目名称:muttx-mirror,代码行数:25,


示例9: uip_port_app_mapper

// this function maps the current packet against the mappings//   pointed to by the paramvoid uip_port_app_mapper(struct port_appcall_map* cur_map){#ifdef __DHCPC_H__    // if dhcpc is enabled and running we want our ip ASAP so skip all others    if(dhcpc_running && uip_poll())    {        dhcpc_appcall();        base_conn = NULL;        return;        }#endif    // yes this will walk the entire list which is up to 4 items at the moment    while ((base_conn != NULL) && (cur_map->an_appcall != NULL))    {        // Now match the app to the packet.        // local AND/OR remote ports match        // firs check remote port matches and local may or may not        // then check local port matches        // can't do it in one statement due to the l & r ports could both be zero and match all apps.        if (((base_conn->rport == HTONS(cur_map->rport)) &&            ((cur_map->lport == 0) || (base_conn->lport == HTONS(cur_map->lport)))) ||            ((base_conn->lport == HTONS(cur_map->lport)) &&             ((cur_map->rport == 0) || (base_conn->rport == HTONS(cur_map->rport)))))        {            cur_map->an_appcall();            base_conn = NULL;            break;        }        cur_map++;    }}
开发者ID:jaseg,项目名称:avr-uip,代码行数:35,


示例10: vnet_txavail

static int vnet_txavail(struct uip_driver_s *dev){  FAR struct vnet_driver_s *vnet = (FAR struct vnet_driver_s *)dev->d_private;  irqstate_t flags;  /* Disable interrupts because this function may be called from interrupt   * level processing.   */  flags = irqsave();  /* Ignore the notification if the interface is not yet up */  if (vnet->sk_bifup)    {      /* Check if there is room in the hardware to hold another outgoing packet. */	if (vnet_is_txbuff_full(vnet->vnet)) {#ifdef CONFIG_DEBUG	    cprintf("VNET: TX buffer is full/n");#endif	    goto out;	}      /* If so, then poll uIP for new XMIT data */      (void)uip_poll(&vnet->sk_dev, vnet_uiptxpoll);    } out:  irqrestore(flags);  return OK;}
开发者ID:l--putt,项目名称:nuttx-bb,代码行数:32,


示例11: e1000_txavail

static int e1000_txavail(struct uip_driver_s *dev){  struct e1000_dev *e1000 = (struct e1000_dev *)dev->d_private;  int tail = e1000->tx_ring.tail;  irqstate_t flags;  /* Disable interrupts because this function may be called from interrupt   * level processing.   */  flags = irqsave();  /* Ignore the notification if the interface is not yet up */  if (e1000->bifup)    {      /* Check if there is room in the hardware to hold another outgoing packet. */      if (e1000->tx_ring.desc[tail].desc_status)        {          (void)uip_poll(&e1000->uip_dev, e1000_uiptxpoll);        }    }  irqrestore(flags);  return OK;}
开发者ID:murix,项目名称:nuttx_ieee80211,代码行数:27,


示例12: tcp_server_demo_appcall

//这是一个TCP 服务器应用回调函数。//该函数通过UIP_APPCALL(tcp_demo_appcall)调用,实现Web Server的功能.//当uip事件发生时,UIP_APPCALL函数会被调用,根据所属端口(1200),确定是否执行该函数。//例如 : 当一个TCP连接被创建时、有新的数据到达、数据已经被应答、数据需要重发等事件void tcp_server_demo_appcall(void){ 	struct tcp_demo_appstate *s = (struct tcp_demo_appstate *)&uip_conn->appstate;	if(uip_aborted())tcp_server_aborted();		//连接终止 	if(uip_timedout())tcp_server_timedout();	//连接超时   	if(uip_closed())tcp_server_closed();		//连接关闭	    	if(uip_connected())tcp_server_connected();	//连接成功	    	if(uip_acked())tcp_server_acked();			//发送的数据成功送达 	//接收到一个新的TCP数据包 	if (uip_newdata())//收到客户端发过来的数据	{		if((tcp_server_sta&(1<<6))==0)//还未收到数据		{			if(uip_len>199)			{		   				((uint8_t*)uip_appdata)[199]=0;			}		    	    	strcpy((char*)tcp_server_databuf,uip_appdata);				   	  		  			tcp_server_sta|=1<<6;//表示收到客户端数据		}	}else if(tcp_server_sta&(1<<5))//有数据需要发送	{		s->textptr=tcp_server_databuf;		s->textlen=strlen((const char*)tcp_server_databuf);		tcp_server_sta&=~(1<<5);//清除标记	}   	//当需要重发、新数据到达、数据包送达、连接建立时,通知uip发送数据 	if(uip_rexmit()||uip_newdata()||uip_acked()||uip_connected()||uip_poll())	{		tcp_server_senddata();	}}	  
开发者ID:RdMaxes,项目名称:stm32f103_uIP_ENC28J60,代码行数:36,


示例13: httpd_appcall

/*---------------------------------------------------------------------------*/voidhttpd_appcall(void){  struct httpd_state *s = (struct httpd_state *)&(uip_conn->appstate);  if(uip_closed() || uip_aborted() || uip_timedout()) {  } else if(uip_connected()) {    PSOCK_INIT(&s->sin, s->inputbuf, sizeof(s->inputbuf) - 1);    PSOCK_INIT(&s->sout, s->inputbuf, sizeof(s->inputbuf) - 1);    PT_INIT(&s->outputpt);    s->state = STATE_WAITING;    /*    timer_set(&s->timer, CLOCK_SECOND * 100);*/    s->timer = 0;    handle_connection(s);  } else if(s != NULL) {    if(uip_poll()) {      ++s->timer;      if(s->timer >= 20) {	uip_abort();      }    } else {      s->timer = 0;    }    handle_connection(s);  } else {    uip_abort();  }}
开发者ID:topiaruss,项目名称:xmostcptests,代码行数:29,


示例14: uip_task_appcall

void uip_task_appcall(){  	if(uip_connected()) 	{		socket_process_new_connect_();	}else	if(uip_poll())	{		if(uip_stopped(uip_conn))		{			socket_process_try_restart_();		}				socket_process_write_();	}else	if(uip_newdata())	{		socket_process_new_data_();		socket_process_write_();	}else	if(uip_aborted() || uip_closed())	{		socket_process_close_();	}else	if(uip_timedout())	{		socket_process_timeout_();		uip_close();	}else	if(uip_acked() || uip_rexmit())	{		socket_process_write_();	}}
开发者ID:jayaraj-poroor,项目名称:freertos-uip-kernel,代码行数:34,


示例15: smcp_plat_process

smcp_status_tsmcp_plat_process(smcp_t self) {	SMCP_EMBEDDED_SELF_HOOK;	if (!uip_udpconnection()) {		goto bail;	}	if (uip_udp_conn != smcp_plat_get_udp_conn(smcp)) {		goto bail;	}	if(uip_newdata()) {		memcpy(&self->plat.sockaddr_remote.smcp_addr,&UIP_IP_BUF->srcipaddr,sizeof(smcp_addr_t));		self->plat.sockaddr_remote.smcp_port = UIP_UDP_BUF->srcport;		memcpy(&self->plat.sockaddr_local.smcp_addr,&UIP_IP_BUF->destipaddr,sizeof(smcp_addr_t));		self->plat.sockaddr_local.smcp_port = UIP_UDP_BUF->destport;		smcp_plat_set_session_type(SMCP_SESSION_TYPE_UDP);		smcp_inbound_packet_process(smcp, uip_appdata, uip_datalen(), 0);	} else if(uip_poll()) {		smcp_set_current_instance(self);		smcp_handle_timers(self);	}bail:	smcp_set_current_instance(NULL);	self->is_responding = false;	return 0;}
开发者ID:robbie-cao,项目名称:smcp,代码行数:33,


示例16: irc_main

static voidirc_main(void){    if (uip_aborted() || uip_timedout()) {	IRCDEBUG ("connection aborted/n");	irc_conn = NULL;    }    if (uip_closed()) {	IRCDEBUG ("connection closed/n");	irc_conn = NULL;    }    if (uip_connected()) {	IRCDEBUG ("new connection/n");	STATE->stage = IRC_SEND_USERNICK;	STATE->sent = IRC_SEND_INIT;#ifdef ECMD_IRC_SUPPORT	STATE->reparse = 0;#endif	*STATE->outbuf = 0;    }    if (STATE->stage == IRC_SEND_JOIN	&& uip_acked ())	STATE->stage ++;    else if (STATE->stage == IRC_CONNECTED	     && uip_acked ()) {	*STATE->outbuf = 0;#ifdef ECMD_IRC_SUPPORT	if (STATE->reparse)	    irc_handle_ecmd ();#endif    }    else if (uip_newdata() && uip_len) {	((char *) uip_appdata)[uip_len] = 0;	IRCDEBUG ("received data: %s/n", uip_appdata);	if (irc_parse ()) {	    uip_close ();	/* Parse error */	    return;	}    }    if (uip_rexmit ())	irc_send_data (STATE->sent);    else if ((STATE->stage > STATE->sent || STATE->stage == IRC_CONNECTED)	     && (uip_newdata()		 || uip_acked()		 || uip_connected()))	irc_send_data (STATE->stage);    else if (STATE->stage == IRC_CONNECTED && uip_poll() && *STATE->outbuf)	irc_send_data (STATE->stage);}
开发者ID:HansBaechle,项目名称:ethersex,代码行数:59,


示例17: httpd_main

voidhttpd_main(void){  if (uip_aborted() || uip_timedout())  {    printf("httpd: connection aborted/n");    httpd_cleanup();    return;  }  if (uip_closed())  {    printf("httpd: connection closed/n");    httpd_cleanup();    return;  }  if (uip_connected())  {    printf("httpd: new connection/n");    /* initialize struct */    STATE->handler = NULL;    STATE->header_acked = 0;    STATE->eof = 0;    STATE->header_reparse = 0;#ifdef HTTPD_AUTH_SUPPORT    STATE->auth_state = PAM_UNKOWN;#endif  }  if (uip_newdata() && (!STATE->handler || STATE->header_reparse))  {    printf("httpd: new data/n");    httpd_handle_input();  }#ifdef HTTPD_AUTH_SUPPORT  if (STATE->auth_state == PAM_DENIED && STATE->handler != httpd_handle_401)  {    httpd_cleanup();    STATE->handler = httpd_handle_401;    STATE->header_reparse = 0;    printf("httpd: auth failed/n");  }  else if (STATE->auth_state == PAM_PENDING)    return;                     /* Waiting for the PAM Layer */#endif  if (uip_rexmit() ||      uip_newdata() || uip_acked() || uip_poll() || uip_connected())  {    /* Call associated handler, if set already. */    if (STATE->handler && (!STATE->header_reparse))      STATE->handler();  }}
开发者ID:AnDann,项目名称:ethersex,代码行数:59,


示例18: webclient_appcall

/*-----------------------------------------------------------------------------------*/voidwebclient_appcall(void){  if(uip_connected()) {    s.timer = 0;    s.state = WEBCLIENT_STATE_STATUSLINE;    senddata();    webclient_connected();    return;  }  if(s.state == WEBCLIENT_STATE_CLOSE) {    webclient_closed();    uip_abort();    return;  }  if(uip_aborted()) {    webclient_aborted();  }  if(uip_timedout()) {    webclient_timedout();  }    if(uip_acked()) {    s.timer = 0;    acked();  }  if(uip_newdata()) {    s.timer = 0;    newdata();  }  if(uip_rexmit() ||     uip_newdata() ||     uip_acked()) {    senddata();  } else if(uip_poll()) {    ++s.timer;    if(s.timer == WEBCLIENT_TIMEOUT) {      webclient_timedout();      uip_abort();      return;    }        /*    senddata();*/  }  if(uip_closed()) {    if(s.httpflag != HTTPFLAG_MOVED) {      /* Send NULL data to signal EOF. */      webclient_datahandler(NULL, 0);    } else {      if(resolv_lookup(s.host) == NULL) {	resolv_query(s.host);      }      webclient_get(s.host, s.port, s.file);    }  }}
开发者ID:ichpuchtli,项目名称:freeburn,代码行数:60,


示例19: i2c_udp_net_main

voidi2c_udp_net_main(void){  if (uip_poll())     i2c_udp_periodic();  if (uip_newdata())    i2c_udp_newdata();}
开发者ID:1234tester,项目名称:ethersex,代码行数:8,


示例20: jabber_main

static voidjabber_main(void){  if (uip_aborted() || uip_timedout())  {    JABDEBUG("connection aborted/n");    jabber_conn = NULL;  }  if (uip_closed())  {    JABDEBUG("connection closed/n");    jabber_conn = NULL;  }  if (uip_connected())  {    JABDEBUG("new connection/n");    STATE->stage = JABBER_OPEN_STREAM;    STATE->sent = JABBER_INIT;#ifdef JABBER_STARTUP_MESSAGE_SUPPORT    strncpy_P(STATE->target, PSTR(CONF_JABBER_BUDDY), sizeof(STATE->target));    strncpy_P(STATE->outbuf, jabber_startup_text, sizeof(STATE->outbuf));    STATE->action = JABBER_ACTION_MESSAGE;#endif /* JABBER_STARTUP_MESSAGE_SUPPORT */  }  if (uip_acked() && STATE->stage == JABBER_CONNECTED)  {    STATE->action = JABBER_ACTION_NONE;    *STATE->outbuf = 0;  }  if (uip_newdata() && uip_len)  {    /* Zero-terminate */    ((char *) uip_appdata)[uip_len] = 0;    JABDEBUG("received data: %s/n", uip_appdata);    if (jabber_parse())    {      uip_close();              /* Parse error */      return;    }  }  if (uip_rexmit())    jabber_send_data(STATE->stage, STATE->action);  else if ((STATE->stage > STATE->sent || STATE->stage == JABBER_CONNECTED)           && (uip_newdata() || uip_acked() || uip_connected()))    jabber_send_data(STATE->stage, STATE->action);  else if (STATE->stage == JABBER_CONNECTED && uip_poll() && STATE->action)    jabber_send_data(STATE->stage, STATE->action);}
开发者ID:AnDann,项目名称:ethersex,代码行数:57,


示例21: syslog_net_main

voidsyslog_net_main(void) {  if (! uip_poll ())    return;#ifdef ENC28J60_SUPPORT  if (uip_check_cache (&syslog_conn->ripaddr))    uip_slen = 1;		/* Trigger xmit to do force ARP lookup. */#endif}
开发者ID:EtherGraf,项目名称:ethersex,代码行数:11,


示例22: e1000_interrupt_handler

static irqreturn_t e1000_interrupt_handler(int irq, void *dev_id){    struct e1000_dev *e1000 = (struct e1000_dev *)dev_id;        /* Get and clear interrupt status bits */    int intr_cause = e1000_inl(e1000, E1000_ICR);    e1000_outl(e1000, E1000_ICR, intr_cause);    // not for me    if (intr_cause == 0) 		return IRQ_NONE;    /* Handle interrupts according to status bit settings */    // Link status change    if (intr_cause & (1<<2)) {		if (e1000_inl(e1000, E1000_STATUS) & 2)			e1000->bifup = true;		else			e1000->bifup = false;    }        /* Check if we received an incoming packet, if so, call skel_receive() */    // Rx-descriptor Timer expired    if (intr_cause & (1<<7))		e1000_receive(e1000);    // Tx queue empty    if (intr_cause & (1<<1))		wd_cancel(e1000->txtimeout);    /* Check is a packet transmission just completed.  If so, call skel_txdone.     * This may disable further Tx interrupts if there are no pending     * tansmissions.     */    // Tx-descriptor Written back    if (intr_cause & (1<<0))		uip_poll(&e1000->uip_dev, e1000_uiptxpoll);      // Rx-Descriptors Low    if (intr_cause & (1<<4)) {		int tail;		tail = e1000->rx_ring.tail + e1000->rx_ring.free;		tail %= CONFIG_E1000_N_RX_DESC;		e1000->rx_ring.tail = tail;		e1000->rx_ring.free = 0;		e1000_outl(e1000, E1000_RDT, tail);    }    return IRQ_HANDLED;}
开发者ID:1015472,项目名称:PX4NuttX,代码行数:54,


示例23: udpds_appcall

/*---------------------------------------------------------------------------*/voidudpds_appcall(void){  if(uip_poll()) {    if(udpds_enable_state && 		timer_expired(&udpds_interval_timer)) {      uip_udp_send(udpds_set_payload());      timer_reset(&udpds_interval_timer);	}  }}
开发者ID:jaseg,项目名称:avr-uip,代码行数:12,


示例24: rc5_udp_recv

/* *  callback function for UDP stack *      uip_poll has to be called before uip_udp_send */voidrc5_udp_recv(void){  if (!uip_poll())    return;#ifdef ETHERNET_SUPPORT  if (udpconn && uip_check_cache(&udpconn->ripaddr))    uip_slen = 1;               /* Trigger xmit to do force ARP lookup. */#endif}
开发者ID:1234tester,项目名称:ethersex,代码行数:15,


示例25: resolv_appcall

/*---------------------------------------------------------------------------*/voidresolv_appcall(void){  if(uip_udp_conn->rport == UIP_HTONS(53)) {    if(uip_poll()) {      check_entries();    }    if(uip_newdata()) {      newdata();    }  }}
开发者ID:FelixPe,项目名称:NanodeUIP,代码行数:13,


示例26: skel_txtimeout

static void skel_txtimeout(int argc, uint32_t arg, ...){  FAR struct skel_driver_s *skel = (FAR struct skel_driver_s *)arg;  /* Increment statistics and dump debug info */  /* Then reset the hardware */  /* Then poll uIP for new XMIT data */  (void)uip_poll(&skel->sk_dev, skel_uiptxpoll);}
开发者ID:grissiom,项目名称:muttx-mirror,代码行数:12,


示例27: emac_txtimeout

static void emac_txtimeout(int argc, uint32_t arg, ...){  FAR struct emac_driver_s *priv = (FAR struct emac_driver_s *)arg;  /* Increment statistics and dump debug info */  /* Then reset the hardware */  /* Then poll uIP for new XMIT data */  (void)uip_poll(&priv->d_dev, emac_uiptxpoll);}
开发者ID:drasko,项目名称:opendous_nuttx,代码行数:12,


示例28: e1000_txtimeout

static void e1000_txtimeout(int argc, uint32_t arg, ...){    struct e1000_dev *e1000 = (struct e1000_dev *)arg;    /* Increment statistics and dump debug info */    /* Then reset the hardware */    e1000_init(e1000);    /* Then poll uIP for new XMIT data */    (void)uip_poll(&e1000->uip_dev, e1000_uiptxpoll);}
开发者ID:1015472,项目名称:PX4NuttX,代码行数:13,


示例29: udp_8899_app

/***************************************************************************** 函 数 名  : udp_8899_app 功能描述  : a uip udp function for local port is 8899 输入参数  : void   输出参数  : 无 返 回 值  :  调用函数  :  被调函数  :   修改历史      :  1.日    期   : 2017年4月17日    作    者   : QSWWD    修改内容   : 新生成函数*****************************************************************************/static void udp_8899_app(void){	if(uip_poll())	{		char *tmp_dat = "the auto send!/n/r";		uip_send(tmp_dat,strlen(tmp_dat));	}	if(uip_newdata())	{		char *tmp_data = "receive the data!/n/r";		uip_send(tmp_data,strlen(tmp_data));	}}
开发者ID:haikong,项目名称:haikong.github.io,代码行数:28,


示例30: httpd_appcall

/*---------------------------------------------------------------------------*/voidhttpd_appcall(void *state){#if DEBUGLOGIC  struct httpd_state *s;   //Enter here for debugging with output directed to TCPBUF  s = sg = (struct httpd_state *)memb_alloc(&conns);  if (1) {#else  struct httpd_state *s = (struct httpd_state *)state;  if(uip_closed() || uip_aborted() || uip_timedout()) {    if(s != NULL) {      memb_free(&conns, s);    }  } else if(uip_connected()) {    s = (struct httpd_state *)memb_alloc(&conns);    if(s == NULL) {      uip_abort();      return;    }#endif    tcp_markconn(uip_conn, s);    PSOCK_INIT(&s->sin, (uint8_t *)s->inputbuf, sizeof(s->inputbuf) - 1);    PSOCK_INIT(&s->sout, (uint8_t *)s->inputbuf, sizeof(s->inputbuf) - 1);    PT_INIT(&s->outputpt);    s->state = STATE_WAITING;    /*    timer_set(&s->timer, CLOCK_SECOND * 100);*/    s->timer = 0;    handle_connection(s);  } else if(s != NULL) {    if(uip_poll()) {      ++s->timer;      if(s->timer >= 20) {        uip_abort();        memb_free(&conns, s);      }    } else {      s->timer = 0;    }    handle_connection(s);  } else {    uip_abort();  }}/*---------------------------------------------------------------------------*/voidhttpd_init(void){  tcp_listen(UIP_HTONS(80));  memb_init(&conns);  httpd_cgi_init();}
开发者ID:Ammar-85,项目名称:contiki-arduino,代码行数:52,



注:本文中的uip_poll函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ uip_rexmit函数代码示例
C++ uip_periodic函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。