android wlan bt 和gps小工具使用

来源:互联网 发布:联通wcdma 通话 数据 编辑:程序博客网 时间:2024/06/08 10:32

//命令行测试wlan
//加载驱动

#insmod /system/lib/modules/wlan.ko   //root  权限#iwpriv  wlan0 version     //查看固件等信息#iwpriv wlan0 getChannelList //wifi信道查看方法 #iw reg get    // 强度#ifconfig wlan0 up#ifconfig wlan0 down如iw 的使用 http://blog.csdn.net/lqrensn/article/details/8159096

Android原生包括高通QRD用的是blueZ的蓝牙协议栈,有提供两个工具:hciconfig和hcitool用于调试蓝牙,开始调试前首先需要将这些工具Push到手机上:

#adb remount#adb push hciconfig /system/bin#adb push hcitool /system/bin#adb shell#chmod -R 777 /system/bin

hciconfig -a (查看蓝牙地址,芯片状态等等)
hcitool scan (进行蓝牙搜索,并列出搜索到的设备名称和设备地址)
hciconfig hciX piscan (开启Inquiry Scan和Page Scan,使手机处于可被搜索和可连接状态)
可以使用hciconfig –help以及hcitool –help来查询其它的功能,尤其要提的是hcitool cmd这个命令,通过这个命令可以发送任何的HCI Command,大部分蓝牙功能都可以通过发送HCI Command来实现,具体HCI Command格式可以查询蓝牙Spec

进入测试模式的命令:
hcitool cmd 0x06 0x0003 (Enter Test Mode)
hcitool cmd 0x03 0x0005 0x02 0x00 0x02 (Auto Accept All Connections)
hcitool cmd 0x03 0x001A 0x03 (Page Inquiry Scans)
hcitool cmd 0x03 0x0020 0x00 (Disable Authentication)
hcitool cmd 0x03 0x0022 0x00 (Disable Encryption)

Qualcomm bt test :

#echo 1 > /sys/class/rfkill/rfkill0/state

#hci_qcomm_init -vvv -e#hciattach /dev/ttyHS0 qualcomm-ibs 3000000#hciconfig hci0 up#hcitool scan

The follow commands are used to enter test mode.

#bttest disable#bttest enable#bttest enable_dut_mode

garden_app test

原创粉丝点击