what to do with hciattach for USB bluetooth?

1,152 views
Skip to first unread message

Lay

unread,
Oct 17, 2010, 11:22:55 PM10/17/10
to android-porting
Dear Android experts,

I am using USB bluetooth on Android. I have finally gotten USB
bluetooth to work using command-line only. Bluetooth cannot be enabled
from the UI.

I suspect that hciattach is the cause because hciattach only works on
UART. What should I do with hciattach if I am not using UART
interface? What to do with hciattach for USB interface? Has someone
tried this before?

Thank you.

Pavan Savoy

unread,
Oct 18, 2010, 12:28:55 AM10/18/10
to light...@gmail.com, android-porting
disabling starting of hciattach service from the
system/bluetooth/bluedroid/bluetooth.c or take a cleaner approach of
having the hciattach service do nothing, as in ...

service hciattach "echo usb bluetooth, nothing to do!!' or something like,
service hciattach /system/bin/hciattach -l
user root
# changing user to root from bluetooth is a potential security issue
# service hciattach_legacy is used instead of hciattach because, we dont
# have nodes named ttyHS0
group bluetooth net_bt_admin misc
disabled
oneshot

> --
> unsubscribe: android-porti...@googlegroups.com
> website: http://groups.google.com/group/android-porting
>

--
--Pavan Savoy

Lay

unread,
Oct 18, 2010, 4:27:06 AM10/18/10
to android-porting
Hi,

Thank you. I have tried to add the lines below to my init.rc file.
However, the result is still the same.

service hciattach /system/bin/hciattach -l
user root
group bluetooth net_bt_admin misc
disabled
oneshot

Whenever I try to enable Bluetooth on the UI, I get the messages
below;

D/BluetoothService( 896): Bluetooth state 10 -> 11

I/StatusBarPolicy( 896): received intent
android.bluetooth.adapter.action.STATE_CHANGED
D/BluetoothService( 896): Bluetooth state 11 -> 10

I/StatusBarPolicy( 896): received intent
android.bluetooth.adapter.action.STATE_CHANGED
V/BluetoothEventRedirector( 1148): Received
android.bluetooth.adapter.action.STATE_CHANGED
V/BluetoothEventRedirector( 1148): Received
android.bluetooth.adapter.action.STATE_CHANGED

Could there be something with the Android framework or app settings
that I need to modify? I am using USB bluetooth.

Pavan Savoy

unread,
Oct 18, 2010, 12:09:37 PM10/18/10
to light...@gmail.com, android-porting
Can you try commenting out the rfkill and the hciattach from the bluedroid?
leave only the bluetoothd to start on turning on bluetooth ....

yes, I agree the current android's bluedroid is not easy for the USB
bluetooth devices, but it shouldn't be too difficult either...

Ash

unread,
Oct 19, 2010, 11:00:21 AM10/19/10
to android-porting
Yes, "try commenting out the rfkill and the hciattach from the
bluedroid?" works fine.

May be one should propose changes in bluetooth.c, it is not transport
independent.

May be rfkill module can be moved into bluez kernel portion and radio
power could be controlled using Bluetooth ON and Bluetooth OFF (which
can be done using hciattach tool).

This would not only help android but also to other platforms which are
using bluez and still uses proprietary drivers for Bluetooth radio
power control. Hope this can and would happen soon..
Reply all
Reply to author
Forward
0 new messages