From 6046926d0e774be5e93ba19ef18edef3c0c25825 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 | 3 ++- components/wpa_supplicant/esp_supplicant/src/esp_scan.c | 2 +- examples/wifi/roaming/roaming_11kvr/main/roaming_example.c | 4 ++-- 3 files changed, 5 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 1e74e61b03..fd15ac6d50 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 @@ -650,7 +650,8 @@ static void conduct_scan(void) gettimeofday(&g_roaming_app.scanned_aps.time, NULL); /* Issue scan */ os_memset(&g_roaming_app.scanned_aps, 0, sizeof(struct scanned_ap_info)); - if (esp_wifi_promiscuous_scan_start(&g_roaming_app.config.scan_config, scan_done_event_handler) < 0) { + /* Issue scan */ + 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; } diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_scan.c b/components/wpa_supplicant/esp_supplicant/src/esp_scan.c index 0326d33683..bf418b1696 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_scan.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_scan.c @@ -253,7 +253,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 */