bluez/android
2013-11-07 17:07:24 +02:00
..
client android/client: Fix build for android 4.3 2013-11-05 14:55:37 +02:00
cutils android: Allow connect() for property_set to fail 2013-11-01 03:18:47 -07:00
hardware android: Copy the KitKat Bluetooth hardware headers 2013-11-01 06:24:55 -07:00
a2dp.c android: Pass notification socket fd to service handlers 2013-11-07 17:05:47 +02:00
a2dp.h android: Pass notification socket fd to service handlers 2013-11-07 17:05:47 +02:00
adapter.c android: Use BASELEN define for property changed 2013-11-07 17:07:24 +02:00
adapter.h android: Remove includes from adapter.h 2013-11-07 17:05:57 +02:00
Android.mk android: Suppress compiler warnings not enabled by autotools build 2013-11-05 13:04:00 +02:00
hal-av.c android/hal-av: Fix command struct names 2013-10-28 12:58:56 +02:00
hal-bluetooth.c android/hal: Send get_remote_services cmd 2013-11-04 10:20:07 +02:00
hal-hidhost.c android/hid: Fix get report buffer size variable name 2013-11-06 10:31:31 +02:00
hal-ipc-api.txt android/hid: Add missing set report parameters to ipc document 2013-11-06 10:24:43 +02:00
hal-ipc.c android/hal-hidhost: Add implementation of .connection_state_cb 2013-10-31 15:00:10 +02:00
hal-ipc.h android: Make hal_ipc_command return directly the status 2013-10-22 17:18:02 +03:00
hal-log.h android: Add wrapper for HAL logging 2013-10-20 22:37:59 +03:00
hal-msg.h android/hal: Rename hal_op_sock_listen to hal_cmd_sock_listen 2013-11-07 10:09:54 +02:00
hal-pan.c android/hal-pan: Add implementation of .disconnect 2013-10-28 14:43:24 +02:00
hal-sock.c android/hal: Rename hal_op_sock_listen to hal_cmd_sock_listen 2013-11-07 10:09:54 +02:00
hal.h android/hal-hidhost: Add implementation of .connection_state_cb 2013-10-31 15:00:10 +02:00
hid.c android: Pass notification socket fd to service handlers 2013-11-07 17:05:47 +02:00
hid.h android: Pass notification socket fd to service handlers 2013-11-07 17:05:47 +02:00
ipc.c android: Make IPC helpers accept file descriptor 2013-11-07 17:05:07 +02:00
ipc.h android: Make IPC helpers accept file descriptor 2013-11-07 17:05:07 +02:00
main.c android: Use payload member to access message data 2013-11-07 17:06:05 +02:00
Makefile.am android: Remove useless device.{c,h} files 2013-11-06 16:39:55 +02:00
pan.c android: Pass notification socket fd to service handlers 2013-11-07 17:05:47 +02:00
pan.h android: Pass notification socket fd to service handlers 2013-11-07 17:05:47 +02:00
README android: Add README file with instructions 2013-10-30 11:15:21 +02:00
socket.c android: Pass notification socket fd to service handlers 2013-11-07 17:05:47 +02:00
socket.h android: Pass notification socket fd to service handlers 2013-11-07 17:05:47 +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 and type 'adapter init' in
prompt to initialize HAL library. On Android required bluetoothd service will
be started automatically. On Linux it is required to start android/bluetoothd
manually before init command timeout. To deinitialize HAL library and stop
daemon type 'adapter cleanup'. Type 'help' for more information. Tab completion
is also supported.