mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-15 00:02:49 +03:00
Fix doc for ESP8266WiFi (#5325)
* Fix WiFiAP doc * Fix softAP doc * Fix doc
This commit is contained in:
committed by
Earle F. Philhower, III
parent
53edcfd94d
commit
79a6f36a02
@ -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<char*>(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<char*>(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<char*>(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<char*>(config.password);
|
||||
char psk[sizeof(config.password) + 1];
|
||||
memcpy(psk, pass, sizeof(config.password));
|
||||
psk[sizeof(config.password)] = '\0';
|
||||
|
||||
return String(psk);
|
||||
}
|
||||
|
Reference in New Issue
Block a user