Driver for the ESP8266 WiFi module using ATParser library. Espressif Firmware.

Dependencies:   ATParser

Dependents:   ESP8266Interface

Fork of ESP8266 by NetworkSocketAPI

Note

This library assumes your ESP8266 is running the Espressif Firmware. For instructions on how to update your ESP8266 to use the correct firmware see the Firmware Update Wiki Page.

Revision:
21:1a9b555962b5
Parent:
20:32e5a5a328e0
--- a/ESP8266.cpp	Tue Feb 23 01:29:53 2016 -0600
+++ b/ESP8266.cpp	Thu Mar 03 17:38:40 2016 +0000
@@ -141,13 +141,15 @@
 
 bool ESP8266::close(int id)
 {
-    //IDs only 0-4
-    if(id > 4) {
-        return false;
+    //May take a second try if device is busy
+    for (unsigned i = 0; i < 2; i++) {
+        if (_parser.send("AT+CIPCLOSE=%d", id)
+            && _parser.recv("OK")) {
+            return true;
+        }
     }
 
-    return _parser.send("AT+CIPCLOSE=%d", id)
-        && _parser.recv("OK");
+    return false;
 }
 
 void ESP8266::setTimeout(uint32_t timeout_ms)