diff --git a/components/driver/test/test_adc2.c b/components/driver/test/test_adc2.c index e02f355ba1..951042869d 100644 --- a/components/driver/test/test_adc2.c +++ b/components/driver/test/test_adc2.c @@ -114,7 +114,7 @@ TEST_CASE("adc2 work with wifi","[adc]") }, }; TEST_ESP_OK(esp_wifi_set_mode(WIFI_MODE_STA)); - TEST_ESP_OK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config)); + TEST_ESP_OK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config)); //test read value TEST_ESP_OK( adc2_get_raw( ADC2_CHANNEL_8, ADC_WIDTH_12Bit, &read_raw )); diff --git a/components/esp_wifi/test/test_wifi.c b/components/esp_wifi/test/test_wifi.c index 7761b95bf2..12072211af 100644 --- a/components/esp_wifi/test/test_wifi.c +++ b/components/esp_wifi/test/test_wifi.c @@ -100,7 +100,7 @@ static void test_wifi_init_deinit(wifi_init_config_t *cfg, wifi_config_t* wifi_c ESP_LOGI(TAG, EMPH_STR("esp_wifi_set_mode")); TEST_ESP_OK(esp_wifi_set_mode(WIFI_MODE_STA)); ESP_LOGI(TAG, EMPH_STR("esp_wifi_set_config")); - TEST_ESP_OK(esp_wifi_set_config(ESP_IF_WIFI_STA, wifi_config)); + TEST_ESP_OK(esp_wifi_set_config(WIFI_IF_STA, wifi_config)); ESP_LOGI(TAG, EMPH_STR("esp_wifi_deinit...")); TEST_ESP_OK(esp_wifi_deinit()); } @@ -114,7 +114,7 @@ static void test_wifi_start_stop(wifi_init_config_t *cfg, wifi_config_t* wifi_co ESP_LOGI(TAG, EMPH_STR("esp_wifi_set_mode")); TEST_ESP_OK(esp_wifi_set_mode(WIFI_MODE_STA)); ESP_LOGI(TAG, EMPH_STR("esp_wifi_set_config")); - TEST_ESP_OK(esp_wifi_set_config(ESP_IF_WIFI_STA, wifi_config)); + TEST_ESP_OK(esp_wifi_set_config(WIFI_IF_STA, wifi_config)); //now start wifi ESP_LOGI(TAG, EMPH_STR("esp_wifi_start...")); TEST_ESP_OK(esp_wifi_start()); diff --git a/components/wifi_provisioning/src/manager.c b/components/wifi_provisioning/src/manager.c index c36b3a8a00..fde7019ecd 100644 --- a/components/wifi_provisioning/src/manager.c +++ b/components/wifi_provisioning/src/manager.c @@ -1104,7 +1104,7 @@ esp_err_t wifi_prov_mgr_is_provisioned(bool *provisioned) /* Get Wi-Fi Station configuration */ wifi_config_t wifi_cfg; - if (esp_wifi_get_config(ESP_IF_WIFI_STA, &wifi_cfg) != ESP_OK) { + if (esp_wifi_get_config(WIFI_IF_STA, &wifi_cfg) != ESP_OK) { return ESP_FAIL; } @@ -1163,7 +1163,7 @@ esp_err_t wifi_prov_mgr_configure_sta(wifi_config_t *wifi_cfg) } /* Configure Wi-Fi station with host credentials * provided during provisioning */ - if (esp_wifi_set_config(ESP_IF_WIFI_STA, wifi_cfg) != ESP_OK) { + if (esp_wifi_set_config(WIFI_IF_STA, wifi_cfg) != ESP_OK) { ESP_LOGE(TAG, "Failed to set Wi-Fi configuration"); RELEASE_LOCK(prov_ctx_lock); return ESP_FAIL; @@ -1433,14 +1433,14 @@ esp_err_t wifi_prov_mgr_start_provisioning(wifi_prov_security_t security, const * to the AP whose credentials were present earlier */ wifi_config_t wifi_cfg_empty, wifi_cfg_old; memset(&wifi_cfg_empty, 0, sizeof(wifi_config_t)); - esp_wifi_get_config(ESP_IF_WIFI_STA, &wifi_cfg_old); + esp_wifi_get_config(WIFI_IF_STA, &wifi_cfg_old); err = esp_wifi_set_storage(WIFI_STORAGE_RAM); if (err != ESP_OK) { ESP_LOGE(TAG, "Failed to set Wi-Fi storage to RAM"); RELEASE_LOCK(prov_ctx_lock); return err; } - esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_cfg_empty); + esp_wifi_set_config(WIFI_IF_STA, &wifi_cfg_empty); if (err != ESP_OK) { ESP_LOGE(TAG, "Failed to set empty Wi-Fi credentials"); RELEASE_LOCK(prov_ctx_lock); @@ -1526,7 +1526,7 @@ esp_err_t wifi_prov_mgr_start_provisioning(wifi_prov_security_t security, const err: prov_ctx->prov_state = WIFI_PROV_STATE_IDLE; esp_wifi_set_storage(WIFI_STORAGE_FLASH); - esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_cfg_old); + esp_wifi_set_config(WIFI_IF_STA, &wifi_cfg_old); exit: RELEASE_LOCK(prov_ctx_lock); diff --git a/components/wpa_supplicant/src/rsn_supp/wpa.c b/components/wpa_supplicant/src/rsn_supp/wpa.c index eaa39448da..4da50c4be9 100644 --- a/components/wpa_supplicant/src/rsn_supp/wpa.c +++ b/components/wpa_supplicant/src/rsn_supp/wpa.c @@ -1009,7 +1009,7 @@ int ieee80211w_set_keys(struct wpa_sm *sm, if (keyidx > 4095) { return -1; } - return esp_wifi_set_igtk_internal(ESP_IF_WIFI_STA, igtk); + return esp_wifi_set_igtk_internal(WIFI_IF_STA, igtk); } return 0; #else @@ -2148,7 +2148,7 @@ int wpa_set_bss(char *macddr, char * bssid, u8 pairwise_cipher, u8 group_cipher, if (esp_wifi_sta_pmf_enabled()) { wifi_config_t wifi_cfg; - esp_wifi_get_config(ESP_IF_WIFI_STA, &wifi_cfg); + esp_wifi_get_config(WIFI_IF_STA, &wifi_cfg); sm->pmf_cfg = wifi_cfg.sta.pmf_cfg; sm->mgmt_group_cipher = cipher_type_map_public_to_supp(esp_wifi_sta_get_mgmt_group_cipher()); } else { diff --git a/examples/bluetooth/esp_ble_mesh/ble_mesh_coex_test/components/case/wifi_connect.c b/examples/bluetooth/esp_ble_mesh/ble_mesh_coex_test/components/case/wifi_connect.c index 6096d75bcc..cdb0422ad7 100644 --- a/examples/bluetooth/esp_ble_mesh/ble_mesh_coex_test/components/case/wifi_connect.c +++ b/examples/bluetooth/esp_ble_mesh/ble_mesh_coex_test/components/case/wifi_connect.c @@ -127,7 +127,7 @@ static void start(const char *ssid, const char *passwd) ESP_LOGI(TAG, "Connecting to %s...", wifi_config.sta.ssid); ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA)); - ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config)); + ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config)); ESP_ERROR_CHECK(esp_wifi_start()); esp_wifi_connect(); s_connection_name = ssid; diff --git a/examples/bluetooth/esp_ble_mesh/ble_mesh_wifi_coexist/components/iperf/cmd_wifi.c b/examples/bluetooth/esp_ble_mesh/ble_mesh_wifi_coexist/components/iperf/cmd_wifi.c index 810b58b4a8..db7937e8d6 100644 --- a/examples/bluetooth/esp_ble_mesh/ble_mesh_wifi_coexist/components/iperf/cmd_wifi.c +++ b/examples/bluetooth/esp_ble_mesh/ble_mesh_wifi_coexist/components/iperf/cmd_wifi.c @@ -166,7 +166,7 @@ static bool wifi_cmd_sta_join(const char *ssid, const char *pass) reconnect = true; esp_wifi_disconnect(); //ESP_ERROR_CHECK( esp_wifi_set_mode(WIFI_MODE_STA) ); //by snake - ESP_ERROR_CHECK( esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) ); + ESP_ERROR_CHECK( esp_wifi_set_config(WIFI_IF_STA, &wifi_config) ); esp_wifi_connect(); xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT, 0, 1, 5000 / portTICK_RATE_MS); diff --git a/examples/common_components/protocol_examples_common/connect.c b/examples/common_components/protocol_examples_common/connect.c index 24717b0e2a..482f163a14 100644 --- a/examples/common_components/protocol_examples_common/connect.c +++ b/examples/common_components/protocol_examples_common/connect.c @@ -164,7 +164,7 @@ static void start(void) }; ESP_LOGI(TAG, "Connecting to %s...", wifi_config.sta.ssid); ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA)); - ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config)); + ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config)); ESP_ERROR_CHECK(esp_wifi_start()); esp_wifi_connect(); s_connection_name = CONFIG_EXAMPLE_WIFI_SSID; diff --git a/examples/protocols/esp_local_ctrl/main/app_main.c b/examples/protocols/esp_local_ctrl/main/app_main.c index fdb0792523..acf3458e8f 100644 --- a/examples/protocols/esp_local_ctrl/main/app_main.c +++ b/examples/protocols/esp_local_ctrl/main/app_main.c @@ -88,7 +88,7 @@ esp_err_t wifi_init_sta(void) }, }; ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) ); - ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) ); + ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config) ); ESP_ERROR_CHECK(esp_wifi_start() ); ESP_LOGI(TAG, "wifi_init_sta finished."); diff --git a/examples/provisioning/ble_prov/main/app_prov.c b/examples/provisioning/ble_prov/main/app_prov.c index 3e9dbdb41d..0baf4a8811 100644 --- a/examples/provisioning/ble_prov/main/app_prov.c +++ b/examples/provisioning/ble_prov/main/app_prov.c @@ -288,7 +288,7 @@ esp_err_t app_prov_is_provisioned(bool *provisioned) /* Get WiFi Station configuration */ wifi_config_t wifi_cfg; - if (esp_wifi_get_config(ESP_IF_WIFI_STA, &wifi_cfg) != ESP_OK) { + if (esp_wifi_get_config(WIFI_IF_STA, &wifi_cfg) != ESP_OK) { return ESP_FAIL; } @@ -309,7 +309,7 @@ esp_err_t app_prov_configure_sta(wifi_config_t *wifi_cfg) } /* Configure WiFi station with host credentials * provided during provisioning */ - if (esp_wifi_set_config(ESP_IF_WIFI_STA, wifi_cfg) != ESP_OK) { + if (esp_wifi_set_config(WIFI_IF_STA, wifi_cfg) != ESP_OK) { ESP_LOGE(TAG, "Failed to set WiFi configuration"); return ESP_FAIL; } diff --git a/examples/provisioning/console_prov/main/app_prov.c b/examples/provisioning/console_prov/main/app_prov.c index d6bd41b41f..9cef6d66bb 100644 --- a/examples/provisioning/console_prov/main/app_prov.c +++ b/examples/provisioning/console_prov/main/app_prov.c @@ -226,7 +226,7 @@ esp_err_t app_prov_is_provisioned(bool *provisioned) /* Get WiFi Station configuration */ wifi_config_t wifi_cfg; - if (esp_wifi_get_config(ESP_IF_WIFI_STA, &wifi_cfg) != ESP_OK) { + if (esp_wifi_get_config(WIFI_IF_STA, &wifi_cfg) != ESP_OK) { return ESP_FAIL; } @@ -247,7 +247,7 @@ esp_err_t app_prov_configure_sta(wifi_config_t *wifi_cfg) } /* Configure WiFi station with host credentials * provided during provisioning */ - if (esp_wifi_set_config(ESP_IF_WIFI_STA, wifi_cfg) != ESP_OK) { + if (esp_wifi_set_config(WIFI_IF_STA, wifi_cfg) != ESP_OK) { ESP_LOGE(TAG, "Failed to set WiFi configuration"); return ESP_FAIL; } diff --git a/examples/provisioning/custom_config/main/app_prov.c b/examples/provisioning/custom_config/main/app_prov.c index 2b685e8e6f..2bf2a5d757 100644 --- a/examples/provisioning/custom_config/main/app_prov.c +++ b/examples/provisioning/custom_config/main/app_prov.c @@ -251,7 +251,7 @@ esp_err_t app_prov_is_provisioned(bool *provisioned) /* Get WiFi Station configuration */ wifi_config_t wifi_cfg; - if (esp_wifi_get_config(ESP_IF_WIFI_STA, &wifi_cfg) != ESP_OK) { + if (esp_wifi_get_config(WIFI_IF_STA, &wifi_cfg) != ESP_OK) { return ESP_FAIL; } @@ -272,7 +272,7 @@ esp_err_t app_prov_configure_sta(wifi_config_t *wifi_cfg) } /* Configure WiFi station with host credentials * provided during provisioning */ - if (esp_wifi_set_config(ESP_IF_WIFI_STA, wifi_cfg) != ESP_OK) { + if (esp_wifi_set_config(WIFI_IF_STA, wifi_cfg) != ESP_OK) { ESP_LOGE(TAG, "Failed to set WiFi configuration"); return ESP_FAIL; } diff --git a/examples/provisioning/softap_prov/main/app_prov.c b/examples/provisioning/softap_prov/main/app_prov.c index 09f74d96af..c7a3919e2d 100644 --- a/examples/provisioning/softap_prov/main/app_prov.c +++ b/examples/provisioning/softap_prov/main/app_prov.c @@ -237,7 +237,7 @@ esp_err_t app_prov_is_provisioned(bool *provisioned) /* Get WiFi Station configuration */ wifi_config_t wifi_cfg; - if (esp_wifi_get_config(ESP_IF_WIFI_STA, &wifi_cfg) != ESP_OK) { + if (esp_wifi_get_config(WIFI_IF_STA, &wifi_cfg) != ESP_OK) { return ESP_FAIL; } @@ -258,7 +258,7 @@ esp_err_t app_prov_configure_sta(wifi_config_t *wifi_cfg) } /* Configure WiFi station with host credentials * provided during provisioning */ - if (esp_wifi_set_config(ESP_IF_WIFI_STA, wifi_cfg) != ESP_OK) { + if (esp_wifi_set_config(WIFI_IF_STA, wifi_cfg) != ESP_OK) { ESP_LOGE(TAG, "Failed to set WiFi configuration"); return ESP_FAIL; } diff --git a/examples/system/console/main/cmd_wifi.c b/examples/system/console/main/cmd_wifi.c index 014d1918d7..0daf53677c 100644 --- a/examples/system/console/main/cmd_wifi.c +++ b/examples/system/console/main/cmd_wifi.c @@ -71,7 +71,7 @@ static bool wifi_join(const char *ssid, const char *pass, int timeout_ms) } ESP_ERROR_CHECK( esp_wifi_set_mode(WIFI_MODE_STA) ); - ESP_ERROR_CHECK( esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) ); + ESP_ERROR_CHECK( esp_wifi_set_config(WIFI_IF_STA, &wifi_config) ); esp_wifi_connect(); int bits = xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT, diff --git a/examples/wifi/fast_scan/main/fast_scan.c b/examples/wifi/fast_scan/main/fast_scan.c index 4818dea5a2..946036ccdd 100644 --- a/examples/wifi/fast_scan/main/fast_scan.c +++ b/examples/wifi/fast_scan/main/fast_scan.c @@ -110,7 +110,7 @@ static void fast_scan(void) }, }; ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA)); - ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config)); + ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config)); ESP_ERROR_CHECK(esp_wifi_start()); } diff --git a/examples/wifi/getting_started/station/main/station_example_main.c b/examples/wifi/getting_started/station/main/station_example_main.c index b2c7cc6c6e..af903b03ee 100644 --- a/examples/wifi/getting_started/station/main/station_example_main.c +++ b/examples/wifi/getting_started/station/main/station_example_main.c @@ -94,7 +94,7 @@ void wifi_init_sta(void) }, }; ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA) ); - ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) ); + ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config) ); ESP_ERROR_CHECK(esp_wifi_start() ); ESP_LOGI(TAG, "wifi_init_sta finished."); diff --git a/examples/wifi/iperf/main/cmd_wifi.c b/examples/wifi/iperf/main/cmd_wifi.c index a60f82ee0c..e832442370 100644 --- a/examples/wifi/iperf/main/cmd_wifi.c +++ b/examples/wifi/iperf/main/cmd_wifi.c @@ -151,7 +151,7 @@ static bool wifi_cmd_sta_join(const char* ssid, const char* pass) reconnect = true; ESP_ERROR_CHECK( esp_wifi_set_mode(WIFI_MODE_STA) ); - ESP_ERROR_CHECK( esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) ); + ESP_ERROR_CHECK( esp_wifi_set_config(WIFI_IF_STA, &wifi_config) ); esp_wifi_connect(); xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT, 0, 1, 5000/portTICK_RATE_MS); diff --git a/examples/wifi/power_save/main/power_save.c b/examples/wifi/power_save/main/power_save.c index ac8f8bbfab..f51167ae9a 100644 --- a/examples/wifi/power_save/main/power_save.c +++ b/examples/wifi/power_save/main/power_save.c @@ -74,7 +74,7 @@ static void wifi_power_save(void) }, }; ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA)); - ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config)); + ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config)); ESP_ERROR_CHECK(esp_wifi_start()); ESP_LOGI(TAG, "esp_wifi_set_ps()."); diff --git a/examples/wifi/smart_config/main/smartconfig_main.c b/examples/wifi/smart_config/main/smartconfig_main.c index d02cdafd6a..0e028df44e 100644 --- a/examples/wifi/smart_config/main/smartconfig_main.c +++ b/examples/wifi/smart_config/main/smartconfig_main.c @@ -69,7 +69,7 @@ static void event_handler(void* arg, esp_event_base_t event_base, ESP_LOGI(TAG, "PASSWORD:%s", password); ESP_ERROR_CHECK( esp_wifi_disconnect() ); - ESP_ERROR_CHECK( esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) ); + ESP_ERROR_CHECK( esp_wifi_set_config(WIFI_IF_STA, &wifi_config) ); esp_wifi_connect(); } else if (event_base == SC_EVENT && event_id == SC_EVENT_SEND_ACK_DONE) { xEventGroupSetBits(s_wifi_event_group, ESPTOUCH_DONE_BIT); diff --git a/examples/wifi/wpa2_enterprise/main/wpa2_enterprise_main.c b/examples/wifi/wpa2_enterprise/main/wpa2_enterprise_main.c index a3d453b6eb..f1a252b644 100644 --- a/examples/wifi/wpa2_enterprise/main/wpa2_enterprise_main.c +++ b/examples/wifi/wpa2_enterprise/main/wpa2_enterprise_main.c @@ -122,7 +122,7 @@ static void initialise_wifi(void) }; ESP_LOGI(TAG, "Setting WiFi configuration SSID %s...", wifi_config.sta.ssid); ESP_ERROR_CHECK( esp_wifi_set_mode(WIFI_MODE_STA) ); - ESP_ERROR_CHECK( esp_wifi_set_config(ESP_IF_WIFI_STA, &wifi_config) ); + ESP_ERROR_CHECK( esp_wifi_set_config(WIFI_IF_STA, &wifi_config) ); ESP_ERROR_CHECK( esp_wifi_sta_wpa2_ent_set_identity((uint8_t *)EXAMPLE_EAP_ID, strlen(EXAMPLE_EAP_ID)) ); #ifdef CONFIG_EXAMPLE_VALIDATE_SERVER_CERT diff --git a/examples/wifi/wps/main/wps.c b/examples/wifi/wps/main/wps.c index 662912c064..b0fa286902 100644 --- a/examples/wifi/wps/main/wps.c +++ b/examples/wifi/wps/main/wps.c @@ -72,7 +72,7 @@ static void wifi_event_handler(void* arg, esp_event_base_t event_base, if (ap_idx < s_ap_creds_num) { ESP_LOGI(TAG, "Connecting to SSID: %s, Passphrase: %s", wps_ap_creds[ap_idx].sta.ssid, wps_ap_creds[ap_idx].sta.password); - ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wps_ap_creds[ap_idx++]) ); + ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wps_ap_creds[ap_idx++]) ); esp_wifi_connect(); } s_retry_num = 0; @@ -99,7 +99,7 @@ static void wifi_event_handler(void* arg, esp_event_base_t event_base, /* If multiple AP credentials are received from WPS, connect with first one */ ESP_LOGI(TAG, "Connecting to SSID: %s, Passphrase: %s", wps_ap_creds[0].sta.ssid, wps_ap_creds[0].sta.password); - ESP_ERROR_CHECK(esp_wifi_set_config(ESP_IF_WIFI_STA, &wps_ap_creds[0]) ); + ESP_ERROR_CHECK(esp_wifi_set_config(WIFI_IF_STA, &wps_ap_creds[0]) ); } /* * If only one AP credential is received from WPS, there will be no event data and