test_wifi
#!/system/bin/sh #Load driver
echo "ASD WIFI TESTING..." AP_NAME="default"
num=0
FLAG=0 busybox cp /system/etc/wifi/pre_supplicant.conf /data/misc/wifi/wpa_supplicant.conf
busybox chmod 666 /data/misc/wifi/pre_supplicant.conf
busybox chmod 666 /data/misc/wifi/wpa_supplicant.conf
busybox chmod 777 /dev/rfkill #insmod /system/lib/dhd.ko firmware_path=/system/etc/wifi/40183/ nvram_path=/system/etc/wifi/40183/nvram.txt
insmod /system/lib/dhd.ko firmware_path=/etc/wifi/40181/fw_bcm40181a2.bin nvram_path=/etc/wifi/40181/nvram.txt sleep 5 busybox ifconfig wlan0 up
sleep 5
#/system/bin/wpa_supplicant_ye -Dwext -C/data/misc/wifi/wlan0 -iwlan0 -c/data/misc/wifi/pre_supplicant.conf &
wpa_supplicant -Dnl80211 -C/data/misc/wifi/wlan0 -iwlan0 -c/data/misc/wifi/wpa_supplicant.conf & sleep 2 while busybox test $num -lt 5 # Test num with test command
do
#Scan
/system/bin/wpa_cli_ye -p/data/misc/wifi/wlan0 -iwlan0 scan sleep 2 /system/bin/wpa_cli_ye -p/data/misc/wifi/wlan0 -iwlan0 scan_results | busybox grep '[0-9a-zA-Z][0-9a-zA-Z]:[0-9a-zA-Z][0-9a-zA-Z]:[0-9a-zA-Z][0-9a-zA-Z]:[0-9a-zA-Z][0-9a-zA-Z]:[0-9a-zA-Z][0-9a-zA-Z]:[0-9a-zA-Z][0-9a-zA-Z]' if busybox test $? -eq 0
then
busybox sed -i "s/wifi_state = [0-9],[0-9]/wifi_state = 1,1/g" /system/bin/pretest_state
echo "WIFI OK"
FLAG=1
break
else
busybox sed -i "s/wifi_state = [0-9],[0-9]/wifi_state = 0,2/g" /system/bin/pretest_state
echo "scanning..."
fi
num=`busybox expr $num + 1` # Increment num
done if busybox test $num = 5
then
busybox sed -i "s/wifi_state = [0-9],[0-9]/wifi_state = 0,0/g" /system/bin/pretest_state
echo "WIFI FAILED"
exit 0
fi
busybox rm /data/misc/wifi/pre_supplicant.conf
rmmod /system/lib/dhd.ko
exit 0
test_wifi的更多相关文章
- python开发_tarfile_文档归档压缩|解压缩
''' python中的tarfile模块实现文档的归档压缩和解压缩 功能: 把工作空间下面的所有文件,打包生成一个tar文件 同时提供一个方法把该tar文件中的一些文件解压缩到 指定的目录中 ''' ...
- Linux 使用wpa_supplicant手动配置连接wifi
Linux 使用wpa_supplicant手动配置连接wifi wpa_supplicant 简介 wpa_supplicant是Linux BSD, Mac OSX和Windows的WPA的服务, ...
随机推荐
- ExcelApplication 另存Excel的SaveAs函数
procedure SaveAs(const Filename: WideString; FileFormat: OleVariant; Password: OleVariant; WriteResP ...
- (转)PHP自定义遍历目录下所有文件dir(),readdir()函数
方法一:使用dir()遍历目录 dir()函数,成功时返回Directory类实例 PHP dir() 语法格式为: dir(directory);//directory为需要显示文件名的目录名称,可 ...
- (转)Mac OS X中配置Apache
我使用的Mac OS X版本是10.8.2,Mac自带了Apache环境. 启动Apache 设置虚拟主机 启动Apache 打开“终端(terminal)”,输入 sudo apachectl -v ...
- iOS开发之字典数据建立模型步骤
1. 在控制器属性的(questions)set方法中完成字典转模型的操作 - (NSArray *)questions { if (nil == _questions) { //1.加载plist文 ...
- WPF 依赖属性与依赖对象
在介绍依赖属性之前,我先介绍下属性的历史 属性的历史: 早期C++的类中,只有字段及方法,暴露数据靠的是方法, 但是字段直接暴露会不安全,所以才用方法来暴露,在设置的时候加些约束,在MFC中 ...
- Linux下面/usr/local和opt目录
1./opt This directory is reserved for all the software and add-on packages that are not part of the ...
- PHP搜索Solr文档(含高亮)
<?php $options = array ( 'hostname' => 'localhost', 'port' => '8080', 'path' => 'solr/he ...
- asp.net Server.HtmlEncode和HtmlDecode
<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server">< ...
- laravel框架——学习笔记
routes.php文件创建路由参数由{}包起来,不需要$ Route::get('/stu/{as}','StuController@show'); 在相对应的Controller创建funcito ...
- Install RHadoop with Hadoop 2.2 – Red Hat Linux
Prerequisite Hadoop 2.2 has been installed (and the below installation steps should be applied on ea ...