cc

Dependencies:   SPWF01SA

Revision:
3:4c2cbca19031
Parent:
2:610672ed2e9f
Child:
4:2f3f156a3b0b
diff -r 610672ed2e9f -r 4c2cbca19031 SpwfInterface.cpp
--- a/SpwfInterface.cpp	Thu Jul 07 06:45:32 2016 +0000
+++ b/SpwfInterface.cpp	Thu Jul 07 11:06:10 2016 +0000
@@ -298,7 +298,7 @@
 int SpwfSAInterface::socket_send(void *handle, const void *data, unsigned size)
 {    
     struct spwf_socket *socket = (struct spwf_socket *)handle;
-    int err;
+    //int err;
     
     /*if(socket->id==SERVER_SOCKET_NO)
         {
@@ -308,11 +308,14 @@
             err = _spwf.socket_server_write((uint16_t)size, (char*)data);
         }
     else
-        {*/
+        {
             err = _spwf.send(socket->id, (char*)data, (uint32_t)size);
-        //}
-    
-    return err;
+        }*/
+    if (!_spwf.send(socket->id, (char*)data, (uint32_t)size)) {
+        return NSAPI_ERROR_DEVICE_ERROR;
+    }
+ 
+    return size;
 }
 
 /**
@@ -332,6 +335,7 @@
     //CHECK:Receive for both Client and Server Sockets same?
     recv = _spwf.recv(socket->id, (char*)data, (uint32_t)size);    
     if (recv < 0) {
+        //printf("ret -1\r\n");
         return NSAPI_ERROR_WOULD_BLOCK;
     }
     return recv;