OSDN Git Service
Lucas De Marchi [Thu, 4 Oct 2012 07:26:30 +0000 (04:26 -0300)]
gdbus: Implement DBus.Properties.Set method
Contrary to Get() and GetAll(), Set() is asynchronous so we pass an id
to the setter so later it can declare the Set() as successful or
otherwise.
Lucas De Marchi [Thu, 4 Oct 2012 07:26:29 +0000 (04:26 -0300)]
gdbus: Implement DBus.Properties.GetAll method
Lucas De Marchi [Thu, 4 Oct 2012 07:26:28 +0000 (04:26 -0300)]
gdbus: Implement DBus.Properties.Get method
Lucas De Marchi [Thu, 4 Oct 2012 07:26:27 +0000 (04:26 -0300)]
gdbus: Add skeleton of DBus.Properties interface
This interface is responsible for handling properties of all objects in
a given path. Right now it only registers itself, doing nothing useful.
A conversion to this new layout will be done by subsequent patches.
org.freedesktop.org.DBus.Properties spec can be found at
http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-properties
Lucas De Marchi [Thu, 4 Oct 2012 07:26:26 +0000 (04:26 -0300)]
gdbus: Use macros to add annotations
Besides being more readable this way it avoids going over 80 chars.
Lucas De Marchi [Thu, 4 Oct 2012 07:26:25 +0000 (04:26 -0300)]
gdbus: Move typedefs up
Move the typedefs up so they can be used by functions and callbacks.
Lucas De Marchi [Thu, 4 Oct 2012 06:37:10 +0000 (03:37 -0300)]
build-sys: Don't use deprecated INCLUDES variable
Makefile.am:410: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
Lucas De Marchi [Thu, 4 Oct 2012 06:37:09 +0000 (03:37 -0300)]
build-sys: Don't use deprecated AM_PROG_MKDIR_P
AM_PROG_MKDIR_P is deprecated since:
configure.ac:23: warning: The 'AM_PROG_MKDIR_P' macro is deprecated, and will soon be removed.
configure.ac:23: You should use the Autoconf-provided 'AC_PROG_MKDIR_P' macro instead,
configure.ac:23: and use '$(MKDIR_P)' instead of '$(mkdir_p)'in your Makefile.am files.
We are already using $(MKDIR_P) so we just need to call the right macro.
Lucas De Marchi [Thu, 4 Oct 2012 05:14:34 +0000 (02:14 -0300)]
AVDTP: Remove hand-written function name from log
Lucas De Marchi [Thu, 4 Oct 2012 05:14:33 +0000 (02:14 -0300)]
AVCTP: Remove hand-written function name from log
Besides being hand-written, it was wrong which leads to confusion with
the AVDTP.
Johan Hedberg [Thu, 4 Oct 2012 08:19:04 +0000 (11:19 +0300)]
core: Add GoepL2capPsm lookup for external OBEX profiles
Johan Hedberg [Wed, 3 Oct 2012 20:14:03 +0000 (23:14 +0300)]
lib: Add GoepL2capPsm SDP attribute define
Szymon Janc [Wed, 3 Oct 2012 13:18:31 +0000 (15:18 +0200)]
neard: Implement RequestOOB function
This function is used by neard to request data to be transmitted over
OOB channel. It also allows neard to provide data to be used in OOB
pairing without initializing pairing it self.
Szymon Janc [Wed, 3 Oct 2012 13:18:30 +0000 (15:18 +0200)]
neard: Implement PushOOB function
This implements PushOOB function which allows neard to pass data used
for discovery and pairing. Only EIR data type is supported.
Szymon Janc [Wed, 3 Oct 2012 13:18:29 +0000 (15:18 +0200)]
Add initial neard plugin implementation
Initial implementation. Only register and unregister support.
Szymon Janc [Wed, 3 Oct 2012 13:18:28 +0000 (15:18 +0200)]
oob: Refactor oob callback handling and move it to adapter code
This allows oob plugin to register for callback after executing
certain action on adapter. Currently reading local OOB data and
pairing is supported. It should be easy to support more callbacks
in future if needed e.g. powering on.
Thanks to this plugin is not required to duplicate code that would
validate adapter/device when callback is received as callback condition
is check in adapter.
It also allows to pass user data which will be provided back when cb
is called further reducing plugin code.
Szymon Janc [Wed, 3 Oct 2012 13:18:27 +0000 (15:18 +0200)]
adapter: Add btd_adapter_get_class function
This is a simple getter to get current Class Of Device of adapter.
Szymon Janc [Wed, 3 Oct 2012 13:18:26 +0000 (15:18 +0200)]
adapter: Rename btd_adapter_get_class to btd_adapter_read_class
It better suits what this function really does.
Szymon Janc [Wed, 3 Oct 2012 13:18:25 +0000 (15:18 +0200)]
adapter: Add btd_adapter_get_services function
Services will be used to create EIR to be send over OOB.
Szymon Janc [Wed, 3 Oct 2012 13:18:24 +0000 (15:18 +0200)]
eir: Add support for creating proper OOB EIR
Address and total length field are mandatory part of OOB EIR.
Szymon Janc [Wed, 3 Oct 2012 13:18:23 +0000 (15:18 +0200)]
eir: Remove struct uuid_info
Remove struct uuid_info and convert functions to use sdp_record_t
list instead. This will allow to easily use services list from
struct btd_adapter to create EIR.
Szymon Janc [Wed, 3 Oct 2012 13:18:22 +0000 (15:18 +0200)]
eir: Return number of bytes written by eir_create_oob
In OOB EIR is not zero padded.
Szymon Janc [Wed, 3 Oct 2012 13:18:21 +0000 (15:18 +0200)]
eir: Remove support for creating EIR with tx_power fields
This field is not used for OOB EIR.
Szymon Janc [Wed, 3 Oct 2012 13:18:20 +0000 (15:18 +0200)]
eir: Rename eir_create to eir_create_oob
With mgmt interface EIR is created by kernel. Renaming this function
makes it clear what is a purpose of it in userspace. It also contains
support for EIR data types that shall be transmitted only over OOB
channel.
Szymon Janc [Wed, 3 Oct 2012 13:18:19 +0000 (15:18 +0200)]
eir: Add support for creating EIR with CoD field
This will be used to create EIR to be send over OOB channel.
Szymon Janc [Wed, 3 Oct 2012 13:18:18 +0000 (15:18 +0200)]
eir: Add support creating EIR with hash and randomizer fields
This will be used to create EIR to be send over OOB channel.
Szymon Janc [Wed, 3 Oct 2012 13:18:17 +0000 (15:18 +0200)]
eir: Add eir_parse_oob function
This will parse EIR received over OOB. Such EIR contains mandatory
and optional part.
Szymon Janc [Wed, 3 Oct 2012 13:18:16 +0000 (15:18 +0200)]
eir: Store class in struct eir_data as uint32_t
This simplify code as class is stored on storage as uint32_t and
had to be converted to it in few places.
Szymon Janc [Wed, 3 Oct 2012 13:18:15 +0000 (15:18 +0200)]
eir: Add support for parsing SSP hash and randomizer
This will be used over OOB mechanism.
Szymon Janc [Wed, 3 Oct 2012 13:18:14 +0000 (15:18 +0200)]
mgmt: Handle missing randomizer in mgmt_add_remote_oob_data
Randomizer is optional. Handling missing randomizer in
mgmt_add_remote_oob_data is easy and will simplify caller code.
Johan Hedberg [Wed, 3 Oct 2012 19:37:13 +0000 (22:37 +0300)]
alert: Fix various coding style issues
Anderson Lizardo [Tue, 2 Oct 2012 20:24:50 +0000 (16:24 -0400)]
alert: Add org.bluez.AlertAgent to D-Bus policy file
This allows BlueZ to call the methods on the org.bluez.AlertAgent
interface.
Anderson Lizardo [Tue, 2 Oct 2012 20:24:49 +0000 (16:24 -0400)]
alert: Implement Release() agent method
This method allows BlueZ to notify the agent that it will not be used
anymore, and can thus cleanup itself (e.g. deallocate D-Bus object, or
exit).
Eder Ruiz Maria [Tue, 2 Oct 2012 20:24:48 +0000 (16:24 -0400)]
alert: Add support for unread alert notification
When UnreadAlert D-Bus method is called for a registered category
from Alert Notification Profile, The unread alert characteristic value
is notified.
Eder Ruiz Maria [Tue, 2 Oct 2012 20:24:47 +0000 (16:24 -0400)]
alert: Add support for new alert notification
When NewAlert D-Bus method is called for one category from Alert
Notification Profile, the new alert characteristic value is notified.
Eder Ruiz Maria [Tue, 2 Oct 2012 20:24:46 +0000 (16:24 -0400)]
alert: Add support for alert status notification
The notification is sent (to peer devices that have it enabled on the
CCC descriptor) every time the alert status characteristic value
changes.
Eder Ruiz Maria [Tue, 2 Oct 2012 20:24:45 +0000 (16:24 -0400)]
alert: Add support for ringer setting notification
When the agent reports a ringer setting change, a ringer setting
notification is sent to the peer device (if notification is enabled).
Anderson Lizardo [Tue, 2 Oct 2012 20:24:44 +0000 (16:24 -0400)]
alert: Update Alert Status and Ringer Setting characteristic values
Now these characteristic values are updated when the agent changes any
PASP alert state or setting.
Eder Ruiz Maria [Tue, 2 Oct 2012 20:24:43 +0000 (16:24 -0400)]
alert: Add test-alert script
This script is useful for testing the Alert API and testing the
implementation with PTS.
Eder Ruiz Maria [Tue, 2 Oct 2012 20:24:42 +0000 (16:24 -0400)]
alert: Add support for calling SetRinger()
When BlueZ wants to call SetRinger() method from org.bluez.AlertAgent
interface for a registered agent, the function agent_ringer_set_ringer()
must be called.
Eder Ruiz Maria [Tue, 2 Oct 2012 20:24:41 +0000 (16:24 -0400)]
alert: Add support for calling MuteOnce()
When BlueZ wants to call MuteOnce() method from org.bluez.AlertAgent
interface for a registered agent, the function agent_ringer_mute_once()
must be called.
Anderson Lizardo [Tue, 2 Oct 2012 20:24:40 +0000 (16:24 -0400)]
alert: Implement MuteOnce command
MuteOnce() is called by BlueZ to instruct the agent to mute the ringer
during a incoming call.
Anderson Lizardo [Tue, 2 Oct 2012 20:24:39 +0000 (16:24 -0400)]
alert: Update unread alert characteristic value
Update the attribute value when the unread alert count is changed.
Anderson Lizardo [Tue, 2 Oct 2012 20:24:38 +0000 (16:24 -0400)]
alert: Update new alert characteristic value
Update the attribute value when a new alert is reported to BlueZ.
Anderson Lizardo [Tue, 2 Oct 2012 20:24:37 +0000 (16:24 -0400)]
alert: Update Supported New/Unread Category characteristic values
The value is now kept up-to-date when new/unread alerts arrive. This
value is not notified yet.
Anderson Lizardo [Tue, 2 Oct 2012 20:24:36 +0000 (16:24 -0400)]
alert: Add per adapter attribute handle information
Each adapter may have different GATT services running, therefore any
attribute handles (e.g. for updating characteristic values) need to be
saved per adapter.
Eder Ruiz Maria [Tue, 2 Oct 2012 20:24:35 +0000 (16:24 -0400)]
alert: Automatically unregister alert when agent leaves D-Bus
Anderson Lizardo [Tue, 2 Oct 2012 20:24:34 +0000 (16:24 -0400)]
alert: Add initial support for UnreadAlert D-Bus method
This method is used for updating the "unread" counter for categories
that support it.
Eder Ruiz Maria [Tue, 2 Oct 2012 20:24:33 +0000 (16:24 -0400)]
alert: Add initial support for NewAlert D-Bus method
NewAlert() is used for notifying BlueZ of new alert(s) for the given
category.
Eder Ruiz Maria [Wed, 3 Oct 2012 12:49:15 +0000 (08:49 -0400)]
alert: Implement category registration in RegisterAlert()
The given alert category is now validated and registered.
Anderson Lizardo [Tue, 2 Oct 2012 20:24:31 +0000 (16:24 -0400)]
alert: Initial Alert Notification
Initial implementation for Alert Notification Profile (ANP).
Bruna Moreira [Tue, 2 Oct 2012 20:24:30 +0000 (16:24 -0400)]
alert: Add Alert Status characteristic
This characteristic allows to read/notify the status of the ringer,
display and vibration motor.
Bruna Moreira [Tue, 2 Oct 2012 20:24:29 +0000 (16:24 -0400)]
alert: Add Ringer Setting characteristic
This characteristic allows to read or notify the ringer mode (silent or
normal).
Bruna Moreira [Tue, 2 Oct 2012 20:24:28 +0000 (16:24 -0400)]
alert: Add Ringer Control Point characteristic
Ringer CP characteristic is used for configuring "silent mode" or muting
the ringer once.
Bruna Moreira [Tue, 2 Oct 2012 20:24:27 +0000 (16:24 -0400)]
alert: Add Phone Alert Status Service
Add Phone Alert Status service for PASP.
Anderson Lizardo [Tue, 2 Oct 2012 20:24:26 +0000 (16:24 -0400)]
alert: Initial profile registration
Anderson Lizardo [Tue, 2 Oct 2012 20:24:25 +0000 (16:24 -0400)]
alert: Introduce manager abstraction layer
This abstraction layer makes the GATT Phone Alert Status and Alert
Notification implementation consistent with other GATT profiles.
Anderson Lizardo [Wed, 3 Oct 2012 12:46:38 +0000 (08:46 -0400)]
doc: Introduce Alert API
This API will be implemented and initially used by Phone Alert Status
and Alert Notification GATT profiles (server role).
Johan Hedberg [Wed, 3 Oct 2012 19:18:36 +0000 (22:18 +0300)]
core: Fix return value for external profile SDP function
Johan Hedberg [Wed, 3 Oct 2012 19:17:52 +0000 (22:17 +0300)]
core: Fix using correct address values for profile connecting
Johan Hedberg [Wed, 3 Oct 2012 19:17:15 +0000 (22:17 +0300)]
core: Add specific error to profile connect log
Johan Hedberg [Wed, 3 Oct 2012 15:29:14 +0000 (18:29 +0300)]
core: Add SDP resolving callback for external profiles
Johan Hedberg [Wed, 3 Oct 2012 14:58:09 +0000 (17:58 +0300)]
core: Add skeleton for initiating remote profile connections
Luiz Augusto von Dentz [Tue, 2 Oct 2012 14:01:39 +0000 (17:01 +0300)]
AVRCP: Fix not freeing session list on exit
96 (16 direct, 80 indirect) bytes in 1 blocks are definitely lost in loss record 261 of 338
at 0x4A0884D: malloc (vg_replace_malloc.c:263)
by 0x4C803FE: g_malloc (in /usr/lib64/libglib-2.0.so.0.3200.4)
by 0x4C94801: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.3200.4)
by 0x4C95B42: g_slist_append (in /usr/lib64/libglib-2.0.so.0.3200.4)
by 0x12FDAD: state_changed (avrcp.c:1401)
by 0x12D3B1: avctp_set_state (avctp.c:406)
by 0x12E5C4: avctp_confirm_cb (avctp.c:896)
by 0x1607D3: server_cb (btio.c:254)
by 0x4C7A824: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3200.4)
by 0x4C7AB57: ??? (in /usr/lib64/libglib-2.0.so.0.3200.4)
by 0x4C7AF51: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3200.4)
by 0x120EB1: main (main.c:551)
Luiz Augusto von Dentz [Mon, 1 Oct 2012 11:26:04 +0000 (14:26 +0300)]
AVRCP: Fix not removing session from player upon disconnect
Invalid read of size 8
at 0x1310E3: avrcp_unregister_player (avrcp.c:1604)
by 0x13EB57: path_free (media.c:1834)
by 0x123208: remove_interface.isra.1 (object.c:558)
by 0x1238DD: g_dbus_unregister_interface (object.c:705)
by 0x124BB8: media_server_remove (manager.c:1077)
by 0x4E91C5C: g_slist_foreach (in /usr/lib64/libglib-2.0.so.0.3200.4)
by 0x17B349: adapter_remove (adapter.c:2309)
by 0x176F39: manager_cleanup (manager.c:290)
by 0x120E65: main (main.c:555)
Address 0x6685058 is 24 bytes inside a block of size 80 free'd
at 0x4C279AE: free (vg_replace_malloc.c:427)
by 0x4E7C50E: g_free (in /usr/lib64/libglib-2.0.so.0.3200.4)
by 0x12FC97: state_changed (avrcp.c:1380)
by 0x12D351: avctp_set_state (avctp.c:396)
by 0x12D7B4: session_cb (avctp.c:601)
by 0x4E76824: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3200.4)
by 0x4E76B57: ??? (in /usr/lib64/libglib-2.0.so.0.3200.4)
by 0x4E76F51: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3200.4)
by 0x120E51: main (main.c:551)
Luiz Augusto von Dentz [Sun, 30 Sep 2012 11:21:32 +0000 (14:21 +0300)]
AVRCP: Fix not freeing player session list on exit
16 bytes in 1 blocks are definitely lost in loss record 111 of 359
at 0x4A0884D: malloc (vg_replace_malloc.c:263)
by 0x4C8026E: g_malloc (in /usr/lib64/libglib-2.0.so.0.3200.4)
by 0x4C94671: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.3200.4)
by 0x4C959B2: g_slist_append (in /usr/lib64/libglib-2.0.so.0.3200.4)
by 0x130FCC: avrcp_register_player (avrcp.c:1584)
by 0x13FA1F: register_player (media.c:1689)
by 0x123100: process_message.isra.0 (object.c:197)
by 0x4F70684: ??? (in /usr/lib64/libdbus-1.so.3.5.6)
by 0x4F6290C: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.5.6)
by 0x121747: message_dispatch (mainloop.c:76)
by 0x4C7B22A: ??? (in /usr/lib64/libglib-2.0.so.0.3200.4)
by 0x4C7A694: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3200.4)
Luiz Augusto von Dentz [Mon, 1 Oct 2012 17:45:38 +0000 (20:45 +0300)]
gdbus: Fix not freeing list node by using g_slist_delete_link
g_slist_remove_link does not free the node which can cause leaks so
replace that with g_slist_delete_link which does free memory properly.
Johan Hedberg [Wed, 3 Oct 2012 09:04:02 +0000 (12:04 +0300)]
core: Fix freeing external profile record
The add_record_to_server function takes ownership of the service record
so it only needs to be freed if the function fails.
João Paulo Rechi Vita [Tue, 2 Oct 2012 17:22:58 +0000 (14:22 -0300)]
core: Suspend scanning before connect on pairing
If there is a disconnected bonded device there will be a scanning
procedure active due to the General Connection Establishment Procedure.
This scan have to be suspended before trying to connect to the remote
device for pairing.
João Paulo Rechi Vita [Tue, 2 Oct 2012 17:22:57 +0000 (14:22 -0300)]
mgmt: Add address type to bonding debug message
Claudio Takahasi [Tue, 2 Oct 2012 17:22:56 +0000 (14:22 -0300)]
core: Re-connect for ECONNRESET or ECONNABORTED
This patch keeps scanning and re-connections active if the disconnection
reason is ECONNRESET(Remote Initiated Disconnection).
Re-connection is a behaviour determined by Profiles or by the upper
layer(user actions). For instance, HoG requires re-connection always
active, no matter if the previous disconnection reason was page timeout
or remote initiated disconnection (ECONNRESET). Some devices disconnects
after some idle time, connectable advertises are sent by the peripheral
when commanded by the user(eg: key pressed). Disconnection can be also
triggered by the local host (ECONNABORTED) using command line tools or
Disconnect method in the Device interface.
The peripheral dictates the re-connection controlling the connectable
advertises, BlueZ(central) needs to keep the scanning always active to
able to detect the advertises and trigger the connection.
Paulo Alcantara [Tue, 2 Oct 2012 17:22:55 +0000 (14:22 -0300)]
core: Disable unnecessary auto connections
BlueZ host disconnects the link when encryption fails. ECONNABORTED
error is returned by the kernel when the connection is terminated by the
local host. This scenario commonly happens when authentication fails due
PIN or Key Missing.
Claudio Takahasi [Tue, 2 Oct 2012 17:22:54 +0000 (14:22 -0300)]
core: Start LE scanning when a device requests
This patch enables the LE scanning when a device requires connection and
there isn't discovery sessions, triggering the General Connection
Establishment Procedure.
Claudio Takahasi [Tue, 2 Oct 2012 17:22:53 +0000 (14:22 -0300)]
core: Replace interleaved by LE scanning
This patches replaces the interleaved discovery by LE scanning when LE
re-connection is required.
Claudio Takahasi [Tue, 2 Oct 2012 17:22:52 +0000 (14:22 -0300)]
mgmt: Add LE scanning callback
This patch adds a new callback to allow the adapter to control LE
scanning. The current approach uses the active scanning with default
windows and intervals defined by the core spec without any filtering.
João Paulo Rechi Vita [Tue, 2 Oct 2012 17:22:51 +0000 (14:22 -0300)]
core: Mutually exclude concurrent connections
Since controllers don't support more than one ongoing connection
procedure at the same time, new connection attempts needs to yield if
there is an ongoing connection procedure already.
Mikel Astiz [Tue, 2 Oct 2012 17:46:40 +0000 (19:46 +0200)]
audio: Fix missing gateway state check on Connect
If the gateway is already connected (or connecting) when Connect() is
called, an error should be returned, exactly as other interfaces do.
Anderson Lizardo [Tue, 2 Oct 2012 12:50:20 +0000 (08:50 -0400)]
attrib: Get address type using gatt_get_address()
This avoids a separate call to device_get_addr_type().
Johan Hedberg [Tue, 2 Oct 2012 12:46:28 +0000 (15:46 +0300)]
core: Add support for ServiceRecord option for exteral profiles
Johan Hedberg [Tue, 2 Oct 2012 12:45:29 +0000 (15:45 +0300)]
core: Move sdp_xml_parse_record from service plugin to sdp-xml.c
Szymon Janc [Tue, 2 Oct 2012 11:39:55 +0000 (13:39 +0200)]
device: Remove not used variables from search_cb
sda and dba are not used in function code.
Johan Hedberg [Tue, 2 Oct 2012 12:05:36 +0000 (15:05 +0300)]
core: Add variables to track client/server enabling for external profiles
Johan Hedberg [Tue, 2 Oct 2012 10:51:01 +0000 (13:51 +0300)]
core: Support friendly names in profile registration
Johan Hedberg [Tue, 2 Oct 2012 10:50:26 +0000 (13:50 +0300)]
core: Use proper defines for SPP profile detection
Johan Hedberg [Tue, 2 Oct 2012 10:49:03 +0000 (13:49 +0300)]
core: Add missing profile "friendly names" to glib-helper.c
Johan Hedberg [Tue, 2 Oct 2012 10:43:07 +0000 (13:43 +0300)]
lib: Add SPP UUID define
Johan Hedberg [Tue, 2 Oct 2012 10:42:43 +0000 (13:42 +0300)]
lib: Add some missing svclass values
Szymon Janc [Tue, 2 Oct 2012 09:33:12 +0000 (11:33 +0200)]
agent: Remote not used variables from pincode_reply
adapter and sba are not used later in function code.
Szymon Janc [Tue, 2 Oct 2012 09:33:11 +0000 (11:33 +0200)]
service: Remove extra memory copying from cancel_authorization
src is never read before being overwritten few lines below.
Mikel Astiz [Mon, 1 Oct 2012 15:24:06 +0000 (17:24 +0200)]
audio: Fix crash on gateway close while connected
RFCOMM and SCO watches need to be removed in gateway_close(), otherwise
the watch callbacks might get called later on, resulting in a second
call to gateway_close().
The issue can be easily reproduced if a device is removed (unpaired) a
device while HFP gateway is connected:
bluetoothd[26579]: audio/gateway.c:path_unregister() Unregistered interface org.bluez.HandsfreeGateway on path /org/bluez/26579/hci0/dev_90_84_0D_B2_C7_04
bluetoothd[26579]: audio/media.c:gateway_state_changed()
bluetoothd[26579]: audio/media.c:gateway_state_changed() Clear endpoint 0x555555822cb0
bluetoothd[26579]: audio/source.c:path_unregister() Unregistered interface org.bluez.AudioSource on path /org/bluez/26579/hci0/dev_90_84_0D_B2_C7_04
bluetoothd[26579]: audio/avdtp.c:avdtp_unref() 0x555555827980: ref=2
bluetoothd[26579]: src/device.c:btd_device_unref() 0x55555581a470: ref=1
bluetoothd[26579]: src/device.c:btd_device_unref() 0x55555581a470: ref=0
bluetoothd[26579]: src/device.c:device_free() 0x55555581a470
Program received signal SIGSEGV, Segmentation fault.
gateway_close (device=0x555555820390) at audio/gateway.c:585
585 if (gw->rfcomm) {
Mikel Astiz [Mon, 1 Oct 2012 15:24:05 +0000 (17:24 +0200)]
audio: Fix crash if gateway closed before reply
Any pending call to the agent needs to be cancelled in gateway_close(),
to make sure newconnection_reply() never gets called.
Otherwise, the audio gateway can be closed (dev->gateway == NULL) before
the reply from the agent has been received, resulting in the following
crash as reproduced while removing (unpairing) a device:
bluetoothd[2219]: src/mgmt.c:mgmt_unpair_device() index 0 addr 38:16:D1:C5:D1:A2
bluetoothd[2219]: audio/gateway.c:path_unregister() Unregistered interface org.bluez.HandsfreeGateway on path /org/bluez/2219/hci0/dev_38_16_D1_C5_D1_A2
bluetoothd[2219]: audio/media.c:gateway_state_changed()
bluetoothd[2219]: audio/media.c:gateway_state_changed() Clear endpoint 0x555555820640
bluetoothd[2219]: audio/source.c:path_unregister() Unregistered interface org.bluez.AudioSource on path /org/bluez/2219/hci0/dev_38_16_D1_C5_D1_A2
bluetoothd[2219]: src/device.c:btd_device_unref() 0x555555833e70: ref=1
bluetoothd[2219]: src/adapter.c:adapter_get_device() 38:16:D1:C5:D1:A2
bluetoothd[2219]: src/adapter.c:adapter_create_device() 38:16:D1:C5:D1:A2
bluetoothd[2219]: src/device.c:device_create() Creating device /org/bluez/2219/hci0/dev_38_16_D1_C5_D1_A2
bluetoothd[2219]: src/device.c:device_free() 0x55555581f9c0
bluetoothd[2219]: Unable to get btd_device object for 38:16:D1:C5:D1:A2
bluetoothd[2219]: src/device.c:btd_device_unref() 0x555555833e70: ref=0
bluetoothd[2219]: src/device.c:device_free() 0x555555833e70
bluetoothd[2219]: src/mgmt.c:mgmt_event() cond 1
bluetoothd[2219]: src/mgmt.c:mgmt_event() Received 16 bytes from management socket
bluetoothd[2219]: src/mgmt.c:mgmt_cmd_complete()
bluetoothd[2219]: src/mgmt.c:mgmt_cmd_complete() unpair_device complete
Program received signal SIGSEGV, Segmentation fault.
0x000055555556fa26 in newconnection_reply (call=<optimized out>, data=0x555555824dd0) at audio/gateway.c:285
285 if (!dev->gateway->rfcomm) {
Additionally, this patch makes it unnecessary to check if RFCOMM got
disconnected before newconnection_reply, since RFCOMM disconnection also
triggers gateway_close() and thus the agent's call will be cancelled.
Mikel Astiz [Fri, 28 Sep 2012 16:32:25 +0000 (18:32 +0200)]
audio: Drop audio-specific authorization mechanism
Remove the audio-specific service authorization mechanism in favor of
using the conventional one.
The main difference is that audio profiles will be authorized
independently. Therefore a single connection might result in several
profile authorization requests to the agent (i.e. HFP, A2DP and AVRCP).
This removes any internal policy that would skip the authorization
procedure, making it simpler and more convenient for IVI use-cases.
Agents interested in simulating the old behavior are encouraged to
either set the device as trusted or just reply to the additional
authorization requests automatically without user intervention.
Mikel Astiz [Fri, 28 Sep 2012 16:32:24 +0000 (18:32 +0200)]
adapter: Queue parallel authorization requests
Remote device could try to connect several profiles in parallel, or
several devices could be trying to connect services. Instead of
returning EBUSY, this patch adds a queue to each adapter such that the
authorization requests will be queued and processed sequentially.
Mikel Astiz [Fri, 28 Sep 2012 16:32:23 +0000 (18:32 +0200)]
adapter: Use authorization id for cancelling
Return a request id in btd_request_authorization() in order to be used
when the request needs to be cancelled. This id alone will be enough to
use btd_cancel_authorization().
Mikel Astiz [Fri, 28 Sep 2012 16:32:22 +0000 (18:32 +0200)]
adapter: Replace device authorizing flag
Refactor code to drop the device authorizing flag by replacing it with a
private authorization pointer in btd_adapter. After all, no more than
one authorization can be ongoing, so the code is easier to follow if
this is made explicit.
Mikel Astiz [Fri, 28 Sep 2012 16:32:21 +0000 (18:32 +0200)]
build: Update glib dependency to 2.32
This version of the library adds several convenient features such as
g_queue_free_full.
Johan Hedberg [Mon, 1 Oct 2012 12:17:46 +0000 (15:17 +0300)]
core: Add skeleton for connecting external profiles
Johan Hedberg [Mon, 1 Oct 2012 10:43:25 +0000 (13:43 +0300)]
core: Fix profile cleanup when removing or disconnecting
Johan Hedberg [Mon, 1 Oct 2012 10:43:00 +0000 (13:43 +0300)]
core: Add btd_profile parameter to profile disconnect callback
Johan Hedberg [Mon, 1 Oct 2012 10:12:10 +0000 (13:12 +0300)]
core: Add proper adapter_remove callback for external profiles