SNIC UART Interface library: Serial to Wi-Fi library for Murata TypeYD Wi-Fi module. For more information about TypeYD: http://www.murata.co.jp/products/microwave/module/lbwb1zzydz/index.html

Dependents:   SNIC-xively-jumpstart-demo SNIC-FluentLogger-example TCPEchoServer murataDemo ... more

Fork of YDwifiInterface by Takao Kishino

Revision:
48:ee7e07fb401f
Parent:
43:d80bbb12ffe6
diff -r 69dd5911fc6a -r ee7e07fb401f Socket/TCPSocketConnection.cpp
--- a/Socket/TCPSocketConnection.cpp	Mon Feb 02 00:10:06 2015 +0000
+++ b/Socket/TCPSocketConnection.cpp	Tue Mar 31 02:48:32 2015 +0000
@@ -191,7 +191,7 @@
 
     // SNIC_SEND_FROM_SOCKET_REQ
     FUNC_OUT();
-    return 0;
+    return length;
 }
 
 int TCPSocketConnection::send_all(char *data_p, int length)
@@ -229,9 +229,17 @@
         return -1;
     }
     con_info_p->is_receive_complete = true;
-    while( con_info_p->is_received == false )
+    if( con_info_p->is_received == false )
     {
+        // Try receive
         Thread::yield();
+        
+        if( con_info_p->is_received == false )
+        {
+            // No data received.
+            FUNC_OUT();
+            return 0;
+        }        
     }
     // Get packet data from buffer for receive.
     for (i = 0; i < length; i ++) 
@@ -253,6 +261,11 @@
     return i;
 }
 
+int TCPSocketConnection::receive_all(char* data_p, int length)
+{
+    return receive( data_p, length );
+}
+
 void TCPSocketConnection::setAcceptSocket( int socket_id )
 {
     FUNC_IN();