fix(wifi) : Roam handle unregister issue

This commit is contained in:
tarun.kumar
2026-09-02 12:44:03 +05:30
parent 6aae7e9c3d
commit dd6a87a734

View File

@@ -2198,8 +2198,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));
@@ -2210,6 +2213,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");
}
@@ -2243,7 +2247,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();
@@ -2285,6 +2288,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