File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
hardware/esp8266com/esp8266/libraries/ESP8266WiFi/src Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -328,10 +328,14 @@ void ESP8266WiFiClass::_scanDone(void* result, int status)
328
328
329
329
int8_t ESP8266WiFiClass::scanNetworks ()
330
330
{
331
- if (( wifi_get_opmode () & 1 ) == 0 ) // 1 and 3 have STA enabled
332
- {
331
+ if (_useApMode) {
332
+ // turn on AP+STA mode
333
333
mode (WIFI_AP_STA);
334
+ } else {
335
+ // turn on STA mode
336
+ mode (WIFI_STA);
334
337
}
338
+
335
339
int status = wifi_station_get_connect_status ();
336
340
if (status != STATION_GOT_IP && status != STATION_IDLE)
337
341
{
@@ -503,9 +507,12 @@ void ESP8266WiFiClass::beginSmartConfig()
503
507
if (_smartConfigStarted)
504
508
return ;
505
509
506
- if (( wifi_get_opmode () & 1 ) == 0 ) // 1 and 3 have STA enabled
507
- {
510
+ if (_useApMode) {
511
+ // turn on AP+STA mode
508
512
mode (WIFI_AP_STA);
513
+ } else {
514
+ // turn on STA mode
515
+ mode (WIFI_STA);
509
516
}
510
517
511
518
_smartConfigStarted = true ;
You can’t perform that action at this time.
0 commit comments