这篇教程C++ uip_arp_timer函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中uip_arp_timer函数的典型用法代码示例。如果您正苦于以下问题:C++ uip_arp_timer函数的具体用法?C++ uip_arp_timer怎么用?C++ uip_arp_timer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了uip_arp_timer函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: tcpip_periodic_timervoid tcpip_periodic_timer(){ int i; MT_TimerExpired(); if(timer_expired(&periodic_timer)) { timer_reset(&periodic_timer); for(i = 0; i < UIP_CONNS; i++) { uip_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); mt76xx_dev_send(); } }#if UIP_UDP for(i = 0; i < UIP_UDP_CONNS; i++) { uip_udp_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); mt76xx_dev_send(); } }#endif /* UIP_UDP */ /* Call the ARP timer function every 10 seconds. */ if(timer_expired(&arp_timer)) { timer_reset(&arp_timer); uip_arp_timer(); } }#if 0 if(timer_expired(&cli_timer)) { clk = (clk > (CLOCK_SECOND*60))?clk:(clk*2); timer_set(&cli_timer, clk); if ((cli_fd == -1) && memcmp(uip_hostaddr, 0x00000000, sizeof(uip_hostaddr))) { struct uip_conn *conn = NULL; uip_ipaddr_t srv_ip; uip_ipaddr(srv_ip, IoTpAd.ComCfg.IoT_ServeIP[0], IoTpAd.ComCfg.IoT_ServeIP[1], IoTpAd.ComCfg.IoT_ServeIP[2], IoTpAd.ComCfg.IoT_ServeIP[3]); conn = uip_connect(&srv_ip, HTONS(IoTpAd.ComCfg.IoT_TCP_Srv_Port)); if(conn) { conn->lport = HTONS(7682); cli_fd = conn->fd; } else { printf("connect fail/n"); } } }#endif }
开发者ID:cxy560,项目名称:ZCloud,代码行数:60,
示例2: sizeofvoid Network::on_idle(void *argument){ if (!ethernet->isUp()) return; int len= sizeof(uip_buf); // set maximum size if (ethernet->_receive_frame(uip_buf, &len)) { uip_len = len; this->handlePacket(); } else { if (timer_expired(&periodic_timer)) { /* no packet but periodic_timer time out (0.1s)*/ timer_reset(&periodic_timer); for (int i = 0; i < UIP_CONNS; i++) { uip_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if (uip_len > 0) { uip_arp_out(); tapdev_send(uip_buf, uip_len); } }#if UIP_CONF_UDP for (int i = 0; i < UIP_UDP_CONNS; i++) { uip_udp_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if (uip_len > 0) { uip_arp_out(); tapdev_send(uip_buf, uip_len); } }#endif }/* This didn't work actually made it worse,it should have worked though else{ // TODO if the command queue is below a certain amount we should poll any stopped connections if(command_q->size() < 4) { for (struct uip_conn *connr = &uip_conns[0]; connr <= &uip_conns[UIP_CONNS - 1]; ++connr) { if(uip_stopped(connr)){ // Force a poll of this printf("Force poll of connection/n"); uip_poll_conn(connr); } } } }*/ /* Call the ARP timer function every 10 seconds. */ if (timer_expired(&arp_timer)) { timer_reset(&arp_timer); uip_arp_timer(); } }}
开发者ID:2thetop,项目名称:Smoothieware,代码行数:60,
示例3: ethernet_servicevoid ethernet_service(void) { int i; struct uip_eth_hdr *buf = (struct uip_eth_hdr *)&uip_buf[0]; etimer_request_poll(); process_run(); uip_len = liteethmac_poll(); if(uip_len > 0) { if(buf->type == uip_htons(UIP_ETHTYPE_IP)) { uip_arp_ipin(); uip_input(); if(uip_len > 0) { uip_arp_out(); liteethmac_send(); } } else if(buf->type == uip_htons(UIP_ETHTYPE_ARP)) { uip_arp_arpin(); if(uip_len > 0) liteethmac_send(); } } else if (elapsed(&uip_periodic_event, uip_periodic_period)) { for(i = 0; i < UIP_CONNS; i++) { uip_periodic(i); if(uip_len > 0) { uip_arp_out(); liteethmac_send(); } } } if (elapsed(&uip_arp_event, uip_arp_period)) { uip_arp_timer(); }}
开发者ID:enjoy-digital,项目名称:arty-soc,代码行数:35,
示例4: dealvoid deal(){ int i; if(uip_len > 0) { if(BUF_IF->type == htons(UIP_ETHTYPE_IP)) { uip_arp_ipin(); uip_input(); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); current_dev->eth_tx(current_dev, uip_buf, uip_len); } } else if(BUF_IF->type == htons(UIP_ETHTYPE_ARP)) { uip_arp_arpin(); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { current_dev->eth_tx(current_dev, uip_buf, uip_len); } } } else if(timer_expired(&periodic_timer)) { timer_reset(&periodic_timer); for(i = 0; i < UIP_CONNS; i++) { uip_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); current_dev->eth_tx(current_dev, uip_buf, uip_len); } }#if UIP_UDP for(i = 0; i < UIP_UDP_CONNS; i++) { uip_udp_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); current_dev->eth_tx(current_dev, uip_buf, uip_len); } }#endif /* UIP_UDP */ /* Call the ARP timer function every 10 seconds. */ if(timer_expired(&arp_timer)) { timer_reset(&arp_timer); uip_arp_timer(); } } //rt_exit_critical(); return 0;}
开发者ID:dreamflyforever,项目名称:rt-thread-1.1.0,代码行数:59,
示例5: uip_servervoid uip_server(chanend mac_rx, chanend mac_tx, chanend xtcp[], int num_xtcp, xtcp_ipconfig_t *ipconfig, chanend connect_status) { struct uip_timer periodic_timer, arp_timer, autoip_timer; unsigned char hwaddr[6]; timer_set(&periodic_timer, CLOCK_SECOND / 10); timer_set(&autoip_timer, CLOCK_SECOND / 2); timer_set(&arp_timer, CLOCK_SECOND * 10); xcoredev_init(mac_rx, mac_tx); mac_get_macaddr(mac_tx, hwaddr); uip_server_init(xtcp, num_xtcp, ipconfig, hwaddr); // Main uIP service loop while (1) { xtcpd_service_clients(xtcp, num_xtcp); xtcpd_check_connection_poll(mac_tx); uip_xtcp_checkstate(); uip_xtcp_checklink(connect_status); uip_len = xcoredev_read(mac_rx, UIP_CONF_BUFFER_SIZE); if (uip_len > 0) { xtcp_process_incoming_packet(mac_tx); } xtcp_process_udp_acks(mac_tx); if (timer_expired(&arp_timer)) { timer_reset(&arp_timer); uip_arp_timer(); }#if UIP_USE_AUTOIP if (timer_expired(&autoip_timer)) { timer_reset(&autoip_timer); autoip_periodic(); if (uip_len > 0) { xtcp_tx_buffer(mac_tx); } }#endif if (timer_expired(&periodic_timer)) { xtcp_process_periodic_timer(mac_tx); timer_reset(&periodic_timer); } } return;}
开发者ID:BiancoZandbergen,项目名称:XMOS_Minimal_Ethernet_Board,代码行数:58,
示例6: enc28j60PacketReceivevoid NanodeUIP::poll(void) { int i; uip_len = enc28j60PacketReceive(UIP_BUFSIZE,uip_buf); if(uip_len > 0) { if(BUF->type == UIP_HTONS(UIP_ETHTYPE_IP)) { uip_arp_ipin(); uip_input(); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); enc28j60PacketSend(uip_len,uip_buf); } } else if(BUF->type == UIP_HTONS(UIP_ETHTYPE_ARP)) { uip_arp_arpin(); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { enc28j60PacketSend(uip_len,uip_buf); } } } else if(timer_expired(&periodic_timer)) { timer_reset(&periodic_timer); for(i = 0; i < UIP_CONNS; i++) { uip_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); enc28j60PacketSend(uip_len,uip_buf); } }#if UIP_UDP for(i = 0; i < UIP_UDP_CONNS; i++) { uip_udp_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); enc28j60PacketSend(uip_len,uip_buf); } }#endif /* UIP_UDP */ /* Call the ARP timer function every 10 seconds. */ if(timer_expired(&arp_timer)) { timer_reset(&arp_timer); uip_arp_timer(); } }}
开发者ID:skydome,项目名称:NanodeUIP,代码行数:57,
示例7: Network_Process/** * @brief Process Network * @param None * @retval None */void Network_Process(void){ static uint8_t arp_counter = 0; int i; for (i = 0; i < UIP_CONNS; i++) { uip_periodic(i); if (uip_len > 0) { uip_arp_out(); enc28j60_send_packet((uint8_t *)uip_buf, uip_len); } } #if UIP_UDP for (i = 0; i < UIP_UDP_CONNS; i++) { uip_udp_periodic(i); if (uip_len > 0) { uip_arp_out(); network_send(); } } #endif /* UIP_UDP */ if (++arp_counter >= 50) { arp_counter = 0; uip_arp_timer(); } uip_len = enc28j60_recv_packet((uint8_t *)uip_buf, UIP_BUFSIZE); if (uip_len > 0) { if (((struct uip_eth_hdr *)&uip_buf[0])->type == htons(UIP_ETHTYPE_IP)) { uip_arp_ipin(); uip_input(); if (uip_len > 0) { uip_arp_out(); enc28j60_send_packet((uint8_t *)uip_buf, uip_len); } } else if (((struct uip_eth_hdr *)&uip_buf[0])->type == htons(UIP_ETHTYPE_ARP)) { uip_arp_arpin(); if (uip_len > 0) { enc28j60_send_packet((uint8_t *)uip_buf, uip_len); } } }}
开发者ID:alemoke,项目名称:theLEDStripControl,代码行数:61,
示例8: arptimer_pollstatic void arptimer_poll(int argc, uint32_t arg, ...){ /* Call the ARP timer function every 10 seconds. */ uip_arp_timer(); /* Setup the watchdog timer again */ (void)wd_start(g_arptimer, ARPTIMER_WDINTERVAL, arptimer_poll, 0);}
开发者ID:aliniger,项目名称:Firmware_orca,代码行数:10,
示例9: TcpIpMain/** ******************************************************************************************* * @fn void TcpIpMain(void) * @brief Update the uIP stack. * @return None * @attention ******************************************************************************************* */void TcpIpMain(void){ uint8_t Index; uip_len = nic_poll(); if (uip_len == 0) { // If timed out, call periodic function for each connection if (TcpIpUipTimerCounter >= TCP_IP_CNT_TIME) { TcpIpUipTimerCounter = 0; for (Index = 0; Index < UIP_CONNS; Index++) { uip_periodic(Index); if (uip_len > 0) { uip_arp_out(); nic_send(); } } /* Call the ARP timer function every ~10 seconds. */ if (++TcpIpUipArpTimerCounter >= TCP_IP_ARP_CNT_TIME) { uip_arp_timer(); TcpIpUipArpTimerCounter = 0; } } } else // packet received { // process an IP packet if (TCP_IP_BUF->type == htons(UIP_ETHTYPE_IP)) { uip_arp_ipin(); uip_input(); if (uip_len > 0) { uip_arp_out(); nic_send(); } } // process an ARP packet else if (TCP_IP_BUF->type == htons(UIP_ETHTYPE_ARP)) { uip_arp_arpin(); if (uip_len > 0) nic_send(); } TcpIpUipTimerCounter = 0; }}
开发者ID:AndTH,项目名称:GCA,代码行数:61,
示例10: uip_timeout_entryvoid uip_timeout_entry(void* parameter)//由于TIMEOUT函数,不参与调度{ // struct timer periodic_timer, arp_timer; static uint8_t cnt; int i; /* post message to ethernet thread */ //if ((rt_sem_take(msg,RT_WAITING_NO)) != -RT_ETIMEOUT) //if (timer_expired(&periodic_timer)) //5s enter once { //timer_reset(&periodic_timer); for (i = 0; i < UIP_CONNS; i++) { uip_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if (uip_len > 0) { uip_arp_out(); TransmitPacket(); } }#if UIP_UDP for (i = 0; i < UIP_UDP_CONNS; i++) // { uip_udp_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if (uip_len > 0) { uip_arp_out(); TransmitPacket(); } }#endif /* UIP_UDP */ /* Call the ARP timer function every 10 seconds. */ //if (timer_expired(&arp_timer)) if (++cnt >= 2) //t { //timer_reset(&arp_timer); uip_arp_timer(); cnt = 0; } } }
开发者ID:CollinsLiu,项目名称:rt-thread-pc,代码行数:49,
示例11: HttpdHandlervoid HttpdHandler(void){ int i; for(i = 0; i < UIP_CONNS; i++){ uip_periodic(i); if(uip_len > 0){ uip_arp_out(); NetSendHttpd(); } } if(++arptimer == 20){ uip_arp_timer(); arptimer = 0; }}
开发者ID:AdityaL05,项目名称:uboot,代码行数:17,
示例12: Ethernet_TaskvoidEthernet_Task(void) { int i; ethernet_process(); if(timer_expired(&periodic_timer)) { timer_reset(&periodic_timer); for(i = 0; i < UIP_CONNS; i++) { uip_periodic(i); if(uip_len > 0) { uip_arp_out(); network_send(); } } for(i = 0; i < UIP_UDP_CONNS; i++) { uip_udp_periodic(i); if(uip_len > 0) { uip_arp_out(); network_send(); } } interface_periodic(); } if(timer_expired(&arp_timer)) { timer_reset(&arp_timer); uip_arp_timer(); } }
开发者ID:Talustus,项目名称:culfw,代码行数:37,
示例13: uip_tcpip_threadvoid uip_tcpip_thread(void *parameter){ int i; static u8_t cnt; while(1) { rt_thread_delay(CLOCK_SECOND*5); for (i = 0; i < UIP_CONNS; i++) { uip_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if (uip_len > 0) { uip_arp_out(); TransmitPacket(); } }#if UIP_UDP for (i = 0; i < UIP_UDP_CONNS; i++) { uip_udp_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if (uip_len > 0) { uip_arp_out(); TransmitPacket(); } }#endif /* UIP_UDP */ /* Call the ARP timer function every 10 seconds. */ if (++cnt > 2) uip_arp_timer(); }}
开发者ID:634351070,项目名称:rt-thread,代码行数:37,
示例14: main//.........这里部分代码省略......... check_for_reset_jumper(); #ifdef SERIAL // start the serial port server seriald_init();#endif // SERIAL // initialize ethernet controller // loop until link comes up while (init_CP2200()==0) { _delay_ms(200); } // replace config by hardcoded defaults if the flash is unprogrammed (all bits 1) if (uip_ipaddr_cmp(config.ipaddr, all_ones_addr) && uip_ipaddr_cmp(config.netmask, all_ones_addr) && uip_ipaddr_cmp(config.gateway, all_ones_addr)) { set_defaults(); } // initialize uIP protocol uip_arp_init(); uip_init(); // Configure the IP-Adrdess IP_config(); #ifdef EMAIL_APP // Initialize the email application email_app_init();#endif // EMAIL_APP // Initialize the inetd inetd_init(); // main loop, dispatches network and timer events while (1) { uip_len = network_device_read(); if (uip_len > 0) { if (BUF->type == htons(UIP_ETHTYPE_IP)) { uip_arp_ipin(); uip_input(); // If the above function invocation resulted in data that // should be sent out on the network, the global variable // uip_len is set to a value > 0. if (uip_len > 0) { uip_arp_out(); network_device_send(); } } else if (BUF->type == htons(UIP_ETHTYPE_ARP)) { uip_arp_arpin(); // If the above function invocation resulted in data that // should be sent out on the network, the global variable // uip_len is set to a value > 0. if (uip_len > 0) { network_device_send(); } } } else if (timer_expired(&periodic_timer)) { timer_reset(&periodic_timer); for (int i = 0; i < UIP_CONNS; i++) { uip_periodic(i); // If the above function invocation resulted in data that // should be sent out on the network, the global variable // uip_len is set to a value > 0. if (uip_len > 0) { uip_arp_out(); network_device_send(); } }#if UIP_UDP for (int i = 0; i < UIP_UDP_CONNS; i++) { uip_udp_periodic(i); // If the above function invocation resulted in data that // should be sent out on the network, the global variable // uip_len is set to a value > 0. if (uip_len > 0) { uip_arp_out(); network_device_send(); } }#endif // UIP_UDP // Call the ARP timer function every 10 seconds. if (timer_expired(&arp_timer)) { timer_reset(&arp_timer); uip_arp_timer(); } } #ifdef EMAIL_APP email_app_main_loop();#endif //EMAIL_APP } return 0;}
开发者ID:housecream,项目名称:restmcu,代码行数:101,
示例15: UIP_TASK_Handler//.........这里部分代码省略......... uip_ipaddr(ipaddr, ((MY_NETMASK)>>24) & 0xff, ((MY_NETMASK)>>16) & 0xff, ((MY_NETMASK)>> 8) & 0xff, ((MY_NETMASK)>> 0) & 0xff); uip_setnetmask(ipaddr); // default router uip_ipaddr(ipaddr, ((MY_GATEWAY)>>24) & 0xff, ((MY_GATEWAY)>>16) & 0xff, ((MY_GATEWAY)>> 8) & 0xff, ((MY_GATEWAY)>> 0) & 0xff); uip_setdraddr(ipaddr); MIOS32_MIDI_SendDebugMessage("[UIP_TASK] IP Address statically set:/n"); // start services immediately UIP_TASK_StartServices();#endif // release exclusive access to UIP functions MUTEX_UIP_GIVE; // endless loop while( 1 ) { vTaskDelayUntil(&xLastExecutionTime, 1 / portTICK_RATE_MS); // take over exclusive access to UIP functions MUTEX_UIP_TAKE; if( !(clock_time_tick() % 100) ) { // each 100 mS: check availablility of network device network_device_check(); } if( network_device_available() ) { uip_len = network_device_read(); if( uip_len > 0 ) { if(BUF->type == htons(UIP_ETHTYPE_IP) ) { uip_arp_ipin(); uip_input(); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if( uip_len > 0 ) { uip_arp_out(); network_device_send(); } } else if(BUF->type == htons(UIP_ETHTYPE_ARP)) { uip_arp_arpin(); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { network_device_send(); } } } else if(timer_expired(&periodic_timer)) { timer_reset(&periodic_timer); for(i = 0; i < UIP_CONNS; i++) { uip_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); network_device_send(); } }#if UIP_UDP for(i = 0; i < UIP_UDP_CONNS; i++) { uip_udp_periodic(i); /* If the above function invocation resulted in data that should be sent out on the network, the global variable uip_len is set to a value > 0. */ if(uip_len > 0) { uip_arp_out(); network_device_send(); } }#endif /* UIP_UDP */ /* Call the ARP timer function every 10 seconds. */ if(timer_expired(&arp_timer)) { timer_reset(&arp_timer); uip_arp_timer(); } } } // release exclusive access to UIP functions MUTEX_UIP_GIVE; }}
开发者ID:JKcompute,项目名称:395_midi_controller,代码行数:101,
示例16: main/*---------------------------------------------------------------------------*/intmain(void){ int i; uip_ipaddr_t ipaddr; struct timer periodic_timer, arp_timer; timer_set(&periodic_timer, CLOCK_SECOND / 2); timer_set(&arp_timer, CLOCK_SECOND * 10); tapdev_init(); uip_init(); uip_ipaddr(ipaddr, 192,168,0,2); uip_sethostaddr(ipaddr); uip_ipaddr(ipaddr, 192,168,0,1); uip_setdraddr(ipaddr); uip_ipaddr(ipaddr, 255,255,255,0); uip_setnetmask(ipaddr); httpd_init(); /* telnetd_init();*/ /* hello_world_init();*/ /* { u8_t mac[6] = {1,2,3,4,5,6}; dhcpc_init(&mac, 6); }*/ /*uip_ipaddr(ipaddr, 127,0,0,1); smtp_configure("localhost", ipaddr); SMTP_SEND("[email C++ uip_close函数代码示例 C++ uip_arp_out函数代码示例
|