fix wifi reset and monitor deinit routine

This commit is contained in:
microDev 2021-11-10 22:33:44 +05:30
parent b435e7b56a
commit a62675a81a
No known key found for this signature in database
GPG Key ID: 2C0867BE60967730
2 changed files with 2 additions and 2 deletions

View File

@ -102,8 +102,7 @@ void common_hal_wifi_monitor_construct(wifi_monitor_obj_t *self, uint8_t channel
bool common_hal_wifi_monitor_deinited(void) {
bool enabled;
esp_wifi_get_promiscuous(&enabled);
return !enabled;
return (esp_wifi_get_promiscuous(&enabled) == ESP_ERR_WIFI_NOT_INIT) ? true : !enabled;
}
void common_hal_wifi_monitor_deinit(wifi_monitor_obj_t *self) {

View File

@ -174,6 +174,7 @@ void wifi_reset(void) {
radio->netif = NULL;
esp_netif_destroy(radio->ap_netif);
radio->ap_netif = NULL;
wifi_inited = false;
}
void ipaddress_ipaddress_to_esp_idf(mp_obj_t ip_address, ip_addr_t *esp_ip_address) {