mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
example: Scan failure should not cause system crash
This commit is contained in:
parent
2f4ef71beb
commit
3590a6816f
@ -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:
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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, "<MESH_EVENT_STOPPED>");
|
||||
@ -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:
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user