Skip to content

Commit

Permalink
wifi disconnect before deinit (#1978)
Browse files Browse the repository at this point in the history
  • Loading branch information
Slider0007 authored Feb 5, 2023
1 parent 800e231 commit 55efc3b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion code/components/jomjol_wlan/connect_wlan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,9 @@ bool getWIFIisConnected()

void WIFIDestroy()
{
esp_event_handler_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP, event_handler);
esp_wifi_disconnect();

esp_event_handler_unregister(IP_EVENT, IP_EVENT_STA_GOT_IP, event_handler);
esp_event_handler_unregister(WIFI_EVENT, ESP_EVENT_ANY_ID, event_handler);
#ifdef WLAN_USE_MESH_ROAMING
esp_event_handler_unregister(WIFI_EVENT, WIFI_EVENT_STA_BSS_RSSI_LOW, esp_bss_rssi_low_handler);
Expand Down

0 comments on commit 55efc3b

Please sign in to comment.