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 ESP8266 by
Revision 15:1ff5d44d5e30, committed 2015-11-11
- Comitter:
- ohneta
- Date:
- Wed Nov 11 03:40:18 2015 +0000
- Parent:
- 14:71474261a9d7
- Commit message:
- check of disconnected on close()
Changed in this revision
| ESP8266.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/ESP8266.cpp Tue Nov 10 14:42:20 2015 +0000
+++ b/ESP8266.cpp Wed Nov 11 03:40:18 2015 +0000
@@ -145,6 +145,18 @@
bool ESP8266::close(int id)
{
+ // if status = Disconnected , port was closed.
+ {
+ int status;
+ atParser.send("AT+CIPSTATUS");
+ atParser.recv("STATUS:%d", &status);
+ atParser.recv("OK");
+ if (status == 4) {
+ return true;
+ }
+ }
+
+
//IDs only 0-4
if(id > 4) {
return false;
@@ -154,7 +166,6 @@
string close_command = "AT+CIPCLOSE="+(string)idstr;
string closed_response = (string)idstr + ",CLOSED OK";
- //return (atParser.send(close_command.c_str()) && atParser.recv("OK"));
return (atParser.send(close_command.c_str()) && atParser.recv(closed_response.c_str()));
}
