wifi1

Dependencies:   mbed

Fork of ESP8266-configuaration-baudrate by Paul Staron

Revision:
3:14e33fec26c3
Parent:
2:c5515c7eba46
Child:
4:5b59cd16199e
--- a/main.cpp	Tue Feb 10 16:59:16 2015 +0000
+++ b/main.cpp	Tue Feb 10 17:14:53 2015 +0000
@@ -23,6 +23,24 @@
     //ESPsetbaudrate();   //******************  include this routine to set a different ESP8266 baudrate  ******************
 
     ESPconfig();        //******************  include Config to set the ESP8266 configuration  ***********************
+    
+   
+   // contiuosly get AP list and IP
+    while(1){
+        pc.printf("\n---------- Listing Acces Points ----------\r\n");
+        strcpy(snd, "AT+CWLAP\r\n");
+        SendCMD();
+        timeout=3;
+        getreply();   
+        pc.printf(buf);
+
+        pc.printf("\n---------- Get IP's ----------\r\n"); 
+        strcpy(snd, "AT+CIFSR\r\n");
+        SendCMD();
+        timeout=2;
+        getreply(); 
+        pc.printf(buf);
+    }    
      
 }
 
@@ -107,6 +125,15 @@
     getreply(); 
     pc.printf(buf);
     
+    wait(1);
+    
+    pc.printf("\n---------- Get Connection Status ----------\r\n"); 
+    strcpy(snd, "AT+CIPSTATUS\r\n");
+    SendCMD();
+    timeout=2;
+    getreply(); 
+    pc.printf(buf);   
+    
     pc.printf("\n\n\n  If you get a valid IP, ESP8266 has been set up.\r\n");
     pc.printf("  Run this if you want to reconfig the ESP8266 at any time.\r\n");
 }