摘要:,初始化底层堆栈,创建默认事件循环。,使用默认配置创建对象,将连接到并注册默认处理程序。,为驱动初始化分配资源,如控制结构缓冲区结构等,这个也启动任务。必须先调用此,然后才能调用所有其他,设置工作模式为或,默认模式为模式。
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);
觉得好,就一键三连呗(点赞+收藏+关注)
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/121072.html
摘要:前言芯片接口占用管脚数量比以太网的少,版线布局可更精简。网卡芯片介绍接口网卡芯片是为方物联网行业进以太网通信而开发出的解决方案。此应用可用于监控家庭物联网网关搭建等。 前言 DM9051NP芯片 SPI接口占用管脚数量比以太网PHY的RMII/MII少,PCBA版线布局可更精简。...
摘要:论坛下载由于库是不带中值滤波器的,需要自己实现,所以花了点时间制作了一个章节。红色线是波形高斯白噪声均匀白噪声。第版教程发布中文显示章节论坛下载可以直接运行界面效果,也可以使用可以直接编译运行。上位机已经整合主机,下一版发布 往期周报汇总地址:http://www.armbbs.cn/for...
阅读 2490·2021-11-18 10:02
阅读 1931·2021-11-09 09:45
阅读 2321·2021-09-26 09:47
阅读 982·2021-07-23 10:26
阅读 1030·2019-08-30 15:47
阅读 3341·2019-08-30 15:44
阅读 934·2019-08-30 15:43
阅读 857·2019-08-29 13:50