example: Scan failure should not cause system crash

This commit is contained in:
xiehang 2021-01-14 19:33:10 +08:00 committed by bot
parent 9cb3ac94c4
commit d9e1d51ec8
5 changed files with 7 additions and 7 deletions

View File

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

View File

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

View File

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

View File

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

View File

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