Commit Graph

955 Commits

Author SHA1 Message Date
Marcel Holtmann
85180c23f7 profiles: Fix includes for gdbus.h header 2015-03-01 00:14:21 -08:00
Marcel Holtmann
318e32cddb profiles: Use local libbluetooth includes 2015-02-28 23:58:08 -08:00
Marcel Holtmann
17763527a3 profiles: Use local libbluetooth includes 2015-02-28 23:33:09 -08:00
Andrei Emeltchenko
3361ceaeab audio/avdtp: Fix session list handling
Until we move to queue we shall use server->sessions, this will be
changed in the following patches.
2015-02-23 16:17:32 +02:00
Andrei Emeltchenko
e80a68defc audio/a2dp: Fix server name typo
Fixes typo in server name
2015-02-23 11:29:10 +02:00
Andrei Emeltchenko
5cc71d9a56 audio/a2dp: Fix queue initialization
After changing GSList to queue initialization was missing.
2015-02-23 11:29:09 +02:00
Andrei Emeltchenko
625e2c62fc audio/avdtp: Use SEP queue instead of avdtp_server in avdtp code
This makes register/unregister sep code inside avdtp.c similar between
profiles/ and android/
2015-02-22 21:27:37 +01:00
Andrei Emeltchenko
104e05acca audio/avdtp: Move avdtp_server from avdtp SEP structures
a2dp_server and avdtp_server are handled inside a2dp_sep structure.
2015-02-22 21:27:37 +01:00
Andrei Emeltchenko
b840e5edc8 audio: Refactor avdtp_get function
Refactor avdtp_get() moving it from avdtp to a2dp and renaming to
a2dp_avdtp_get().
2015-02-22 21:27:27 +01:00
Andrei Emeltchenko
9fa1b5afac audio/avdtp: Replace GSList with queue for SEP list 2015-02-22 21:26:25 +01:00
Andrei Emeltchenko
d042c6f33a audio/avdtp: Refactor avdtp and a2dp code
Move connection-related code from avdtp to a2dp. This shall help to use
same avdtp library in profiles/ and android/ code.
2015-02-22 21:26:25 +01:00
Andrei Emeltchenko
aabaa70200 audio/avdtp: Use bitfield id generation
Use bitfield utils for assigning SEP id. This fixes duplicated id
generation shown in unit/avdtp tests.
2015-02-22 21:26:25 +01:00
Andrei Emeltchenko
252cc886be audio/avdtp: Fix incorrect delay_reporting assignment 2015-02-20 11:26:16 +02:00
Marcel Holtmann
2df675b1ee profiles: Add explicit include for lib/bluetooth.h 2015-02-18 06:23:23 +01:00
Kuba Pawlak
853592f98f audioo/AVCTP: Set initial key repeat timeout
'AVC Panel Subunit Specification' mandates that:
To help the target to decide whether a pressed button is hold
or not, it is recommended that the controller have capability
of issuing a “release” command within 300 ms, after it receives
a response to the last “press” command. The target should not
judge the user operation to be “press and hold” within this
300ms.". The kernel's default timeout is currently set to 250ms
with 33ms between repeats which means it will issue one repeat
key before 300ms window elapses.
2015-02-11 17:38:07 +02:00
Luiz Augusto von Dentz
dadec19ece audio/avctp: Don't repeat key presses
The kernel will take care of repeat event until the key is released so
it is not necessary to generate a new press event.
2015-01-20 17:58:49 +02:00
Luiz Augusto von Dentz
f97cc75e00 audio/avctp: Fix press and hold logic
Currently code would always release any key pressed upon any event
which breaks press and hold, this fix it by only releasing once a
different key is pressed.
2015-01-20 17:58:49 +02:00
Luiz Augusto von Dentz
4a7514cfff audio/avctp: Fix key auto release logic
uinput key codes are 16 bits long not 8 bits, this may cause an overflow
if the key code is above 0xff breaking the auto release logic.
2015-01-20 17:58:49 +02:00
Jukka Taimisto
91ce0439f5 profiles/gap: Change len parameter of name2utf8() to uint16_t
When device name is read its length is of type uint16_t, change the type
of length parameter of name2utf8() to uint16_t to avoid unnecessary
truncation.
2015-01-20 12:40:43 +02:00
Jukka Taimisto
4977100c5c profiles/gap: Make sure device name is null -terminated.
If value of device name characteristic does not contain valid UTF-8
characters, make sure the name is null terminated before converting
non-ascii characters to spaces.
2015-01-20 12:40:40 +02:00
Jukka Taimisto
027a4610a7 profiles/gap: Handle error or no device name
Fixes segmentation fault when reading value of device name
characteristic returns error or no data.
2015-01-20 10:10:58 +02:00
Arman Uguray
79beb1c6ac profiles/gap: Fix probe/accept behavior
This patch fixes the GAP profile so that it assumes that there will be
one btd_service instance per-device rather than per-service-per-device.
2015-01-16 16:08:27 +02:00
Gowtham Anandha Babu
1314a764ce profiles/hog: Remove dead code
warning: Value stored to 'attrib' is never read
		attrib = report->hogdev->attrib;
		^        ~~~~~~~~~~~~~~~~~~~~~~
2015-01-07 11:32:40 -02:00
Arman Uguray
1a737d6a32 profiles/gap: Add Google copyright
Added Google Inc. to the copyright comment since the profile has been
mostly rewritten.
2014-12-19 18:49:45 -02:00
Arman Uguray
c34d3d7fa4 profiles/gap: Rewrite using bt_gatt_client
This patch rewrites the GAP profile to use the shared GATT stack instead
of GAttrib. The profile now also handles the Device Name characteristic.
2014-12-19 18:49:44 -02:00
Arman Uguray
9942dcdb55 profiles/gatt: Rename profile to gap
Since this built in profile only handles the GAP service, this patch
renames it to gap.
2014-12-19 18:49:25 -02:00
Arman Uguray
fdfd8575bf profiles/gatt: Don't handle GATT service
ATT MTU exchange and handling of indications from the "Service Changed"
characteristic are now handled by shared/gatt-client, so this profile
should only deal with the GAP service.
2014-12-19 18:49:25 -02:00
Szymon Janc
f1d0c834ee profiles: List all enum values in switch
As described in coding style M10.
2014-12-08 14:00:28 +01:00
Sagar Nageshmurthy
14750a2e48 audio/a2dp: Fix Access session device only when its valid
session will be NULL if A2DP connection fails because of NO REPLY
from endpoint or if the configuration is aborted. Accessing session
device in such a scenario leads to bluetoothd crash.

(gdb) bt full
0  avdtp_get_device (session=0x0) at profiles/audio/avdtp.c:3987
No locals.
1  0xb6f0e352 in auto_config (data=<value optimized out>)
    at profiles/audio/a2dp.c:382
        setup = 0xb7a4f230
        dev = <value optimized out>
2  0xb6f132f6 in config_cb (endpoint=<value optimized out>,
    ret=<value optimized out>, size=<value optimized out>,
    user_data=<value optimized out>) at profiles/audio/media.c:534
        data = <value optimized out>
3  0xb6f1398a in media_endpoint_cancel (endpoint=0xb7a43e78)
    at profiles/audio/media.c:136
        endpoint = 0xb7a43e78
4  media_endpoint_cancel_all (endpoint=0xb7a43e78)
    at profiles/audio/media.c:144
No locals.
5  0xb6f13e04 in clear_endpoint (endpoint=0xb7a43e78)
    at profiles/audio/media.c:245
No locals.
6  0xb6f13f68 in endpoint_reply (call=<value optimized out>,
    user_data=0xb7a4e538) at profiles/audio/media.c:275
        request = 0xb7a4e538
        endpoint = 0xb7a43e78
        reply = 0xb7a3f560
        err = {name = 0xb7a5de70 "org.freedesktop.DBus.Error.NoReply"
2014-11-26 15:43:58 +02:00
Johan Hedberg
23d0a252dd hog: Fix unnecessary < 0 check of unsigned value 2014-11-26 10:02:03 +02:00
Benjamin Tissoires
34f34e9e1f hog: implement set_report functionality
When UHID_SET_REPORT is received, hog has to send the given value
of the report to the device and send back the error code to the caller.

This function has to be synchronous, so the answer is sent in
set_report_cb().

(David: Track reports and cancel them on timeouts. Also fix some
        "get"->"set" typos.)
2014-11-26 09:59:54 +02:00
Benjamin Tissoires
9b58288693 hog: implement get_report functionality
When UHID_GET_REPORT is received, hog has to update the current value
of the report and send it back to the caller.

This function should be synchronous, so the answer is sent in
get_report_cb().

(David: Track reports and cancel them on uhid timeouts. Otherwise, we'd
        incorrectly match reponses. Also fix "feature"->"get" typos and
        handle reports without IDs)
2014-11-26 09:57:53 +02:00
Benjamin Tissoires
fe3d9fd8da hog: break out the report retrieval in its own function
HoG currently only implements UHID_OUTPUT. We need to also implement
UHID_GET_REPORT and UHID_SET_REPORT. Break out the report retrieval
to use this function in the two missing implementation.
2014-11-26 09:57:35 +02:00
Benjamin Tissoires
43c346bde0 hog: import latest uhid.h definition
Kernel 3.18 ships a new API for uhid devices. This API is retro-compatible
so we can keep the current symbols.
2014-11-26 09:57:22 +02:00
Luiz Augusto von Dentz
8da8df121d audio/source: Fix XCASE connection
In case the remote has initiate a connection already the code should
return -EBUSY to avoid possible command collisions on AVDTP session.
2014-11-24 10:10:40 +02:00
Chethan T N
3237dd609e audio/sink: Fix a2dp XCASE connection
Some bluetooth headset (BOSE) initates the avdtp connection immediately
after HFP connection is completed, so if application initates a2dp
connection and since already avdtp connection is ongoing should return
error EBUSY.
2014-11-20 16:48:06 +02:00
Alex Gal
face37796d profiles/input: Add Sony Navigation Controller 2014-11-07 21:51:00 +01:00
Grzegorz Kolodziejczyk
78d406b77a health: Keep struct element indentions consist
Indentions should be tabbed to keep consist with other structs.
2014-11-02 15:33:19 +02:00
Andrei Emeltchenko
ca7458bc89 bnep: Return errno instead of -1 and print error
Make code consistent with the rest returning -errno and printing error
message.
2014-10-23 13:15:30 +03:00
Andrei Emeltchenko
28f4a00f41 bnep: trivial: code cleanup 2014-10-23 13:15:30 +03:00
Andrei Emeltchenko
6fa7b53bff bnep: Add error print and return errno instead of -1 2014-10-23 13:15:29 +03:00
Luiz Augusto von Dentz
a848ceb072 bnep: Fix treating return of bnep_if_up as bool 2014-10-20 15:35:15 +03:00
Andrei Emeltchenko
a1e74ab31e bnep: Fix bnep_add_to_bridge() errno usage
Avoid errno be overwritten and make code consistent.
2014-10-20 15:28:32 +03:00
Andrei Emeltchenko
7714548e2d bnep: Fix incorrect ioctl() check 2014-10-20 15:28:32 +03:00
Andrei Emeltchenko
e29197cb14 bnep: Fix incorrect use of errno
Fixes bnep_if_up() usage since it already prints error message and
returns errno.
2014-10-20 15:28:04 +03:00
Andrei Emeltchenko
62e1842345 bnep: Refactor bnep_if_up() returning -errno
Some functions are using bnep_if_up() like bnep_server_add() referring
directly to errno which may be overwritten already.
2014-10-20 15:28:04 +03:00
Andrei Emeltchenko
c73724d80f bnep: Make error logging more descriptive
Add "bnep" before error message.
2014-10-20 15:28:04 +03:00
Andrei Emeltchenko
5636af1884 bnep: Avoid double error print for bnep_connadd()
This avoids double printing the same error with bnep connection add
ioctl.
2014-10-20 15:26:37 +03:00
Ravi kumar Veeramally
9164e6d2c5 mcap: Rename mcap-lib to mcap 2014-10-02 16:09:50 +03:00
Ravi kumar Veeramally
c2a70e6b9d mcap: Unify libmcap usage for Android and non-Android versions
Now profiles/health/ , android/health and mcaptest will use
profiles/health/mcap-lib.
2014-10-02 14:24:28 +03:00