Linux bluetooth development
 help / color / mirror / Atom feed
From: Andrei Emeltchenko <andrei.emeltchenko.news@gmail.com>
To: Szymon Janc <szymon.janc@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v2] android: Add README file with instructions
Date: Tue, 29 Oct 2013 15:07:59 +0200	[thread overview]
Message-ID: <20131029130758.GG27517@aemeltch-MOBL1> (raw)
In-Reply-To: <1383051302-9754-1-git-send-email-szymon.janc@tieto.com>

Hi Szymon,

On Tue, Oct 29, 2013 at 01:55:02PM +0100, Szymon Janc wrote:
> This file cotains help on how BlueZ for Android should be build, run
> and test. Some hints and examples on how BlueZ can be intergrated into
> Android are present as well.
> ---
> V2:
>  - rebased against master
>  - clarify requirements on Android init system  
> 
>  android/Makefile.am |  2 +-
>  android/README      | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 88 insertions(+), 1 deletion(-)
>  create mode 100644 android/README
> 
> diff --git a/android/Makefile.am b/android/Makefile.am
> index 22002be..5690e93 100644
> --- a/android/Makefile.am
> +++ b/android/Makefile.am
> @@ -96,7 +96,7 @@ EXTRA_DIST += android/client/terminal.c \
>  		android/client/history.h \
>  		android/client/terminal.h
>  
> -EXTRA_DIST += android/hal-ipc-api.txt
> +EXTRA_DIST += android/hal-ipc-api.txt android/README
>  
>  EXTRA_DIST += android/hardware/bluetooth.h \
>  		android/hardware/bt_av.h \
> diff --git a/android/README b/android/README
> new file mode 100644
> index 0000000..ada2c2f
> --- /dev/null
> +++ b/android/README
> @@ -0,0 +1,87 @@
> +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 logwrapper /system/bin/bluetoothd

logwrapper cannot be found without the full path:

service bluetoothd /system/bin/logwrapper /system/bin/bluetoothd

> +  class main
> +  group bluetooth net_bt_stack

net_bt_stack seems to be bluedroid specific, currently we use

group bluetooth net_admin

otherwise looks good

Best regards 
Andrei Emeltchenko 

> +  disabled
> +  oneshot
> +
> +It is required that bluetooth user could start and stop bluetoothd service by
> +setting 'ctl.start' or 'ctl.stop' property.
> +
> +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.
> +
> +=======
> +Testing
> +=======
> +
> +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.
> \ No newline at end of file
> -- 
> 1.8.4.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2013-10-29 13:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-29 12:55 [PATCH v2] android: Add README file with instructions Szymon Janc
2013-10-29 13:07 ` Andrei Emeltchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131029130758.GG27517@aemeltch-MOBL1 \
    --to=andrei.emeltchenko.news@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=szymon.janc@tieto.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox