wpa_supplicant与wpa_cli个人总结

wpa_supplicant的帮助文档

usage:
wpa_supplicant [-BddhKLqqstuvW] [-P] [-g]
-i -c [-C] [-D] [-p]
[-b] [-f] [-e]
[-o] [-O]
[-N -i -c [-C] [-D]
[-p] [-b] …]

drivers:
nl80211 = Linux nl80211/cfg80211
options:
-b = optional bridge interface name
-B = run daemon in the background
-c = Configuration file
-C = ctrl_interface parameter (only used if -c is not)
-i = interface name
-d = increase debugging verbosity (-dd even more)
-D = driver name (can be multiple drivers: nl80211,wext)
-e = entropy file
-g = global ctrl_interface
-K = include keys (passwords, etc.) in debug output
-t = include timestamp in debug messages
-h = show this help text
-L = show license (BSD)
-o = override driver parameter for new interfaces
-O = override ctrl_interface parameter for new interfaces
-p = driver parameters
-P = PID file
-q = decrease debugging verbosity (-qq even less)
-v = show version
-W = wait for a control interface monitor before starting
-N = start describing new interface

example:
 wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf

-D:驱动名称,有wext和nl80211
-i:网口名称
-c:指定wpa_supplicant.conf 配置文件
-B:后台运行
-d:增加调试信息。

v3s中个人的是用方法:
wpa_supplicant -Dnl80211 -iwlan0 -c/data/wlan/wpa_supplicant.conf -d -B
wpa_supplicant.conf:
ctrl_interface = /data/misc/wifi/wpa_supplicant   //wpa_supplicant 和 wpa_cli通信的套接子,个人理解
update_config=1	//自动更新wpa_cli操作所保存的数据
。。。。还可以配置其他的配置,如果wifi的信息,wifi连接的优先级等等

wpa_cli 的部分帮助文档

wpa_cli [-p ] [-i] [-hvB] [-a]
[-P] [-g] [-G] [command…]
-h = help (show this usage text)
-v = shown version information
-a = run in daemon mode executing the action file based on events from
wpa_supplicant
-B = run a daemon in the background
default path: /data/system/wpa_supplicant //注意:该地址为套接字的地址,如果wpa_supplicant.conf 没有把ctrl_interface指向这里,则需要使用-p指定套接字wlan0的路径。
default interface: first interface found in socket path

比如:
之前我将ctrl_interface = /data/misc/wifi/wpa_supplicant设置为该地址,
则使用wpa_cli 时就得指定-p /data/misc/wifi/wpa_supplicant 进行配置,否则会出现

  • Could not connect to wpa_supplicant: wlan0 - re-trying
    的错误。

你可能感兴趣的:(学习资料)