File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,21 @@ bool WiFiAPClass::softAP(const char* ssid, const char* passphrase, int channel,
137
137
return true ;
138
138
}
139
139
140
+ /* *
141
+ * Return the current SSID associated with the network
142
+ * @return SSID
143
+ */
144
+ String WiFiAPClass::softAPSSID () const
145
+ {
146
+ if (WiFiGenericClass::getMode () == WIFI_MODE_NULL){
147
+ return String ();
148
+ }
149
+ wifi_config_t info;
150
+ if (!esp_wifi_get_config (WIFI_IF_AP, &info)) {
151
+ return String (reinterpret_cast <char *>(info.ap .ssid ));
152
+ }
153
+ return String ();
154
+ }
140
155
141
156
/* *
142
157
* Configure access point
@@ -189,7 +204,7 @@ bool WiFiAPClass::softAPdisconnect(bool wifioff)
189
204
wifi_config_t conf;
190
205
191
206
if (WiFiGenericClass::getMode () == WIFI_MODE_NULL){
192
- return ESP_ERR_INVALID_STATE ;
207
+ return false ;
193
208
}
194
209
195
210
*conf.ap .ssid = 0 ;
Original file line number Diff line number Diff line change @@ -58,6 +58,8 @@ class WiFiAPClass
58
58
uint8_t * softAPmacAddress (uint8_t * mac);
59
59
String softAPmacAddress (void );
60
60
61
+ String softAPSSID (void ) const ;
62
+
61
63
protected:
62
64
63
65
};
You can’t perform that action at this time.
0 commit comments