Commit Graph

19030 Commits

Author SHA1 Message Date
Jakub Tyszkowski
c75e5374f7 android/hal: Fix not seting mode in health hal
This fixes the following issue:
==8505== Syscall param socketcall.sendmsg(msg.msg_iov[i]) points to
uninitialised byte(s)
==8505==    at 0x534133D: ??? (syscall-template.S:82)
==8505==    by 0x7756346: hal_ipc_cmd (hal-ipc.c:359)
==8505==    by 0x7750EB2: init (hal-health.c:206)
==8505==    by 0x40DF7F: init_p (if-hl.c:86)
==8505==    by 0x401961: main (haltest.c:417)
==8505==  Address 0x7fefffb81 is on thread 1's stack
2014-05-18 13:58:33 +02:00
Jakub Tyszkowski
3519d60fae android/client: Support sending GATT Server responses
We prepare response by filling btgatt_response_t union's first member
only. The same thing is done by JNI in Android, which ignores second
member. There is also no parameter to tell which union member is set.
More to this, second union member seams to be redundant duplicate of
first member's inner member (broken API?). JNI method is always called
with auth_req set to 0 thus this parameter is omitted in haltest.
2014-05-18 13:58:33 +02:00
Jakub Tyszkowski
c89bc105a0 android/hal: Fix sending not initialised data
As we always send whole gatt_response_t struct through IPC,
but copy only cmd->len bytes, the rest should be initilised to 0.

This fixes the following issue:
==30585== Syscall param socketcall.sendmsg(msg.msg_iov[i]) points
to uninitialised byte(s)
==30585==    at 0x534133D: ??? (syscall-template.S:82)
==30585==    by 0x7756336: hal_ipc_cmd (hal-ipc.c:359)
==30585==    by 0x77546DF: send_response.part.0 (hal-gatt.c:1247)
==30585==    by 0x408119: gatts_send_response_p (if-gatt.c:1777)
==30585==    by 0x40219F: process_line (haltest.c:293)
==30585==    by 0x402552: terminal_action_enter (terminal.c:666)
==30585==    by 0x403184: terminal_process_char (terminal.c:781)
==30585==    by 0x401B90: stdin_handler (haltest.c:308)
==30585==    by 0x402261: poll_dispatch_loop (pollhandler.c:60)
==30585==    by 0x401870: main (haltest.c:441)
==30585==  Address 0x7fefff2a3 is on thread 1's stack
2014-05-18 13:58:33 +02:00
Jakub Tyszkowski
e770585f46 android/gatt: Handle Androids read/write responses in response queue
This is needed for reads like "read by type" to support Android
responses, callback reads and direct db reads in a single request.
2014-05-18 13:58:33 +02:00
Marcel Holtmann
b4755d7f8c lib: Update company identifiers 2014-05-16 15:56:35 -07:00
Antonio Ospite
1783548cf7 plugins/sixaxis: Factor out a calc_leds_bitmap() function
This is also in preparation of set_leds_sysfs().
2014-05-16 14:34:47 +02:00
Antonio Ospite
f6e6850c1e plugins/sixaxis: Factor out a set_leds_hidraw() function
This is in preparation for a set_leds_sysfs() function.

Make set_leds_hidraw() return void, as its return value is never used
by the caller: the setup_leds() callback has to always return FALSE.
2014-05-16 14:34:47 +02:00
Marcin Kraglak
a148b6bbf9 shared/gatt: Fix freeing uninitialized attributes
Don't free uninitialized attributes. It could cause NULL pointer
dereference.
2014-05-16 14:34:29 +02:00
Lukasz Rymanowski
40798ee2cf android/gatt: Fix for read request
If there is no attribute in database we should return immediately.
2014-05-16 14:34:29 +02:00
Szymon Janc
db36dfe7c9 android/bluetooth: Fix minor codestyle issues 2014-05-16 13:22:43 +02:00
Marcin Kraglak
b93c6d5b5f android/gatt: Don't try send responses after process_dev_pending_req()
Process_dev_pending_requests call send_pending_respone, so we don't
have to call it again.
2014-05-16 10:43:59 +02:00
Marcin Kraglak
219bc72b00 android/gatt: Set length to READ_INIT before read request
It is needed while we pass read request to framework.
2014-05-16 10:43:41 +02:00
Marcin Kraglak
474299cd44 android/gatt: Fix reading attribute value
If value and length was set by callback while gatt_db_read(), don't set
length to READ_PENDING. We have to set it only for async callbacks, then
length is still READ_INIT.
2014-05-16 10:43:41 +02:00
Luiz Augusto von Dentz
f0af92e9a9 unit/avrcp-lib: Fix avrcp_get_play_status_rsp
GetPlayStatus PDU start with duration followed by position not the other
way around.
2014-05-16 10:41:40 +03:00
Lukasz Rymanowski
2d4c1d2664 doc: Add description for Get Connection Information command
This patch introduces Get Connection Information command.
2014-05-16 08:06:22 +03:00
Sebastian Chlad
da6bd65993 android/pts: Change mode for SDP pics file 2014-05-15 17:44:43 +02:00
Jakub Tyszkowski
fcb612eff6 android/gatt: Add find by type and value handler
As from database point of view there are two data sources (db entry,
and callbacks), we need to perform 'find by type' in databse and filter
out entries with not matching values, before sending.
2014-05-15 16:22:19 +02:00
Marcin Kraglak
8cf7540f57 shared/gatt: Make 'find_by_type_value' callback compatible
'Find by type and value' was handling only values written directly to
database and not those returned by callbacks or by Android Framework.
This replaces it with 'find by type' and leaves value verification to
the user.
2014-05-15 16:22:19 +02:00
Marcin Kraglak
af9343e785 shared/gatt: Remove unused structure
This structure is no longer used.
2014-05-15 16:22:19 +02:00
Marcin Kraglak
60f00f34dc android/gatt: Change handling of read_by_group_type requests
Use modified version of gatt_db_read_by_group_type which return list
of handles instead of specific data.
2014-05-15 16:22:19 +02:00
Marcin Kraglak
5b04c6fab2 shared/gatt: Retun list of handles in gatt_db_read_by_group_type
Fom now return list of handles instead of specific data.
2014-05-15 16:22:18 +02:00
Marcin Kraglak
4eaf6bfdbe shared/gatt: Add function to get end group handle
This function will return end group handle or zero if attribute
not found.
2014-05-15 16:22:18 +02:00
Marcin Kraglak
3384237290 shared/gatt: Remove unused structure
This structure is no longer used.
2014-05-15 16:22:18 +02:00
Marcin Kraglak
426b67584f android/gatt: Change handling of find_information requests
This uses new version of gatt_db_find_information function which
returns list of handles.
2014-05-15 16:22:18 +02:00
Marcin Kraglak
6537fb763e shared/gatt: Add helper function to get attribute type
This will return uuid with attribute type or NULL if attribute was not
found in database.
2014-05-15 16:22:18 +02:00
Marcin Kraglak
821f10e024 shared/gatt: Modify gatt_db_find_information to return list of handles
For now this function will return list of found handles.
2014-05-15 16:22:18 +02:00
Marcin Kraglak
3677dd9932 shared/gatt: Remove unused structure
This structure is no longer used in gatt_db implementation.
2014-05-15 16:22:18 +02:00
Marcin Kraglak
44a74ed006 android/gatt: Change handling read_by_type requests
For now list of handles is returned from database so we should read each
attribute's value. It uses new way of handling requests from remote
devices.
2014-05-15 16:22:18 +02:00
Marcin Kraglak
a73741c461 shared/gatt: Modify gatt_db_read_by_type to return handles only
For now read_by_type function will just return handles of found attributes.
2014-05-15 16:22:18 +02:00
Marcin Kraglak
f20cfda54c android/gatt: Refactor ATT read operations
This changes device info and gap services callbacks to use response queue.
It will allow them work with plain read and read by type as well.

This starts transition to single response data queue, which should be
filled by various read type functions and processed in one place. This
will unify the way that responses are send, regardless of data source
(value taken directly from database, returned by read callback or sent
from upper layers asynchronously).

We will also introduce 'getter' type functions, using handles to
retrieve data from database. This will make various read and find
operations return handles instead of their own custom structures,
different for every operation performed.
2014-05-15 16:22:16 +02:00
Marcin Kraglak
02c6fdc7d2 shared/gatt: Extend gatt_db_read function
If value exists in database, return pointer to it instead of returning
false. It is needed because some attributes don't have read_cb callback
and their value can be read directly from database.
2014-05-15 16:21:10 +02:00
Johan Hedberg
4d1d63777c core: Fix missing static declaration for main_conf 2014-05-15 17:02:10 +03:00
Johan Hedberg
da90eb1e81 core: Make use of device_set_[bearer]_support functions 2014-05-15 16:12:47 +03:00
Johan Hedberg
a74268601e core: Simplify device lookup logic in update_found_devices() 2014-05-15 16:12:47 +03:00
Johan Hedberg
033f0b92d3 core: Fix updating bearer support when looking up devices 2014-05-15 16:12:47 +03:00
Johan Hedberg
aa5223d662 core: Fix matching based on public address regardless of bearer 2014-05-15 16:12:47 +03:00
Johan Hedberg
1479dd29ac core: Add API to set LE support for a device 2014-05-15 16:12:46 +03:00
Johan Hedberg
625fe7d94c core: Fix device_set_bredr_support to update storage if necessary 2014-05-15 15:34:30 +03:00
Johan Hedberg
986c3d2b1a plugins/policy: Both !uuids and !uuids[0] mean an empty list 2014-05-15 11:46:00 +03:00
Johan Hedberg
de663bfc39 plugins/policy: Remove reconnect timer in reconnect_reset()
In the case that the remote starts connecting to us while we're waiting
for the timeout to discover we shouldn't just reset the basic time
keeping variables but also remove the timer.
2014-05-15 11:46:00 +03:00
Johan Hedberg
422015388d core: Add "Policy" to valid main.conf groups 2014-05-15 11:19:32 +03:00
Johan Hedberg
f8a0c50bc6 plugins/policy: Add support to retreive ReconnectUUIDs from main.conf 2014-05-15 11:19:32 +03:00
Johan Hedberg
86f4b55232 core: Add API to get access to main.conf 2014-05-15 11:16:34 +03:00
Johan Hedberg
40e77e7b71 plugins/policy: Rename UUIDs list variable to avoid name collisions 2014-05-15 11:16:34 +03:00
Johan Hedberg
42fd4ce72c plugins/policy: Add exponential backoff for reconnection attempts 2014-05-15 11:16:34 +03:00
Johan Hedberg
c3a21d3393 plugins/policy: Continue reconnections after connect attempt failure
This patch adds support for continuing reconnecting for several more
times (up to 3 minutes) even when a connection attempt fails.
2014-05-15 11:16:34 +03:00
Johan Hedberg
967a38d45a core: Export API for tracking connection failures
This will be used by the reconnection policy logic.
2014-05-15 11:16:33 +03:00
Johan Hedberg
e0929a6e88 plugins/policy: Add basic reconnection handling 2014-05-15 11:16:33 +03:00
Johan Hedberg
b98bb6c102 core: Export API to request services to be connected
This API reuses the existing serialized profile connection creation and
its primary user is the reconnection policy.
2014-05-15 11:16:33 +03:00
Johan Hedberg
396b3b62c9 core: Add API to monitor device disconnections
This patch adds an API to monitor devices disconnections, including the
reason for the disconnection. It paves the way to allow creating a
policy for reconnecting when disconnected.
2014-05-15 11:16:33 +03:00