From 0d7a3416bcff24e4f62866a9a3b4128ff836e5ea Mon Sep 17 00:00:00 2001 From: "tarun.kumar" Date: Thu, 18 Dec 2025 15:02:18 +0530 Subject: [PATCH] fix(roam) : Set and unset roam scan ongoing flag properly --- components/esp_wifi/wifi_apps/roaming_app/src/roaming_app.c | 2 +- components/wpa_supplicant/esp_supplicant/src/esp_scan.c | 2 +- examples/wifi/roaming/roaming_11kvr/main/roaming_example.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/esp_wifi/wifi_apps/roaming_app/src/roaming_app.c b/components/esp_wifi/wifi_apps/roaming_app/src/roaming_app.c index c7b84d5c0f..b1f97190ec 100644 --- a/components/esp_wifi/wifi_apps/roaming_app/src/roaming_app.c +++ b/components/esp_wifi/wifi_apps/roaming_app/src/roaming_app.c @@ -784,7 +784,7 @@ static bool conduct_scan(void) gettimeofday(&g_roaming_app.scanned_aps.time, NULL); os_memset(&g_roaming_app.scanned_aps, 0, sizeof(struct scanned_ap_info)); /* Issue scan */ - if (esp_wifi_promiscuous_scan_start(&g_roaming_app.config.scan_config, scan_done_event_handler) < 0) { + if (esp_wifi_promiscuous_scan_start(&g_roaming_app.config.scan_config, scan_done_event_handler) != ESP_OK) { ESP_LOGE(ROAMING_TAG, "failed to issue scan"); return false; } diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_scan.c b/components/wpa_supplicant/esp_supplicant/src/esp_scan.c index 7c2b0d4446..9c4158d481 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_scan.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_scan.c @@ -262,7 +262,7 @@ static int issue_scan(struct wpa_supplicant *wpa_s, typedef void (* scan_done_cb_t)(void *arg, ETS_STATUS status); extern int esp_wifi_promiscuous_scan_start(wifi_scan_config_t *config, scan_done_cb_t cb); /* issue scan */ - if (esp_wifi_promiscuous_scan_start(params, scan_done_event_handler) < 0) { + if (esp_wifi_promiscuous_scan_start(params, scan_done_event_handler) != ESP_OK) { ret = -1; goto cleanup; } diff --git a/examples/wifi/roaming/roaming_11kvr/main/roaming_example.c b/examples/wifi/roaming/roaming_11kvr/main/roaming_example.c index edf0669494..35a201b8ed 100644 --- a/examples/wifi/roaming/roaming_11kvr/main/roaming_example.c +++ b/examples/wifi/roaming/roaming_11kvr/main/roaming_example.c @@ -325,7 +325,7 @@ static void esp_neighbor_report_recv_handler(void* arg, esp_event_base_t event_b g_neighbor_report_active = false; uint8_t cand_list = 0; wifi_event_neighbor_report_t *neighbor_report_event = (wifi_event_neighbor_report_t*)event_data; - uint8_t *pos = (uint8_t *)neighbor_report_event->report; + uint8_t *pos = (uint8_t *)neighbor_report_event->n_report; char * neighbor_list = NULL; if (!pos) { ESP_LOGE(TAG, "Neighbor report is empty"); @@ -343,7 +343,7 @@ static void esp_neighbor_report_recv_handler(void* arg, esp_event_base_t event_b /* issue scan */ wifi_scan_config_t params; memset(¶ms, 0, sizeof(wifi_scan_config_t)); - if (esp_wifi_scan_start(¶ms, true) < 0) { + if (esp_wifi_scan_start(¶ms, true) != ESP_OK) { goto cleanup; } /* cleanup from net802.11 */