BT测试进入信令模式

        Bluetooth进行FCC测试,需要先进入信令模式。Android4.0以下版本,在system/bin目录下没有hci_qcomm_init文件,在system/xbin目录下没有hcitool。进入测试模式之前,我们需要把这两个文件push到对应目录。然后进入adb shell,执行hcitool cmd。在4.0如果按照此步骤执行,执行完后能进入测试模式,测试完一项之后重启手机,查看bluetooth的状态一直是正在打开,最终打开失败。查看log,显示以下信息:

I/qcom-bluetooth(  434): /system/etc/init.qcom.bt.sh: Transport :  
I/qcom-bluetooth(  435): /system/etc/init.qcom.bt.sh: Power Class: Ignored. Default(1) used (1-CLASS1/2-CLASS2/3-CUSTOM) 
I/SystemServer(  290): UI Mode Manager Service
I/SystemServer(  290): Backup Service
I/qcom-bluetooth(  437): /system/etc/init.qcom.bt.sh: Power Class: To override, Before turning BT ON; setprop qcom.bt.dev_power_class <1 or 2 or 3> 
V/BackupManagerService(  290): Initializing package tracking
V/BackupManagerService(  290): No ancestral data
I/qcom-bluetooth(  438): /system/etc/init.qcom.bt.sh: LE Power Class: Ignored. Default(2) used (1-CLASS1/2-CLASS2/3-CUSTOM) 
I/qcom-bluetooth(  439): /system/etc/init.qcom.bt.sh: LE Power Class: To override, Before turning BT ON; setprop qcom.bt.le_dev_pwr_class <1 or 2 or 3> 
E/qcom-bluetooth(  441): /system/etc/init.qcom.bt.sh: Bluetooth QSoC firmware download failed: exit code 1 
E/bluedroid(  290): bt_enable: Timeout waiting for HCI device to come up, error- -1, 
E/BluetoothAdapterStateMachine(  290): failed to prepare bluetooth, abort turning on


出现蓝牙打不开的时候,只能重新升级版本蓝牙才能正常使用。

 查看Android4.0/4.1,在system/bin,system/xbin两个目录下存在这两个文件,而hci_qcom_init这个文件是跟打开蓝牙时,驱动需要使用的文件。之前push进去的hci_qcomm_init跟新版本的不一样,导致了下载firmware失败,蓝牙打不开。所以在Android4.0/4.1版本只需使用以下命令就可进入BT的信令模式进行测试:

adb shell
#hcitool cmd 0x06 0x0003
#hcitool cmd 0x03 0x0005 0x02 0x00 0x02
#hcitool cmd 0x03 0x001A 0x03
#hcitool cmd 0x03 0x0020 0x00
#hcitool cmd 0x03 0x0022 0x00


 

你可能感兴趣的:(Bluetooth)