This commit is contained in:
Steffen Beyer 2024-09-20 14:40:33 +08:00 committed by GitHub
commit 8546308abc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 4 deletions

View File

@ -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;
} }

View File

@ -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;