From 42db599ce37f4e919a27da56ad7e2c5593dd0889 Mon Sep 17 00:00:00 2001 From: dav1901 <44604348+dav1901@users.noreply.github.com> Date: Thu, 8 Nov 2018 15:40:03 +0200 Subject: [PATCH 1/3] Fix WiFiAP doc --- doc/esp8266wifi/soft-access-point-class.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/esp8266wifi/soft-access-point-class.rst b/doc/esp8266wifi/soft-access-point-class.rst index 6e0a9dd2fd..9cf7b1645c 100644 --- a/doc/esp8266wifi/soft-access-point-class.rst +++ b/doc/esp8266wifi/soft-access-point-class.rst @@ -50,8 +50,8 @@ The first parameter of this function is required, remaining four are optional. Meaning of all parameters is as follows: -- ``ssid`` - character string containing network SSID (max. 63 characters) -- ``password`` - optional character string with a password. For WPA2-PSK network it should be at least 8 character long. If not specified, the access point will be open for anybody to connect. +- ``ssid`` - character string containing network SSID (max. 31 characters) +- ``password`` - optional character string with a password. For WPA2-PSK network it should be at least 8 character long. If not specified, the access point will be open for anybody to connect, (max. 63 characters). - ``channel`` - optional parameter to set Wi-Fi channel, from 1 to 13. Default channel = 1. - ``hidden`` - optional parameter, if set to ``true`` will hide SSID. - ``max_connection`` - optional parameter to set max simultaneous connected stations, `from 0 to 8 `__. Defaults to 4. Once the max number has been reached, any other station that wants to connect will be forced to wait until an already connected station disconnects. From d86d173e42a1c2044c1989af156e33b9857f9c37 Mon Sep 17 00:00:00 2001 From: dav1901 <44604348+dav1901@users.noreply.github.com> Date: Thu, 8 Nov 2018 15:45:05 +0200 Subject: [PATCH 2/3] Fix softAP doc --- libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp | 36 ++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp b/libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp index 24843d6d3e..9d1ba5ea09 100644 --- a/libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp +++ b/libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp @@ -85,8 +85,8 @@ static bool softap_config_equal(const softap_config& lhs, const softap_config& 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 ssid Pointer to the SSID (max 31 char). + * @param passphrase For WPA2 min 8 char, for open use NULL (max 63 char). * @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, 0 - 8. https://bbs.espressif.com/viewtopic.php?f=46&t=481&p=1832&hilit=max_connection#p1832 @@ -345,14 +345,14 @@ String ESP8266WiFiAPClass::softAPmacAddress(void) { * @return String SSID. */ String ESP8266WiFiAPClass::softAPSSID() const { - struct softap_config config; - wifi_softap_get_config(&config); - char* name = reinterpret_cast(config.ssid); - char ssid[sizeof(config.ssid) + 1]; - memcpy(ssid, name, sizeof(config.ssid)); - ssid[sizeof(config.ssid)] = '\0'; - - return String(ssid); + struct softap_config config; + wifi_softap_get_config(&config); + char* name = reinterpret_cast(config.ssid); + char ssid[sizeof(config.ssid) + 1]; + memcpy(ssid, name, sizeof(config.ssid)); + ssid[sizeof(config.ssid)] = '\0'; + + return String(ssid); } /** @@ -360,12 +360,12 @@ String ESP8266WiFiAPClass::softAPSSID() const { * @return String psk. */ String ESP8266WiFiAPClass::softAPPSK() const { - struct softap_config config; - wifi_softap_get_config(&config); - char* pass = reinterpret_cast(config.password); - char psk[sizeof(config.password) + 1]; - memcpy(psk, pass, sizeof(config.password)); - psk[sizeof(config.password)] = '\0'; - - return String(psk); + struct softap_config config; + wifi_softap_get_config(&config); + char* pass = reinterpret_cast(config.password); + char psk[sizeof(config.password) + 1]; + memcpy(psk, pass, sizeof(config.password)); + psk[sizeof(config.password)] = '\0'; + + return String(psk); } From 69a1ee3595bff3eebb6a7a9ca279158b55a14066 Mon Sep 17 00:00:00 2001 From: dav1901 <44604348+dav1901@users.noreply.github.com> Date: Thu, 8 Nov 2018 15:47:27 +0200 Subject: [PATCH 3/3] Fix doc --- libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp b/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp index 1582124a37..631aa381d2 100644 --- a/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp +++ b/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp @@ -523,7 +523,7 @@ static bool _dns_lookup_pending = false; * @param aHostname Name to be resolved * @param aResult IPAddress structure to store the returned IP address * @return 1 if aIPAddrString was successfully converted to an IP address, - * else error code + * else 0 */ int ESP8266WiFiGenericClass::hostByName(const char* aHostname, IPAddress& aResult) {