We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 41534f1 commit ea4febeCopy full SHA for ea4febe
esp32/modnetwork.c
@@ -295,9 +295,12 @@ STATIC mp_obj_t esp_scan(mp_obj_t self_in) {
295
STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp_scan_obj, esp_scan);
296
297
STATIC mp_obj_t esp_isconnected(mp_obj_t self_in) {
298
- return mp_const_none;
+ wlan_if_obj_t *self = MP_OBJ_TO_PTR(self_in);
299
+ require_if(self_in, WIFI_IF_STA);
300
+ tcpip_adapter_ip_info_t info;
301
+ tcpip_adapter_get_ip_info(self->if_id, &info);
302
+ return mp_obj_new_bool(info.ip.addr != 0);
303
}
-
304
STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp_isconnected_obj, esp_isconnected);
305
306
STATIC mp_obj_t esp_ifconfig(size_t n_args, const mp_obj_t *args) {
0 commit comments