diff --git a/ports/esp8266/network_wlan.c b/ports/esp8266/network_wlan.c index 4ab4a9a0024f2..32ca3f9da9847 100644 --- a/ports/esp8266/network_wlan.c +++ b/ports/esp8266/network_wlan.c @@ -423,6 +423,20 @@ STATIC mp_obj_t esp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs wifi_set_sleep_type(mp_obj_get_int(kwargs->table[i].value)); break; } + case MP_QSTR_auto_connect: { + wifi_station_set_auto_connect(mp_obj_is_true(kwargs->table[i].value)); + break; + } + case MP_QSTR_reconnects: { + req_if = STATION_IF; + if (self->if_id == STATION_IF) { + int reconnects = mp_obj_get_int(kwargs->table[i].value); + // parameter reconnects == -1 means to retry forever. + wifi_station_set_reconnect_policy((reconnects != 0)); + wifi_station_dhcpc_set_maxtry((reconnects == -1) ? 255 : reconnects); + } + break; + } default: goto unknown; } @@ -494,6 +508,10 @@ STATIC mp_obj_t esp_config(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs val = MP_OBJ_NEW_SMALL_INT(wifi_get_sleep_type()); break; } + case MP_QSTR_auto_connect: { + val = mp_obj_new_bool(wifi_station_get_auto_connect()); + break; + } default: goto unknown; } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy