From 675a6755b8aa3e47d313f64efc482a11dacd28cc Mon Sep 17 00:00:00 2001 From: SO_yeah Date: Sun, 21 May 2017 21:28:44 +0200 Subject: [PATCH 1/5] Update WiFiAP.cpp set from code the maximum number of clients to smaller than 4 (in my case i must allow only one client at a time) --- libraries/WiFi/src/WiFiAP.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libraries/WiFi/src/WiFiAP.cpp b/libraries/WiFi/src/WiFiAP.cpp index 0ce76ab21e6..7521544a879 100644 --- a/libraries/WiFi/src/WiFiAP.cpp +++ b/libraries/WiFi/src/WiFiAP.cpp @@ -69,6 +69,9 @@ static bool softap_config_equal(const wifi_config_t& lhs, const wifi_config_t& r if(lhs.ap.ssid_hidden != rhs.ap.ssid_hidden) { return false; } + if(lhs.max_connection != rhs.max_connection) { + return false; + } return true; } @@ -84,7 +87,7 @@ static bool softap_config_equal(const wifi_config_t& lhs, const wifi_config_t& r * @param channel WiFi channel number, 1 - 13. * @param ssid_hidden Network cloaking (0 = broadcast SSID, 1 = hide SSID) */ -bool WiFiAPClass::softAP(const char* ssid, const char* passphrase, int channel, int ssid_hidden) +bool WiFiAPClass::softAP(const char* ssid, const char* passphrase, int channel, int ssid_hidden, int max_connection) { if(!WiFi.enableAP(true)) { @@ -109,7 +112,7 @@ bool WiFiAPClass::softAP(const char* ssid, const char* passphrase, int channel, conf.ap.channel = channel; conf.ap.ssid_len = strlen(ssid); conf.ap.ssid_hidden = ssid_hidden; - conf.ap.max_connection = 4; + conf.ap.max_connection = max_connection; conf.ap.beacon_interval = 100; if(!passphrase || strlen(passphrase) == 0) { From 6a1727b672bac739b9fb33bf4738fcb7df4a9395 Mon Sep 17 00:00:00 2001 From: SO_yeah Date: Sun, 21 May 2017 21:34:22 +0200 Subject: [PATCH 2/5] Update WiFiAP.h --- libraries/WiFi/src/WiFiAP.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/WiFi/src/WiFiAP.h b/libraries/WiFi/src/WiFiAP.h index cbb47c64b48..9a29621e9ea 100644 --- a/libraries/WiFi/src/WiFiAP.h +++ b/libraries/WiFi/src/WiFiAP.h @@ -37,7 +37,7 @@ class WiFiAPClass public: - bool softAP(const char* ssid, const char* passphrase = NULL, int channel = 1, int ssid_hidden = 0); + bool softAP(const char* ssid, const char* passphrase = NULL, int channel = 1, int ssid_hidden = 0, int max_connection = 4); bool softAPConfig(IPAddress local_ip, IPAddress gateway, IPAddress subnet); bool softAPdisconnect(bool wifioff = false); From 59eab1906af2302e0a35c5b5f94b7dd0c78a778d Mon Sep 17 00:00:00 2001 From: SO_yeah Date: Sun, 21 May 2017 21:37:56 +0200 Subject: [PATCH 3/5] Update WiFiAP.cpp --- libraries/WiFi/src/WiFiAP.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libraries/WiFi/src/WiFiAP.cpp b/libraries/WiFi/src/WiFiAP.cpp index 7521544a879..3014240c84b 100644 --- a/libraries/WiFi/src/WiFiAP.cpp +++ b/libraries/WiFi/src/WiFiAP.cpp @@ -82,11 +82,12 @@ static bool softap_config_equal(const wifi_config_t& lhs, const wifi_config_t& r /** * Set up an access point - * @param ssid Pointer to the SSID (max 63 char). - * @param passphrase (for WPA2 min 8 char, for open use NULL) - * @param channel WiFi channel number, 1 - 13. - * @param ssid_hidden Network cloaking (0 = broadcast SSID, 1 = hide SSID) - */ + * @param ssid Pointer to the SSID (max 63 char). + * @param passphrase (for WPA2 min 8 char, for open use NULL) + * @param channel WiFi channel number, 1 - 13. + * @param ssid_hidden Network cloaking (0 = broadcast SSID, 1 = hide SSID) + * @param max_connection Max simultaneous connected clients, 1 - 4. +*/ bool WiFiAPClass::softAP(const char* ssid, const char* passphrase, int channel, int ssid_hidden, int max_connection) { From aee13676f8420188fb3716703b9d55f76405d24f Mon Sep 17 00:00:00 2001 From: SO_yeah Date: Sun, 21 May 2017 21:38:51 +0200 Subject: [PATCH 4/5] Update WiFiAP.cpp --- libraries/WiFi/src/WiFiAP.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/WiFi/src/WiFiAP.cpp b/libraries/WiFi/src/WiFiAP.cpp index 3014240c84b..b1d7e1e3d7d 100644 --- a/libraries/WiFi/src/WiFiAP.cpp +++ b/libraries/WiFi/src/WiFiAP.cpp @@ -82,10 +82,10 @@ static bool softap_config_equal(const wifi_config_t& lhs, const wifi_config_t& r /** * Set up an access point - * @param ssid Pointer to the SSID (max 63 char). - * @param passphrase (for WPA2 min 8 char, for open use NULL) - * @param channel WiFi channel number, 1 - 13. - * @param ssid_hidden Network cloaking (0 = broadcast SSID, 1 = hide SSID) + * @param ssid Pointer to the SSID (max 63 char). + * @param passphrase (for WPA2 min 8 char, for open use NULL) + * @param channel WiFi channel number, 1 - 13. + * @param ssid_hidden Network cloaking (0 = broadcast SSID, 1 = hide SSID) * @param max_connection Max simultaneous connected clients, 1 - 4. */ bool WiFiAPClass::softAP(const char* ssid, const char* passphrase, int channel, int ssid_hidden, int max_connection) From c7219331c310a245bda6dc9b9b5c0d87f461c32f Mon Sep 17 00:00:00 2001 From: SO_yeah Date: Sun, 11 Jun 2017 19:01:19 +0200 Subject: [PATCH 5/5] Create WiFiAP.cpp --- libraries/WiFi/src/WiFiAP.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/WiFi/src/WiFiAP.cpp b/libraries/WiFi/src/WiFiAP.cpp index b1d7e1e3d7d..6086ac6f630 100644 --- a/libraries/WiFi/src/WiFiAP.cpp +++ b/libraries/WiFi/src/WiFiAP.cpp @@ -69,7 +69,7 @@ static bool softap_config_equal(const wifi_config_t& lhs, const wifi_config_t& r if(lhs.ap.ssid_hidden != rhs.ap.ssid_hidden) { return false; } - if(lhs.max_connection != rhs.max_connection) { + if(lhs.ap.max_connection != rhs.ap.max_connection) { return false; } return true;