mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-26 21:54:33 +08:00
d51dce6e81
Currently CoD is hardcoded so just adjust test value for now. |
||
---|---|---|
.. | ||
client | ||
cutils | ||
hardware | ||
system | ||
a2dp.c | ||
a2dp.h | ||
android-tester.c | ||
Android.mk | ||
audio-ipc-api.txt | ||
audio-ipc.c | ||
audio-ipc.h | ||
audio-msg.h | ||
avdtp.c | ||
avdtp.h | ||
bluetooth.c | ||
bluetooth.h | ||
bluetoothd-snoop.c | ||
hal-a2dp.c | ||
hal-audio.c | ||
hal-bluetooth.c | ||
hal-hidhost.c | ||
hal-ipc-api.txt | ||
hal-ipc.c | ||
hal-ipc.h | ||
hal-log.h | ||
hal-msg.h | ||
hal-pan.c | ||
hal-sock.c | ||
hal-utils.c | ||
hal-utils.h | ||
hal.h | ||
hidhost.c | ||
hidhost.h | ||
ipc.c | ||
ipc.h | ||
main.c | ||
Makefile.am | ||
pan.c | ||
pan.h | ||
pics-did.txt | ||
pics-gap.txt | ||
pics-hid.txt | ||
pics-l2cap.txt | ||
pics-map.txt | ||
pics-opp.txt | ||
pics-pan.txt | ||
pics-pbap.txt | ||
pixit-did.txt | ||
pixit-gap.txt | ||
pixit-hid.txt | ||
pixit-l2cap.txt | ||
pixit-map.txt | ||
pixit-opp.txt | ||
pixit-pan.txt | ||
pixit-pbap.txt | ||
pts-did.txt | ||
pts-gap.txt | ||
pts-hid.txt | ||
pts-l2cap.txt | ||
pts-map.txt | ||
pts-opp.txt | ||
pts-pbap.txt | ||
README | ||
socket-api.txt | ||
socket.c | ||
socket.h | ||
system-emulator.c | ||
utils.h |
BlueZ for Android ***************** Since Android 4.2 there exists a well standardized HAL interface that the Bluetooth stack is expected to provide and which enables the easy replacement of the stack of choice on Android. Android BlueZ is intended as a drop-in replacement to Android provided Bluetooth stack. More details about BlueZ for Android architecture and components can be found in android/hal-apc-api.txt file. =============================== Building and running on Android =============================== Build requirements ================== - GLib - Android 4.2 or later don't provide GLib and one must provide it in 'external/bluetooth/glib' folder of Android tree. Sample Android GLib port is available at https://code.google.com/p/android-bluez.glib/ - Bionic support - BlueZ requires signalfd and timerfd APIs to be provided by libc library. Currently only 'master' branch available at https://android.googlesource.com/platform/bionic provides all required functionality and running BlueZ on older branch requires backporting missing features. Sample Bionic for Android on Intel Architecture (Android-IA) with all required features backported is available at https://code.google.com/p/android-bluez.bionic/ Runtime requirements ==================== BlueZ HAL library requires 'bluetoothd' service to be available on Android system. This can be done by defining service in init.rc file of targeted board: service bluetoothd /system/bin/logwrapper /system/bin/bluetoothd class main group bluetooth net_admin disabled oneshot It is required that bluetooth user could start and stop bluetoothd service by setting 'ctl.start' or 'ctl.stop' property. This can be achieved by whitelisting bluetooth user and bluetoothd service in init source code. Required Android init system modifications can be found at https://code.google.com/p/android-bluez.system-core/ Downloading and building ======================== Building for Android requires full Android AOSP source tree. Sample Android-IA tree with all required components present is available at http://code.google.com/p/android-bluez/ Downloading: repo init -u https://code.google.com/p/android-bluez.manifest/ -m topics/bluez repo sync Build for Intel ultrabook: 'source build/envsetup.sh' 'lunch core_mesa-eng' 'make allimages -j8' After full build is done it is possible to rebuild only BlueZ: 'cd external/bluetooth/bluez/android/' 'mm' (or 'mm -B' to force rebuilding of all files) 'adb sync' to update target device. ============================= Building and running on Linux ============================= It is possible to build and test BlueZ for Android daemon on Linux (eg. PC). Simply follow instructions available at README file in BlueZ top directory. Android daemon binary is located at android/bluetoothd. See next section on how to test Android daemon on Linux. ============ Testing tool ============ BT HAL test tools located in android/haltest is provided for HAL level testing of both Android daemon and HAL library. Start it with '-n' parameter and type 'bluetooth init' in prompt to initialize HAL library. Running without parameter will make haltest try to initialize all services after start. On Android required bluetoothd service will be started automatically. On Linux it is required to start android/bluetoothd manually before init command timeout or use provided android/system-emulator, which takes care of launching daemon automatically on HAL library initialization. To deinitialize HAL library and stop daemon type 'bluetooth cleanup'. Type 'help' for more information. Tab completion is also supported. =========================== Implementation shortcomings =========================== It is possible that some of HAL functionality is missing implementation due to reasons like feature feasibility or necessity for latest Android Framework. This sections provides list of such deficiencies. Note that HAL library is always expected to fully implement HAL API so missing implementation might happen only in daemon. HAL Bluetooth ============= methods: dut_mode_send never called from Android Framework le_test_mode never called from Android Framework get_remote_service_record never called from Android Framework callbacks: dut_mode_recv_cb le_test_mode_cb properties: BT_PROPERTY_SERVICE_RECORD not supported for adapter and device, for device this property is to be returned as response to get_remote_service_record, not sure what to return on get_property calls (records of all services?) BT_PROPERTY_REMOTE_VERSION_INFO information required by this property (LMP information) are not accessible from mgmt interface, also marking this property as settable is probably a typo in HAL header Socket HAL ========== Support only for BTSOCK_RFCOMM socket type.