Skip to content

Wi-Fi 管理

wifi_mgmr_init()

初始化 Wi-Fi 管理器并注册事件过滤

返回值:见 SDK 头文件

wifi_mgmr_bitmap_to_chanlist(bitmap, chan_list, chan_count)

把信道位图转换为信道列表

返回值:无

wifi_mgmr_chanlist_to_bitmap(chan_list, chan_count, bitmap)

把信道列表转换为信道位图

返回值:无

wifi_mgmr_init_country_bitmaps()

初始化国家/地区信道位图

返回值:无

wifi_mgmr_print_channel_info(country_code)

打印支持的信道信息

返回值:无

wifi_mgmr_task_start()

启动 Wi-Fi 管理任务

返回值:见 SDK 头文件

wifi_mgmr_get_channel_nums(country_code, c24G_cnt, c5G_cnt)

获取某国家码的 2.4G/5G 信道数量

返回值:见 SDK 头文件

wifi_mgmr_scan_beacon_save(scan)

保存扫描到的 Beacon 信息

返回值:见 SDK 头文件

wifi_mgmr_sta_info_reset()

重置 STA 信息

返回值:无

wifi_mgmr_sta_info_upatestatus(status_code, reason_code)

更新 STA 连接状态信息

返回值:无

wifi_mgmr_sta_info_save(param)

保存 STA 连接信息

返回值:无

wifi_mgmr_sta_connect_params_get()

获取当前 STA 连接参数

返回值:见 SDK 头文件

wifi_mgmr_ap_sta_info_del(sta_idx)

删除 AP 模式的客户端信息

返回值:无

wifi_mgmr_ap_sta_info_add(sta_idx, aid, addr)

添加 AP 模式的客户端信息

返回值:无

wifi_mgmr_auth_to_str(auth)

把认证方式枚举转为字符串(如 WPA2-PSK)

返回值:见 SDK 头文件

wifi_mgmr_cipher_to_str(cipher)

把加密方式枚举转为字符串(如 AES)

返回值:见 SDK 头文件

Wi-Fi 管理扩展

wifi_sta_antenna_connect(ssid, key, bssid, akm_str, pmf_cfg, freq1, freq2, use_dhcp)

wifi_sta_antenna_connect Connect to the AP

返回值:见 SDK 头文件

wifi_sta_connect(ssid, key, bssid, akm_str, pmf_cfg, freq1, freq2, use_dhcp)

wifi_sta_connect Connect to the AP

返回值:见 SDK 头文件

wifi_mgmr_sta_quickconnect(ssid, key, freq1, freq2)

wifi_mgmr_sta_quickconnect Connect to the AP

返回值:见 SDK 头文件

wifi_mgmr_sta_connect(config)

wifi_mgmr_sta_connect Connect to the AP

返回值:见 SDK 头文件

wifi_sta_disconnect()

wifi_sta_disconnect Disconnect from the AP

返回值:见 SDK 头文件

wifi_mgmr_sta_ip_set(ip, mask, gw, dns)

Set IPv4 地址 of STA interface

返回值:见 SDK 头文件

wifi_sta_ip4_addr_get(addr, mask, gw, dns)

Get IPv4 地址 of STA interface

返回值:见 SDK 头文件

wifi_sta_dhcp_client_start(to_ms)

Start dhcp client on STA interface IF STA interface is not connected, just return -1

参数

  • to_ms:超时 in ms to obtain IP (0 uses WIFI_STA_DHCPC_TIMEOUT_MS_DEFAULT)

返回值:见 SDK 头文件

wifi_mgmr_sniffer_enable(to_ms)

wifi_mgmr_sniffer_enable start 抓包 模式

参数

  • to_ms:超时 in ms to obtain IP (0 uses WIFI_STA_DHCPC_TIMEOUT_MS_DEFAULT)

返回值:见 SDK 头文件

wifi_mgmr_sniffer_disable(sniffer_item)

wifi_mgmr_sniffer_disable stop 抓包 模式

返回值:见 SDK 头文件

wifi_mgmr_state_get()

wifi_mgmr_state_get get AP/STA state

返回值:见 SDK 头文件

wifi_mgmr_sta_rssi_get(rssi)

wifi_mgmr_sta_rssi_get get the last Beacon 信号强度

返回值:见 SDK 头文件

wifi_mgmr_sta_channel_get(channel)

wifi_mgmr_sta_channel_get get STA 模式 通道

返回值:见 SDK 头文件

wifi_mgmr_sta_ssid_set(ssid)

wifi_mgmr_sta_ssid_set set STA 模式 SSID

返回值:见 SDK 头文件

wifi_mgmr_sta_ssid_get(ssid)

wifi_mgmr_sta_ssid_get get STA 模式 SSID

返回值:见 SDK 头文件

wifi_mgmr_sta_passphr_set(passphr)

wifi_mgmr_sta_passphr_set set STA 模式 password

返回值:见 SDK 头文件

wifi_mgmr_sta_connect_ind_stat_get(wifi_mgmr_ind_stat)

wifi_mgmr_sta_connect_ind_stat_get get state (SSID password) of STA 模式

返回值:见 SDK 头文件

wifi_mgmr_sta_scan(config)

wifi_mgmr_sta_scan 扫描 available APs

返回值:见 SDK 头文件

wifi_mgmr_ap_bcn_mode_set(bcn_mode, bcn_timer)

wifi_mgmr_ap_bcn_mode_set Beacon Transmission Control Setting in the SAP modex

返回值:见 SDK 头文件

wifi_mgmr_ap_bcn_mode_get(bcn_mode, bcn_timer)

wifi_mgmr_ap_bcn_mode_get Get Beacon Transmission Control Setting in the SAP modex

返回值:无

wifi_mgmr_sta_scanlist()

wifi_mgmr_sta_scanlist List the 扫描 results in last 扫描

返回值:见 SDK 头文件

wifi_mgmr_sta_scanlist_nums_get()

wifi_mgmr_sta_scanlist_nums_get Get the number of 扫描 results

返回值:见 SDK 头文件

wifi_mgmr_sta_scanlist_dump(results, resultNums)

wifi_mgmr_sta_scanlist_dump Get the 扫描 results

返回值:见 SDK 头文件

wifi_mgmr_scan_filter_hidden_ssid(filter)

wifi_mgmr_scan_filter_hidden_ssid Whether filter hidden SSID from 扫描 results

返回值:见 SDK 头文件

wifi_mgmr_scan_ap_all(env, arg, cb)

Get 扫描 results

参数

  • env:env for cb
  • arg:arg for cb
  • cb:回调 to receive 扫描 results

返回值:0

wifi_mgmr_ap_start(env, arg, cb)

wifi_mgmr_ap_start Start AP 模式

参数

  • env:env for cb
  • arg:arg for cb
  • cb:回调 to receive 扫描 results

返回值:0

wifi_mgmr_ap_stop()

wifi_mgmr_ap_stop Stop AP 模式

返回值:见 SDK 头文件

wifi_mgmr_ap_acl_enable(default_perm)

wifi_mgmr_ap_acl_enable MAC 地址 Filtering Enable && MAC 地址 Filtering Default permission setting

返回值:见 SDK 头文件

wifi_mgmr_ap_acl_set(acl, action, mac_str)

wifi_mgmr_ap_acl_set MAC 地址 White-list/Black-list setting

返回值:见 SDK 头文件

wifi_mgmr_mac_set(mac)

wifi_mgmr_mac_set Set mac

返回值:见 SDK 头文件

wifi_mgmr_sta_set_mac(mac)

wifi_mgmr_sta_set_mac Set mac addr for STA 模式

返回值:见 SDK 头文件

wifi_mgmr_ap_set_mac(mac)

wifi_mgmr_ap_set_mac Set mac addr for AP 模式

返回值:见 SDK 头文件

wifi_mgmr_sta_mac_get(mac)

wifi_mgmr_sta_mac_get Get STA mac

返回值:见 SDK 头文件

wifi_mgmr_ap_mac_get(mac)

wifi_mgmr_ap_mac_get Get AP mac

返回值:见 SDK 头文件

wifi_mgmr_set_country_code(country_code)

wifi_mgmr_set_country_code Set 国家码

返回值:见 SDK 头文件

wifi_mgmr_get_country_code(country_code)

wifi_mgmr_get_country_code Get 国家码

返回值:见 SDK 头文件

wifi_mgmr_sta_autoconnect_enable()

wifi_mgmr_set_autoconnect_enable Enable station autoconnect

返回值:见 SDK 头文件

wifi_mgmr_sta_autoconnect_disable()

wifi_mgmr_set_autoconnect_disable Disable station autoconnect

返回值:见 SDK 头文件

wifi_mgmr_sta_reconnect_policy_set(cfg)

wifi_mgmr_sta_reconnect_policy_set Set station reconnect policy used after authentication failure.

返回值:见 SDK 头文件

wifi_mgmr_sta_reconnect_policy_get(cfg)

wifi_mgmr_sta_reconnect_policy_get Get station reconnect policy used after authentication failure.

返回值:见 SDK 头文件

wifi_mgmr_sta_wps_pbc(auth)

wifi_mgmr_sta_wps_pbc Start STA wps pbc

返回值:见 SDK 头文件

wifi_mgmr_sta_non_pref_chan_set(argc, argv)

wifi_mgmr_sta_non_pref_chan_set - Set the non-preferred 通道 list for Wi-Fi management @argc: The number of arguments passed to the function

返回值:见 SDK 头文件

wifi_mgmr_sta_non_pref_chan_notify()

wifi_mgmr_sta_non_pref_chan_notify - Notify the Wi-Fi management system of non-preferred 通道 changes

返回值:见 SDK 头文件

wifi_mgmr_sta_ps_enter()

wifi_mgmr_sta_ps_enter Enter powersave 模式

返回值:见 SDK 头文件

wifi_mgmr_sta_ps_exit()

wifi_mgmr_sta_ps_exit Exit powersave 模式

返回值:见 SDK 头文件

wifi_mgmr_sta_ps_active_time(ms)

wifi_mgmr_sta_ps_active_time set ps active time

返回值:见 SDK 头文件

wifi_mgmr_sta_coex_enable()

启用 WiFi/BLE 共存模式(需先连接 WiFi;BL616/BL616CL 启用 combo PS_PTA)。

返回值:0 on success, negative error code on failure

wifi_mgmr_ap_coex_enable()

对已启用的 SoftAP 应用共存配置(当前仅支持 BL618DG 5G 双天线方案)。

返回值:0 on success, -1 on failure.

wifi_mgmr_sta_coex_enable_2g(config, ps_pta_enable)

使能 BL618DG 2.4 GHz coexistence with an explicit 配置。

参数

  • config:COEX combo or standalone SPDT 配置.
  • ps_pta_enable:Enable the software TBTT/PS_PTA runtime.

返回值:0 on success, -1 on failure.

wifi_mgmr_sta_coex_disable()

关闭 Wi-Fi/BLE coexistence 模式 This function disables coexistence 模式 and restores normal Wi-Fi operation。

返回值:0 on success, negative error code on failure

wifi_mgmr_sta_coex_duty_set(active_ms)

设置 Wi-Fi active 占空比 for coexistence 模式 This function configures the Wi-Fi active time per TBTT period。

参数

  • active_ms:Wi-Fi active time in milliseconds (valid range: 10-90)

返回值:0 on success, -1 on invalid parameter

wifi_mgmr_sta_coex_status_get()

Get Wi-Fi/BLE coexistence 模式 状态

返回值:true if coex 模式 is enabled, false otherwise

wifi_mgmr_sta_coex_duty_get()

Get current Wi-Fi active 占空比

返回值:Wi-Fi active time in milliseconds

wifi_mgmr_sta_twt_setup(twt_params_ptr)

配置 STA TWT(目标唤醒时间)功能以实现指定条件下的省电。

参数

  • twt_params_ptr:Pointer to the structure containing all the necessary parameters for TWT setup

返回值:Returns the result of the function execution, 0 for success and -1 for failure

wifi_mgmr_sta_twt_teardown(twt_params_ptr)

按参数拆除 STA TWT 会话。

参数

  • twt_params_ptr:Pointer to the structure containing TWT teardown parameters

返回值:Returns the result of the function execution, 0 for success and -1 for failure

wifi_mgmr_sta_twt_statusget(conf, twt_num)

查询当前 TWT 状态,包括所有活跃 TWT 流及其配置。

参数

  • conf:Pointer to an array of twt_status_info structures to store TWT flow configurations
  • twt_num:Pointer to store the number of active TWT flows

返回值:Returns the result of the function execution, 0 for success and -1 for failure

wifi_mgmr_sta_twt_flow_get()

获取 active STA TWT flow count。

返回值:Active TWT flow count, or 0 when TWT is not enabled.

wifi_mgmr_sta_set_listen_itv(itv)

wifi_mgmr_sta_set_listen_itv Set listen interval

返回值:Active TWT flow count, or 0 when TWT is not enabled.

wifi_mgmr_sta_get_listen_itv()

wifi_mgmr_sta_get_listen_itv Get listen interval

返回值:见 SDK 头文件

wifi_mgmr_sta_aid_get()

wifi_mgmr_sta_aid_get Get aid

返回值:见 SDK 头文件

wifi_mgmr_sta_get_bssid(bssid)

wifi_mgmr_sta_get_bssid Get STA bssid

返回值:见 SDK 头文件

wifi_mgmr_ap_sta_info_get(sta_info, idx)

wifi_mgmr_ap_sta_info_get Get STA List in AP 模式

返回值:见 SDK 头文件

wifi_mgmr_tpc_pwr_set(power_table)

wifi_mgmr_tpc_pwr_set Set power table

返回值:见 SDK 头文件

wifi_mgmr_tpc_pwr_get(power_table)

wifi_mgmr_tpc_pwr_get Get power table

返回值:见 SDK 头文件

wifi_mgmr_connection_info(connection_info)

wifi_mgmr_connection_info Get connected AP/router info

返回值:见 SDK 头文件

wifi_mgmr_get_ap_info(ap)

wifi_mgmr_get_ap_info Get AP info

返回值:见 SDK 头文件

wifi_mgmr_sta_keepalive_time_set(time_seconds)

Set keep alive time for STA 模式

返回值:见 SDK 头文件

wifi_mgmr_sta_state_get()

get STA connected or not connected for STA 模式 return: 0 : not connected 1 : connected

返回值:见 SDK 头文件

wifi_mgmr_sta_state_get_ext()

get STA specific state return: state

返回值:见 SDK 头文件

wifi_mgmr_sta_info_status_code_get()

wifi_mgmr_sta_info_status_code_get Get 状态 code

返回值:见 SDK 头文件

wifi_mgmr_ap_state_get()

get whether AP has started for AP 模式 return: 0 : not started 1 : has started

返回值:见 SDK 头文件

wifi_mgmr_ap_state_get_ext()

get AP specific state return: state

返回值:见 SDK 头文件

wifi_mgmr_conf_max_sta(max_sta_supported)

wifi_mgmr_conf_max_sta Set max number of STA supported for AP

返回值:见 SDK 头文件

wifi_mgmr_ap_sta_delete(sta_idx)

wifi_mgmr_ap_sta_delete Del STA in AP 模式

返回值:见 SDK 头文件

wifi_mgmr_raw_80211_send(config)

wifi_mgmr_raw_80211_send Send raw packet

返回值:见 SDK 头文件

wifi_mgmr_get_stats(stats, num_stats)

wifi_mgmr_raw_80211_send Send raw packet

返回值:见 SDK 头文件

wifi_mgmr_clear_stats()

wifi_mgmr_raw_80211_send Send raw packet

返回值:见 SDK 头文件

wifi_mgmr_null_data_send()

wifi_mgmr_null_data_send Send null packet

返回值:见 SDK 头文件

wifi_mgmr_psk_cal(password, ssid, ssid_len, output)

wifi_mgmr_psk_cal Calucate psk by using passpharse

返回值:见 SDK 头文件

wifi_mgmr_rate_config(cfg)

wifi_mgmr_rate_config param:

返回值:见 SDK 头文件

wifi_mgmr_rate_config_sta(fixed_rate_cfg)

wifi_mgmr_rate_config param:

返回值:见 SDK 头文件

fhost_rc_set_rate_sta(sta, params)

wifi_mgmr_rate_config param:

返回值:见 SDK 头文件

wifi_mgmr_set_ht40_enable(value)

wifi_mgmr_set_ht40_enable Toggle state of HT40 模式

返回值:见 SDK 头文件

wifi_mgmr_set_ldpc_rx_enable(value)

wifi_mgmr_set_ldpc_rx_enable Toggle state of LDPC RX 模式

返回值:见 SDK 头文件

wifi_mgmr_sta_ap_tx_power_set(pwr_table)

wifi_mgmr_set_ldpc_rx_enable Toggle state of LDPC RX 模式

返回值:见 SDK 头文件

wifi_mgmr_sta_ap_tx_power_get()

wifi_mgmr_set_ldpc_rx_enable Toggle state of LDPC RX 模式

返回值:见 SDK 头文件

wifi_mgmr_sta_ap_retry_limit_set(retry_limit)

wifi_mgmr_sta_ap_retry_limit_set Set tx retry limit for AP/STA 模式

返回值:见 SDK 头文件

wifi_mgmr_sta_ap_retry_limit_get()

wifi_mgmr_sta_ap_retry_limit_set Get tx retry limit for AP/STA 模式

返回值:见 SDK 头文件

wifi_mgmr_set_tx_queue_params(queue, aifs, cw_min, cw_max, burst_time)

wifi_mgmr_set_tx_queue_params Set CWmin, CWmax, and AIFS for each Tx 队列

返回值:见 SDK 头文件

wifi_mgmr_get_tx_queue_params(queue, aifsn, cwmin, cwmax)

wifi_mgmr_set_tx_queue_params Get CWmin, CWmax, and AIFS for each Tx 队列

返回值:见 SDK 头文件

wifi_mgmr_get_remaining_tx(tx0_cnt, tx1_cnt, tx2_cnt, tx3_cnt)

wifi_mgmr_get_remaining_tx Get the number of frames remaining in each Tx 队列.

返回值:见 SDK 头文件

wifi_mgmr_set_mode(ap_or_sta, mode)

wifi_mgmr_set_mode Set STA/AP 模式 (e.g. b/g/n/ax)

返回值:见 SDK 头文件

wifi_mgmr_get_mode(ap_or_sta)

wifi_mgmr_get_mode Get STA/AP 模式 (e.g. b/g/n/ax)

返回值:见 SDK 头文件

wifi_mgmr_adhoc_set_rate(rate)

wifi_mgmr_adhoc_set_rate Set tx rate

返回值:见 SDK 头文件

wifi_mgmr_adhoc_get_rate()

wifi_mgmr_adhoc_get_rate Get tx rate

返回值:见 SDK 头文件

wifi_mgmr_adhoc_set_rts_thrshold(rts_thrshold)

wifi_mgmr_adoc_set_rts_thrshold Set/ RTS threshold

返回值:见 SDK 头文件

wifi_mgmr_adhoc_get_rts_thrshold()

wifi_mgmr_adoc_get_rts_thrshold Get RTS threshold

返回值:见 SDK 头文件

wifi_mgmr_adhoc_set_tx_power(tx_power)

wifi_mgmr_adoc_set_tx_power Set 发射功率

返回值:见 SDK 头文件

wifi_mgmr_adhoc_get_tx_power()

wifi_mgmr_adoc_get_tx_power Get 发射功率

返回值:见 SDK 头文件

wifi_mgmr_adhoc_set_retry_limit(retry_limit)

wifi_mgmr_adoc_set_retry_limit Set retry limit

返回值:见 SDK 头文件

wifi_mgmr_adhoc_get_retry_limit()

wifi_mgmr_adoc_get_retry_limit Get retry limit

返回值:见 SDK 头文件

wifi_mgmr_adhoc_get_channel()

wifi_mgmr_adhoc_get_channel Get 通道 of ad-hoc 模式

返回值:见 SDK 头文件

wifi_mgmr_adhoc_pkt_send(config)

wifi_mgmr_adhoc_pkt_send Send packets for testing

返回值:见 SDK 头文件

wifi_mgmr_adhoc_start(config)

wifi_mgmr_adhoc_start Start adhoc 模式

返回值:见 SDK 头文件

wifi_mgmr_adhoc_stop()

wifi_mgmr_adhoc_stop Stop adhoc 模式

返回值:见 SDK 头文件

wifi_mgmr_coex_enable(en)

wifi_mgmr_coex_enable Enable or disable Wi-Fi coex

返回值:无

wifi_sta_ipv6_enable(enable)

wifi_sta_ipv6_enable Enable or disable ipv6

返回值:见 SDK 头文件

wifi_mgmr_get_channelnum_24G()

Get the number of valid 2.4GHz Wi-Fi 通道

返回值:见 SDK 头文件

wifi_mgmr_channel_valid_check(channel)

Get the number of valid 2.4GHz Wi-Fi 通道

返回值:uint8_t

wifi_mgmr_wifimode_valid_check(mode)

Check if a Wi-Fi 模式 is valid

参数

  • mode:The Wi-Fi 模式 to validate

返回值:int

wifi_mgmr_ap_chan_switch(channel, cs_count)

触发 AP 信道切换通告(CSA),将 SoftAP 迁移到新信道且不踢掉关联站点。

参数

  • channel:Target primary 通道 (2.4 GHz: 1..14, 5 GHz: 36..165).
  • cs_count:Number of beacons to send before switching. Unit is one

返回值:int

wifi_mgmr_mode_to_str(mode)

把 Wi-Fi 模式枚举转为字符串

返回值:见 SDK 头文件

printf(n, channel_count)

格式化打印到串口(标准库函数)

返回值:见 SDK 头文件

Wi-Fi 命令行

cmd_hello(argc, argv)

CLI 命令:打印 hello 测试信息

返回值:无

cmd_phy(argc, argv)

CLI 命令:PHY 测试相关操作

返回值:无

cmd_ac_set(argc, argv)

CLI 命令:设置 AC 参数

返回值:无

cmd_ap_stop(argc, argv)

CLI 命令:停止 AP 模式

返回值:无

wifi_scan_cmd(argc, argv)

CLI 命令:执行 Wi-Fi 扫描

返回值:无

wifi_connect_cmd(argc, argv)

CLI 命令:连接指定 Wi-Fi(SSID/密码)

返回值:无

wifi_disconnect_cmd(argc, argv)

CLI 命令:断开当前 Wi-Fi 连接

返回值:无

lwip_cmd(argc, argv)

CLI 命令:lwIP 调试信息

返回值:无

cmd_wifi_sniffer_on(argc, argv)

CLI 命令:开启 Wi-Fi 抓包(抓包)

返回值:无

cmd_wifi_sniffer_off(argc, argv)

CLI 命令:关闭 Wi-Fi 抓包

返回值:无

cmd_wifi_state_get(argc, argv)

CLI 命令:获取 Wi-Fi 状态

返回值:无

cmd_wifi_sta_dhcp_client_start(argc, argv)

CLI 命令:启动 STA DHCP 客户端

返回值:无

cmd_wifi_sta_rssi_get(argc, argv)

CLI 命令:获取 STA 信号强度 信号强度

返回值:无

cmd_wifi_sta_channel_get(argc, argv)

CLI 命令:获取当前信道

返回值:无

cmd_wifi_sta_ssid_passphr_get(argc, argv)

CLI 命令:获取已连接 SSID 与密码

返回值:无

cmd_wifi_sta_mac_get(argc, argv)

CLI 命令:获取 STA MAC 地址

返回值:无

wifi_enable_autoreconnect_cmd(argc, argv)

CLI 命令:开启自动重连

返回值:无

wifi_disable_autoreconnect_cmd(argc, argv)

CLI 命令:关闭自动重连

返回值:无

wifi_country_code_get_cmd(argc, argv)

CLI 命令:获取国家/地区码

返回值:无

wifi_country_code_set_cmd(argc, argv)

CLI 命令:设置国家/地区码

返回值:无

wifi_sta_ps_on_cmd(argc, argv)

CLI 命令:开启 STA 省电

返回值:无

wifi_sta_ps_off_cmd(argc, argv)

CLI 命令:关闭 STA 省电

返回值:无

wifi_sta_ps_set_cmd(argc, argv)

CLI 命令:设置省电占空比

返回值:无

wifi_coex_enable_cmd(argc, argv)

CLI 命令:开启 Wi-Fi/BLE 共存

返回值:无

wifi_ap_coex_enable_cmd(argc, argv)

CLI 命令:开启 AP 共存

返回值:无

wifi_coex_disable_cmd(argc, argv)

CLI 命令:关闭共存

返回值:无

wifi_coex_duty_set_cmd(argc, argv)

CLI 命令:设置共存占空比

返回值:无

wifi_coex_status_cmd(argc, argv)

CLI 命令:查询共存状态

返回值:无

wifi_coex_bt_spdt_cmd(argc, argv)

CLI 命令:设置共存蓝牙 SPDT 开关

返回值:无

wifi_coex_bt_adj_pwr_cmd(argc, argv)

CLI 命令:开启共存蓝牙功率调节

返回值:无

wifi_coex_bt_adj_pwr_off_cmd(argc, argv)

CLI 命令:关闭共存蓝牙功率调节

返回值:无

wifi_coex_bt_overlay_cmd(argc, argv)

CLI 命令:开启共存蓝牙覆盖

返回值:无

wifi_coex_bt_overlay_off_cmd(argc, argv)

CLI 命令:关闭共存蓝牙覆盖

返回值:无

wifi_sta_info_cmd(argc, argv)

CLI 命令:显示 STA 信息

返回值:无

wifi_ap_sta_list_get_cmd(argc, argv)

CLI 命令:获取 AP 客户端列表

返回值:无

wifi_ap_sta_delete_cmd(argc, argv)

CLI 命令:踢除 AP 客户端

返回值:无

wifi_mgmr_ap_start_cmd(argc, argv)

CLI 命令:启动 AP 模式

返回值:无

wifi_mgmr_ap_stop_cmd(argc, argv)

CLI 命令:停止 AP 模式

返回值:无

cmd_wifi_ap_mac_get(argc, argv)

CLI 命令:获取 AP MAC 地址

返回值:无

cmd_wifi_ap_conf_max_sta(argc, argv)

CLI 命令:配置 AP 最大客户端数

返回值:无

cmd_wifi_raw_send(argc, argv)

CLI 命令:发送原始 Wi-Fi 帧

返回值:无

cmd_wifi(argc, argv)

CLI 命令:Wi-Fi 通用调试入口

返回值:无

wifi_sta_static_ipv4(argc, argv)

CLI 命令:配置 STA 静态 IPv4

返回值:无

cmd_iperf(argc, argv)

CLI 命令:iperf 网络吞吐测试

返回值:无

cmd_rc(argc, argv)

CLI 命令:射频/速率控制相关

返回值:无

cmd_rate(argc, argv)

CLI 命令:设置发送速率

返回值:无

cmd_non_pref_chan(argc, argv)

CLI 命令:设置非首选信道

返回值:无

cmd_non_pref_chan_notify(argc, argv)

CLI 命令:通知非首选信道变化

返回值:无

cmd_wifi_mgmr_sta_twt_setup(argc, argv)

CLI 命令:配置 STA TWT(Wi-Fi 6 节能)

返回值:无

cmd_wifi_mgmr_sta_twt_teardown(argc, argv)

CLI 命令:拆除 TWT 会话

返回值:无

cmd_wifi_mgmr_sta_twt_statusget(argc, argv)

CLI 命令:查询 TWT 状态

返回值:无

cmd_wifi_adhoc_send(argc, argv)

CLI 命令:AD-HOC 发送数据

返回值:无

cmd_adhoc_start(argc, argv)

CLI 命令:启动 AD-HOC 模式

返回值:无

cmd_adhoc_stop(argc, argv)

CLI 命令:停止 AD-HOC 模式

返回值:无

cmd_wifi_mode_set(argc, argv)

CLI 命令:设置 Wi-Fi 工作模式

返回值:无

cmd_wifi_wps_pbc(argc, argv)

CLI 命令:触发 WPS PBC 配网

返回值:无

wifi_ap_bcn_mode_set_cmd(argc, argv)

CLI 命令:设置 AP 信标模式

返回值:无

wifi_mgmr_ap_acl_set_cmd(argc, argv)

CLI 命令:配置 AP 接入控制列表

返回值:无

wifi_mgmr_ap_acl_enable_cmd(argc, argv)

CLI 命令:使能/关闭 AP ACL

返回值:无

cmd_wifi_stats(argc, argv)

CLI 命令:显示 Wi-Fi 统计信息

返回值:无

cmd_wifi_get_tx_remaining(argc, argv)

CLI 命令:查询剩余可发送数据量

返回值:无

cmd_wifi_power_get(argc, argv)

CLI 命令:获取发射功率

返回值:无

cmd_wifi_channel_get(argc, argv)

CLI 命令:获取当前信道

返回值:无

cmd_wifi_cca(argc, argv)

CLI 命令:CCA 信道空闲评估测试

返回值:无

wifi_antenna_scan_cmd(argc, argv)

CLI 命令:天线扫描

返回值:无

wifi_antenna_scan_connect_cmd(argc, argv)

CLI 命令:天线扫描后连接

返回值:无

fhost 框架

dbg_vsnprintf_offset(buffer, size, offset, fmt, args)

Fully Hosted module implementation. This module creates different RTOS tasks that will be used to handle the operations of the fully-hosted FW

返回值:见 SDK 头文件

fhost_wakeup()

配置/control messages received from supplicant application

返回值:无

fhost_to_net_if(fhost_vif_idx)

获取 Network interface associated to a FHOST VIF。

返回值:A pointer to the corresponding network interface

fhost_vif_name(fhost_vif_idx, name, len)

获取 fhost 虚拟接口名并拷贝到缓冲区(含结束符)。

📎 设备名速查:支持的设备名(BL616)

返回值:< 0 if error occurred, otherwise the number of characters (excluding the

fhost_vif_idx_from_name(name)

获取 FHOST VIF index from its 名称。

📎 设备名速查:支持的设备名(BL616)

返回值:index of the fhost vif and < 0 if there is no interface with the provided 名称

fhost_vif_set_uapsd_queues(fhost_vif_idx, uapsd_queues)

配置 STA 连接支持 U-APSD 的 AP 时默认启用的队列,下次连接生效。

返回值:0 on success and != 0 if error occurred.

fhost_application_init()

应用初始化回调:在 RTOS 调度器启动前调用,通常用于创建应用任务。

返回值:0 on success and != 0 if error occurred.

fhost_print_buf(handle, buf)

Print a pre-formatted string 缓冲区. Implementation of this function will depend of target/application

返回值:0 on success and != 0 if error occurred.

fhost_print(handle, fmt, ...)

Print a message. Implementation of this function will depend of target/application

返回值:见 SDK 头文件

fhost_ip_chksum(dataptr, len)

Compute checksum on a given IP packet Compute IP packet checksum using HSU and fallback to software computation if HSU is unavailable

返回值:IP packet checksum

fhost_sta_cfg(fhost_vif_idx, cfg)

Connect a STA interface to an AP This is blocking until 连接 is successful.

返回值:0 on success and != 0 if error occurred.

fhost_ap_cfg(fhost_vif_idx, cfg, mesh_mode)

启动 an Access Point This is blocking until AP is operational。

返回值:0 on success and != 0 if error occurred.

fhost_get_sta_idx(fhost_vif, table_max_size, idx_table)

Retrieve list of Stations connected to a certain VIF

返回值:Size of the idx_table

fhost_get_cipher_supported()

按 MAC 能力返回支持的加密套件位掩码(MAC_CIPHER 格式)。

返回值:Bitmask of supported ciphers

fhost_vif_is_up(fhost_vif_idx)

查询接口状态/支持的加密能力(接口语义见头文件)。

返回值:Bitmask of supported ciphers

fhost_to_mac_vif(fhost_vif_idx)

把 fhost 接口映射到 MAC 虚拟接口

返回值:A pointer to the corresponding MAC VIF

fhost_from_mac_vif(mac_vif_idx)

把 MAC 虚拟接口映射回 fhost 接口

返回值:A pointer to the corresponding FHOST VIF

fhost 网络接口

fhost_init()

初始化 fully-hosted 模块并分配各子模块资源;须在 rtos_init 之后调用。

返回值:0 on success and != 0 if error occurred.

fhost_wait_ready()

阻塞等待 fhost 模块完全就绪(其全部任务完成初始化)。

返回值:见 SDK 头文件

fhost_get_status(status)

Retrieve fully hosted module 状态.

返回值:无

fhost_get_vif_status(fvif_idx, status)

Retrieve one interface 状态.

返回值:0 on success and != 0 if error occurred

fhost_get_vif_raw_state(fvif_idx)

Retrieve one interface raw state.

返回值:raw state of the interface

fhost_get_vif_state(fvif_idx)

Retrieve one interface state.

返回值:state of the interface

fhost_set_vif_type(resp_queue, fvif_idx, type, p2p)

改变接口类型;切换前会先清理当前接口(断开连接、释放 IP 等)。

返回值:0 on success and <0 if any error occurred.

fhost_configure_vif(resp_queue, fvif_idx, cfg)

配置接口:MONITOR 设置信道、STA 启动连接、AP 启动热点、MESH_POINT 启动 Mesh。

返回值:见 SDK 头文件

fhost_scan(resp_queue, fvif_idx)

阻塞式扫描 AP,完成后可用 fhost_get_scan_results 获取结果。

返回值:< 0 if an error occurred, otherwise it returns the number of Access point

fhost_get_scan_results(resp_queue, result_idx, max_nb_result, results)

Retrieve 扫描 results This function retrieves up to @p max_nb_result 扫描 results starting at index

返回值:0 on success and <0 if any error occurred.

fhost_send_80211_frame(fvif_idx, frame, length, no_cck, cfm_cb, cfm_cb_arg)

发送预格式化的 802.11 帧(多为管理帧),以基础速率单发。

返回值:见 SDK 头文件

fhost_ftm(resp_queue, fvif_idx, res)

启动 FTM(往返时间测距)测量,阻塞直到完成。

返回值:< 0 if an error occurred, 0 otherwise.

lwIP Socket

lwip_socket_thread_init()

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:无

lwip_socket_thread_cleanup()

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:无

fcntl(s, cmd, ...)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_accept(s, addr, addrlen)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_bind(s, name, namelen)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

📎 设备名速查:支持的设备名(BL616)

返回值:见 SDK 头文件

lwip_shutdown(s, how)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_getpeername(s, name, namelen)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

📎 设备名速查:支持的设备名(BL616)

返回值:见 SDK 头文件

lwip_getsockname(s, name, namelen)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

📎 设备名速查:支持的设备名(BL616)

返回值:见 SDK 头文件

lwip_getsockopt(s, level, optname, optval, optlen)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_setsockopt(s, level, optname, optval, optlen)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_close(s)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_connect(s, name, namelen)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

📎 设备名速查:支持的设备名(BL616)

返回值:见 SDK 头文件

lwip_listen(s, backlog)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_recv(s, mem, len, flags)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_read(s, mem, len)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_readv(s, iov, iovcnt)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_recvfrom(s, mem, len, flags, from, fromlen)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_recvmsg(s, message, flags)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_send(s, dataptr, size, flags)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_sendmsg(s, message, flags)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_sendto(s, dataptr, size, flags, to, tolen)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_socket(domain, type, protocol)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_write(s, dataptr, size)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_writev(s, iov, iovcnt)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_select(maxfdp1, readset, writeset, exceptset, timeout)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_poll(fds, nfds, timeout)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_ioctl(s, cmd, argp)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_fcntl(s, cmd, val)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_inet_pton(af, src, dst)

LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided by your system, set this to 0 and include <sys/time.h> in cc.h

返回值:见 SDK 头文件

lwip_inet_ntop(af, src, dst, size)

把 IP 地址结构转为字符串(lwIP 实现)

返回值:见 SDK 头文件

遇到问题?

如有其他问题,请到统一的提问与讨论区:Ai-Thinker Discussions

Released under the MIT License. Build Time 2026-09-11 14:52:23