NNN40 change mode from AP to STA by HTTP server

Dependencies:   WIFI_API_32kRAM mbed

How to use Demo code

  • Step1: Prepare a router, and set the SSID and Password as follow
  1. SSID: "SSID"
  2. Password: "0123456789"
  • Step2: Burn demo code to NNN40 module.

You can drag and drop the sample code to NNN40 module.

  • Step3: Login module from Http server (192.168.2.1) by PC.

You can set SSID and password by browser. After clicking "confirm" button, the module will change mode from AP to STA, get IP from router

  • DEMO video:

Files at this revision

API Documentation at this revision

Comitter:
lester0507
Date:
Wed Oct 21 05:54:02 2015 +0000
Parent:
13:f3d681e5b6c6
Commit message:
fix bug for ssid underline.

Changed in this revision

Formatter.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Formatter.cpp	Wed Sep 23 03:16:17 2015 +0000
+++ b/Formatter.cpp	Wed Oct 21 05:54:02 2015 +0000
@@ -101,7 +101,7 @@
 }function send() {var ip = \"192.168.2.1/WebSetting/\";\
 var ssid = document.getElementById(\"ssid\").value;\
 var pwd = document.getElementById(\"password\").value;\
-location.href = \"http://\"+ip+ssid +\"_\"+pwd;}\  
+location.href = \"http://\"+ip+ssid +\"/\"+pwd;}\  
 </script></head><body>";
 
         const char* DELRA_WIFI_SETTING_HTML_CODE_1 = "<div id=\"background\">\
--- a/main.cpp	Wed Sep 23 03:16:17 2015 +0000
+++ b/main.cpp	Wed Oct 21 05:54:02 2015 +0000
@@ -21,7 +21,7 @@
 {
     char *pch;
 
-    pch=strchr(cmd.get_func_name(),'_');
+    pch=strchr(cmd.get_func_name(),'/');
     cmd.get_func_name()[pch-cmd.get_func_name()] = '\0';
     
     //must call disconnect before switch between AP and STA mode