mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-07-19 05:22:08 +02:00
Add WiFi.softAPSSID()
Fixes: https://github.com/espressif/arduino-esp32/issues/4922
This commit is contained in:
@ -137,6 +137,21 @@ bool WiFiAPClass::softAP(const char* ssid, const char* passphrase, int channel,
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the current SSID associated with the network
|
||||
* @return SSID
|
||||
*/
|
||||
String WiFiAPClass::softAPSSID() const
|
||||
{
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return String();
|
||||
}
|
||||
wifi_config_t info;
|
||||
if(!esp_wifi_get_config(WIFI_IF_AP, &info)) {
|
||||
return String(reinterpret_cast<char*>(info.ap.ssid));
|
||||
}
|
||||
return String();
|
||||
}
|
||||
|
||||
/**
|
||||
* Configure access point
|
||||
@ -189,7 +204,7 @@ bool WiFiAPClass::softAPdisconnect(bool wifioff)
|
||||
wifi_config_t conf;
|
||||
|
||||
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
|
||||
return ESP_ERR_INVALID_STATE;
|
||||
return false;
|
||||
}
|
||||
|
||||
*conf.ap.ssid = 0;
|
||||
|
Reference in New Issue
Block a user