From 0355976f628857b2675377fa4f2de12b3b5a44aa Mon Sep 17 00:00:00 2001
From: David Warren 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. Android's Bluetooth stack uses BlueZ version 3.36 for GAP, SDP, and RFCOMM profiles, and is a SIG-qualified Bluetooth 2.0 + EDR host stack. Bluez is GPL licensed, so the Android framework interacts with userspace bluez code through D-BUS IPC to avoid proprietary code.
Bluetooth Power On / Off
-Tools
+Compiling
+Troubleshooting
+Tools
+Feature Support
+
Introduction
-
To compile Android with Bluetooth support enabled, add the following line to BoardConfig.mk.
+
+BOARD_HAVE_BLUETOOTH := true ++ +
Debugging
+To debug your bluetooth implementation, start by reading the logs (adb logcat) and look for ERRROR and WARNING messages regarding Bluetooth.
+ Andoird uses Bluez, which comes with some useful debugging tools. The snippet below provides examples in a suggested order:
+hciconfig -a # print BT chipset address and features. Useful to check if you can communicate with your BT chipset. +hcidump -XVt # print live HCI UART traffic. +hcitool scan # scan for local devices. Useful to check if RX/TX works. +l2ping ADDRESS # ping another BT device. Useful to check if RX/TX works. +sdptool records ADDRESS # request the SDP records of another BT device. ++ +
Deamon Logs
+Deamon logs for hcid (STDOUT) and hciattach (STDERR) are sent to /dev/null by default. Edit init.rc and init.PLATFORM.rc to run these daemons under logwrapper, which redirects output to logcat.
hciconfig -a and hcitool
+If you compile your own system.img for Android, and hciconfig -a works but hcitool scan doesn't, try installing the firmware for the Bluetooth chipset. This firmware isn't yet available in the open source codebase, but you can adb pull and then adb pushit from a stock T-Mobile G1 (located in /etc/firmware/brf6300.bin).
+
BlueZ provides a rich set of command line tools for debugging and interacting with the Bluetooth sub-system, including:
dbus-monitorThis section provides a change history of Bluetooth features added in each Android release and provides some rough guidance as to future features.
+No Bluetooth changes since 1.0
+This section offers a rough guide of which features the team is developing for the next release. This feature list may change without notice. It isn't possible to post scheduling advice to the mailing lists.
+Development Notes
+external/bluez/utils/input/Android.mk, which gets compiled. dbus-send and dbus-monitor. While not officially supported, you should be able to connect and use a HID keyboard and mouse using the Bluez HID plugin API. Next steps include plumbing the plugin API in the Android Java framework and offering better support for HID input methods (new keymaps and mouse support).external/bluez/utils/dun/Android.mk
+ external/bluez/utils/pan/Android.mk
+BNEP support is compiled into the kernel with cupcake. dund or pand daemons and, using pppd or iptables, test tethering support. Next steps include plubming the DBUS APIs to these daemons up into the Android Java framework and adding code to setup the network paths via pppd and / or iptables.