WiFi WebServer for ESP8266

Fork of ESP8266_WebServer by Sebastian Schocke

Revision:
7:f6172ba3e807
Parent:
6:34d93ea4d519
Child:
8:5573f6f70a82
--- a/ESP8266_WebServer.cpp	Sun Jan 04 12:11:33 2015 +0000
+++ b/ESP8266_WebServer.cpp	Mon Jan 05 19:22:25 2015 +0000
@@ -94,13 +94,7 @@
     return 0;
 }
 
-void ESP8266_WebServer::Initialize(void) {
-    readBuffer();
-    serial->printf("AT+RST\r\n");
-    wait_ms(1000);
-    while( string_waiting("\r\nready\r\n") == 0 ) {
-        wait_ms(100);
-    }
+void ESP8266_WebServer::ResetModule(void) {
     readBuffer();
     serial->printf("ATE0\r\n");
     while( data_waiting() == 0 ) {
@@ -108,15 +102,22 @@
     }
     readBuffer();
     
-    if( debugSerial != NULL ) {
-        debugSerial->printf("Done\r\nSetting operating mode...");
+    readBuffer();
+    serial->printf("AT+RST\r\n");
+    wait_ms(1000);
+    while( string_waiting("\r\nready\r\n") == 0 ) {
+        wait_ms(100);
     }
-    serial->printf("AT+CWMODE=3\r\n");
+    
+    readBuffer();
+    serial->printf("ATE0\r\n");
     while( data_waiting() == 0 ) {
         wait_ms(10);
     }
     readBuffer();
+}    
     
+void ESP8266_WebServer::Initialize(void) {
     if( debugSerial != NULL ) {
         debugSerial->printf("Done\r\nAccept Multiple connections...");
     }