摘要:,初始化底層堆棧,創(chuàng)建默認(rèn)事件循環(huán)。,使用默認(rèn)配置創(chuàng)建對(duì)象,將連接到并注冊(cè)默認(rèn)處理程序。,為驅(qū)動(dòng)初始化分配資源,如控制結(jié)構(gòu)緩沖區(qū)結(jié)構(gòu)等,這個(gè)也啟動(dòng)任務(wù)。必須先調(diào)用此,然后才能調(diào)用所有其他,設(shè)置工作模式為或,默認(rèn)模式為模式。
WiFi
—>scan
menuconfig
配置ESP32C3-Specific
—>Rec 0
ESP32-C3(Built-in USB JTAG)
ESP-IDF Build, Flash and Monitor
(左下角)
nvs_flash_init
,初始化默認(rèn) NVS 分區(qū)。esp_netif_init
,初始化底層TCP/IP堆棧esp_event_loop_create_default
,創(chuàng)建默認(rèn)事件循環(huán)。esp_netif_create_default_wifi_sta
,使用默認(rèn)WiFi Station配置創(chuàng)建esp_netif
對(duì)象,將netif連接到WiFi并注冊(cè)默認(rèn)WiFi處理程序。esp_wifi_init
,為 WiFi 驅(qū)動(dòng)初始化 WiFi 分配資源,如 WiFi 控制結(jié)構(gòu)、RX/TX 緩沖區(qū)、WiFi NVS 結(jié)構(gòu)等,這個(gè) WiFi 也啟動(dòng) WiFi 任務(wù)。必須先調(diào)用此API,然后才能調(diào)用所有其他WiFi APIesp_wifi_set_mode
,設(shè)置WiFi工作模式為station、soft-AP或station+soft-AP,默認(rèn)模式為soft-AP模式。本程序設(shè)置為stationesp_wifi_start
,根據(jù)配置,啟動(dòng)WiFiesp_wifi_scan_start
,掃描所有有效的APesp_wifi_scan_get_ap_records
,獲取上次掃描中找到的AP列表esp_wifi_scan_get_ap_num
,獲取上次掃描中找到的AP數(shù)config
,掃描的配置block
,是否堵塞程序運(yùn)行/** * @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個(gè)數(shù)ap_records
,返回的app記錄數(shù)組/** * @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
,存儲(chǔ)上次掃描中找到的API數(shù)/** * @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);
覺得好,就一鍵三連唄(點(diǎn)贊+收藏+關(guān)注)
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://specialneedsforspecialkids.com/yun/121072.html
摘要:前言芯片接口占用管腳數(shù)量比以太網(wǎng)的少,版線布局可更精簡。網(wǎng)卡芯片介紹接口網(wǎng)卡芯片是為方物聯(lián)網(wǎng)行業(yè)進(jìn)以太網(wǎng)通信而開發(fā)出的解決方案。此應(yīng)用可用于監(jiān)控家庭物聯(lián)網(wǎng)網(wǎng)關(guān)搭建等。 前言 ????DM9051NP芯片?SPI接口占用管腳數(shù)量比以太網(wǎng)PHY的RMII/MII少,PCBA版線布局可更精簡。...
摘要:論壇下載由于庫是不帶中值濾波器的,需要自己實(shí)現(xiàn),所以花了點(diǎn)時(shí)間制作了一個(gè)章節(jié)。紅色線是波形高斯白噪聲均勻白噪聲。第版教程發(fā)布中文顯示章節(jié)論壇下載可以直接運(yùn)行界面效果,也可以使用可以直接編譯運(yùn)行。上位機(jī)已經(jīng)整合主機(jī),下一版發(fā)布 往期周報(bào)匯總地址:http://www.armbbs.cn/for...
閱讀 2510·2021-11-18 10:02
閱讀 1976·2021-11-09 09:45
閱讀 2399·2021-09-26 09:47
閱讀 1010·2021-07-23 10:26
閱讀 1063·2019-08-30 15:47
閱讀 3356·2019-08-30 15:44
閱讀 957·2019-08-30 15:43
閱讀 881·2019-08-29 13:50