Updates and additions required by mbed-os 5.2.2

Dependencies:   SPWF01SA-lapi-1

Dependents:   x-nucleo-iks01a1-test x-nucleo-iks01a1-test

Fork of X_NUCLEO_IDW01M1v2 by ST

Files at this revision

API Documentation at this revision

Comitter:
mridup
Date:
Tue Aug 02 07:05:25 2016 +0000
Parent:
4:2f3f156a3b0b
Child:
6:5b86d03236e1
Commit message:
sock_recv returns DEVICE_ERROR as well to not block in case of "device error"

Changed in this revision

SPWF01SA.lib Show annotated file Show diff for this revision Revisions of this file
SpwfInterface.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/SPWF01SA.lib	Thu Jul 07 13:21:57 2016 +0000
+++ b/SPWF01SA.lib	Tue Aug 02 07:05:25 2016 +0000
@@ -1,1 +1,1 @@
-https://developer.mbed.org/users/mridup/code/SPWF01SA/#00bc9c029aec
+https://developer.mbed.org/users/mridup/code/SPWF01SA/#f21e4e73bbb6
--- a/SpwfInterface.cpp	Thu Jul 07 13:21:57 2016 +0000
+++ b/SpwfInterface.cpp	Tue Aug 02 07:05:25 2016 +0000
@@ -335,9 +335,12 @@
     //CHECK:Receive for both Client and Server Sockets same?
     recv = _spwf.recv(socket->id, (char*)data, (uint32_t)size);    
     if (recv < 0) {
-        wait_ms(1);//delay of 1ms <for F4>??
-        return NSAPI_ERROR_WOULD_BLOCK;//send this if we want to block call (else timeout will happen)
+        //wait_ms(1);//delay of 1ms <for F4>??
+        //printf(".");
+        if (recv == -1) return NSAPI_ERROR_WOULD_BLOCK;//send this if we want to block call (else timeout will happen)
+        else return NSAPI_ERROR_DEVICE_ERROR;
     }
+
     return recv;
     
 }