From 3590a6816f36ae825cbdff993e5975e192157a49 Mon Sep 17 00:00:00 2001 From: xiehang Date: Fri, 15 Jan 2021 19:45:59 +0800 Subject: [PATCH] example: Scan failure should not cause system crash --- examples/bluetooth/blufi/main/blufi_example_main.c | 2 +- .../ble_mesh_wifi_coexist/components/iperf/cmd_wifi.c | 2 +- examples/mesh/manual_networking/main/mesh_main.c | 6 +++--- examples/wifi/iperf/main/cmd_wifi.c | 2 +- examples/wifi/scan/main/scan.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/bluetooth/blufi/main/blufi_example_main.c b/examples/bluetooth/blufi/main/blufi_example_main.c index 04415327c5..38307c9054 100644 --- a/examples/bluetooth/blufi/main/blufi_example_main.c +++ b/examples/bluetooth/blufi/main/blufi_example_main.c @@ -350,7 +350,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_wifi_coexist/components/iperf/cmd_wifi.c b/examples/bluetooth/esp_ble_mesh/ble_mesh_wifi_coexist/components/iperf/cmd_wifi.c index 77a22550c9..59cb534fd2 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 @@ -175,7 +175,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/mesh/manual_networking/main/mesh_main.c b/examples/mesh/manual_networking/main/mesh_main.c index 56df30ab6e..d2dae99ddf 100644 --- a/examples/mesh/manual_networking/main/mesh_main.c +++ b/examples/mesh/manual_networking/main/mesh_main.c @@ -152,7 +152,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); } } @@ -173,7 +173,7 @@ void mesh_event_handler(mesh_event_t event) /* 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: ESP_LOGI(MESH_TAG, ""); @@ -229,7 +229,7 @@ void mesh_event_handler(mesh_event_t event) 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; case MESH_EVENT_LAYER_CHANGE: diff --git a/examples/wifi/iperf/main/cmd_wifi.c b/examples/wifi/iperf/main/cmd_wifi.c index eb64d2e0e8..95191542df 100644 --- a/examples/wifi/iperf/main/cmd_wifi.c +++ b/examples/wifi/iperf/main/cmd_wifi.c @@ -169,7 +169,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 a1f1dddc6a..6d5554f10b 100644 --- a/examples/wifi/scan/main/scan.c +++ b/examples/wifi/scan/main/scan.c @@ -147,7 +147,7 @@ static void init_wifi(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); while (1) { if (got_scan_done_event == true) {