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.
Fork of SPWF01SA by
Diff: SPWFSA01.cpp
- Revision:
- 4:042d5b9bb6e7
- Parent:
- 3:2af9df1068a5
- Child:
- 5:f17d6351e942
--- a/SPWFSA01.cpp Thu Jun 30 08:25:26 2016 +0000 +++ b/SPWFSA01.cpp Thu Jun 30 08:42:47 2016 +0000 @@ -247,8 +247,9 @@ && _parser.recv("OK")) break; //TODO:implement time-out functionality in case of no response + //if(timeout) return false; } - printf("\r\nsock id = %d\r\n", *id); + //printf("\r\nsock id = %d\r\n", *id); return true; } @@ -285,9 +286,9 @@ bool SPWFSA01::close(int id) { - //May take a second try if device is busy + //May take a second try if device is busy or error is returned for (unsigned i = 0; i < 2; i++) { - if (_parser.send("AT+CIPCLOSE=%d", id) + if (_parser.send("AT+S.SOCKC=%d", id) && _parser.recv("OK")) { return true; }