for testing wifi

Dependents:   ESP8266_Test_WIFI

Fork of ESP8266Interface by Steve Kim

Revision:
23:de9221771e96
Parent:
22:c4360e61486a
Child:
27:9c6cefc12f0c
--- a/Socket/UDPSocket.cpp	Tue Dec 02 16:02:21 2014 +0000
+++ b/Socket/UDPSocket.cpp	Mon Dec 08 00:53:07 2014 +0000
@@ -95,15 +95,14 @@
     while (time < _timeout) {
 
         nb_available = wifi->readable();
-        for (int i = 0; i < min(nb_available, length); i++) {
+        //for (int i = 0; i < min(nb_available, length); i++) {
+        for (int i = 0; i < min(nb_available, (length-idx)); i++) {
             buffer[idx] = wifi->getc();
             idx++;
         }
-
         if (idx == length) {
             break;
         }
-        
         time = tmr.read_ms();
     }
     readEndpoint(remote);