Commit Graph

19628 Commits

Author SHA1 Message Date
Szymon Janc
2c2e873870 android/gatt: Fix not sending notification on get included service
If there was and error notification with GATT error status should be
send.
2014-06-26 11:15:31 +02:00
Szymon Janc
2520ba8587 android/gatt: Fix not sending notification if no included services 2014-06-26 11:15:30 +02:00
Ravi kumar Veeramally
ebf5439c30 android/health: Provide a helper funtion to search channel by id 2014-06-26 11:15:25 +02:00
Ravi kumar Veeramally
09d30507f0 android/hal-health: Return app_id and channel_id -1 in case of error
Right now returning only status of request but java layer expecting
-1 for app_id and channel_id in failure case.
2014-06-26 10:56:26 +02:00
Ravi kumar Veeramally
a0ec9aee8f android/health: Rename matching functions 2014-06-26 10:28:18 +02:00
Petri Gynther
8186b39293 core: Fix adapter_connect_list_add()
adapter_connect_list_add() needs to ensure that trigger_passive_scanning() is
called even for existing devices on the connect list.

This issue can be seen with BLE HoG remotes trying to reconnect to BlueZ. If
the connection fails, att_error_cb() adds the failed device back to connect
list, but since the device is already on the list, no code ends up calling
trigger_passive_scanning(). After this point, passive scanning is disabled
and remains disabled for good, and BLE reconnects to BlueZ no longer work.

bluetoothd[931]: src/adapter.c:device_found_callback() hci0 addr ...
bluetoothd[931]: src/device.c:device_set_legacy() legacy 0
bluetoothd[931]: src/adapter.c:stop_passive_scanning()
bluetoothd[931]: src/adapter.c:stop_passive_scanning_complete() status 0x00 (Success)
bluetoothd[931]: src/device.c:device_connect_le() Connection attempt to: ...
bluetoothd[931]: src/adapter.c:discovering_callback() hci0 type 6 discovering 0
bluetoothd[931]: src/adapter.c:connect_failed_callback() hci0 ... status 2
bluetoothd[931]: plugins/policy.c:conn_fail_cb() status 2
bluetoothd[931]: src/adapter.c:bonding_attempt_complete() hci0 bdaddr ... type 1 status 0x2
bluetoothd[931]: src/device.c:device_bonding_complete() bonding (nil) status 0x02
bluetoothd[931]: src/device.c:device_bonding_failed() status 2
bluetoothd[931]: src/adapter.c:resume_discovery()
bluetoothd[931]: src/device.c:att_connect_cb() connect error: Transport endpoint is not connected (134)
bluetoothd[931]: src/device.c:att_error_cb() Enabling automatic connections
bluetoothd[931]: src/adapter.c:adapter_connect_list_add() ignoring already added device ...
... passive scan is disabled and remains disabled for good ...
2014-06-26 10:54:54 +03:00
Petri Gynther
a3e66a6b74 core: Fix discovering_callback()
discovering_callback() should not call trigger_passive_scanning() when
outgoing BLE connection is pending.

This issue can be seen with BLE HoG devices trying to reconnect to BlueZ:
bluetoothd[931]: src/adapter.c:device_found_callback() hci0 addr ...
bluetoothd[931]: src/device.c:device_set_legacy() legacy 0
bluetoothd[931]: src/device.c:device_set_rssi() rssi -75
bluetoothd[931]: src/adapter.c:stop_passive_scanning()
bluetoothd[931]: src/adapter.c:discovering_callback() hci0 type 6 discovering 0
bluetoothd[931]: src/adapter.c:trigger_passive_scanning()
bluetoothd[931]: src/adapter.c:stop_passive_scanning_complete() status 0x0b (Rejected)
bluetoothd[931]: Stopping passive scanning failed: Rejected
2014-06-26 10:54:54 +03:00
Petri Gynther
61fd5a8e12 core: Fix stop_passive_scanning_complete()
Consider MGMT_STATUS_REJECTED as success for stop_passive_scanning().
MGMT_STATUS_REJECTED may be returned from kernel because the passive
scan timer had expired in kernel and passive scan was disabled just
around the time we called stop_passive_scanning().

This issue can be seen with BLE HoG devices trying to reconnect to BlueZ:
bluetoothd[931]: src/adapter.c:device_found_callback() hci0 addr ...
bluetoothd[931]: src/device.c:device_set_legacy() legacy 0
bluetoothd[931]: src/device.c:device_set_rssi() rssi -75
bluetoothd[931]: src/adapter.c:stop_passive_scanning()
bluetoothd[931]: src/adapter.c:discovering_callback() hci0 type 6 discovering 0
bluetoothd[931]: src/adapter.c:trigger_passive_scanning()
bluetoothd[931]: src/adapter.c:stop_passive_scanning_complete() status 0x0b (Rejected)
bluetoothd[931]: Stopping passive scanning failed: Rejected
2014-06-26 10:54:54 +03:00
Luiz Augusto von Dentz
e847a85605 android/hog: Fix using invalid range for external report 2014-06-26 09:44:44 +02:00
Andrei Emeltchenko
e181b40d7c android/health: Fix setting wrong PSM for SDP record 2014-06-26 09:42:55 +02:00
Luiz Augusto von Dentz
8cdfae35c1 android/hog: Fix code style 2014-06-25 17:36:05 +02:00
Luiz Augusto von Dentz
ab063ec8c6 android/hidhost: Add hid_device_new helper function 2014-06-25 17:36:05 +02:00
Andrei Emeltchenko
16e27fa445 android/health: Add setting mcl callbacks for incoming connection
For incoming connection NULL is passed as argument since application is
not known yet.
2014-06-25 17:29:55 +02:00
Andrei Emeltchenko
c701a30bbe android/health: Refactor create_device
create_device() should not search for apps again since we have searched
already, and we do not have always app_id.
2014-06-25 17:29:55 +02:00
Andrei Emeltchenko
f756b74ba4 android/health: Add actual error message to error print 2014-06-25 17:29:55 +02:00
Andrei Emeltchenko
32180fa3a6 android/health: Refactor setting mcl callbacks to function
Function will be used in other places as well.
2014-06-25 17:29:55 +02:00
Andrei Emeltchenko
c2cb1bf8c8 android/health: trivial: Fix missing space 2014-06-25 17:29:54 +02:00
Andrei Emeltchenko
90d3512560 android/health: Remove extra check
gerr is always set on error condition.
2014-06-25 17:29:54 +02:00
Andrei Emeltchenko
a1d44da044 android/health: trivial: Remove empty line 2014-06-25 17:29:54 +02:00
Andrei Emeltchenko
fddcaa4833 android/health: Fix missing error check 2014-06-25 17:29:54 +02:00
Andrei Emeltchenko
ee86b4a255 android/health: Fix possible overflow 2014-06-25 17:29:54 +02:00
Andrei Emeltchenko
1403ec3781 android/health: Remove unneeded check
In case of error err is always set so the check is not needed.
2014-06-25 17:29:54 +02:00
Andrei Emeltchenko
e8bb8f1e1d android/hal-health: trivial: Correct coding style 2014-06-25 17:29:54 +02:00
Andrei Emeltchenko
961cbdfe13 android/gatt: Remove dead code
The code apparently left after wrong rebase as it duplicates code
several lines above.
2014-06-25 17:15:32 +02:00
Andrei Emeltchenko
054f3bcf05 android/gatt: Fix wrong size argument
Instead of sizeof of (uint8_t *) pass real length, though for that
function it doesn't matter at this point.
2014-06-25 17:15:32 +02:00
Szymon Janc
374d7a37da android/cts: Update tests results with CTS 4.4 R3
No LE GATT tests were run yet.
2014-06-25 16:51:54 +02:00
Andrei Emeltchenko
09b9afbbea HDP: Fix NULL check
Improves readability of the code using similar check for not NULL.
2014-06-25 12:26:19 +03:00
Andrei Emeltchenko
dc95c60e08 HDP: trivial: Remove empty lines 2014-06-25 12:26:15 +03:00
Andrei Emeltchenko
333dacef05 HDP: Fix possible memory leak 2014-06-25 12:26:11 +03:00
Andrei Emeltchenko
ba5442362d mcap: Fix possible overflow 2014-06-25 12:25:58 +03:00
Andrei Emeltchenko
eaebd5db40 HDP: Fix checking always constant error code
Function sdp_set_add_access_protos() always returns 0, so there is no
sense to check for error code.
2014-06-25 12:25:55 +03:00
Andrei Emeltchenko
0a295fa8ea HDP: Fix checking always constant error code
sdp_set_access_protos() always returns 0, there is no sense to check for
error code. Fixes compile warnings.
2014-06-25 12:25:47 +03:00
Andrei Emeltchenko
faf90d0d52 HDP: Remove extra debug statements
DBG() includes function name by default, so including it is not needed.
2014-06-25 12:25:18 +03:00
Szymon Janc
2ea7214869 android/bluetooth: Log error if loading LTKs or IRKs failed 2014-06-24 22:40:14 +02:00
Szymon Janc
df257c1950 android/gatt: Use proper address when connecting
If device was using RPA but address was resolved IDA must be used.
2014-06-24 22:40:14 +02:00
Szymon Janc
aea4b868b9 android/bluetooth: Map RPA to Identity address on New IRK event
This patch allows to pair with devices using RPA. There is no API
to notify HAL about new Identity Address. When New IRK event is
received ID address is stored in device and map to RPA is done.
This allows to use RPA after address was resolved making this
transparent to Android Framework. When daemon is restarted device
is advertised to Framework with ID address.
2014-06-24 22:40:14 +02:00
Szymon Janc
edb033a01b android/bluetooth: Add get_device_android_addr helper
This will be used to fake address for Android Framework.
2014-06-24 22:40:14 +02:00
Szymon Janc
fded4d3716 android/bluetooth: Fix passing address type to SSP replies 2014-06-24 22:40:14 +02:00
Szymon Janc
d3e7e6f546 android/bluetooth: Pass device to send_bond_state_change function 2014-06-24 22:40:14 +02:00
Szymon Janc
36d29fc88f android/bluetooth: Add helper for finding device with android address 2014-06-24 22:40:14 +02:00
Grzegorz Kolodziejczyk
a0ad13ddd2 android/hidhost: Fix adding hidhost device on devices list
Create hog connection cb functionality tried to operate on stored on
list hidhost device. Adding hidhost device to list should be done
before operating on it.

It caused sending bogus connecting state change.
2014-06-24 11:48:15 +02:00
Ravi kumar Veeramally
162f3f64db android/health: Update PTS results
Update test results for TC_SRC_CC_BV_03_C, TC_SRC_CC_BV_07_C,
TC_SNK_CC_BV_04_C, TC_SNK_HCT_BV_01_I, TC_SNK_CC_BV_08_C and
TC_SRC_HCT_BV_01_I.
2014-06-24 10:20:12 +02:00
Ravi kumar Veeramally
ef7e4c3796 android/client: Write dummy data on fd on health source connect
PTS expects dummy data on fd when it connects in source role.
2014-06-24 10:19:17 +02:00
Ravi kumar Veeramally
1a384796a5 android/client: Fix coding style 2014-06-24 10:19:02 +02:00
Ravi kumar Veeramally
36c0227f52 android/health: Fix error messages 2014-06-24 10:19:02 +02:00
Ravi kumar Veeramally
5503e3ae0e android/health: Fix wrong mdep config index
MDEP Id starts from 1, (0 value for Echo). HAL api sends mdep cfg index
which starts from 0.
2014-06-24 10:19:02 +02:00
Luiz Augusto von Dentz
ee675de191 android/pics: Do not set Suspend feature in HOGP
This requires integration with Android power management so leave it out
for now.
2014-06-24 09:50:55 +02:00
Luiz Augusto von Dentz
33a5353e06 android/pics: Fix having both types of discover set in HOGP
Currently the code discover by service handle and not by UUID.
2014-06-24 09:50:43 +02:00
Szymon Janc
59a17e31ce android/client: Fix closing wrong FD in health HAL 2014-06-23 15:29:11 +02:00
Andrei Emeltchenko
e61fc2565e core: Fix using address of array instead of size
The dev->name variable is an array, so the address of it can never be
NULL.
2014-06-23 14:37:28 +03:00