Commit Graph

58 Commits

Author SHA1 Message Date
Johan Hedberg
23200acf0a android: Fix expected size of hal_ev_ssp_request 2013-11-19 22:35:47 +02:00
Szymon Janc
3e0b74007b android/hal-bluetooth: Remove not needed check in get_adapter_property
Properties types are verified on daemon side and proper error is
returned on wrong type. No need to double check that on HAL side.
2013-11-19 18:26:46 +02:00
Szymon Janc
2399cd19e6 android/hal-bluetooth: Remove not needed check in set_adapter_property
Properties types are verified on daemon side and proper error is
returned on wrong type. No need to double check that on HAL side.
2013-11-19 18:24:49 +02:00
Szymon Janc
d090b7b8e5 android/hal-bluetooth: Handle dut mode receive event
Pass received data to callback if it is present.
2013-11-19 18:24:34 +02:00
Szymon Janc
a293f0e8f4 android/hal-bluetooth: Remove not needed __func__ from debug print
DBG macro already adds function name to print output.
2013-11-19 18:24:12 +02:00
Szymon Janc
697405ef01 android/hal-bluetooth: Add support for dut mode send command
This is used to send test HCI commands when DUT mode is enabled.
2013-11-19 18:22:43 +02:00
Szymon Janc
2fcb0e3903 android/hal-bluetooth: Add support for dut mode configure command
This command is used to enter or exit DUT mode.
2013-11-19 18:22:33 +02:00
Szymon Janc
b43aac26d2 android/hal-bluetooth: Add support for get remote service record cmd 2013-11-19 18:21:57 +02:00
Szymon Janc
d99a0d216f android/hal-bluetooth: Add support for set remote device property cmd
This command is used to set remote device property of specified type.
2013-11-19 18:21:22 +02:00
Szymon Janc
598f60cbd3 android/hal-bluetooth: Add support for get remote device properties cmd
This command is used to get all properties of remote device.
2013-11-19 18:21:11 +02:00
Szymon Janc
c916ed5ff2 android/hal-bluetooth: Add support for get remote device property cmd
This command is used to get remote device property of specifided type.
2013-11-19 18:20:48 +02:00
Szymon Janc
c58070eb1e android/hal-bluetooth: Register IPC message handlers
Register handlers on service init. Since this requires all handlers to
be registered (unknown opcode is considered IPC error) missing handlers
stubs are provided.
2013-11-19 16:42:01 +02:00
Andrei Emeltchenko
d39e947a1f android/debug: Move debug functions to hal-utils.c
Debug functions will be used by HALs and haltest.
2013-11-14 10:27:15 +02:00
Ravi kumar Veeramally
ab8a2ab554 android: Fix opcode parameter type from uint16_t to uint8_t 2013-11-13 11:27:46 +02:00
Szymon Janc
931eb9f16d android/hal: Use a2dp instead of av in a2dp HAL
Match functions names to HAL name. Where not needed av prefix is
removed.
2013-11-07 17:59:01 +02:00
Marcin Kraglak
5658fadf26 android/hal: Send get_remote_services cmd 2013-11-04 10:20:07 +02:00
Andrei Emeltchenko
be06afd877 android/hal: Add extra logs to HAL
Use exported functions from hal test tool to print properties.
2013-11-04 09:29:09 +02:00
Andrei Emeltchenko
c70142b3f4 android/hal: Add debug prints for every HAL callback
This allows us to trace callbacks to Java.
2013-11-01 16:39:07 +02:00
Andrei Emeltchenko
981b04355e android/hal: Handle acl_state_changed event 2013-11-01 16:39:07 +02:00
Szymon Janc
08e6aadd83 android/hal: Add support for repacking received IPC data to HAL data
Some HAL defined types that are passed as type-len-value in properties
callback needs to be repacked at runtime to match defined types.

This is due to HAL using data types without strict refined sizes like
enums or unpacked structures. This is needed only if data is passed as
TLV. With data passed to callbacks as parameters compiler will handle
types convertion.

Currently only enum types are supported.
2013-10-31 10:55:43 +02:00
Jakub Tyszkowski
ccfc207b4f android/hal: Add device state changed event handler
This is used to report property change of already reported remote
device.
2013-10-30 12:11:55 +02:00
Jakub Tyszkowski
56f12d1a33 android/hal: Add device found event handler
This is called when new remote device is found.
2013-10-30 12:11:46 +02:00
Jakub Tyszkowski
66f9de59f3 android/hal: Extract bt property repacking code for further reuse
This extracted part of code can be reused for repacking remote device
properties.
2013-10-30 12:11:33 +02:00
Jakub Tyszkowski
2cbbb5bbb6 android/hal: Add support for handling discovery state change event 2013-10-30 12:11:24 +02:00
Jakub Tyszkowski
98f4e39831 android/hal: Add support for start/cancel device discovery commands 2013-10-30 12:11:13 +02:00
Szymon Janc
556507b49d android/hal: Add support for handling SSP request event 2013-10-29 15:06:08 +02:00
Szymon Janc
10e7618ca5 android/hal: Add support for handling pin request event 2013-10-29 15:05:15 +02:00
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