ThingPlug Test

Dependents:   WizFi310_ThingPlug_Test WizFi310_ThingPlug_Test_P

Fork of WizFi310Interface by WIZnet

Revision:
1:16e57103a7dd
Parent:
0:df571f8f8c03
Child:
5:72212beb817c
Child:
9:90902218e268
--- a/WizFi310/WizFi310_sock.cpp	Wed Oct 05 09:40:30 2016 +0000
+++ b/WizFi310/WizFi310_sock.cpp	Mon Oct 10 05:12:51 2016 +0000
@@ -169,14 +169,17 @@
     int i;
 
     if (!isConnected(cid))  return -1;
+    
+    if (_con[cid].buf == NULL ) return 0;
 
-    if (_con[cid].buf == NULL ) return 0;
     while (!_con[cid].received && _state.mode != MODE_COMMAND);
     _con[cid].received = false;
+    
     for(i=0; i<len; i++)
     {
         if(_con[cid].buf->dequeue(&buf[i]) == false)    break;
     }
+    
     setRts(true);       // release
     return i;
 }
@@ -215,7 +218,7 @@
 bool WizFi310::isConnected (int cid)
 {
     if ( cid < 0 || cid >=8 ) return false;
-
+    //printf("%d %d\r\n", cid, _con[cid].connected);
     return _con[cid].connected;
 }