From 2f4ef71bebc8d3d104af6c05eadf893a515ebd88 Mon Sep 17 00:00:00 2001 From: xiehang Date: Fri, 15 Jan 2021 19:40:25 +0800 Subject: [PATCH] example: do not check the return value of esp_wifi_connect() --- .../ble_mesh_wifi_coexist/components/iperf/cmd_wifi.c | 2 +- .../protocols/http2_request/main/http2_request_example_main.c | 4 ++-- examples/protocols/http_server/advanced_tests/main/main.c | 4 ++-- examples/protocols/http_server/file_serving/main/main.c | 4 ++-- examples/protocols/http_server/persistent_sockets/main/main.c | 4 ++-- examples/protocols/http_server/simple/main/main.c | 4 ++-- examples/protocols/https_server/main/main.c | 4 ++-- examples/system/console/main/cmd_wifi.c | 2 +- examples/wifi/fast_scan/main/fast_scan.c | 4 ++-- examples/wifi/iperf/main/cmd_wifi.c | 2 +- examples/wifi/power_save/main/power_save.c | 4 ++-- examples/wifi/smart_config/main/smartconfig_main.c | 2 +- examples/wifi/wps/main/wps.c | 4 ++-- 13 files changed, 22 insertions(+), 22 deletions(-) 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 8d258dc923..77a22550c9 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 @@ -148,7 +148,7 @@ static bool wifi_cmd_sta_join(const char *ssid, const char *pass) 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_connect() ); + esp_wifi_connect(); xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT, 0, 1, 5000 / portTICK_RATE_MS); diff --git a/examples/protocols/http2_request/main/http2_request_example_main.c b/examples/protocols/http2_request/main/http2_request_example_main.c index 8083fcf720..3a69b5bbd4 100644 --- a/examples/protocols/http2_request/main/http2_request_example_main.c +++ b/examples/protocols/http2_request/main/http2_request_example_main.c @@ -153,7 +153,7 @@ static esp_err_t event_handler(void *ctx, system_event_t *event) switch (event->event_id) { case SYSTEM_EVENT_STA_START: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_START"); - ESP_ERROR_CHECK(esp_wifi_connect()); + esp_wifi_connect(); break; case SYSTEM_EVENT_STA_GOT_IP: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_GOT_IP"); @@ -162,7 +162,7 @@ static esp_err_t event_handler(void *ctx, system_event_t *event) break; case SYSTEM_EVENT_STA_DISCONNECTED: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_DISCONNECTED"); - ESP_ERROR_CHECK(esp_wifi_connect()); + esp_wifi_connect(); xEventGroupClearBits(wifi_event_group, CONNECTED_BIT); break; default: diff --git a/examples/protocols/http_server/advanced_tests/main/main.c b/examples/protocols/http_server/advanced_tests/main/main.c index de32966c8f..895e740985 100644 --- a/examples/protocols/http_server/advanced_tests/main/main.c +++ b/examples/protocols/http_server/advanced_tests/main/main.c @@ -24,7 +24,7 @@ static esp_err_t event_handler(void *ctx, system_event_t *event) switch(event->event_id) { case SYSTEM_EVENT_STA_START: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_START"); - ESP_ERROR_CHECK(esp_wifi_connect()); + esp_wifi_connect(); break; case SYSTEM_EVENT_STA_GOT_IP: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_GOT_IP"); @@ -39,7 +39,7 @@ static esp_err_t event_handler(void *ctx, system_event_t *event) break; case SYSTEM_EVENT_STA_DISCONNECTED: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_DISCONNECTED"); - ESP_ERROR_CHECK(esp_wifi_connect()); + esp_wifi_connect(); // Stop webserver tests if (*hd) { diff --git a/examples/protocols/http_server/file_serving/main/main.c b/examples/protocols/http_server/file_serving/main/main.c index ee1aaeef60..2e19f399a1 100644 --- a/examples/protocols/http_server/file_serving/main/main.c +++ b/examples/protocols/http_server/file_serving/main/main.c @@ -37,7 +37,7 @@ static esp_err_t event_handler(void *ctx, system_event_t *event) switch(event->event_id) { case SYSTEM_EVENT_STA_START: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_START"); - ESP_ERROR_CHECK(esp_wifi_connect()); + esp_wifi_connect(); break; case SYSTEM_EVENT_STA_GOT_IP: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_GOT_IP"); @@ -46,7 +46,7 @@ static esp_err_t event_handler(void *ctx, system_event_t *event) break; case SYSTEM_EVENT_STA_DISCONNECTED: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_DISCONNECTED"); - ESP_ERROR_CHECK(esp_wifi_connect()); + esp_wifi_connect(); break; default: break; diff --git a/examples/protocols/http_server/persistent_sockets/main/main.c b/examples/protocols/http_server/persistent_sockets/main/main.c index b353559292..8d18e07805 100644 --- a/examples/protocols/http_server/persistent_sockets/main/main.c +++ b/examples/protocols/http_server/persistent_sockets/main/main.c @@ -197,7 +197,7 @@ static esp_err_t event_handler(void *ctx, system_event_t *event) switch(event->event_id) { case SYSTEM_EVENT_STA_START: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_START"); - ESP_ERROR_CHECK(esp_wifi_connect()); + esp_wifi_connect(); break; case SYSTEM_EVENT_STA_GOT_IP: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_GOT_IP"); @@ -211,7 +211,7 @@ static esp_err_t event_handler(void *ctx, system_event_t *event) break; case SYSTEM_EVENT_STA_DISCONNECTED: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_DISCONNECTED"); - ESP_ERROR_CHECK(esp_wifi_connect()); + esp_wifi_connect(); /* Stop the webserver */ if (*server) { diff --git a/examples/protocols/http_server/simple/main/main.c b/examples/protocols/http_server/simple/main/main.c index 9ada49cabc..79fc4f34b7 100644 --- a/examples/protocols/http_server/simple/main/main.c +++ b/examples/protocols/http_server/simple/main/main.c @@ -255,7 +255,7 @@ static esp_err_t event_handler(void *ctx, system_event_t *event) switch(event->event_id) { case SYSTEM_EVENT_STA_START: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_START"); - ESP_ERROR_CHECK(esp_wifi_connect()); + esp_wifi_connect(); break; case SYSTEM_EVENT_STA_GOT_IP: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_GOT_IP"); @@ -269,7 +269,7 @@ static esp_err_t event_handler(void *ctx, system_event_t *event) break; case SYSTEM_EVENT_STA_DISCONNECTED: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_DISCONNECTED"); - ESP_ERROR_CHECK(esp_wifi_connect()); + esp_wifi_connect(); /* Stop the web server */ if (*server) { diff --git a/examples/protocols/https_server/main/main.c b/examples/protocols/https_server/main/main.c index d46897f1bd..cae0497306 100644 --- a/examples/protocols/https_server/main/main.c +++ b/examples/protocols/https_server/main/main.c @@ -95,7 +95,7 @@ static esp_err_t event_handler(void *ctx, system_event_t *event) switch(event->event_id) { case SYSTEM_EVENT_STA_START: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_START"); - ESP_ERROR_CHECK(esp_wifi_connect()); + esp_wifi_connect(); break; case SYSTEM_EVENT_STA_GOT_IP: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_GOT_IP"); @@ -109,7 +109,7 @@ static esp_err_t event_handler(void *ctx, system_event_t *event) break; case SYSTEM_EVENT_STA_DISCONNECTED: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_DISCONNECTED"); - ESP_ERROR_CHECK(esp_wifi_connect()); + esp_wifi_connect(); /* Stop the web server */ if (*server) { diff --git a/examples/system/console/main/cmd_wifi.c b/examples/system/console/main/cmd_wifi.c index e5eb8a29ce..f6b734d570 100644 --- a/examples/system/console/main/cmd_wifi.c +++ b/examples/system/console/main/cmd_wifi.c @@ -70,7 +70,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_connect() ); + esp_wifi_connect(); int bits = xEventGroupWaitBits(wifi_event_group, CONNECTED_BIT, pdFALSE, pdTRUE, timeout_ms / portTICK_PERIOD_MS); diff --git a/examples/wifi/fast_scan/main/fast_scan.c b/examples/wifi/fast_scan/main/fast_scan.c index fa27bf7f21..2aa46d67ba 100644 --- a/examples/wifi/fast_scan/main/fast_scan.c +++ b/examples/wifi/fast_scan/main/fast_scan.c @@ -73,7 +73,7 @@ static esp_err_t event_handler(void *ctx, system_event_t *event) switch (event->event_id) { case SYSTEM_EVENT_STA_START: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_START"); - ESP_ERROR_CHECK(esp_wifi_connect()); + esp_wifi_connect(); break; case SYSTEM_EVENT_STA_GOT_IP: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_GOT_IP"); @@ -82,7 +82,7 @@ static esp_err_t event_handler(void *ctx, system_event_t *event) break; case SYSTEM_EVENT_STA_DISCONNECTED: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_DISCONNECTED"); - ESP_ERROR_CHECK(esp_wifi_connect()); + esp_wifi_connect(); break; default: break; diff --git a/examples/wifi/iperf/main/cmd_wifi.c b/examples/wifi/iperf/main/cmd_wifi.c index 960cd22ea7..eb64d2e0e8 100644 --- a/examples/wifi/iperf/main/cmd_wifi.c +++ b/examples/wifi/iperf/main/cmd_wifi.c @@ -142,7 +142,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_connect() ); + 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 c9576a9aa6..578725b394 100644 --- a/examples/wifi/power_save/main/power_save.c +++ b/examples/wifi/power_save/main/power_save.c @@ -45,7 +45,7 @@ static esp_err_t event_handler(void *ctx, system_event_t *event) switch(event->event_id) { case SYSTEM_EVENT_STA_START: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_START"); - ESP_ERROR_CHECK(esp_wifi_connect()); + esp_wifi_connect(); break; case SYSTEM_EVENT_STA_GOT_IP: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_GOT_IP"); @@ -54,7 +54,7 @@ static esp_err_t event_handler(void *ctx, system_event_t *event) break; case SYSTEM_EVENT_STA_DISCONNECTED: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_DISCONNECTED"); - ESP_ERROR_CHECK(esp_wifi_connect()); + esp_wifi_connect(); break; default: break; diff --git a/examples/wifi/smart_config/main/smartconfig_main.c b/examples/wifi/smart_config/main/smartconfig_main.c index 71e9365e47..537980f160 100644 --- a/examples/wifi/smart_config/main/smartconfig_main.c +++ b/examples/wifi/smart_config/main/smartconfig_main.c @@ -84,7 +84,7 @@ static void sc_callback(smartconfig_status_t status, void *pdata) ESP_LOGI(TAG, "PASSWORD:%s", wifi_config->sta.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_connect() ); + esp_wifi_connect(); break; case SC_STATUS_LINK_OVER: ESP_LOGI(TAG, "SC_STATUS_LINK_OVER"); diff --git a/examples/wifi/wps/main/wps.c b/examples/wifi/wps/main/wps.c index 50ab8de9bc..a3677f28d2 100644 --- a/examples/wifi/wps/main/wps.c +++ b/examples/wifi/wps/main/wps.c @@ -55,7 +55,7 @@ static esp_err_t event_handler(void *ctx, system_event_t *event) break; case SYSTEM_EVENT_STA_DISCONNECTED: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_DISCONNECTED"); - ESP_ERROR_CHECK(esp_wifi_connect()); + esp_wifi_connect(); break; case SYSTEM_EVENT_STA_WPS_ER_SUCCESS: /*point: the function esp_wifi_wps_start() only get ssid & password @@ -63,7 +63,7 @@ static esp_err_t event_handler(void *ctx, system_event_t *event) * */ ESP_LOGI(TAG, "SYSTEM_EVENT_STA_WPS_ER_SUCCESS"); ESP_ERROR_CHECK(esp_wifi_wps_disable()); - ESP_ERROR_CHECK(esp_wifi_connect()); + esp_wifi_connect(); break; case SYSTEM_EVENT_STA_WPS_ER_FAILED: ESP_LOGI(TAG, "SYSTEM_EVENT_STA_WPS_ER_FAILED");