mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge 099c7c0541
into 9b3eda0974
This commit is contained in:
commit
8546308abc
@ -232,10 +232,14 @@ esp_err_t example_ethernet_connect(void)
|
|||||||
eth_start();
|
eth_start();
|
||||||
ESP_LOGI(TAG, "Waiting for IP(s).");
|
ESP_LOGI(TAG, "Waiting for IP(s).");
|
||||||
#if CONFIG_EXAMPLE_CONNECT_IPV4
|
#if CONFIG_EXAMPLE_CONNECT_IPV4
|
||||||
xSemaphoreTake(s_semph_get_ip_addrs, portMAX_DELAY);
|
if (xSemaphoreTake(s_semph_get_ip_addrs, pdMS_TO_TICKS(10000)) == pdFALSE) {
|
||||||
|
ESP_LOGW(TAG, "Gave up waiting for IPv4 address.");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_EXAMPLE_CONNECT_IPV6
|
#if CONFIG_EXAMPLE_CONNECT_IPV6
|
||||||
xSemaphoreTake(s_semph_get_ip6_addrs, portMAX_DELAY);
|
if (xSemaphoreTake(s_semph_get_ip6_addrs, pdMS_TO_TICKS(10000)) == pdFALSE) {
|
||||||
|
ESP_LOGW(TAG, "Gave up waiting for (preferred) IPv6 address.");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
@ -171,10 +171,14 @@ esp_err_t example_wifi_sta_do_connect(wifi_config_t wifi_config, bool wait)
|
|||||||
if (wait) {
|
if (wait) {
|
||||||
ESP_LOGI(TAG, "Waiting for IP(s)");
|
ESP_LOGI(TAG, "Waiting for IP(s)");
|
||||||
#if CONFIG_EXAMPLE_CONNECT_IPV4
|
#if CONFIG_EXAMPLE_CONNECT_IPV4
|
||||||
xSemaphoreTake(s_semph_get_ip_addrs, portMAX_DELAY);
|
if (xSemaphoreTake(s_semph_get_ip_addrs, pdMS_TO_TICKS(10000)) == pdFALSE) {
|
||||||
|
ESP_LOGW(TAG, "Gave up waiting for IPv4 address.");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_EXAMPLE_CONNECT_IPV6
|
#if CONFIG_EXAMPLE_CONNECT_IPV6
|
||||||
xSemaphoreTake(s_semph_get_ip6_addrs, portMAX_DELAY);
|
if (xSemaphoreTake(s_semph_get_ip6_addrs, pdMS_TO_TICKS(10000)) == pdFALSE) {
|
||||||
|
ESP_LOGW(TAG, "Gave up waiting for (preferred) IPv6 address.");
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
if (s_retry_num > CONFIG_EXAMPLE_WIFI_CONN_MAX_RETRY) {
|
if (s_retry_num > CONFIG_EXAMPLE_WIFI_CONN_MAX_RETRY) {
|
||||||
return ESP_FAIL;
|
return ESP_FAIL;
|
||||||
|
Loading…
Reference in New Issue
Block a user