diff --git a/examples/bluetooth/bluedroid/ble/blufi/main/blufi_example_main.c b/examples/bluetooth/bluedroid/ble/blufi/main/blufi_example_main.c index c25e5c2fdb..f33a2125aa 100644 --- a/examples/bluetooth/bluedroid/ble/blufi/main/blufi_example_main.c +++ b/examples/bluetooth/bluedroid/ble/blufi/main/blufi_example_main.c @@ -371,7 +371,7 @@ static void example_event_callback(esp_blufi_cb_event_t event, esp_blufi_cb_para .channel = 0, .show_hidden = false }; - ESP_ERROR_CHECK(esp_wifi_scan_start(&scanConf, true)); + esp_wifi_scan_start(&scanConf, true); break; } case ESP_BLUFI_EVENT_RECV_CUSTOM_DATA: 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 720a532f6e..6096d75bcc 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 @@ -93,11 +93,7 @@ static void on_wifi_disconnect(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data) { ESP_LOGI(TAG, "Wi-Fi disconnected, trying to reconnect..."); - esp_err_t err = esp_wifi_connect(); - if (err == ESP_ERR_WIFI_NOT_STARTED) { - return; - } - ESP_ERROR_CHECK(err); + esp_wifi_connect(); } static void start(const char *ssid, const char *passwd) @@ -133,7 +129,7 @@ static void start(const char *ssid, const char *passwd) 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_start()); - ESP_ERROR_CHECK(esp_wifi_connect()); + 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 28548c1ec3..48eebe360d 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 @@ -167,7 +167,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); @@ -194,7 +194,7 @@ static bool wifi_cmd_sta_scan(const char *ssid) scan_config.ssid = (uint8_t *) ssid; ESP_ERROR_CHECK( esp_wifi_set_mode(WIFI_MODE_STA) ); - ESP_ERROR_CHECK( esp_wifi_scan_start(&scan_config, false) ); + esp_wifi_scan_start(&scan_config, false); return true; } diff --git a/examples/common_components/protocol_examples_common/connect.c b/examples/common_components/protocol_examples_common/connect.c index e1d4d220a2..36be310a1a 100644 --- a/examples/common_components/protocol_examples_common/connect.c +++ b/examples/common_components/protocol_examples_common/connect.c @@ -257,7 +257,7 @@ static esp_netif_t* wifi_start(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_start()); - ESP_ERROR_CHECK(esp_wifi_connect()); + esp_wifi_connect(); return netif; } diff --git a/examples/mesh/manual_networking/main/mesh_main.c b/examples/mesh/manual_networking/main/mesh_main.c index cf788d83aa..6bf136e044 100644 --- a/examples/mesh/manual_networking/main/mesh_main.c +++ b/examples/mesh/manual_networking/main/mesh_main.c @@ -136,7 +136,7 @@ void mesh_scan_done_handler(int num) esp_wifi_scan_stop(); scan_config.show_hidden = 1; scan_config.scan_type = WIFI_SCAN_TYPE_PASSIVE; - ESP_ERROR_CHECK(esp_wifi_scan_start(&scan_config, 0)); + esp_wifi_scan_start(&scan_config, 0); } } @@ -157,7 +157,7 @@ void mesh_event_handler(void *arg, esp_event_base_t event_base, /* mesh softAP is hidden */ scan_config.show_hidden = 1; scan_config.scan_type = WIFI_SCAN_TYPE_PASSIVE; - ESP_ERROR_CHECK(esp_wifi_scan_start(&scan_config, 0)); + esp_wifi_scan_start(&scan_config, 0); } break; case MESH_EVENT_STOPPED: { @@ -228,7 +228,7 @@ void mesh_event_handler(void *arg, esp_event_base_t event_base, esp_wifi_scan_stop(); scan_config.show_hidden = 1; scan_config.scan_type = WIFI_SCAN_TYPE_PASSIVE; - ESP_ERROR_CHECK(esp_wifi_scan_start(&scan_config, 0)); + esp_wifi_scan_start(&scan_config, 0); } } break; diff --git a/examples/system/console/main/cmd_wifi.c b/examples/system/console/main/cmd_wifi.c index e0751e476d..014d1918d7 100644 --- a/examples/system/console/main/cmd_wifi.c +++ b/examples/system/console/main/cmd_wifi.c @@ -72,7 +72,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/iperf/main/cmd_wifi.c b/examples/wifi/iperf/main/cmd_wifi.c index 766163324f..94aaaf2c52 100644 --- a/examples/wifi/iperf/main/cmd_wifi.c +++ b/examples/wifi/iperf/main/cmd_wifi.c @@ -159,7 +159,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); @@ -186,7 +186,7 @@ static bool wifi_cmd_sta_scan(const char* ssid) scan_config.ssid = (uint8_t *) ssid; ESP_ERROR_CHECK( esp_wifi_set_mode(WIFI_MODE_STA) ); - ESP_ERROR_CHECK( esp_wifi_scan_start(&scan_config, false) ); + esp_wifi_scan_start(&scan_config, false); return true; } diff --git a/examples/wifi/scan/main/scan.c b/examples/wifi/scan/main/scan.c index 15edb4b831..3ac8230ade 100644 --- a/examples/wifi/scan/main/scan.c +++ b/examples/wifi/scan/main/scan.c @@ -124,7 +124,7 @@ static void wifi_scan(void) ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA)); ESP_ERROR_CHECK(esp_wifi_start()); - ESP_ERROR_CHECK(esp_wifi_scan_start(NULL, true)); + esp_wifi_scan_start(NULL, true); ESP_ERROR_CHECK(esp_wifi_scan_get_ap_records(&number, ap_info)); ESP_ERROR_CHECK(esp_wifi_scan_get_ap_num(&ap_count)); ESP_LOGI(TAG, "Total APs scanned = %u", ap_count); @@ -137,7 +137,6 @@ static void wifi_scan(void) } ESP_LOGI(TAG, "Channel \t\t%d\n", ap_info[i].primary); } - } void app_main(void) diff --git a/examples/wifi/smart_config/main/smartconfig_main.c b/examples/wifi/smart_config/main/smartconfig_main.c index b8a668c3f1..d02cdafd6a 100644 --- a/examples/wifi/smart_config/main/smartconfig_main.c +++ b/examples/wifi/smart_config/main/smartconfig_main.c @@ -70,7 +70,7 @@ static void event_handler(void* arg, esp_event_base_t event_base, 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(); } 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/wps/main/wps.c b/examples/wifi/wps/main/wps.c index edf87ae54a..662912c064 100644 --- a/examples/wifi/wps/main/wps.c +++ b/examples/wifi/wps/main/wps.c @@ -64,7 +64,7 @@ static void wifi_event_handler(void* arg, esp_event_base_t event_base, case WIFI_EVENT_STA_DISCONNECTED: ESP_LOGI(TAG, "WIFI_EVENT_STA_DISCONNECTED"); if (s_retry_num < MAX_RETRY_ATTEMPTS) { - ESP_ERROR_CHECK(esp_wifi_connect()); + esp_wifi_connect(); s_retry_num++; } else if (ap_idx < s_ap_creds_num) { /* Try the next AP credential if first one fails */ @@ -73,7 +73,7 @@ static void wifi_event_handler(void* arg, esp_event_base_t event_base, 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_connect()); + esp_wifi_connect(); } s_retry_num = 0; } else { @@ -107,7 +107,7 @@ static void wifi_event_handler(void* arg, esp_event_base_t event_base, * with legacy apps. So directly attempt connection here. */ ESP_ERROR_CHECK(esp_wifi_wps_disable()); - ESP_ERROR_CHECK(esp_wifi_connect()); + esp_wifi_connect(); } break; case WIFI_EVENT_STA_WPS_ER_FAILED: