|
55 | 55 |
|
56 | 56 | NORETURN void _esp_exceptions(esp_err_t e) {
|
57 | 57 | switch (e) {
|
58 |
| - case ESP_ERR_WIFI_NOT_INIT: |
| 58 | + case ESP_ERR_WIFI_NOT_INIT: |
59 | 59 | mp_raise_msg(&mp_type_OSError, "Wifi Not Initialized");
|
60 | 60 | case ESP_ERR_WIFI_NOT_STARTED:
|
61 | 61 | mp_raise_msg(&mp_type_OSError, "Wifi Not Started");
|
@@ -87,7 +87,7 @@ NORETURN void _esp_exceptions(esp_err_t e) {
|
87 | 87 | mp_raise_OSError(MP_ETIMEDOUT);
|
88 | 88 | case ESP_ERR_TCPIP_ADAPTER_NO_MEM:
|
89 | 89 | case ESP_ERR_WIFI_NO_MEM:
|
90 |
| - mp_raise_OSError(MP_ENOMEM); |
| 90 | + mp_raise_OSError(MP_ENOMEM); |
91 | 91 | default:
|
92 | 92 | nlr_raise(mp_obj_new_exception_msg_varg(
|
93 | 93 | &mp_type_RuntimeError, "Wifi Unknown Error 0x%04x", e
|
@@ -337,9 +337,12 @@ STATIC mp_obj_t esp_ifconfig(size_t n_args, const mp_obj_t *args) {
|
337 | 337 | wlan_if_obj_t *self = MP_OBJ_TO_PTR(args[0]);
|
338 | 338 | tcpip_adapter_ip_info_t info;
|
339 | 339 | tcpip_adapter_dns_info_t dns_info;
|
340 |
| - tcpip_adapter_get_ip_info(self->if_id, &info); |
341 |
| - tcpip_adapter_get_dns_info(self->if_id, TCPIP_ADAPTER_DNS_MAIN, &dns_info); |
| 340 | + // tcpip_adapter_get_ip_info(self->if_id, &info); |
| 341 | + // tcpip_adapter_get_dns_info(self->if_id, TCPIP_ADAPTER_DNS_MAIN, &dns_info); |
342 | 342 | if (n_args == 1) {
|
| 343 | + tcpip_adapter_get_ip_info(self->if_id, &info); |
| 344 | + tcpip_adapter_get_dns_info(self->if_id, TCPIP_ADAPTER_DNS_MAIN, &dns_info); |
| 345 | + usleep(200000); |
343 | 346 | // get
|
344 | 347 | mp_obj_t tuple[4] = {
|
345 | 348 | netutils_format_ipv4_addr((uint8_t*)&info.ip, NETUTILS_BIG),
|
|
0 commit comments