Android's Bluetooth stack uses BlueZ version 3.36 for GAP, SDP, and RFCOMM profiles, and is a SIG-qualified Bluetooth 2.0 host stack.
Bluez is GPL licensed, so the Android framework interacts with userspace bluez code through D-BUS IPC to avoid proprietary code.
Headset and Handsfree (v1.5) profiles are implemented in the Android framework and are both tightly coupled with the Phone App. These profiles are also SIG qualified.
The diagram below offers a library-oriented view of the Bluetooth stack. Click Bluetooth Process Diagram for a process-oriented view.
BlueZ is Bluetooth 2.0 compatible and should work with any 2.0 chipset. There are two integration points:
The BlueZ kernel sub-system attaches to your hardware-specific UART driver using the hciattach
daemon.
For example, for MSM7201A, this is drivers/serial/msm_serial.c
. You may also need to edit command line options to hciattach
via init.rc
.
The method for powering on and off your bluetooth chip varies from Android V 1.0 to post 1.0.
/sys/modules/board_[PLATFORM]/parameters/bluetooth_power_on
.rfkill
API. See arch/arm/mach-msm/board-trout-rfkill.c
for an example.BlueZ provides a rich set of command line tools for debugging and interacting with the Bluetooth sub-system, including:
hciconfig
hcitool
hcidump
sdptool
dbus-send
dbus-monitor