fix(wifi) : Roam handle unregister issue

This commit is contained in:
tarun.kumar
2026-09-02 13:12:14 +05:30
parent dce5812654
commit 52d901c539
@@ -2200,8 +2200,11 @@ void roam_init_app(void)
ESP_LOGE(ROAMING_TAG, "No roaming method enabled. Roaming app cannot be initialized");
return;
#endif
if (g_roaming_app.app_active) {
ESP_LOGD(ROAMING_TAG, "Roaming app already initialized");
return;
}
memset(&g_roaming_app, 0, sizeof(g_roaming_app));
g_roaming_app.app_active = true;
#if LOW_RSSI_ROAMING_ENABLED
ESP_ERROR_CHECK(esp_event_handler_register(WIFI_EVENT, WIFI_EVENT_STA_BSS_RSSI_LOW,
&roaming_app_rssi_low_handler, NULL));
@@ -2212,6 +2215,7 @@ void roam_init_app(void)
ESP_ERROR_CHECK(esp_event_handler_register(WIFI_EVENT, WIFI_EVENT_STA_NEIGHBOR_REP,
&roaming_app_neighbor_report_recv_handler, NULL));
#endif /*PERIODIC_RRM_MONITORING*/
g_roaming_app.app_active = true;
ESP_LOGI(ROAMING_TAG, "Roaming app initialization done");
}
@@ -2245,7 +2249,6 @@ static int roaming_app_deinit_internal(void *ctx, void *data)
{
(void) ctx;
(void) data;
g_roaming_app.app_active = false;
roaming_app_cancel_pending_events();
roaming_app_stop_periodic_monitors();
roaming_app_reset_connect_hint_state();
@@ -2287,6 +2290,7 @@ void roam_deinit_app(void)
ESP_ERROR_CHECK(esp_event_handler_unregister(WIFI_EVENT, WIFI_EVENT_STA_NEIGHBOR_REP,
&roaming_app_neighbor_report_recv_handler));
#endif /*PERIODIC_RRM_MONITORING*/
g_roaming_app.app_active = false;
}
#if CONFIG_ESP_WIFI_ROAMING_BSSID_BLACKLIST