OSDN Git Service
Claudio Takahasi [Tue, 25 Sep 2012 15:26:41 +0000 (12:26 -0300)]
scan: Write parameters when requested
This patch implements the update procedure of the scan parameters
when the Scan Server requests. The Scan Refresh characteristic is
used to inform the Scan Client(BlueZ) that the Scan Server requires
the most recent scan settings.
Claudio Takahasi [Tue, 25 Sep 2012 15:26:40 +0000 (12:26 -0300)]
scan: Register notification handler
This patch registers the GAttrib notification handler for Refresh
Characteristic notification.
Claudio Takahasi [Tue, 25 Sep 2012 15:26:39 +0000 (12:26 -0300)]
scan: Enable Scan Refresh notification
This patch discovers the Scan Refresh Characteristic handle and sets
it's Client Characteristic Configuration bit to enable notifications.
Claudio Takahasi [Tue, 25 Sep 2012 15:26:38 +0000 (12:26 -0300)]
scan: Add write scan interval window
This patch adds the handle discovery of the Scan Interval Window
Characteristic and writes the default value (hard-coded in the kernel)
of the scan interval, and scan window in the remote's characteristic.
Claudio Takahasi [Tue, 25 Sep 2012 15:26:37 +0000 (12:26 -0300)]
scan: Add ATTIO callbacks registration
This patch add the functions to manage ATTIO callbacks. The current
registration mechanism is not suitable for this service since it needs
to be passive. Scan Parameters should not actively request connections,
it needs to be notified if the connections has been established
requested by other services.
Claudio Takahasi [Tue, 25 Sep 2012 15:26:36 +0000 (12:26 -0300)]
scan: Register profile
This patch add the probe and remove callbacks for the GATT Scan
Parameters service.
Claudio Takahasi [Tue, 25 Sep 2012 15:26:35 +0000 (12:26 -0300)]
scan: Add plugin skeleton
This patch adds the Makefile changes and plugin declaration to support
Scan Parameters service. BlueZ will act as Scan Client writting to a Scan
Server the scanning parameters.
Claudio Takahasi [Tue, 25 Sep 2012 15:34:17 +0000 (12:34 -0300)]
hog: Add suspend/resume callbacks declaration
This patch declares the callbacks functions that intend to be used
by the suspend back-ends.
Claudio Takahasi [Tue, 25 Sep 2012 15:34:16 +0000 (12:34 -0300)]
hog: Add suspend back-end selection
This patch series introduces back-end selection for HoG suspend drivers.
The default back-end is called "dummy", added for testing purpose only.
Claudio Takahasi [Tue, 25 Sep 2012 15:34:15 +0000 (12:34 -0300)]
hog: Add initial files for suspend support
This patch adds the initial files to support HoG suspend. The suspend
concept for HoG is implementation specific. The proposal is allowing
back-end selection at build time. Each Linux distribution/platform is
responsible for defining and writting their own policy to manage suspend
on HoG capable devices.
When setting the Control Point, the report device can execute actions to
save power. eg: Reduce the cycle of the key press detection or disable
LEDs.
Andrzej Kaczmarek [Fri, 28 Sep 2012 09:47:04 +0000 (12:47 +0300)]
proximity: Change Monitor drivers function prefix to monitor_
Andrzej Kaczmarek [Fri, 28 Sep 2012 09:43:18 +0000 (12:43 +0300)]
proximity: Split profile driver into Monitor and Reporter
Proximity Monitor interface is registered for each GATT device since
profile driver matches by GATT_UUID which is intended only for Reporter
role.
This patches splits Proximity profile driver into two separate drivers
for Monitor and Reporter role to register interfaces properly.
Szymon Janc [Fri, 28 Sep 2012 09:35:29 +0000 (11:35 +0200)]
adapter: Remove unused struct btd_adapter members
stop_discov_id and state are not used anymore.
Johan Hedberg [Thu, 27 Sep 2012 19:14:29 +0000 (22:14 +0300)]
test: Fix fd handling in test-profile
Lucas De Marchi [Wed, 26 Sep 2012 13:39:47 +0000 (10:39 -0300)]
gdbus: Refactor filter_data_find()
Now this function is only used for searching the listeners of a
connection and the other parameters are not needed anymore.
Lucas De Marchi [Wed, 26 Sep 2012 13:39:46 +0000 (10:39 -0300)]
gdbus: Fix wrong signal handler match
When we add a signal handler with g_dbus_add_signal_watch(), this
function tries to multiplex the matches added in libdbus by checking
if there's a previous filter_data with the same fields. However, if the
field is NULL it accepts as being the same. The result is that the
following watches will use the same filter data:
watch1 = g_dbus_add_signal_watch(conn, BUS_NAME, NULL, iface, member,
cb1, data1, NULL);
watch2 = g_dbus_add_signal_watch(conn, BUS_NAME, "/path2", iface, member,
cb2, data2, NULL);
watch3 = g_dbus_add_signal_watch(conn, BUS_NAME, "/path3", iface, member,
cb3, data3, NULL);
The result is that when a signal arrives with path == "/path2", all 3
callbacks above will be called, with the same signal delivered to all of
them.
Another problem is that, if we invert the calls like below, only signals
to cb1 will never be trigerred, nonetheless it used path == NULL.
watch2 = g_dbus_add_signal_watch(conn, BUS_NAME, "/path2", iface, member,
cb2, data2, NULL);
watch1 = g_dbus_add_signal_watch(conn, BUS_NAME, NULL, iface, member,
cb1, data1, NULL);
watch3 = g_dbus_add_signal_watch(conn, BUS_NAME, "/path3", iface, member,
cb3, data3, NULL);
This is fixed by not multiplexing the matchs with filter data if any of
the fields are different, including being NULL. When a signal arrives,
if a field is NULL we accept it as a match, but not when adding the
signal handler.
Johan Hedberg [Wed, 26 Sep 2012 18:45:05 +0000 (21:45 +0300)]
gdbus: Fix crash when getting disconnected from the bus
When getting disconnected from the bus sometimes (maybe always?)
dbus_watch_handle() can cause the "info" context to be free'd meaning
that we should not try to access it after the call. The only member we
need access to is the connection pointer and as the code already has a
ref() call for it it's only natural to solve the issue by adding a local
variable not dependent on "info".
The backtrace of the crash fixed looks as follows:
Invalid read of size 8
at 0x121085: watch_func (mainloop.c:105)
by 0x4C72694: g_main_context_dispatch (gmain.c:2539)
by 0x4C729C7: g_main_context_iterate.isra.23 (gmain.c:3146)
by 0x4C72DC1: g_main_loop_run (gmain.c:3340)
by 0x120541: main (main.c:551)
Address 0x5bbcd90 is 16 bytes inside a block of size 24 free'd
at 0x4A079AE: free (vg_replace_malloc.c:427)
by 0x4C7837E: g_free (gmem.c:252)
by 0x4F708BF: dbus_watch_set_data (dbus-watch.c:614)
by 0x4F70938: _dbus_watch_unref (dbus-watch.c:132)
by 0x4F6E9A7: _dbus_transport_handle_watch (dbus-transport.c:884)
by 0x4F59AFB: _dbus_connection_handle_watch (dbus-connection.c:1497)
by 0x4F70AF9: dbus_watch_handle (dbus-watch.c:683)
by 0x121084: watch_func (mainloop.c:103)
by 0x4C72694: g_main_context_dispatch (gmain.c:2539)
by 0x4C729C7: g_main_context_iterate.isra.23 (gmain.c:3146)
by 0x4C72DC1: g_main_loop_run (gmain.c:3340)
by 0x120541: main (main.c:551)
Anderson Lizardo [Wed, 26 Sep 2012 18:22:42 +0000 (14:22 -0400)]
build: Fix make distcheck for src/profile.c
Fix this "make distcheck" error:
../src/profile.c:39:18: fatal error: uuid.h: No such file or directory
Luiz Augusto von Dentz [Wed, 26 Sep 2012 13:45:53 +0000 (16:45 +0300)]
AVRCP: Store version and features of the remote in the session
Luiz Augusto von Dentz [Wed, 26 Sep 2012 13:07:59 +0000 (16:07 +0300)]
AVRCP: Fix using struct avrcp_player as session abstraction
This fixes several limitations with the current design including not
being able to connect multiple devices at same time and not being able
to register players on the fly while a connection was already
established.
Luiz Augusto von Dentz [Tue, 25 Sep 2012 11:45:38 +0000 (14:45 +0300)]
AVRCP: Automatically connect browsing channel if supported
Once control channel is connected check if the device support browsing
channel and connect to it.
Vani Patel [Mon, 24 Sep 2012 11:12:03 +0000 (14:12 +0300)]
AVRCP: Add handler for browsing PDUs
Implement generic handling of browsing PDU ids
Joohi Rastogi [Fri, 21 Sep 2012 04:56:42 +0000 (10:26 +0530)]
AVCTP: Add functions to register and unregister Browsing handler
Vani Patel [Mon, 24 Sep 2012 10:20:56 +0000 (13:20 +0300)]
AVRCP: Add browsing channel support
Implements browsing channel creation and release.
Vani Patel [Mon, 24 Sep 2012 09:07:40 +0000 (12:07 +0300)]
AVRCP: Rename variables used for control channel
Vani Patel [Thu, 20 Sep 2012 08:51:37 +0000 (14:21 +0530)]
AVRCP: Adds SDP record to support browsing channel
Luiz Augusto von Dentz [Tue, 25 Sep 2012 07:58:40 +0000 (10:58 +0300)]
AVRCP: Fix handler lookup for undefined control PDU ids
The lookup table of handlers is not NULL terminated which in case of an
undefined id may lead to read invalid memory out of the table area.
To fix this the id 0x00 is now used as delimiter.
Johan Hedberg [Wed, 26 Sep 2012 10:41:02 +0000 (13:41 +0300)]
core: Add support for Profile.NewConnection
Johan Hedberg [Wed, 26 Sep 2012 13:28:51 +0000 (16:28 +0300)]
dbus: Add org.bluez.Profile to D-Bus policy
Johan Hedberg [Wed, 26 Sep 2012 13:27:48 +0000 (16:27 +0300)]
test: Fix signature of Profile.NewConnection in test-profile
Johan Hedberg [Wed, 26 Sep 2012 12:21:14 +0000 (15:21 +0300)]
core: Fix sending Profile.Cancel before Profile.Release
Johan Hedberg [Wed, 26 Sep 2012 12:12:45 +0000 (15:12 +0300)]
test: Add PSM and Channel options to test-profile
Johan Hedberg [Wed, 26 Sep 2012 11:47:39 +0000 (14:47 +0300)]
core: Add basic defaults lookup to external profiles
Johan Hedberg [Wed, 26 Sep 2012 11:46:27 +0000 (14:46 +0300)]
test: Improve test-profile functionality
Johan Hedberg [Wed, 26 Sep 2012 11:47:08 +0000 (14:47 +0300)]
core: Add support for Role option for RegisterProfile
Johan Hedberg [Wed, 26 Sep 2012 10:40:43 +0000 (13:40 +0300)]
core: Fix order of calling Profile.Release
Johan Hedberg [Wed, 26 Sep 2012 07:52:17 +0000 (10:52 +0300)]
core: Initialize profile security level to a sane default
Johan Hedberg [Wed, 26 Sep 2012 10:03:27 +0000 (13:03 +0300)]
core: Fix minor coding style issue (long line)
Johan Hedberg [Wed, 26 Sep 2012 11:46:00 +0000 (14:46 +0300)]
mgmt: Fix parsing read_index_list response
Johan Hedberg [Tue, 25 Sep 2012 17:14:04 +0000 (20:14 +0300)]
core: Add skeleton for handling server sockets for external profiles
Johan Hedberg [Tue, 25 Sep 2012 16:27:13 +0000 (19:27 +0300)]
core: Make profile debug logging a bit more readable
Johan Hedberg [Tue, 25 Sep 2012 16:17:22 +0000 (19:17 +0300)]
core: Add basic profile options parsing support
Johan Hedberg [Tue, 25 Sep 2012 16:17:00 +0000 (19:17 +0300)]
test: Add some more options to test-profile registration
Johan Hedberg [Tue, 25 Sep 2012 15:45:12 +0000 (18:45 +0300)]
core: Add simple adapter probe function to external profiles
Johan Hedberg [Tue, 25 Sep 2012 15:42:05 +0000 (18:42 +0300)]
core: Add dynamic adapter and device probe support
Particularly With the introduction of external profiles the probe
functions must be possible to be triggered at any point during runtime.
Johan Hedberg [Tue, 25 Sep 2012 15:10:53 +0000 (18:10 +0300)]
core: Add debug logs for external profile registration
Johan Hedberg [Tue, 25 Sep 2012 14:26:16 +0000 (17:26 +0300)]
doc: Add profile API documentation
Luiz Augusto von Dentz [Tue, 25 Sep 2012 12:56:44 +0000 (15:56 +0300)]
audio: Fix attempting to create a device on driver .remove
audio_remove calls get_audio_dev which may attempt to create the device
if it doesn't exist.
Johan Hedberg [Tue, 25 Sep 2012 12:35:33 +0000 (15:35 +0300)]
core: Monitor external profile processes
Johan Hedberg [Tue, 25 Sep 2012 12:11:48 +0000 (15:11 +0300)]
test: Add test-profile test script
Johan Hedberg [Tue, 25 Sep 2012 11:39:28 +0000 (14:39 +0300)]
core: Add cleanup function for external profiles
Johan Hedberg [Tue, 25 Sep 2012 11:23:57 +0000 (14:23 +0300)]
core: Add profile parameter to adapter and device probe functions
This is necessary for the external profile implementation (which will
have the same callback functions for all external profiles).
Johan Hedberg [Tue, 25 Sep 2012 10:25:28 +0000 (13:25 +0300)]
core: Add external profile registration callbacks
Johan Hedberg [Tue, 25 Sep 2012 10:23:31 +0000 (13:23 +0300)]
core: Remove btd_get_profiles
Johan Hedberg [Tue, 25 Sep 2012 10:22:42 +0000 (13:22 +0300)]
core: Use btd_profile_foreach for device probing
Johan Hedberg [Tue, 25 Sep 2012 09:49:26 +0000 (12:49 +0300)]
input: Add Device.Connect support
Johan Hedberg [Tue, 25 Sep 2012 08:17:16 +0000 (11:17 +0300)]
test: Add command for Device.Connect()
Johan Hedberg [Tue, 25 Sep 2012 08:12:38 +0000 (11:12 +0300)]
core: Add Device.Connect method
Johan Hedberg [Tue, 25 Sep 2012 08:08:29 +0000 (11:08 +0300)]
core: Add error reporting to profile callbacks
David Herrmann [Wed, 12 Sep 2012 21:32:53 +0000 (23:32 +0200)]
wiimote: add Wii Balance Board detection
Add the name of the Wii Balance Board so it can be paired with BlueZ like
any other Wii Remote. Reported by Florian Echtler.
Luiz Augusto von Dentz [Fri, 21 Sep 2012 13:12:23 +0000 (16:12 +0300)]
media: Fix possible crash when endpoint exit
a2dp_sep_unlock may free the endpoint if it is not registered anymore
which leads to destroying all related transport causing the following:
Invalid read of size 1
at 0x4A09F09: memcpy@GLIBC_2.2.5 (mc_replace_strmem.c:836)
by 0x4F7C02D: ??? (in /usr/lib64/libdbus-1.so.3.5.6)
by 0x4F7AAE5: ??? (in /usr/lib64/libdbus-1.so.3.5.6)
by 0x4F7B10B: ??? (in /usr/lib64/libdbus-1.so.3.5.6)
by 0x4F68DA0: ??? (in /usr/lib64/libdbus-1.so.3.5.6)
by 0x4F66788: ??? (in /usr/lib64/libdbus-1.so.3.5.6)
by 0x4F66B41: ??? (in /usr/lib64/libdbus-1.so.3.5.6)
by 0x4F6D64E: dbus_message_new_signal (in /usr/lib64/libdbus-1.so.3.5.6)
by 0x180FC2: emit_property_changed (dbus-common.c:130)
by 0x13FD15: transport_set_state (transport.c:206)
by 0x140519: suspend_a2dp (transport.c:460)
by 0x122436: service_filter (watch.c:476)
Address 0x6546110 is 48 bytes inside a block of size 49 free'd
at 0x4A079AE: free (vg_replace_malloc.c:427)
by 0x4C8037E: g_free (in /usr/lib64/libglib-2.0.so.0.3200.4)
by 0x1409F9: media_transport_free (transport.c:1160)
by 0x12282F: remove_interface (object.c:553)
by 0x123699: g_dbus_unregister_interface (object.c:1231)
by 0x141547: media_transport_destroy (transport.c:228)
by 0x4C95ACC: g_slist_foreach (in /usr/lib64/libglib-2.0.so.0.3200.4)
by 0x4C95AEA: g_slist_free_full (in /usr/lib64/libglib-2.0.so.0.3200.4)
by 0x13E53D: media_endpoint_remove (media.c:162)
by 0x133F62: a2dp_unregister_sep (a2dp.c:1247)
by 0x1369D7: a2dp_sep_unlock (a2dp.c:1814)
by 0x1404D3: suspend_a2dp (transport.c:455)
Johan Hedberg [Fri, 21 Sep 2012 12:08:03 +0000 (15:08 +0300)]
network: Fix DBusMessage leaks
Johan Hedberg [Fri, 21 Sep 2012 12:08:49 +0000 (15:08 +0300)]
core: Fix Device.Disconnect() DBusMessage leak
Johan Hedberg [Fri, 21 Sep 2012 12:06:34 +0000 (15:06 +0300)]
service: Fix DBusMessage leak
Andrzej Kaczmarek [Wed, 19 Sep 2012 10:22:19 +0000 (12:22 +0200)]
dbusoob: Simplify DBusConnection object handling
This patch removes local reference to DBusConnection object and uses
btd_get_dbus_connection() call wherever such object is needed instead.
Pointer returned by this call is guaranteed to be valid for entire
bluetoothd lifetime and thus do not need to be refcounted.
Andrzej Kaczmarek [Wed, 19 Sep 2012 10:22:18 +0000 (12:22 +0200)]
service: Simplify DBusConnection object handling
This patch removes redundant references and function parameters for
DBusConnection object and uses btd_get_dbus_connection() call wherever
such object is needed instead.
Pointer returned by this call is guaranteed to be valid for entire
bluetoothd lifetime and thus do not need to be refcounted.
Andrzej Kaczmarek [Wed, 19 Sep 2012 10:22:17 +0000 (12:22 +0200)]
thermometer: Simplify DBusConnection object handling
This patch removes redundant references and function parameters for
DBusConnection object and uses btd_get_dbus_connection() call wherever
such object is needed instead.
Pointer returned by this call is guaranteed to be valid for entire
bluetoothd lifetime and thus do not need to be refcounted.
Andrzej Kaczmarek [Wed, 19 Sep 2012 10:22:16 +0000 (12:22 +0200)]
sap: Simplify DBusConnection object handling
This patch removes redundant references and function parameters for
DBusConnection object and uses btd_get_dbus_connection() call wherever
such object is needed instead.
Pointer returned by this call is guaranteed to be valid for entire
bluetoothd lifetime and thus do not need to be refcounted.
Andrzej Kaczmarek [Wed, 19 Sep 2012 10:22:15 +0000 (12:22 +0200)]
network: Simplify DBusConnection object handling
This patch removes redundant references and function parameters for
DBusConnection object and uses btd_get_dbus_connection() call wherever
such object is needed instead.
Pointer returned by this call is guaranteed to be valid for entire
bluetoothd lifetime and thus do not need to be refcounted.
Andrzej Kaczmarek [Wed, 19 Sep 2012 10:22:14 +0000 (12:22 +0200)]
input: Simplify DBusConnection object handling
This patch removes redundant references and function parameters for
DBusConnection object and uses btd_get_dbus_connection() call wherever
such object is needed instead.
Pointer returned by this call is guaranteed to be valid for entire
bluetoothd lifetime and thus do not need to be refcounted.
Andrzej Kaczmarek [Wed, 19 Sep 2012 10:22:13 +0000 (12:22 +0200)]
health: Simplify DBusConnection object handling
This patch removes redundant references and function parameters for
DBusConnection object and uses btd_get_dbus_connection() call wherever
such object is needed instead.
Pointer returned by this call is guaranteed to be valid for entire
bluetoothd lifetime and thus do not need to be refcounted.
Andrzej Kaczmarek [Wed, 19 Sep 2012 10:22:12 +0000 (12:22 +0200)]
audio: Simplify DBusConnection object handling
This patch removes redundant references and function parameters for
DBusConnection object and uses btd_get_dbus_connection() call wherever
such object is needed instead.
Pointer returned by this call is guaranteed to be valid for entire
bluetoothd lifetime and thus do not need to be refcounted.
Andrzej Kaczmarek [Wed, 19 Sep 2012 10:22:11 +0000 (12:22 +0200)]
attrib: Simplify DBusConnection object handling
This patch removes redundant references and function parameters for
DBusConnection object and uses btd_get_dbus_connection() call wherever
such object is needed instead.
Pointer returned by this call is guaranteed to be valid for entire
bluetoothd lifetime and thus do not need to be refcounted.
Andrzej Kaczmarek [Wed, 19 Sep 2012 10:22:10 +0000 (12:22 +0200)]
adapter: Simplify DBusConnection object handling
This patch removes redundant references and function parameters for
DBusConnection object and uses btd_get_dbus_connection() call wherever
such object is needed instead.
Pointer returned by this call is guaranteed to be valid for entire
bluetoothd lifetime and thus do not need to be refcounted.
Andrzej Kaczmarek [Wed, 19 Sep 2012 10:22:09 +0000 (12:22 +0200)]
device: Simplify DBusConnection object handling
This patch removes redundant references and function parameters for
DBusConnection object and uses btd_get_dbus_connection() call wherever
such object is needed instead.
Pointer returned by this call is guaranteed to be valid for entire
bluetoothd lifetime and thus do not need to be refcounted.
Andrzej Kaczmarek [Wed, 19 Sep 2012 10:22:08 +0000 (12:22 +0200)]
agent: Simplify DBusConnection object handling
This patch removes local reference to DBusConnection object and uses
btd_get_dbus_connection() call wherever such object is needed instead.
Pointer returned by this call is guaranteed to be valid for entire
bluetoothd lifetime and thus do not need to be refcounted.
Andrzej Kaczmarek [Wed, 19 Sep 2012 10:22:07 +0000 (12:22 +0200)]
manager: Simplify DBusConnection object handling
This patch removes local reference to DBusConnection object and uses
btd_get_dbus_connection() call wherever such object is needed instead.
Andrzej Kaczmarek [Wed, 19 Sep 2012 10:22:06 +0000 (12:22 +0200)]
dbus-common: Remove conn parameter from emit_array_property_changed
DBusConnection pointer is already stored in connection static variable
so it's redundant to pass it as function parameter.
Andrzej Kaczmarek [Wed, 19 Sep 2012 10:22:05 +0000 (12:22 +0200)]
dbus-common: Remove conn parameter from emit_property_changed
Valid DBusConnection pointer is available static variable 'connection'
so it's it's redundant to pass it as function parameter.
Andrzej Kaczmarek [Wed, 19 Sep 2012 10:22:04 +0000 (12:22 +0200)]
core: Make D-Bus connection valid for entire bluetoothd lifetime
D-Bus is connected before any subsystem needs to use it and disconnected
only after nothing uses it (i.e. plugins). This is to guarantee that
every call to btd_get_dbus_connection() will return valid DBusConnection
object so various components and plugins do not need to store it
somewhere and care about ref counting.
Andrzej Kaczmarek [Wed, 19 Sep 2012 10:22:03 +0000 (12:22 +0200)]
Rename get_dbus_connection to btd_get_dbus_connection
get_dbus_connection is exported function which can be used by plugins thus
should be prefixed with "btd_"
Andrzej Kaczmarek [Tue, 28 Aug 2012 12:38:34 +0000 (14:38 +0200)]
mgmt: Add wrapper for Set LE
Wrap mgmt_set_mode for Set LE into separate function to be consistent
with other calls and have debug printout.
Andrzej Kaczmarek [Tue, 28 Aug 2012 12:38:33 +0000 (14:38 +0200)]
mgmt: Add wrapper for Set SSP
Wrap mgmt_set_mode for Set SSP into separate function to be consistent
with other calls and have debug printout.
João Paulo Rechi Vita [Tue, 11 Sep 2012 13:32:58 +0000 (10:32 -0300)]
core: Use adapter connect list for LE connections
When a connection is needed for a LE device it is added to the adapter
connect list instead of directly connecting the ATT io channel.
Claudio Takahasi [Tue, 11 Sep 2012 13:32:57 +0000 (10:32 -0300)]
core: Control connections based on adapter state
This patch disable automatic ATTIO connections when the adapter is
powered down and enable automatic connection when the adapter is powered
on.
João Paulo Rechi Vita [Fri, 14 Sep 2012 13:56:50 +0000 (10:56 -0300)]
hog: Fix segfault when discovering descriptors
Invalid memory was being accessed when discovering the External Report
Reference descriptor.
Claudio Takahasi [Wed, 19 Sep 2012 19:37:56 +0000 (16:37 -0300)]
gatttool: Fix Characteristic descriptor discovery
This patch fixes end condition for Characteristic Descriptor Discovery.
This sub-procedure is complete when the Error Response is received and
the Error Code is set to Attribute Not Found or the Find Information
Response has an Attribute Handle that is equal to the Ending Handle of
the request.
Syam Sidhardhan [Fri, 14 Sep 2012 16:10:11 +0000 (21:40 +0530)]
cups: Free D-Bus error
If D-Bus error is set we should free it.
Syam Sidhardhan [Fri, 14 Sep 2012 16:10:10 +0000 (21:40 +0530)]
gstavdtpsink: Free the D-Bus error on reply failure
If D-Bus error is set we should free it.
Syam Sidhardhan [Fri, 14 Sep 2012 16:10:09 +0000 (21:40 +0530)]
adapter: Remove dead code from adapter_emit_device_found()
Syam Sidhardhan [Fri, 14 Sep 2012 16:10:08 +0000 (21:40 +0530)]
device: Remove dead code from get_properties()
Mikel Astiz [Fri, 14 Sep 2012 11:18:40 +0000 (13:18 +0200)]
media: Fix infinite loop due to release_endpoint()
release_endpoint() cannot succeed unless all transports are released
first. For example a2dp_remove_sep() will ignore the call if the SEP is
locked, leading to an infinite loop in path_free(), which expects to
successfully release and remove the endpoint in each call to
release_endpoint().
This issue can easily be reproduced by shutting bluetoothd daemon
during A2DP streaming (tested in sink role).
Mikel Astiz [Fri, 14 Sep 2012 12:56:00 +0000 (14:56 +0200)]
media: Extend media API with optional acquire
Acquiring a transport is needed in two different situations: either
we are initiating the audio stream locally, or the remote side initiated
it and thus we are just reacting. In the second case, we would expect
the stream is already available, and otherwise the operation should
fail. This means the media API needs to be extended in order to make
this difference.
This issue is specially relevant in the case of SCO, because the current
approach is racy. With HFP, for example (say BlueZ has the HS role), the
following race condition could be met:
1. Phone has an incoming call and thus starts in-band ringing.
2. SCO connection is accepted and stablished by BlueZ.
3. Gateway interface state is changed to Playing.
4. Exactly afterwards, the user routes the audio to the phone, to have
a private conversation. So the SCO link is closed.
5. In parallel, PulseAudio sees the transition to Playing, and acquires
the transport.
6. BlueZ receives an Acquire() request, but SCO is down. So it tries to
reconnect the SCO link.
The last step is an undesired behavior (the audio is routed back to the
car). BlueZ should be smart enough to know that the SCO connection
shouldn't be reestablished, but this is only possible if the endpoint
provides additional information in the media API.
Note that the API change introduced by this patch is backward
compatible, meaning that older versions of BlueZ will just ignore the
flag. So clients are encouraged to use it without necessarily adding a
dependency to newer versions of BlueZ.
Mikel Astiz [Fri, 14 Sep 2012 12:55:59 +0000 (14:55 +0200)]
media: Automatically release transport when HUP
When the remote end suspends the audio stream, release the transport
automatically without waiting until the clients call Release().
This affects the D-Bus API since clients will get an error when trying
to release the transport afterwards.
However, this should have no real impact, since most clients (i.e.
PulseAudio) would just log some error trace but otherwise ignore the
issue.
Mikel Astiz [Fri, 14 Sep 2012 12:55:58 +0000 (14:55 +0200)]
media: Expose transport state in D-Bus
Extend the Media API to expose the transport state in D-Bus, as a
property of the transport. This way the clients do not have to find
out which is the corresponding profile-specific interface for the
transport.
Additionally, this state along with the automatic release of transports
will allow clients to avoid the "optional release" or "accept remote
release" race condition. For example, with HSP/HFP profiles, the problem
is the following:
1. User suspends SCO in the remote end.
2. BlueZ signals the Playing->Connected state change in D-Bus.
3. Exactly afterwards, the user resumes SCO in the remote end.
4. In parallel, PulseAudio sees the aforementioned transition to
Connected, and thus releases the transport.
5. BlueZ receives a Release() request while SCO is up. So the audio
stream will be suspended.
The last step is an undesired behavior since the user explicitly wanted
to route the audio stream through Bluetooth.
The issue is difficult to reproduce but it can easily be solved by
exposing the transport state in D-Bus.
Mikel Astiz [Fri, 14 Sep 2012 12:55:57 +0000 (14:55 +0200)]
media: Split transport state based on playing flag
Split the transport states (formerly in_use) into more specific states
where the stream state (playing or suspended) is explicitly represented,
along with the transitional states (locally initiated suspend and
resume).
TRANSPORT_STATE_ACTIVE is an exception since it also includes the state
where the transport is acquired, but the audio was later suspended (not
released yet though).
Mikel Astiz [Fri, 7 Sep 2012 15:20:29 +0000 (17:20 +0200)]
media: Watch interface state changes in transport
Install watches to keep track whether the audio is streaming or not.
This should be relevant if the transport needs to reflect this state.
Mikel Astiz [Fri, 7 Sep 2012 15:20:28 +0000 (17:20 +0200)]
media: Replace transport->in_use flag with state
Refactor the code to use a enum type to represent the transport state.
This should scale better when additional states need to be represented.
A helper function has been added to help track the mapping between the
enum type and the old in_use flag.
Mikel Astiz [Fri, 7 Sep 2012 15:20:27 +0000 (17:20 +0200)]
media: Add gateway_get_state() to internal API
Expose the state of the gateway interface in the internal API.
Mikel Astiz [Fri, 7 Sep 2012 15:20:26 +0000 (17:20 +0200)]
media: Add a2dp_sep_is_playing() to internal API
Add this function to expose whether the local SEP is streaming or not.