OpenWrt上移植了很多通用的無線指令, iwpriv, iwconfig, iwlist ,iw 等,這些是我經常遇到的,但都是隻是使用其中部分而已。
iwlist 支援的一些參數:
[email protected]:~# iwlist
Usage: iwlist [interface] scanning [essid NNN] [last]
[interface] frequency
[interface] channel
[interface] bitrate
[interface] rate
[interface] encryption
[interface] keys
[interface] power
[interface] txpower
以上參數的執行結果如下,但這隻是部分,因為這裡用的的MTK的SDK中驅動,是以可能存在部分不相容的問題(SDK驅動移植到OpenWrt上)。
[email protected]:~# iwlist ra0 scanning
ra0 Interface doesn't support scanning : Operation not supported
[email protected]:~# iwlist ra0 scanning last
ra0 Failed to read scan data : Operation not supported
[email protected]:~# iwlist ra0 frequency
ra0 0 channels
Current Channel:11
[email protected]:~# iwlist ra0 channel
ra0 0 channels
Current Channel:11
[email protected]:~# iwlist ra0 bitrate
ra0 unknown bit-rate information.
Current Bit Rate=300 Mb/s
[email protected]:~# iwlist ra0 rate
ra0 unknown bit-rate information.
Current Bit Rate=300 Mb/s
[email protected]:~# iwlist ra0 encryption
ra0 0 keys available :
[email protected]:~# keys
-ash: keys: not found
[email protected]:~# iwlist ra0 keys
ra0 0 keys available :
[email protected]:~# iwlist ra0 power
ra0
[email protected]:~# iwlist ra0 txpower
ra0 unknown transmit-power information.
[email protected]:~#
我們可以看到對我們有用的是 channel, bitrate/rate. 我們可以擷取無線的信号,以及無線連接配接支援的速率(這裡顯示的是最大速率)。