蓝牙相关杂记

1、打开蓝牙

adb shell service call bluetooth_manager 6

或者service call bluetooth_manager 6 s16 "com.android.bluetooth"

 

2、关闭蓝牙

adb shell service call bluetooth_manager 8

或者service call bluetooth_manager 8 s16 "com.android.bluetooth" i32 1

 

3、查看蓝牙信息

adb shell dumpsys bluetooth_manager

 

4、允许被发现---需要按键确认

adb shell am start -a android.bluetooth.adapter.action.REQUEST_DISCOVERABLE

 

5、获取蓝牙开关状态

adb shell settings get global bluetooth_on

返回1表示开启,0表示关闭

 

6、获取蓝牙MAC地址

adb shell settings get secure bluetooth_addressv

上一篇:QCC3024蓝牙对讲机替代CSR8670方案(Bluetooth interphone)


下一篇:安卓系统广播