Commit Graph

16129 Commits

Author SHA1 Message Date
Szymon Janc
a54c1e9259 android/hal-hidhost: Use generic IPC message handling for events
Register handlers on service init and unregister on cleanup.
2013-11-19 16:42:01 +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
Szymon Janc
d7f2a7916f android/hal: Add initial code for IPC message handlers
This will allow to register and unregister handlers for IPC messages
Basic sanity check will be done in common code. Commands with variable
length will be verified against minimum size only.
2013-11-19 16:42:01 +02:00
Andrei Emeltchenko
07ff7758fd android/hal-sock: Print bdaddr string instead of pointer 2013-11-19 16:06:13 +02:00
Bastien Nocera
ffd321f1e1 autopair: Add special handling for printers
As was done in gnome-bluetooth since 2009:
https://git.gnome.org/browse/gnome-bluetooth/commit/?id=7a472c151d44a3378ecbd3c2a75c763f5c577fe9
2013-11-19 15:35:19 +02:00
Ravi kumar Veeramally
0a5ae04d8e android/pan: Fix wrong struct parameter in disconnect function call 2013-11-19 15:23:20 +02:00
Andrei Emeltchenko
e818990935 android/A2DP: Use sdp_data_free for freeing sdp data types 2013-11-19 12:15:51 +02:00
Andrei Emeltchenko
fafd7c20b1 android/A2DP: trivial: Use NULL for zero pointer 2013-11-19 12:15:19 +02:00
Szymon Janc
0ea63051cd profile: Add missing browse group to MAS, MNS and SYNC records
This fix not updating UUIDs when those services are registered.
2013-11-19 12:14:24 +02:00
Andrei Emeltchenko
2022b92090 android: trivial: Add comment making code consistent 2013-11-19 11:16:11 +02:00
Andrei Emeltchenko
bde65270e3 android/socket: Add connect signal to socket
Connect signal is used to pass information to framework that socket
is accepted.
2013-11-19 11:15:49 +02:00
Luiz Augusto von Dentz
9ee7b3dd69 audio/AVCTP: Use A/V_RemoteControl UUID for incoming connections
By the time and incoming connection arrives it is not possible to
determine the role, so this changes the UUID to A/V_RemoteControl which
according to assigned number page bellow is the profile UUID for AVRCP:

https://www.bluetooth.org/en-us/specification/assigned-numbers/service-discovery
2013-11-18 16:27:14 +02:00
Szymon Janc
5a8313a473 android/hal: Verify command status response before processing
This makes HAL IPC code verify error reply before processing it. It
also verify if success status was reported according to IPC spec.
2013-11-18 15:17:24 +02:00
Szymon Janc
fc10c55498 android: Improve IPC helper to not send invalid status response
This fix issue with sending invalid success response from several
places where ipc_send_rsp was used for reporting success. Instead of
using using ipc_send for success response, make helper handle that.
2013-11-18 15:17:22 +02:00
Luiz Augusto von Dentz
d9c8be6132 audio/AVDTP: Remove unused avdtp_set_device_disconnect 2013-11-18 14:10:52 +02:00
Luiz Augusto von Dentz
9c2e54ab07 audio/sink: Remove shutdown parameter from sink_disconnect
This parameter is always false so it never do anything.
2013-11-18 14:10:51 +02:00
Luiz Augusto von Dentz
dd48f0b84f audio/source: Remove shutdown parameter from source_disconnect
This parameter is always false so it never do anything.
2013-11-18 14:10:49 +02:00
Luiz Augusto von Dentz
9e7edd013e audio/AVDTP: Remove public function that are only used locally 2013-11-18 14:10:48 +02:00
Luiz Augusto von Dentz
d439f0536a audio/AVDTP: Remove unused code 2013-11-18 14:10:46 +02:00
Andrei Emeltchenko
f9d15c95af android/a2dp: Use NULL for zero pointer 2013-11-18 13:04:22 +02:00
Andrei Emeltchenko
7d777eda20 android/socket: Use static local adapter address 2013-11-18 10:42:37 +02:00
Andrei Emeltchenko
e94a667739 android/hal-sock: Add debug flag printing 2013-11-18 10:42:18 +02:00
Szymon Janc
2e86eac876 android: Refactor update_found_device function
This makes function flow easier to follow and understand. Besides that
it also fix issue with sending to many bytes if some prop were not
present in EIR.
2013-11-16 20:22:03 +02:00
Szymon Janc
51012a0104 android: Fix sending invalid remote device property event
Remote device property event has variable length, pass whole event
length to ipc_send, not only header.
2013-11-16 20:22:01 +02:00
Szymon Janc
ff7246fb8f android: Fix sending remote device property if name is not present
This fix missing bdaddr to string convertion if name was NULL. This
was resulting in using undefined dst value.
2013-11-16 20:21:59 +02:00
Marcel Holtmann
b3203173bc Release 5.11 2013-11-15 15:07:36 -08:00
Marcel Holtmann
40a960d2e4 build: Update library version 2013-11-15 14:53:53 -08:00
Marcel Holtmann
97e344952f lib: Update company identifiers 2013-11-15 14:52:53 -08:00
Lukasz Rymanowski
ba310d7f90 android: Change TODO with explaining comment 2013-11-15 20:23:38 +02:00
Lukasz Rymanowski
e623075212 android: Update bond state on auth and connect failed 2013-11-15 20:22:23 +02:00
Lukasz Rymanowski
818d532ba3 android: Cache device name on device list. 2013-11-15 20:20:51 +02:00
Lukasz Rymanowski
e9d43a87fa android: Update bond state on incoming bonding
Before sending any ssp request or pin code request up to HAL library we
need to send bond state change with bonding state. Otherwise incoming
bonding is not correctly handled by Bluetooth.apk.
In this patch also device list has been added in order to e.g track
bonding state.

Note: For incoming paring (security mode 3) there is a  need to send
HAL_EVE_REMOTE_DEVICE_PROPS before HAL_EV_PIN_REQUEST.
It is because Android will crash due to bug in pinRequestCallback
function in java. Android checks if device is already in HashMap and if
not then creates  device, but forget to use that one, but instead do
operations on NULL. By sending HAL_BOND_STATE_BONDING event it works
better but we have race issue. It is because new device is added to
HashMap not in callback context but later after BONDING msg will be
received  by BondStateMachine. If it happens before pin_request_cb hits
java then we are fine, otherwise not. So for that reason we send
HAL_EV_REMOTE_DEVICE_PROPS so in the java handler class new device will
be added to HashMap in the  callback context.

In ssp case we don't have this problem as we send device found once acl
is created.
2013-11-15 20:19:50 +02:00
Szymon Janc
e30125fa92 android: Fix not storing adapter index in index added event
If controller was addded after daemon start its index was not stored
resulting in mgmt commands to be always send to MGMT_INDEX_NONE index.
2013-11-15 14:44:10 +02:00
Ravi kumar Veeramally
32776f33d2 android/hal-ipc: Add pan notification call to hal-ipc dispatch handler 2013-11-15 12:02:39 +02:00
Ravi kumar Veeramally
017aa01531 android/pan: Fix wrong HAL service id 2013-11-15 12:02:36 +02:00
Luiz Augusto von Dentz
711331d28f android/a2dp: Add implementation of SDP record
This adds the following record:

Service Name: Audio Source
Service RecHandle: 0x10001
Service Class ID List:
  "Audio Source" (0x110a)
Protocol Descriptor List:
  "L2CAP" (0x0100)
    PSM: 25
  "AVDTP" (0x0019)
    uint16: 0x103
Profile Descriptor List:
  "Advanced Audio" (0x110d)
    Version: 0x0103
2013-11-14 17:27:48 +02:00
Johan Hedberg
d311204d6d android/build: Remove unnecessary mentions of source files in EXTRA_DIST 2013-11-14 15:57:27 +02:00
Johan Hedberg
4fc1a0cfd1 android/build: Add missing header files to android_haltest_SOURCES 2013-11-14 15:57:03 +02:00
Szymon Janc
9ad9540f7d android: Rename bluetooth service functions to match service name
Make public functions match service name.
2013-11-14 14:58:16 +02:00
Szymon Janc
c060fc6976 android: Rename adapter.c to bluetooth.c
Match service name that is implemened in that file. This will also
keep convention of foo.c and hal-foo.c implementing remote parts of
same service.
2013-11-14 14:57:56 +02:00
Szymon Janc
3419cd2118 android: Remove not needed bt_adapter_get_address function
All services receive adapter address on init so there is no need for
this function. Removing it will also help keeping services not depend
on adapter service.
2013-11-14 14:55:30 +02:00
Szymon Janc
3be6d4a82f android: Report adapter address in adapter_ready callback
Adapter is not going to change while daemon is running so its address
can be stored after init is complete.
2013-11-14 14:55:30 +02:00
Szymon Janc
a332daeba9 android/hidhost: Use adapter address provided on register
There is no need to use bt_adapter_get_address every time local address
is needed.
2013-11-14 14:55:30 +02:00
Szymon Janc
cd1dd51f79 android: Don't use static pointer for storing adapter_ready callback
There is no need to keep ready callback for daemon lifetime as it is
not used after reporting adapter being ready. Use mgmt library feature
for passing user data so that static pointer is not needed.
2013-11-14 14:55:30 +02:00
Szymon Janc
e809154eba android: Move adapter initialization to adapter.c
There is no need to handle that in main.c. Also this removes mgmt
interface dependency from adapter API as all mgmt commands are handled
from adapter code.

Startup and shutdown timeouts handling is left in main.c.
2013-11-14 14:55:30 +02:00
Szymon Janc
73e110b5b0 android: Make adapter static
Only one controller is used so there is no need to keep it as allocable
structure. This will also make memory management simpler and more
correct eg. adapter was never free.

Elements not directly related to adapter are kept outside of adapter
structure.
2013-11-14 14:55:30 +02:00
Luiz Augusto von Dentz
f3f7b7229c core: Do not change service state in btd_service_connect if it fails
If .connect fails and the service state changes it may re-enter
connect_next, inverting the order and messing up the error of each
connect request.
2013-11-14 14:55:30 +02:00
Luiz Augusto von Dentz
41599b1d3b android/a2dp: Add initial implementation of HAL_OP_A2DP_DISCONNECT 2013-11-14 14:25:39 +02:00
Luiz Augusto von Dentz
9cb73c97f8 android/a2dp: Add initial implementation of HAL_OP_A2DP_CONNECT 2013-11-14 14:25:24 +02:00
Luiz Augusto von Dentz
46c8cd97fc android/a2dp: Add initial implementation of socket handling
This adds initial code to handle incoming connection and notifying
connection states.
2013-11-14 14:20:53 +02:00