From 35f8d9d42c0b89f26da4d6b40ddabe66a1e35cae Mon Sep 17 00:00:00 2001 From: Kapil Gupta Date: Mon, 14 Jul 2025 18:09:20 +0530 Subject: [PATCH] fix(esp_wifi): Remove deprecated arguments from some APIs --- components/wpa_supplicant/esp_supplicant/include/esp_dpp.h | 4 +--- components/wpa_supplicant/esp_supplicant/include/esp_wps.h | 7 +------ components/wpa_supplicant/esp_supplicant/src/esp_dpp.c | 2 +- components/wpa_supplicant/esp_supplicant/src/esp_wps.c | 2 +- .../dpp-enrollee/main/dpp_enrollee_main.c | 2 +- examples/wifi/wps/main/wps.c | 4 ++-- .../protocols/esp_netif/build_config/main/netif_init_c99.c | 2 +- .../esp_netif/build_config/main/netif_init_cpp.cpp | 2 +- 8 files changed, 9 insertions(+), 16 deletions(-) diff --git a/components/wpa_supplicant/esp_supplicant/include/esp_dpp.h b/components/wpa_supplicant/esp_supplicant/include/esp_dpp.h index 76a0e50f4f..a68a458523 100644 --- a/components/wpa_supplicant/esp_supplicant/include/esp_dpp.h +++ b/components/wpa_supplicant/esp_supplicant/include/esp_dpp.h @@ -37,13 +37,11 @@ typedef enum dpp_bootstrap_type { * * Starts DPP Supplicant and initializes related Data Structures. * - * @param evt_cb (Deprecated) Callback function to receive DPP related events - * * return * - ESP_OK: Success * - ESP_FAIL: Failure */ -esp_err_t esp_supp_dpp_init(void *ctx); +esp_err_t esp_supp_dpp_init(void); /** * @brief De-initialize DPP Supplicant diff --git a/components/wpa_supplicant/esp_supplicant/include/esp_wps.h b/components/wpa_supplicant/esp_supplicant/include/esp_wps.h index c907480386..59c1363095 100644 --- a/components/wpa_supplicant/esp_supplicant/include/esp_wps.h +++ b/components/wpa_supplicant/esp_supplicant/include/esp_wps.h @@ -125,11 +125,6 @@ esp_err_t esp_wifi_wps_disable(void); * * @attention WPS can only be used when station is enabled. WPS needs to be enabled first for using this API. * - * @param timeout_ms : deprecated: This argument's value will have not effect in functionality of API. - * The argument will be removed in future. - * The app should start WPS and register for WIFI events to get the status. - * WPS status is updated through WPS events. See wifi_event_t enum for more info. - * * @return * - ESP_OK : succeed * - ESP_ERR_WIFI_WPS_TYPE : wps type is invalid @@ -137,7 +132,7 @@ esp_err_t esp_wifi_wps_disable(void); * - ESP_ERR_WIFI_WPS_SM : wps state machine is not initialized * - ESP_FAIL : wps initialization fails */ -esp_err_t esp_wifi_wps_start(int timeout_ms); +esp_err_t esp_wifi_wps_start(void); /** * @brief Enable Wi-Fi AP WPS function. diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_dpp.c b/components/wpa_supplicant/esp_supplicant/src/esp_dpp.c index 9a75cc5501..ee7a833aa2 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_dpp.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_dpp.c @@ -1060,7 +1060,7 @@ init_fail: } -esp_err_t esp_supp_dpp_init(esp_supp_dpp_event_cb_t cb) +esp_err_t esp_supp_dpp_init(void) { esp_err_t ret = ESP_OK; diff --git a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c index 186571237a..7a5f9c2b8b 100644 --- a/components/wpa_supplicant/esp_supplicant/src/esp_wps.c +++ b/components/wpa_supplicant/esp_supplicant/src/esp_wps.c @@ -1656,7 +1656,7 @@ int esp_wifi_wps_disable(void) return ESP_OK; } -int esp_wifi_wps_start(int timeout_ms) +int esp_wifi_wps_start(void) { int ret; diff --git a/examples/wifi/wifi_easy_connect/dpp-enrollee/main/dpp_enrollee_main.c b/examples/wifi/wifi_easy_connect/dpp-enrollee/main/dpp_enrollee_main.c index b2bac9e24c..97243704b3 100644 --- a/examples/wifi/wifi_easy_connect/dpp-enrollee/main/dpp_enrollee_main.c +++ b/examples/wifi/wifi_easy_connect/dpp-enrollee/main/dpp_enrollee_main.c @@ -161,7 +161,7 @@ void dpp_enrollee_init(void) ESP_ERROR_CHECK(esp_wifi_init(&cfg)); ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA)); - ESP_ERROR_CHECK(esp_supp_dpp_init(NULL)); + ESP_ERROR_CHECK(esp_supp_dpp_init()); ESP_ERROR_CHECK(dpp_enrollee_bootstrap()); ESP_ERROR_CHECK(esp_wifi_start()); diff --git a/examples/wifi/wps/main/wps.c b/examples/wifi/wps/main/wps.c index 882a1f7201..4fe5c1bc75 100644 --- a/examples/wifi/wps/main/wps.c +++ b/examples/wifi/wps/main/wps.c @@ -58,7 +58,7 @@ static void wps_restart(void) { ESP_ERROR_CHECK(esp_wifi_wps_disable()); ESP_ERROR_CHECK(esp_wifi_wps_enable(&config)); - ESP_ERROR_CHECK(esp_wifi_wps_start(0)); + ESP_ERROR_CHECK(esp_wifi_wps_start()); } static void handle_wps_success(void *event_data) @@ -172,7 +172,7 @@ static void start_wps(void) ESP_LOGI(TAG, "start wps..."); ESP_ERROR_CHECK(esp_wifi_wps_enable(&config)); - ESP_ERROR_CHECK(esp_wifi_wps_start(0)); + ESP_ERROR_CHECK(esp_wifi_wps_start()); } void app_main(void) diff --git a/tools/test_apps/protocols/esp_netif/build_config/main/netif_init_c99.c b/tools/test_apps/protocols/esp_netif/build_config/main/netif_init_c99.c index e2ad85d8b8..96c70404cd 100644 --- a/tools/test_apps/protocols/esp_netif/build_config/main/netif_init_c99.c +++ b/tools/test_apps/protocols/esp_netif/build_config/main/netif_init_c99.c @@ -70,7 +70,7 @@ static void test_wps_init(void) { esp_wps_config_t config = WPS_CONFIG_INIT_DEFAULT(WPS_TYPE_DISABLE); ESP_ERROR_CHECK(esp_wifi_wps_enable(&config)); - ESP_ERROR_CHECK(esp_wifi_wps_start(0)); + ESP_ERROR_CHECK(esp_wifi_wps_start()); } diff --git a/tools/test_apps/protocols/esp_netif/build_config/main/netif_init_cpp.cpp b/tools/test_apps/protocols/esp_netif/build_config/main/netif_init_cpp.cpp index f74e7184ed..11615c1c83 100644 --- a/tools/test_apps/protocols/esp_netif/build_config/main/netif_init_cpp.cpp +++ b/tools/test_apps/protocols/esp_netif/build_config/main/netif_init_cpp.cpp @@ -65,7 +65,7 @@ static void test_wps_init(void) { esp_wps_config_t config = WPS_CONFIG_INIT_DEFAULT(WPS_TYPE_DISABLE); ESP_ERROR_CHECK(esp_wifi_wps_enable(&config)); - ESP_ERROR_CHECK(esp_wifi_wps_start(0)); + ESP_ERROR_CHECK(esp_wifi_wps_start()); }