本文共 2371 字,大约阅读时间需要 7 分钟。
1、下载源码:wireless_tools.29.tar.gz
2、编译
解压后直接make 就可以产生调试工具: iwconfig iwevent iwlist iwpriv iwspy iwgetid 和 动态库文件: libiw.so.29 交叉编译:
修改Makefile, 修改CC AR 和 RANLIB 就可以,直接make就可以了 ## Compiler to use (modify this for cross compile). CC = arm-hisiv500-linux-gcc ## Other tools you need to modify for cross compile (static lib only). AR = arm-hisiv500-linux-ar RANLIB = arm-hisiv500-linux-ranlib 3、调试工具简介:
Wireless tools for Linux是一个Linux命令行工具包,用来设置支持Linux Wireless Extension的无线设备。 iwconfig: 设置基本无线参数 iwlist: 扫描、列出频率,比特率,密钥等 iwspy: 获取每个节点链接的质量(只能查阅与之相连的节点) iwpriv: 操作Wireless Extensions 特定驱动 iwevent: 监控和显示无线设备的状态和事件 4、iwconfig
iwconfig: 设置基本无线参数 iwconfig --help Usage: iwconfig [interface] interface essid {NNN|any|on|off} interface mode {managed|ad-hoc|master|...} interface freq N.NNN[k|M|G] interface channel N interface bit {N[k|M|G]|auto|fixed} interface rate {N[k|M|G]|auto|fixed} interface enc {NNNN-NNNN|off} interface key {NNNN-NNNN|off} interface power {period N|timeout N|saving N|off} interface nickname NNN interface nwid {NN|on|off} interface ap {N|off|auto} interface txpower {NmW|NdBm|off|auto} interface sens N interface retry {limit N|lifetime N} interface rts {N|auto|fixed|off} interface frag {N|auto|fixed|off} interface modulation {11g|11a|CCK|OFDMg|...} interface commit Check man pages for more details. 连接到网络: iwconfig wlan0 essid "My ssid" 或者 iwconfig wlan0 essid "my ssid" key MyPassword 5、iwlist
iwlist: 扫描、列出频率,比特率,密钥等 iwlist Usage: iwlist [interface] scanning [essid NNN] [last] [interface] frequency [interface] channel [interface] bitrate [interface] rate [interface] encryption [interface] keys [interface] power [interface] txpower [interface] retry [interface] ap [interface] accesspoints [interface] peers [interface] event [interface] auth [interface] wpakeys [interface] genie [interface] modulation 比如: iwlist wlan0 scanning wlan0 Scan completed : Cell 01 - Address: F4:83:CD:82:B6:D8 ESSID:"TP-LINK_B6D8" Protocol:IEEE 802.11bgn Mode:Master Frequency:2.412 GHz (Channel 1) Encryption key:on Bit Rates:300 Mb/s Extra:wpa_ie=dd160050f20101000050f20401000050f20401000050f202 IE: WPA Version 1 Group Cipher : CCMP Pairwise Ciphers (1) : CCMP Authentication Suites (1) : PSK Extra:rsn_ie=30140100000fac040100000fac040100000fac020000 IE: IEEE 802.11i/WPA2 Version 1 Group Cipher : CCMP Pairwise Ciphers (1) : CCMP Authentication Suites (1) : PSK 转载地址:http://yefli.baihongyu.com/