This simplify a bit the handling by introducing common checks before
calling the handler callback, it is also much easier to add/remove
new PDUs in this way.
This patch fixes wrong adapter state when using Management interface.
When bluetoothd starts, the adapter should be switched to the state
informed by Maemo6 MCE. In the current implementation, Maemo6 plugin
sends set powered command when the adapter is still powering up, the
last command sent fails(kernel returns EALREADY).
Fix unneeded Write Local Name command being sent when bluetoothd starts
or switching the adapter on. Using an array of chars it is not possible
to distinguish if there is a valid value to be set since empty is a
valid value.
When management interface is enabled, name changed event comes when the
adapter is initialized as consequence of the Read Local Name. Use the
same function to set and handle event causes looping when bluetoothd
starts if the name stored in the controller is different from the name
provided by the adapter name plugin.
Splitting the adapter_update_local_name also fix the PropertyChanged
(for Name) signal being sent before AdapterAdded.
GAttrib disconnect function needs to be set after discovering the
primary services if the connection callback list is not empty. After
creating a device the connection can stay up, for this scenario the
registered disconnection callbacks are not being called.
There are two reasons for this change:
First: consistency. __asm__ was already used elsewhere in the files, so
using that throughout is cleaner.
Second: both asm and __asm__ are GCC-specific extensions, not defined in
the C standard. When compiling with --std=gnu99 both are recognized, but
when using --std=c99 only __asm__ is recognized to make it perfectly
clear that you're not using some standard C99 construct, but a
GCC-extension.
Add support for mgmt interface events for device blocking/unblocking.
Kernel sends a mgmt event when a device has been blocked by another
management socket or with ioctl command (e.g. by hciconfig).
Parameter update_only is added to device_block/unblock functions in
device.c to avoid code copying. When update_only is true, blocking
command is not sent to kernel, but only device status is updated and
dbus signal is sent.
When the avctp channel is not connected, we call
g_io_channel_unix_get_fd() with a NULL pointer. Glib does not check the
pointer before dereferencing it, causing bluetoothd to segv.
Move the function call to the place it's actually needed, after the
safety checks.
That is standard processing when dbus_error_is_set() returns true, according to
dbus/dbus/dbus-errors.c.
In this case of g_dbus_setup_bus(), it provides extra help for determing the
specific cause of the error.
Variable len could be assigned to PATH_MAX + 1 length (returned
from readlink) and this variable is used as index to array link
of size only PATH_MAX + 1.
Indexing of chassis_map array has to be done like that:
chassis_map[chassis_type * 2 - 1]
because if not, everything is shifted by one. When (e.g.) chassis_type
is 0x04 result should be "Low Profile Desktop" => "desktop" (not a
"Pizza Box" => "server"). Lets see the 2.6.1 document on:
http://www.dmtf.org/standards/smbios
The header files with constants and structures for audio specific
interaction with Pulseaudio are suppose to be under LGPL license.
For some odd reason a2dp-codecs.h ended up being under GPL license
which is against the intention of this being shared and re-used by
non-GPL programs. Fix this now to avoid any future confusion.
When a HFPHS endpoint is created, media will start to watch for
HandsfreeGateway state changes. media call SetConfiguration upon
connection and ClearConfiguration upon disconnection.
If SetConfiguration call fails, the headset or gateway for which
SetConfiguration is called is disconnected. This will free any
pending request, but this does not prevent the request to
terminate (endpoint_reply) and try to free itself once again.
Note that a copy of the freed pointer is tested which has not
been updated.
After creating a Proximity device, Link Loss alert level is always
written. Setting the default value to "high" enables alert without
requiring an application to change it later.
This fixes regression caused by 33cdfcb0fa.
Temporary link key should be removed after device is disconnected if
bonding information is not stored in file system.
Currently, the key is deleted only when paired device is removed, or
adapter is powered off. In case of No Bonding authentication, device is
not paired after disconnection, which results in link key left in memory.
On the other hand, device is not necessarily removed after disconnection
that also leaves unneeded temporary link key in memory. Therefore,
btd_adapter_remove_bonding is moved to device_set_paired(device, FALSE)
covering both cases.
Local extended features bitmask may change when Write LE Host Supported
Command is sent by the kernel. This patch adds reading of the local
extended features in the initialization sending a HCI command, extend
the ioctl HCIGETDEVINFO is not suitable due possible inconsistency
between kernel and userspace.
Deprecated configure option after adding "enable_le" parameter in the
bluetooth module. Write LE Host Supported Command is now sent by the
kernel if "enable_le" is enabled and the controller supports LE.
AVDTP_CONNECT_TIMEOUT controls the delay between HSP/HFP
connection establishment and AVDTP signal channel establishment.
The original value of 1 sec. is too short to avoid racing for AVDTP
connection establishment (eg., if the device continues to configure
the HFP service level connection with additional AT cmds).
Some devices have broken AVDTP implementations that just cannot
handle the race conditions that arise if both devices are attempting
stream establishment at the same time. However, these conditions arise
only when the remote device is the ACL initiator (and in practice, the
RFCOMM initiator as well). This fix bumps out the timeout value only
when the headset has initiated the link.