Skip to content

Commit 79a6f36

Browse files
dav1901earlephilhower
authored andcommitted
Fix doc for ESP8266WiFi (#5325)
* Fix WiFiAP doc * Fix softAP doc * Fix doc
1 parent 53edcfd commit 79a6f36

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

doc/esp8266wifi/soft-access-point-class.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ The first parameter of this function is required, remaining four are optional.
5050

5151
Meaning of all parameters is as follows:
5252

53-
- ``ssid`` - character string containing network SSID (max. 63 characters)
54-
- ``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.
53+
- ``ssid`` - character string containing network SSID (max. 31 characters)
54+
- ``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).
5555
- ``channel`` - optional parameter to set Wi-Fi channel, from 1 to 13. Default channel = 1.
5656
- ``hidden`` - optional parameter, if set to ``true`` will hide SSID.
5757
- ``max_connection`` - optional parameter to set max simultaneous connected stations, `from 0 to 8 <https://bbs.espressif.com/viewtopic.php?f=46&t=481&p=1832&hilit=max_connection#p1832>`__. 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.

libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp

+18-18
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ static bool softap_config_equal(const softap_config& lhs, const softap_config& r
8585

8686
/**
8787
* Set up an access point
88-
* @param ssid Pointer to the SSID (max 63 char).
89-
* @param passphrase (for WPA2 min 8 char, for open use NULL)
88+
* @param ssid Pointer to the SSID (max 31 char).
89+
* @param passphrase For WPA2 min 8 char, for open use NULL (max 63 char).
9090
* @param channel WiFi channel number, 1 - 13.
9191
* @param ssid_hidden Network cloaking (0 = broadcast SSID, 1 = hide SSID)
9292
* @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,27 +345,27 @@ String ESP8266WiFiAPClass::softAPmacAddress(void) {
345345
* @return String SSID.
346346
*/
347347
String ESP8266WiFiAPClass::softAPSSID() const {
348-
struct softap_config config;
349-
wifi_softap_get_config(&config);
350-
char* name = reinterpret_cast<char*>(config.ssid);
351-
char ssid[sizeof(config.ssid) + 1];
352-
memcpy(ssid, name, sizeof(config.ssid));
353-
ssid[sizeof(config.ssid)] = '\0';
354-
355-
return String(ssid);
348+
struct softap_config config;
349+
wifi_softap_get_config(&config);
350+
char* name = reinterpret_cast<char*>(config.ssid);
351+
char ssid[sizeof(config.ssid) + 1];
352+
memcpy(ssid, name, sizeof(config.ssid));
353+
ssid[sizeof(config.ssid)] = '\0';
354+
355+
return String(ssid);
356356
}
357357

358358
/**
359359
* Get the configured(Not-In-Flash) softAP PSK or PASSWORD.
360360
* @return String psk.
361361
*/
362362
String ESP8266WiFiAPClass::softAPPSK() const {
363-
struct softap_config config;
364-
wifi_softap_get_config(&config);
365-
char* pass = reinterpret_cast<char*>(config.password);
366-
char psk[sizeof(config.password) + 1];
367-
memcpy(psk, pass, sizeof(config.password));
368-
psk[sizeof(config.password)] = '\0';
369-
370-
return String(psk);
363+
struct softap_config config;
364+
wifi_softap_get_config(&config);
365+
char* pass = reinterpret_cast<char*>(config.password);
366+
char psk[sizeof(config.password) + 1];
367+
memcpy(psk, pass, sizeof(config.password));
368+
psk[sizeof(config.password)] = '\0';
369+
370+
return String(psk);
371371
}

libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ static bool _dns_lookup_pending = false;
523523
* @param aHostname Name to be resolved
524524
* @param aResult IPAddress structure to store the returned IP address
525525
* @return 1 if aIPAddrString was successfully converted to an IP address,
526-
* else error code
526+
* else 0
527527
*/
528528
int ESP8266WiFiGenericClass::hostByName(const char* aHostname, IPAddress& aResult)
529529
{

0 commit comments

Comments
 (0)