Android Bluetooth how to (Based on Android L bluedroid)
Continuous update ...
1. How to enable Btsnoop log?
A) UI settings-->
b) Developer options-->
c) Reboot Tablet, then snoop Log would locate In/sdcard/btsnoop_hci.log (this path can be configured In/etc/bluetooth/bt_ stack.conf)
2. IF Developer Options Default not enabled, you can use following steps to enable it
A) settings-->
b) About tablet-->
c) Click 4 or 5 times or more in Build number-->
D) Then, Develop options would comeout-->
Pls also be noted so how to enable Developer Options might depend on system and Android Versions
3. bluedroid useful config files
A) bt_stack.conf
I. This file is saved in the/etc/bluetooth/directory and is used to configure the way the bluedroid stack log is crawled and the log level
b) Bt_config.xml
I. This file, in the/data/misc/bluedroid/directory, holds information about the current BT device, the scanned BT device, and the paired BT device, including device name, BD_ADDR, link key, Report descriptor ( HID) and so on
4. How to enable & Adjust Bluedroid debug log level?
A) This should customized in/etc/bluetooth/bt_stack.conf
b) Enable Btsnoop log---
I.set Btsnooplogoutput to True
Btsnooplogoutput=true
II. Set Btsnoopfilename to path want to save Btsnoop log
Btsnoopfilename=/sdcard/btsnoop_hci.log
c) Adjust trace & Debug level
I. Set traceconf to True
Traceconf=true
II. Set debug level as required, default is 2, usually debug, the level is set by default to 5来 capture log, so that more information can be played (Logcat)
Trc_btm=5
Trc_hci=5
Trc_l2cap=5
Trc_rfcomm=5
Trc_obex=5
Trc_avct=5
Trc_avdt=5
Trc_avrc=5
Trc_avdt_scb=5
Trc_avdt_ccb=5
Trc_a2d=5
Trc_sdp=5
Trc_gatt=5
Trc_smp=5
Trc_btapp=5
Trc_btif=5
5, Android bluetooth related code path
A) bluedroid protocol stack
I. <android Root>/external/bluetooth/bluedroid/
b) bluetooth.apk
I. <android root>/packages/apps/bluetooth/
c) settings.apk
I. <android Root>/packages/apps/settings/src/com/android/settings/bluetooth
d) HAL header file
I. <android root>/hardware/libhardware/include/hardware/
e) Framework-related
I. <android Root>/frameworks/base/core/java/android/bluetooth
II. <android Root>/frameworks/base/services/core/java/com/android/server/bluetoothmanagerservice.java
6, bluedroid build out of binary
A) bluetooth.default.so
I. The profile of this stack, compiled by stack, is the essence of bluedroid
b) audio.a2dp.default.so
I. This is the HAL interface for A2DP and audio
c) libbt-vendor.so
I. Vendor self-implemented for the Bluedroid protocol stack copper-specific chip driver connected
7. Android BT Basic Architecture
Android Bluetooth how to--based on Android L bluedroid