From a6163888f3c56123b1db313743c6147ba498732c Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Fri, 8 Aug 2014 14:42:07 +0300 Subject: Add third_party libs --- third_party/uip-1.0/doc/html/a00043.html | 82 ++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 third_party/uip-1.0/doc/html/a00043.html (limited to 'third_party/uip-1.0/doc/html/a00043.html') diff --git a/third_party/uip-1.0/doc/html/a00043.html b/third_party/uip-1.0/doc/html/a00043.html new file mode 100644 index 0000000..53361f1 --- /dev/null +++ b/third_party/uip-1.0/doc/html/a00043.html @@ -0,0 +1,82 @@ + + +uIP 1.0: example-mainloop-without-arp.c + + + + +
+
+

example-mainloop-without-arp.c

00001 #include "uip.h"
+00002 #include "uip_arp.h"
+00003 #include "network-device.h"
+00004 #include "httpd.h"
+00005 #include "timer.h"
+00006 
+00007 /*---------------------------------------------------------------------------*/
+00008 int
+00009 main(void)
+00010 {
+00011   int i;
+00012   uip_ipaddr_t ipaddr;
+00013   struct timer periodic_timer;
+00014   
+00015   timer_set(&periodic_timer, CLOCK_SECOND / 2);
+00016   
+00017   network_device_init();
+00018   uip_init();
+00019 
+00020   uip_ipaddr(ipaddr, 192,168,0,2);
+00021   uip_sethostaddr(ipaddr);
+00022 
+00023   httpd_init();
+00024   
+00025   while(1) {
+00026     uip_len = network_device_read();
+00027     if(uip_len > 0) {
+00028       uip_input();
+00029       /* If the above function invocation resulted in data that
+00030          should be sent out on the network, the global variable
+00031          uip_len is set to a value > 0. */
+00032       if(uip_len > 0) {
+00033         network_device_send();
+00034       }
+00035     } else if(timer_expired(&periodic_timer)) {
+00036       timer_reset(&periodic_timer);
+00037       for(i = 0; i < UIP_CONNS; i++) {
+00038         uip_periodic(i);
+00039         /* If the above function invocation resulted in data that
+00040            should be sent out on the network, the global variable
+00041            uip_len is set to a value > 0. */
+00042         if(uip_len > 0) {
+00043           network_device_send();
+00044         }
+00045       }
+00046 
+00047 #if UIP_UDP
+00048       for(i = 0; i < UIP_UDP_CONNS; i++) {
+00049         uip_udp_periodic(i);
+00050         /* If the above function invocation resulted in data that
+00051            should be sent out on the network, the global variable
+00052            uip_len is set to a value > 0. */
+00053         if(uip_len > 0) {
+00054           network_device_send();
+00055         }
+00056       }
+00057 #endif /* UIP_UDP */
+00058     }
+00059   }
+00060   return 0;
+00061 }
+00062 /*---------------------------------------------------------------------------*/
+

Generated on Mon Jun 12 10:23:01 2006 for uIP 1.0 by  + +doxygen 1.4.6
+ + -- cgit v1.3.1