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