Commit Graph

31 Commits

Author SHA1 Message Date
Szymon Janc
b201633af3 android/hal: Add support for handling bond state change event 2013-10-29 14:11:42 +02:00
Szymon Janc
2abdd0364c android/hal: Set callbacks before initializing IPC
Notification thread is started on IPC init and it can be scheduled
before main thread.

Fix following crash on HAL init:

pid: 3392, tid: 3492, name: droid.bluetooth  >>> com.android.bluetooth <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000028
    eax 00000000  ebx ce047f64  ecx ce0405d0  edx f7763724
    esi cdf3af00  edi f837fb90
    xcs 00000023  xds 0000002b  xes 0000002b  xfs 00000000  xss 0000002b
    eip ce042289  ebp cdf3a9f8  esp cdf3a9e0  flags 00010292

backtrace:
    #00  pc 00003289  /system/lib/hw/bluetooth.default.so (bt_thread_associate+25)
    #01  pc 000015f8  /system/lib/hw/bluetooth.default.so (notification_handler+40)
    #02  pc 0000f804  /system/lib/libc.so (__thread_entry+276)
    #03  pc 0002999d  /system/lib/libc.so
    #04  pc 00082ae7  /system/lib/libdvm.so (dvmThreadSelf()+39)
    #05  pc 00010db9  /system/lib/libc.so (pthread_mutex_unlock+25)
2013-10-29 14:03:39 +02:00
Andrei Emeltchenko
eb53c75bec android/hal: Use debug helpers from hal client
Debug helpers really helps a lot when debugging on Android target. The
patch uses helper functions already defined for hal test tool so
we do not need to reimplement them.
2013-10-27 13:17:53 +02:00
Andrei Emeltchenko
81af6f918c android/hal: Use defined function to check that interface is ready 2013-10-27 13:17:53 +02:00
Andrei Emeltchenko
39bf745e92 android/hal: Associate thread to Java
Without thread assiciation callbacks are not received by Java.
They are blocked by JNI:
E/BluetoothServiceJni( 2844): Callback env check fail: env: 0x0, callback: 0x0
E/BluetoothServiceJni( 2844): Callback: 'adapter_state_change_callback' is not
called on the correct thread
2013-10-25 16:08:04 +03:00
Szymon Janc
1c0d8eefac android/hal: Add support for handling adapter properties change event 2013-10-25 15:00:29 +03:00
Szymon Janc
ea73f7b785 android/hal: Add support for sending adapter SSP reply command
This allows HAL to reply to SSP request.
2013-10-25 15:00:29 +03:00
Szymon Janc
6748668dc7 android/hal: Add support for sending adapter PIN reply command
This allows HAL to reply to PIN code request.
2013-10-25 14:28:57 +03:00
Szymon Janc
c853f60dd1 android/hal: Add support for sending adapter remove bond command
This allows HAL to remove bonding.
2013-10-25 14:28:52 +03:00
Szymon Janc
6312df1ed5 android/hal: Add support for sending cancel bond command
This allows HAL to cancel pending bonding.
2013-10-25 14:28:47 +03:00
Szymon Janc
34043763e3 android/hal: Add support for sending create bond command
This allows HAL to start bonding.
2013-10-25 14:28:42 +03:00
Szymon Janc
0e35111ec4 android/hal: Add support for sending adapter get properties command
This allows HAL to get all adapter properties.
2013-10-25 14:28:36 +03:00
Szymon Janc
0c5d044175 android/hal: Add support for sending adapter get property command
This allows HAL to get adapter property.
2013-10-25 14:28:30 +03:00
Szymon Janc
32e236d70e android/hal: Add support for sending adapter set property command
This allows HAL to set adapter property.
2013-10-25 14:28:25 +03:00
Luiz Augusto von Dentz
55a25cb83c android/hal-msg: Reduce length of defines and struct names
The current defines and struct names are way too big and sometimes
incosistent.
2013-10-24 10:46:24 +03:00
Andrei Emeltchenko
d60490a7c3 android: Enable AV interface
Include av_interface to get_interface function.
2013-10-24 10:24:24 +03:00
Szymon Janc
1cb38bbfdd android/hal: Use correct service id for adapter commands
This fix enabling and disabling adapter commands.
2013-10-22 23:17:46 +03:00
Johan Hedberg
3783dab083 android: Update bluetooth HAL to match the new hal_ipc_cmd API 2013-10-22 17:18:56 +03:00
Szymon Janc
058537f9aa adapter/hal: Implement adapter disable call 2013-10-22 16:58:21 +03:00
Szymon Janc
e9336144bb adapter/hal: Implement adapter enable call 2013-10-22 16:55:01 +03:00
Szymon Janc
76384da137 android/hal: Unify HALs callbacks pointers definition
Those are not suppose to be modified or used outside of each HAL.
2013-10-22 16:51:07 +03:00
Szymon Janc
5258fa30a4 android/hal: Add initial support for handling adapter notifications
Only adapter state callback is handled for now.
2013-10-22 16:17:26 +03:00
Szymon Janc
3917177c40 android/hal: Make hal.h self contained 2013-10-22 16:17:26 +03:00
Szymon Janc
385e1e4f25 android: Improve hal_ipc_cmd helper
Handle error response inside helper so that users don't expecting any
response don't need to provide dummy buffer only for error (which is
already return value of helper).
2013-10-22 10:32:41 +03:00
Szymon Janc
e28c3072bd android/hal: Register adapter and socket interface on HAL init
After daemon is started HAL needs to register those two interfaces
to performe initialization procedure as described in IPC documentation.
2013-10-21 22:46:19 +03:00
Szymon Janc
2b9988f3f7 android/hal: Move IPC and sockets related code to separate file
hal-ipc will provide functionality related to IPC initialization and
sockets handling (including upcoming callbacks thread).

This allow to remove code from bluetooth HAL not related to adapter.
2013-10-21 22:45:28 +03:00
Szymon Janc
8241f7de72 android: Use hal-log.h for logging in bluetooth HAL
This will allow to log both on Android and Linux (in haltest).
2013-10-20 22:38:23 +03:00
Szymon Janc
d0cd4f3fd6 android: Make HAL library wait for daemon to connect on init
After starting up, daemon is responsible for connecting to HAL library.
If this doesn't happen before timeout occured init will fail.
2013-10-20 22:34:55 +03:00
Andrei Emeltchenko
631304f92b android: Add PAN skeleton
Add skeleton for pan Android HAL. This is modified version
from Frederic Danis earlier patch set.
2013-10-18 14:30:14 +03:00
Andrei Emeltchenko
537d14b68d android: Add HID Host skeleton
Add skeleton for hidhost Android HAL. This is modified version
from Frederic Danis earlier patch set.
2013-10-18 14:30:14 +03:00
Andrei Emeltchenko
705b0cd2ff android: Rename hal_bluetooth.c to hal-bluetooth.c 2013-10-18 14:30:14 +03:00