摘要:,初始化底層堆棧,創建默認事件循環。,使用默認配置創建對象,將連接到并注冊默認處理程序。,為驅動初始化分配資源,如控制結構緩沖區結構等,這個也啟動任務。必須先調用此,然后才能調用所有其他,設置工作模式為或,默認模式為模式。
WiFi
—>scan
menuconfig
配置ESP32C3-Specific
—>Rec 0
ESP32-C3(Built-in USB JTAG)
ESP-IDF Build, Flash and Monitor
(左下角)
nvs_flash_init
,初始化默認 NVS 分區。esp_netif_init
,初始化底層TCP/IP堆棧esp_event_loop_create_default
,創建默認事件循環。esp_netif_create_default_wifi_sta
,使用默認WiFi Station配置創建esp_netif
對象,將netif連接到WiFi并注冊默認WiFi處理程序。esp_wifi_init
,為 WiFi 驅動初始化 WiFi 分配資源,如 WiFi 控制結構、RX/TX 緩沖區、WiFi NVS 結構等,這個 WiFi 也啟動 WiFi 任務。必須先調用此API,然后才能調用所有其他WiFi APIesp_wifi_set_mode
,設置WiFi工作模式為station、soft-AP或station+soft-AP,默認模式為soft-AP模式。本程序設置為stationesp_wifi_start
,根據配置,啟動WiFiesp_wifi_scan_start
,掃描所有有效的APesp_wifi_scan_get_ap_records
,獲取上次掃描中找到的AP列表esp_wifi_scan_get_ap_num
,獲取上次掃描中找到的AP數config
,掃描的配置block
,是否堵塞程序運行/** * @brief Scan all available APs. * * @attention If this API is called, the found APs are stored in WiFi driver dynamic allocated memory and the * will be freed in esp_wifi_scan_get_ap_records, so generally, call esp_wifi_scan_get_ap_records to cause * the memory to be freed once the scan is done * @attention The values of maximum active scan time and passive scan time per channel are limited to 1500 milliseconds. * Values above 1500ms may cause station to disconnect from AP and are not recommended. * * @param config configuration of scanning * @param block if block is true, this API will block the caller until the scan is done, otherwise * it will return immediately * * @return * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init * - ESP_ERR_WIFI_NOT_STARTED: WiFi was not started by esp_wifi_start * - ESP_ERR_WIFI_TIMEOUT: blocking scan is timeout * - ESP_ERR_WIFI_STATE: wifi still connecting when invoke esp_wifi_scan_start * - others: refer to error code in esp_err.h */esp_err_t esp_wifi_scan_start(const wifi_scan_config_t *config, bool block);
number
,返回的最大ap個數ap_records
,返回的app記錄數組/** * @brief Get AP list found in last scan * * @param[inout] number As input param, it stores max AP number ap_records can hold. * As output param, it receives the actual AP number this API returns. * @param ap_records wifi_ap_record_t array to hold the found APs * * @return * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start * - ESP_ERR_INVALID_ARG: invalid argument * - ESP_ERR_NO_MEM: out of memory */esp_err_t esp_wifi_scan_get_ap_records(uint16_t *number, wifi_ap_record_t *ap_records);
number
,存儲上次掃描中找到的API數/** * @brief Get number of APs found in last scan * * @param[out] number store number of APs found in last scan * * @attention This API can only be called when the scan is completed, otherwise it may get wrong value. * * @return * - ESP_OK: succeed * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init * - ESP_ERR_WIFI_NOT_STARTED: WiFi is not started by esp_wifi_start * - ESP_ERR_INVALID_ARG: invalid argument */esp_err_t esp_wifi_scan_get_ap_num(uint16_t *number);
覺得好,就一鍵三連唄(點贊+收藏+關注)
文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規行為,您可以聯系管理員刪除。
轉載請注明本文地址:http://m.specialneedsforspecialkids.com/yun/121072.html
摘要:前言芯片接口占用管腳數量比以太網的少,版線布局可更精簡。網卡芯片介紹接口網卡芯片是為方物聯網行業進以太網通信而開發出的解決方案。此應用可用于監控家庭物聯網網關搭建等。 前言 ????DM9051NP芯片?SPI接口占用管腳數量比以太網PHY的RMII/MII少,PCBA版線布局可更精簡。...
摘要:論壇下載由于庫是不帶中值濾波器的,需要自己實現,所以花了點時間制作了一個章節。紅色線是波形高斯白噪聲均勻白噪聲。第版教程發布中文顯示章節論壇下載可以直接運行界面效果,也可以使用可以直接編譯運行。上位機已經整合主機,下一版發布 往期周報匯總地址:http://www.armbbs.cn/for...
閱讀 2517·2021-11-18 10:02
閱讀 1985·2021-11-09 09:45
閱讀 2432·2021-09-26 09:47
閱讀 1030·2021-07-23 10:26
閱讀 1071·2019-08-30 15:47
閱讀 3364·2019-08-30 15:44
閱讀 974·2019-08-30 15:43
閱讀 888·2019-08-29 13:50