Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2131146
  • 博文数量: 288
  • 博客积分: 10594
  • 博客等级: 上将
  • 技术积分: 3469
  • 用 户 组: 普通用户
  • 注册时间: 2006-10-27 19:27
文章分类

全部博文(288)

文章存档

2012年(4)

2011年(30)

2010年(40)

2009年(32)

2008年(71)

2007年(79)

2006年(32)

分类: LINUX

2011-11-08 14:36:32

 

  1. wifi的连接测试脚本
  2. view plaincopy to clipboardprint?#!/bin/bash
  3.   
  4. cnt=0
  5.   
  6. echo $cnt
  7. busybox cp /system/etc/wifi/wpa_supplicant.conf /data/misc/wifi/
  8.   
  9. insmod /system/lib/wifi/modules/8192cu.ko
  10.   
  11. busybox ifconfig wlan0 up
  12.   
  13. /system/bin/wpa_supplicant -Dwext -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf &
  14.   
  15. echo $#
  16. sleep 3
  17. #if [ $# -eq 1 ]
  18. #then
  19.     echo "into"
  20.     /system/bin/wpa_cli -iwlan0 scan
  21.     /system/bin/wpa_cli -iwlan0 scan_result
  22.     /system/bin/wpa_cli -iwlan0 add_network
  23.     /system/bin/wpa_cli -iwlan0 set_network $cnt ssid '"bontek01"'
  24.     /system/bin/wpa_cli -iwlan0 set_network $cnt key_mgmt NONE
  25.     /system/bin/wpa_cli -iwlan0 set_network $cnt wep_key0 '"bontekcom2009"'
  26.     /system/bin/wpa_cli -iwlan0 set_network $cnt wep_tx_keyidx 0
  27.     /system/bin/wpa_cli -iwlan0 select_network $cnt
  28.     /system/bin/wpa_cli -iwlan0 enable_network $cnt
  29.     /system/bin/busybox ifconfig wlan0 192.168.1.4
  30. #fi
  31.   
  32. echo "end"
  33. #!/bin/bash

  34. cnt=0

  35. echo $cnt
  36. busybox cp /system/etc/wifi/wpa_supplicant.conf /data/misc/wifi/

  37. insmod /system/lib/wifi/modules/8192cu.ko

  38. busybox ifconfig wlan0 up

  39. /system/bin/wpa_supplicant -Dwext -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf &

  40. echo $#
  41. sleep 3
  42. #if [ $# -eq 1 ]
  43. #then
  44.     echo "into"
  45.     /system/bin/wpa_cli -iwlan0 scan
  46.     /system/bin/wpa_cli -iwlan0 scan_result
  47.     /system/bin/wpa_cli -iwlan0 add_network
  48.     /system/bin/wpa_cli -iwlan0 set_network $cnt ssid '"bontek01"'
  49.     /system/bin/wpa_cli -iwlan0 set_network $cnt key_mgmt NONE
  50.     /system/bin/wpa_cli -iwlan0 set_network $cnt wep_key0 '"bontekcom2009"'    
  51.     /system/bin/wpa_cli -iwlan0 set_network $cnt wep_tx_keyidx 0
  52.     /system/bin/wpa_cli -iwlan0 select_network $cnt
  53.     /system/bin/wpa_cli -iwlan0 enable_network $cnt    
  54.     /system/bin/busybox ifconfig wlan0 192.168.1.4
  55. #fi

  56. echo "end"


  57. wifi的无委测试自动化脚本

  58. view plaincopy to clipboardprint? #!/bin/bash
  59. echo "$# parameters"
  60.   
  61. channel=1
  62. bandwidth=0
  63. txpower=55
  64. mp_rate=108
  65.   
  66. test=0
  67.   
  68. echo "start test wifi"
  69.   
  70.   
  71. #if [ $# -ge 1 ]
  72. #then
  73.     channel=$1
  74. #fi
  75. #if [ $# -ge 2 ]
  76. #then
  77.     bandwidth=$2
  78. #fi
  79. #if [ $# -ge 3 ]
  80. #then
  81.     txpower=$3
  82. #fi
  83. #if [ $# -ge 4 ]
  84. #then
  85.     mp_rate=$4
  86. #fi
  87.   
  88. echo "channel = $channel, bandwidth = $bandwidth,
  89.       txpower = $txpower, mp_rate = $mp_rate"
  90. #init wlan0 and mp mode
  91.   
  92. ifconfig wlan0 up
  93. sleep 1
  94. iwpriv wlan0 mp_start
  95.   
  96. echo "iwpriv wlan0 mp_channel $channel"
  97. iwpriv wlan0 mp_channel $channel
  98. echo "iwpriv wlan0 mp_bandwidth 40M=$bandwidth,shortGI=0"
  99. iwpriv wlan0 mp_bandwidth 40M=$bandwidth,shortGI=0
  100. iwpriv wlan0 mp_ant_tx a
  101. echo "iwpriv wlan0 mp_txpower patha=$txpower,pathb=$txpower"
  102. iwpriv wlan0 mp_txpower patha=$txpower,pathb=$txpower
  103. echo "iwpriv wlan0 mp_rate $mp_rate"
  104. iwpriv wlan0 mp_rate $mp_rate
  105. iwpriv wlan0 mp_ctx background
  106.   
  107. read test
  108.   
  109. iwpriv wlan0 mp_ctx stop
  110. iwpriv wlan0 mp_stop
  111. ifconfig wlan0 down
  112.  #!/bin/bash
  113. echo "$# parameters"

  114. channel=1
  115. bandwidth=0
  116. txpower=55
  117. mp_rate=108

  118. test=0

  119. echo "start test wifi"


  120. #if [ $# -ge 1 ]
  121. #then
  122.     channel=$1
  123. #fi
  124. #if [ $# -ge 2 ]
  125. #then
  126.     bandwidth=$2
  127. #fi
  128. #if [ $# -ge 3 ]
  129. #then
  130.     txpower=$3
  131. #fi
  132. #if [ $# -ge 4 ]
  133. #then
  134.     mp_rate=$4
  135. #fi

  136. echo "channel = $channel, bandwidth = $bandwidth,
  137.       txpower = $txpower, mp_rate = $mp_rate"
  138. #init wlan0 and mp mode

  139. ifconfig wlan0 up
  140. sleep 1
  141. iwpriv wlan0 mp_start

  142. echo "iwpriv wlan0 mp_channel $channel"
  143. iwpriv wlan0 mp_channel $channel
  144. echo "iwpriv wlan0 mp_bandwidth 40M=$bandwidth,shortGI=0"
  145. iwpriv wlan0 mp_bandwidth 40M=$bandwidth,shortGI=0
  146. iwpriv wlan0 mp_ant_tx a
  147. echo "iwpriv wlan0 mp_txpower patha=$txpower,pathb=$txpower"
  148. iwpriv wlan0 mp_txpower patha=$txpower,pathb=$txpower
  149. echo "iwpriv wlan0 mp_rate $mp_rate"
  150. iwpriv wlan0 mp_rate $mp_rate
  151. iwpriv wlan0 mp_ctx background

  152. read test

  153. iwpriv wlan0 mp_ctx stop
  154. iwpriv wlan0 mp_stop
  155. ifconfig wlan0 down


  156. wifi的批量安装脚本

  157. view plaincopy to clipboardprint?REM this bat used to install 3c and wifi test.
  158.   
  159. ECHO "test start"
  160.   
  161. adb devices
  162.   
  163. adb shell /system/bin/mount -t ext4 -o remount,rw /dev/block/mmcblk0p1 /system/
  164. adb push iwconfig /system/bin/
  165. adb push iwlist /system/bin/
  166. adb push iwpriv /system/bin/
  167. adb push wifi.sh /data/
  168. adb push test.sh /data/
  169. adb push 8192cu.ko /system/lib/wifi/modules/
  170. adb push 8192cu_mp.ko /system/lib/wifi/modules/
  171.   
  172. adb shell chmod 777 /system/bin/iw*
  173. adb shell ls -l /system/bin/iw*
  174. adb shell ls -l /system/lib/wifi/modules/
  175.   
  176. pause
阅读(3977) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

piaoyizu2011-11-20 21:14:22

liu090: 麻烦问下
iwpriv wlan0 mp_rate $mp_rate
的mp-rate 是bit rate  吗?
用iwpriv  设置 bit rate 和
iwconfig 设置bit rate  有什么区别?
为什么我用 iwconfig  .....
liu090,你好. mp-rate就是bit rate, 在使用脚本前,需要安装mp测试的ko驱动,iwpriv中的命令是芯片独有的命令.

liu0902011-11-19 22:52:37

麻烦问下
iwpriv wlan0 mp_rate $mp_rate
的mp-rate 是bit rate  吗?
用iwpriv  设置 bit rate 和
iwconfig 设置bit rate  有什么区别?
为什么我用 iwconfig  设置bit rate 不成功