Updates and additions required by mbed-os 5.2.2
Dependents: x-nucleo-iks01a1-test x-nucleo-iks01a1-test
Fork of X_NUCLEO_IDW01M1v2 by
Revision 3:4c2cbca19031, committed 2016-07-07
- Comitter:
- mridup
- Date:
- Thu Jul 07 11:06:10 2016 +0000
- Parent:
- 2:610672ed2e9f
- Child:
- 4:2f3f156a3b0b
- Commit message:
- fixing NSAPI socket_send
Changed in this revision
| SpwfInterface.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- 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;
