bluez/android
Ravi kumar Veeramally c5408ef4ac android/hid: Add send data implemention in daemon
Send data on interrupt channel on request from hid host.
2013-11-08 15:28:40 +02:00
..
client android/client: Add ssp key confirmation helper 2013-11-08 15:13:06 +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: Rename a2dp HAL related IPC API to match service name 2013-11-07 17:58:39 +02:00
a2dp.h android: Pass notification socket fd to service handlers 2013-11-07 17:05:47 +02:00
adapter.c android: Remove unnecessary allocations of fixed-size buffers 2013-11-07 22:39:26 +02:00
adapter.h android: Remove includes from adapter.h 2013-11-07 17:05:57 +02:00
Android.mk android: Rename hid.c to hidhost.c 2013-11-07 18:44:57 +02:00
hal-a2dp.c android/hal: Use a2dp instead of av in a2dp HAL 2013-11-07 17:59:01 +02:00
hal-bluetooth.c android/hal: Use a2dp instead of av in a2dp HAL 2013-11-07 17:59:01 +02:00
hal-hidhost.c android/hid: Fill send data command struct in hal-hidhost 2013-11-08 15:28:17 +02:00
hal-ipc-api.txt android/hid: Add missing hid send data parameters in ipc document 2013-11-08 10:29:21 +02:00
hal-ipc.c android/hal: Use hidhost instead of hh in hidhost HAL 2013-11-07 18:45:06 +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/hid: Fill send data command struct in hal-hidhost 2013-11-08 15:23:31 +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: Use hidhost instead of hh in hidhost HAL 2013-11-07 18:45:06 +02:00
hidhost.c android/hid: Add send data implemention in daemon 2013-11-08 15:28:40 +02:00
hidhost.h android: Rename hid.c to hidhost.c 2013-11-07 18:44:57 +02:00
ipc.c android/ipc: Fix crash when sending file descriptor 2013-11-08 11:00:49 +02:00
ipc.h android: Make IPC helpers accept file descriptor 2013-11-07 17:05:07 +02:00
main.c android: Fix PAN service registration 2013-11-08 12:46:03 +02:00
Makefile.am android: Rename hid.c to hidhost.c 2013-11-07 18:44:57 +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.