Android 6.0及7.0版本,蓝牙HCI Log的开关及Path配置的位置变更,具体如下:
配置文件为etc/bluetooth/bt_stack.conf,通过ADB将该文件pull,修改后,再push会系统,开关蓝牙生效;
1# Enable BtSnoop logging function
2# valid value : true, false
3BtSnoopLogOutput=false
4
5# BtSnoop log output file
6BtSnoopFileName=/sdcard/btsnoop_hci.log
7
8# Preserve existing BtSnoop log before overwriting
9BtSnoopSaveLog=false
Android 8.0开始,蓝牙HCI Log的开关及Path配置的位置变更,具体如下:
通过adb shell setprop修改SystemProperties值进行控制。
46// The number of of packets per btsnoop file before we rotate to the next
47// file. As of right now there are two snoop files that are rotated through.
48// The size can be dynamically configured by seting the relevant system
49// property
50#define DEFAULT_BTSNOOP_SIZE 0xffff
51
52#define BTSNOOP_ENABLE_PROPERTY "persist.bluetooth.btsnoopenable"
53#define BTSNOOP_PATH_PROPERTY "persist.bluetooth.btsnooppath"
54#define DEFAULT_BTSNOOP_PATH "/data/misc/bluetooth/logs/btsnoop_hci.log"
55#define BTSNOOP_MAX_PACKETS_PROPERTY "persist.bluetooth.btsnoopsize"
56