I've made some progress on this by adding the following to init.rc file

chmod 0660 /dev/ttymxc4

chown bluetooth bluetooth /dev/ttymxc4

This has moved things on but it is now failing with a different problem. 

Here's the relevant logcat entry and it shows a D-BUS failure (No Such 
Adapter). This looks like a different issue and so I am going to open a new 
question.


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

V/BluetoothEventRedirector( 2206): Received andrBDP rfkill set power 0

oid.bluetooth.adapter.action.STATE_CHANGED

I/bluedroid( 2084): Starting hciattach daemon

I/bluedroid( 2084): Starting bluetoothd deamon

E/BluetoothEventLoop.cpp( 2084): get_adapter_path: D-Bus error: 
org.bluez.Error.NoSuchAdapter (No such adapter)

E/BluetoothEventLoop.cpp( 2084): failure setting up Event Loop!

E/BluetoothEventLoop.cpp( 2084): get_adapter_path: D-Bus error: 
org.bluez.Error.NoSuchAdapter (No such adapter)

E/BluetoothEventLoop.cpp( 2084): failure setting up Event Loop!

D/BluetoothService( 2084): bt EnableThread giving up

I/bluedroid( 2084): Stopping bluetoothd deamon

BDP rfkill set power 1

I/bluedroid( 2084): Stopping hciattach deamon

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

V/BluetoothEventRedirector( 2206): Received 
android.bluetooth.adapter.action.STATE_CHANGED

 


On Thursday, July 3, 2014 5:12:52 PM UTC+1, Bruno De Paoli wrote:
>
> Hi,
>
> I am attempting to get Bluetooth working on an Android platform. I have 
> got things to the stage where a manual hciattach appears to work ok but an 
> attempt to start Bluetooth via the Android GUI fails and nothing much 
> appears to happen. Android version is 2.3.3. Kernal is 2.6.35.
> I've had a look around the forums about this but everything seems to be 
> set up correctly. Can anyone suggest what the problem is?
>
> Thanks,
> Bruno
>
> Here's the relevant bit of logcat after an attempt to turn Bluetooth on.
>
> D/BluetoothService( 2084): Bluetooth state 10 -> 11
> V/BluetoothEventRedirector( 2194): Received 
> android.bluetooth.adapter.action.STATE_CHANGED
> I/bluedroid( 2084): Starting hciattach daemon
> E/bluedroid( 2084): bt_enable: Timeout waiting for HCI device to come up
> D/BluetoothService( 2084): Bluetooth state 11 -> 10
> V/BluetoothEventRedirector( 2194): Received 
> android.bluetooth.adapter.action.STATE_CHANGED
> W/ActivityManager( 2084): finishReceiver called but active receiver is 
> different
>
>
> Here's the relevant piece from the init.rc file
>
> # Prepare for bluetooth
>     chmod 665 /sys/class/rfkill/rfkill0/state
>     chown bluetooth bluetooth /sys/class/rfkill/rfkill0/state
>     write /sys/class/rfkill/rfkill0/state 0
>
>
> service dbus /system/bin/dbus-daemon --system --nofork
>     socket dbus stream 660 bluetooth bluetooth
>     user bluetooth
>     group bluetooth net_bt_admin
>
> service bluetoothd /system/bin/bluetoothd -n
>     socket bluetooth stream 660 bluetooth bluetooth
>     socket dbus_bluetooth stream 660 bluetooth bluetooth
>     # init.rc does not yet support applying capabilities, so run as root 
> and
>     # let bluetoothd drop uid to bluetooth with the right linux 
> capabilities
>     group bluetooth net_bt_admin misc
>     disabled
>
> service hfag /system/bin/sdptool add --channel=10 HFAG
>     user bluetooth
>     group bluetooth net_bt_admin
>     disabled
>     oneshot
>
> service hsag /system/bin/sdptool add --channel=11 HSAG
>     user bluetooth
>     group bluetooth net_bt_admin
>     disabled
>     oneshot
>
> service opush /system/bin/sdptool add --channel=12 OPUSH
>     user bluetooth
>     group bluetooth net_bt_admin
>     disabled
>     oneshot
>
> service pbap /system/bin/sdptool add --channel=19 PBAP
>     user bluetooth
>     group bluetooth net_bt_admin
>     disabled
>     oneshot
>
> service hciattach /system/bin/hciattach -n -s 115200 /dev/ttymxc4 texas 
> 3000000 flow
>     user bluetooth
>     group bluetooth net_bt_admin
>     disabled
>
> Here's what I get when I do a manual hciattach. (Note I removed the -n 
> option in this case)
>
> # hciattach -s 115200 /dev/ttymxc4 texas 3000000 flow
> [ATH_INFO] (external/bluetooth/bluez/tools/hciattach.c) <init_uart>: 
> Serial port is opened
> [ATH_INFO] (external/bluetooth/bluez/tools/hciattach.c) <init_uart>: Port 
> settings is gotten
> [ATH_INFO] (external/bluetooth/bluez/tools/hciattach.c) <init_uart>: Port 
> settings is set
> [ATH_INFO] (external/bluetooth/bluez/tools/hciattach.c) <init_uart>: 
> Initial baud rate is set
> [ATH_INFO] (external/bluetooth/bluez/tools/hciattach.c) <init_uart>: Break 
> is sent
> Found a Texas Instruments' chip!
> Firmware file : /system/lib/firmware/ti/TIInit_7.6.15.bts
> Sending script to serial device
> Loaded BTS script version 1
> texas: changing baud rate to 3000000, flow control to 1
>
> CCCCCCCCCCCCCCCCCCCCWRCSCCCCCWRCCWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRCCWRWRWRWRWRCCCCCWRWRWRWRWRWRWRWRWRCCCWRCCCCCCCCCCCCCCCWRCCWRCCCWRCCCCWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRCCCCCCWRCCWRCCWRCWRCCCCCCWRCCCC
> [ATH_INFO] (external/bluetooth/bluez/tools/hciattach.c) <init_uart>: 
> u->init is loaded
> [ATH_INFO] (external/bluetooth/bluez/tools/hciattach.c) <init_uart>: 
> Actual baud rate is set
> [ATH_INFO] (external/bluetooth/bluez/tools/hciattach.c) <init_uart>: Line 
> discipline is set
> [ATH_INFO] (external/bluetooth/bluez/tools/hciattach.c) <init_uart>: Ioctl 
> device is set
>
> Added device hci0
> Sending script to bluetooth socket
>
> [ATH_INFO] (external/bluetooth/bluez/tools/hciattach.c) <init_uart>: 
> u->post is loaded
> Device setup complete
>
> # hciconfig
> hci0:   Type: BR/EDR  Bus: UART
>         BD Address: 34:B1:F7:97:8E:CE  ACL MTU: 1021:4  SCO MTU: 180:4
>         UP RUNNING
>         RX bytes:352 acl:0 sco:0 events:10 errors:0
>         TX bytes:45 acl:0 sco:0 commands:10 errors:0
>
>
>
>
>
>
>
>
>

-- 
-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

--- 
You received this message because you are subscribed to the Google Groups 
"android-porting" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-porting+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to