/* \method isconnected() Return True if connected to an AP and an IP address has been assigned, false otherwise.  */
STATIC mp_obj_t esp_isconnected(mp_obj_t self_in)
/* \method isconnected() Return True if connected to an AP and an IP address has been assigned, false otherwise.  */
STATIC mp_obj_t esp_isconnected(mp_obj_t self_in)
{
        if (wifi_station_get_connect_status() == STATION_GOT_IP) {
            return mp_const_true;
        }
    } else {
        if (wifi_softap_get_station_num() > 0) {
            return mp_const_true;
        }
    }
    return mp_const_false;
}