wifi setup APmode

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
molberry
Date:
Wed Sep 09 04:44:48 2020 +0000
Parent:
6:c3c9277c64ba
Commit message:
WiFi connection Limit 1

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
wifi_configuration_AP.lib Show diff for this revision Revisions of this file
diff -r c3c9277c64ba -r 8055eb42a0f0 main.cpp
--- a/main.cpp	Mon Aug 24 02:36:06 2020 +0000
+++ b/main.cpp	Wed Sep 09 04:44:48 2020 +0000
@@ -7,7 +7,7 @@
 DigitalOut reset(p26);
 Timer t;
 
-int  count,ended,timeout;
+int  ount,ended,timeout;
 char buf[1024];
 char snd[255];
 
@@ -21,7 +21,7 @@
 //char ssid[32] = "802ZTa-003243";
 //char pwd [32] = "0129875a";
 
-char ssid[32] = "mbed01";
+char ssid[32] = "mbed06";
 char pwd [32] = "0123456789a";
 
 void SendCMD(),getreply(),ESPconfig(),ESPsetbaudrate();
@@ -164,6 +164,8 @@
     strcat(snd, "5");   //<chl>: channel ID. 
     strcat(snd, ",");
     strcat(snd, "4");   //<ecn>: encryption method; WEP is notsupported.(0:OPEN, 2:WPA_PSK, 3:WPA2_PSK, 4:WPA_WPA2_PSK)
+    strcat(snd, ",");
+    strcat(snd, "1");   // <max conn>: max connect. 
     strcat(snd, "\r\n"); // "を入力し改行             //「AT+CWJAP="ssid","pwd",5,3」
     SendCMD();
     timeout=10;
@@ -205,11 +207,11 @@
     memset(buf, '\0', sizeof(buf));
     t.start();
     ended=0;
-    count=0;
+    ount=0;
     while(!ended) {
         if(esp.readable()) {
-            buf[count] = esp.getc();
-            count++;
+            buf[ount] = esp.getc();
+            ount++;
         }
         if(t.read() > timeout) {
             ended = 1;
diff -r c3c9277c64ba -r 8055eb42a0f0 mbed.bld
--- a/mbed.bld	Mon Aug 24 02:36:06 2020 +0000
+++ b/mbed.bld	Wed Sep 09 04:44:48 2020 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/8ed44a420e5c
\ No newline at end of file
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file
diff -r c3c9277c64ba -r 8055eb42a0f0 wifi_configuration_AP.lib
--- a/wifi_configuration_AP.lib	Mon Aug 24 02:36:06 2020 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-https://os.mbed.com/users/4180_1/code/ESP8266-configuration-mbed-LPC1768/#9f46b8cdd469