Android

Bluetooth FAQ
This FAQ refers to the Android Open Source codebase, and is written for platform developers with root access on devices such as the Androd Developer Phone.

Q. How do I compile Android with Bluetooth support enabled?
A. Add this to your BoardConfig.mk:
BOARD_HAVE_BLUETOOTH := true

Q. Does the emulator support Bluetooth?
A. Sorry, not at this time. This would make a nice project if someone wants to take this on.

Q. Bluetooth doesn't work on my device. How should I debug?
A. First step - read the logs (adb logcat)! In particular look for ERROR or WARNING level messages regarding Bluetooth.
Andoird uses Bluez, which comes with some very useful debugging tools. Here are some examples, in the rough order I use to debug BT.
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.

Q. Where are the logs for the Bluetooth deamons hcid and hciattach?
A. Like all Android system daemons, the STDOUT and STDERR are sent to /dev/null by default. If you want to view these logs you can run the daemons under logwrapper which redirects there output to logcat. Edit init.rc and init.PLATFORM.rc to run these daemons under logwrapper.

Q. I compiled my own system.img for the Android Developer Phone, and hciconfig -a works, but hcitool scan does not. Whats going on?
A. You probably need to install the firmware for the Bluetooth chipset. Unfortunately this firmware is not yet in the open source codebase. However you can adb pull and then adb push it from a stock T-Mobile G1. The location is.
/etc/firmware/brf6300.bin

Q. What Bluetooth Core version does Android support?
A. Bluetooth 2.0 + EDR.

Q. What is the architecture of Bluetooth in Android?
A. We are based on Bluez version 3.36. The diagram below shows our 1.0 layout:


Q. When will Java Bluetooth API's be released in an SDK?
A. We are not ready to announce a release target for Bluetooth API's. We do understand there is demand for a Bluetooth API, and it is a top priority for the Android Bluetooth team.

Q. What is needed for Bluetooth 2.1 and Simple Pairing support?
A. We need to move to a Bluez 4.x version.

Profile Support
Q. What is the status of Headset and Handsfree?
A. Android 1.0 is qualified for both HFP and HSP (in the AG role) profiles. We are gladly taking bug fixes on any remaining issues. The one significant feature we lack is eSCO support.

Q. What is the status of A2DP and AVRCP?
A. A2DP and AVRCP work is ongoing for the 'cupcake' release. We are using the Bluez audio plugin and Bluez SBC codec, with a custom audio path designed for the Android Audio sub-system. Qualificiation is not yet complete.

Q. What is the status of HID?
A. Some very early work is in cupcake - Bluez has an HID plugin which we compile:
external/bluez/utils/input/Android.mk
You can interact directly with this plugin using dbus-send and dbus-monitor. With a little study of the Bluez HID plugin API and some luck and you should be able to connect and use a HID keyboard or mouse. A lot of work remains to be done before we could officially claim HID is supported by the platform. For example we need to plumb the plugin API up in the Android Java framework. And the Android framework needs better support for HID input methods - new keymaps and mouse support. We do not yet have a release targetted for official HID support.

Q. What is the status for tethering - DUN and PAN.
A. Similar to HID, some very early work is in cupcake. Bluez has DUN and PAN daemons which we compile.
external/bluez/utils/dun/Android.mk
external/bluez/utils/pan/Android.mk
BNEP support is compiled into the kernel with cupcake. With a little experimentation running these daemons (dund or pand) and using pppd or iptables you can test tethering support. A lot of integration work remains before we could officially claim that DUN or PAN is supported by the platform. Like HID, we would need to plumb the DBUS API's to these daemons up into the Android Java framework, and add code to setup the network paths via pppd and/or iptables. We do not yet have a release targetted for official DUN or PAN support.

你可能感兴趣的:(android,mobile,Access,UP)