bluez/android
Andrei Emeltchenko 4a60ca797e android/tester: Check status returned from HAL calls
In test setup phase check status returned from  enable() call.
2013-12-18 12:23:14 +02:00
..
client android/haltest: Add uuid autocompletions 2013-11-26 17:42:36 +02:00
cutils android: Allow connect() for property_set to fail 2013-11-01 03:18:47 -07:00
hardware android/audio: Add kitkat audio headers 2013-12-16 17:41:56 +02:00
system android/audio: Add kitkat audio headers 2013-12-16 17:41:56 +02:00
a2dp.c android/a2dp: Fix possible NULL dereference 2013-12-08 17:31:58 +02:00
a2dp.h android/a2dp: Use generic IPC message handling for commands 2013-12-02 16:24:02 +02:00
android-tester.c android/tester: Check status returned from HAL calls 2013-12-18 12:23:14 +02:00
Android.mk android/audio: Add audio-hal initial skeleton 2013-12-16 17:41:56 +02:00
audio-ipc-api.txt android: Add initial Android Bluetooth Audio protocol API doc 2013-12-16 17:41:49 +02:00
avdtp.c android/AVDTP: Fix not calling callback if GET_CONFIGURATION is rejected 2013-12-05 12:36:03 +02:00
avdtp.h android/AVDTP: Strip dependencies 2013-11-25 16:50:31 +02:00
bluetooth.c android/bluetooth: Add support for getting remote device UUIDs property 2013-12-13 16:53:30 +02:00
bluetooth.h android: Don't pass notification socket on services register 2013-11-28 18:02:27 +02:00
hal-a2dp.c android/a2dp: Unregister ipc handlers if init fails 2013-12-08 17:47:42 +02:00
hal-audio.c android/audio: Add audio-hal initial skeleton 2013-12-16 17:41:56 +02:00
hal-bluetooth.c android: Fix sending status on bluetooth init if already initialized 2013-12-08 17:47:42 +02:00
hal-hidhost.c android/hidhost: Unregister ipc handlers if init fails 2013-12-08 17:47:42 +02:00
hal-ipc-api.txt android/hidhost: Remove deprecated idle opcode from ipc document 2013-11-13 11:26:38 +02:00
hal-ipc.c android/hal: Check if command socket was shutdown by peer 2013-11-19 16:42:02 +02:00
hal-ipc.h android/hal: Add initial code for IPC message handlers 2013-11-19 16:42:01 +02:00
hal-log.h android/tester: Make HAL logging wrapper print to stderr instead of stdout 2013-12-11 13:10:07 +02:00
hal-msg.h android/bluetooth: Add support for reporting adapter type property 2013-12-11 15:37:23 +02:00
hal-pan.c android/pan: Move logic from HAL to daemon 2013-12-08 17:47:42 +02:00
hal-sock.c android/hal-sock: Fix returning incorrect error code 2013-12-13 16:44:30 +02:00
hal-utils.c android/hal-utils: Fix possible NULL pointer dereference 2013-11-25 15:34:15 +02:00
hal-utils.h android/debug: Move debug functions to hal-utils.c 2013-11-14 10:27:15 +02:00
hal.h android/hal-a2dp: Use generic IPC message handling for events 2013-11-19 16:42:02 +02:00
hidhost.c bluetooth/hidhost: Fix using feature event as output event 2013-12-18 10:01:30 +02:00
hidhost.h android/hidhost: Use generic IPC message handling for commands 2013-12-02 16:24:02 +02:00
ipc.c android: Fix missing failure check in ipc_init 2013-12-09 11:34:10 +02:00
ipc.h android: Move sockets handling from main to IPC code 2013-12-03 13:44:04 +02:00
main.c android: Use G_N_ELEMENTS macro for table elements calculation 2013-12-03 13:44:04 +02:00
Makefile.am android/pts: Add PTS test results for MAP 2013-12-17 13:34:40 +02:00
pan.c android/pan: Fix minor white space 2013-12-11 15:27:43 +02:00
pan.h android/pan: Use generic IPC message handling for commands 2013-12-02 16:24:02 +02:00
pics-did.txt android/pts: Remove PIXIT info from PICS files 2013-12-12 10:27:46 +02:00
pics-gap.txt android/pts: Remove PIXIT info from PICS files 2013-12-12 10:27:46 +02:00
pics-hid.txt android/pts: Remove PIXIT info from PICS files 2013-12-12 10:27:46 +02:00
pics-map.txt android/pts: Add PTS PICS and PIXIT for MAP 2013-12-17 13:34:40 +02:00
pics-opp.txt android/pts: Remove PIXIT info from PICS files 2013-12-12 10:27:46 +02:00
pics-pan.txt android/pts: Remove PIXIT info from PICS files 2013-12-12 10:27:46 +02:00
pics-pbap.txt android/pts: Remove PIXIT info from PICS files 2013-12-12 10:27:46 +02:00
pixit-did.txt android/pts: Add PTS PIXIT for DID 2013-12-12 10:27:48 +02:00
pixit-gap.txt android/pts: Add PTS PIXIT for GAP 2013-12-12 10:27:51 +02:00
pixit-hid.txt android/pts: Add PTS PIXIT for HID 2013-12-12 10:27:53 +02:00
pixit-map.txt android/pts: Add PTS PICS and PIXIT for MAP 2013-12-17 13:34:40 +02:00
pixit-opp.txt android/pts: Add PTS PIXIT for OPP 2013-12-12 10:27:54 +02:00
pixit-pan.txt android/pts: Add PTS PIXIT for PAN 2013-12-12 10:27:56 +02:00
pixit-pbap.txt android/pts: Add PTS PIXIT for PBAP 2013-12-12 10:27:58 +02:00
pts-did.txt android/pts: Add PTS test results for DID 2013-12-12 10:27:50 +02:00
pts-gap.txt android/pts: Add PTS test results for GAP 2013-12-13 11:16:10 +02:00
pts-hid.txt android/pts: Add PTS test results for HID 2013-12-13 11:16:20 +02:00
pts-map.txt android/pts: Add PTS test results for MAP 2013-12-17 13:34:40 +02:00
pts-opp.txt android/pts: Add PTS test results for OPP 2013-12-13 11:16:32 +02:00
pts-pbap.txt android/pts: Add PTS test results for PBAP 2013-12-13 11:16:39 +02:00
README android: Update haltest tool entry in README 2013-12-08 17:47:42 +02:00
socket-api.txt android/doc: Add socket-api.txt document 2013-12-08 17:32:05 +02:00
socket.c android/socket: Do not close fd on unref 2013-12-13 16:38:37 +02:00
socket.h android: Don't pass notification socket on services register 2013-11-28 18:02:27 +02:00
system-emulator.c android: Make system-emulator start daemon only once 2013-11-01 06:07:42 -07:00
utils.h android: Add helper functions for converting bdaddr transmitted over IPC 2013-10-28 16:10:42 +02:00

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.