mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
esp_wifi: Modify ESP_IF_WIFI_STA to WIFI_IF_STA
This commit is contained in:
parent
d6d7a2ad12
commit
4403af7267
@ -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 ));
|
||||
|
@ -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());
|
||||
|
@ -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);
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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.");
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
@ -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.");
|
||||
|
@ -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);
|
||||
|
@ -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().");
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user