Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: IoT_Ex BatteryModelTester BatteryModelTester
Fork of WiflyInterface by
Diff: Socket/TCPSocketConnection.cpp
- Revision:
- 17:cb63119802d9
- Parent:
- 1:fb4494783863
- Child:
- 20:3616a765c1b8
--- a/Socket/TCPSocketConnection.cpp Sat Feb 20 17:43:39 2016 +0000 +++ b/Socket/TCPSocketConnection.cpp Tue Mar 22 23:22:42 2016 +0000 @@ -89,13 +89,17 @@ } - while(!wifi->readable()); - int nb_available = wifi->readable(); - for (int i = 0; i < min(nb_available, length); i++) { - data[i] = wifi->getc(); + //while(!wifi->readable()); + if(wifi->readable()){ + int nb_available = wifi->readable(); + for (int i = 0; i < min(nb_available, length); i++) { + data[i] = wifi->getc(); + } + + return min(nb_available, length); + }else{ + return -1; } - - return min(nb_available, length); }