Wifi接口定义在hardware/libhardware_legacy/include/hardware_legacy/wifi.h中。
其中定义了一系列函数:
函数 | 类型 | 说明 |
wifi_load_driver | int(*) | 加载、卸载、查询是否加载WIFI驱动模块。load_module、remove_module、/proc/modules $(wlan.driver.status) |
wifi_unload_driver | int(*) | |
is_wifi_driver_loaded | int(*) | |
wifi_start_supplicant | int(*) | 通过$(ctrl.start/stop)启动、停止supp服务。服务名:wpa_supplicant或者p2p_supplicant |
wifi_stop_supplicant | int(*) | |
wifi_connect_to_supplicant | int(*) | 打开、关闭与supp服务的UNIX套接字连接。两个连接:控制和事件。 |
wifi_close_supplicant_connection | ||
wifi_wait_for_event | 等待事件,去掉报文中的消息等级<N> | |
wifi_command | 发送命令,等待应答 | |
do_dhcp_request | 通过libnetutils使用DHCP配置无线网卡。后者使用dhcpd。 | |
get_dhcp_error_string | ||
wifi_get_fw_path | ||
wifi_change_fw_path | 切换固件,/sys/module/wlan/parameters/fwpath | |
ensure_entropy_file_exists | /data/misc/wifi/entropy.bin,没有创建,写入dummy_key,修改权限0660,system wifi |