| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
This changes the default of AutoEnable to true so controllers are power
up by default.
Fixes: https://github.com/bluez/bluez/issues/328
|
|
|
|
|
|
|
|
|
|
|
| |
This replaces the uses of g_memdup with util_memdup since the former has
been deprecated:
warning: ‘g_memdup’ is deprecated: Use 'g_memdup2' instead
[-Wdeprecated-declarations]
g_memdup2 requires bumping glib version which would likely have its
own problems thus why util_memdup was introduced.
|
|
|
|
|
|
|
|
| |
Instead of using BTD_SERVICE_STATE_CONNECTING use
btd_service_is_initiator to determine if the service initiated the
connection and then proceed to connect other service immediately.
Fixes: https://github.com/bluez/bluez/issues/205
|
|
|
|
|
| |
Replace calls to g_timeout_add_seconds() by the timeout_add_seconds()
wrapper which takes care of 0 delay.
|
|
|
|
|
| |
Since we use btd term for daemon APIs it makes sense to use it also
for the header name instead of hcid.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds SPDX License Identifier and removes the license text.
-------------------------------------
License COUNT
-------------------------------------
GPL-2.0-or-later : 7
License: GPL-2.0-or-later
plugins/autopair.c
plugins/hostname.c
plugins/neard.c
plugins/policy.c
plugins/sixaxis.c
plugins/wiimote.c
plugins/external-dummy.c
|
|
|
|
| |
APIs exposed to plugins shall have btd_ prefix.
|
|
|
|
|
|
|
|
| |
During system suspend, all peer devices are disconnected. On resume, HID
devices will reconnect but audio devices stay disconnected. As a quality
of life improvement, mark audio devices that were disconnected due to
suspend and attempt to reconnect them when the controller resumes (after
a delay for better co-existence with Wi-Fi).
|
|
|
|
| |
Add a2dp-sink to default reconnects list.
|
|
|
|
|
|
| |
If HFP/HSP HS connects and the device also supports a Sink connect it
as well since some devices (e.g. Sony MW600) may not connect it
automatically.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are two problems:
- When main.conf is not found, bluetoothd copies short the default set
of reconnecting intervals to reconnect_interval. It does not match
the reconnct_interval_len used as the array length.
So if a link of device is disconnected, bluetoothd is run over
reconnect_interval as time proceeds and will not time out as expected.
bluetooothd with --debug option outputed the following log in my box:
plugins/policy.c:reconnect_set_timer() attempt 1/7 1 seconds
plugins/policy.c:reconnect_timeout() Reconnecting profiles
plugins/policy.c:conn_fail_cb() status 4
plugins/policy.c:reconnect_set_timer() attempt 2/7 2 seconds
plugins/policy.c:reconnect_timeout() Reconnecting profiles
plugins/policy.c:conn_fail_cb() status 4
plugins/policy.c:reconnect_set_timer() attempt 3/7 0 seconds
plugins/policy.c:reconnect_timeout() Reconnecting profiles
plugins/policy.c:conn_fail_cb() status 4
plugins/policy.c:reconnect_set_timer() attempt 4/7 0 seconds
- When ReconnectIntervals in main.conf includes invalid characters,
reconnct_interval_len value is bigger than the default array length.
So if ReconnectAttempts value in main.conf is bigger than
reconnct_interval_len value and a link of device is disconnected,
bluetoothd is run over reconnect_interval as time proceeds and will
not time out as expected.
bluetooothd with --debug option outputed the following log in my box,
if ReconnectAttempts value was 28 and ReconnectIntervals was inproper:
...
plugins/policy.c:reconnect_set_timer() attempt 6/28 32 seconds
plugins/policy.c:reconnect_timeout() Reconnecting profiles
plugins/policy.c:conn_fail_cb() status 4
plugins/policy.c:reconnect_set_timer() attempt 7/28 64 seconds
plugins/policy.c:reconnect_timeout() Reconnecting profiles
plugins/policy.c:conn_fail_cb() status 4
plugins/policy.c:reconnect_set_timer() attempt 8/28 0 seconds
...
plugins/policy.c:reconnect_set_timer() attempt 25/28 1 seconds
plugins/policy.c:reconnect_timeout() Reconnecting profiles
plugins/policy.c:conn_fail_cb() status 4
plugins/policy.c:reconnect_set_timer() attempt 26/28 3 seconds
plugins/policy.c:reconnect_timeout() Reconnecting profiles
plugins/policy.c:conn_fail_cb() status 4
plugins/policy.c:reconnect_set_timer() attempt 27/28 110683472 seconds
This fix properly uses the default set of reconnecting intervals.
|
|
|
|
|
| |
If a service connects it should stop new attempts but the current ones
should continue so reconnection should not be reset.
|
|
|
|
| |
policy_connect_sink shall reset the sink_timer not source_timer.
|
|
|
|
|
|
| |
If the link is disconnected before any profile connects it shall still
reset the attempts as the device actually has been connected, otherwise
the number of attempts may not be respected.
|
|
|
|
| |
Other policies shall not interfere while reconnect is active.
|
|
|
|
| |
Set list separator to ',' as it is used in main.conf.
|
|
|
|
|
|
| |
Patch 96db78604252eeb17614b9982ced95fd66c6c6fc actually breaks
iterating to each attempt since the attempt++ is already done in
reconnect_timeout callback.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This option is used to configure policy for auto enabling adapters when
found. This includes adapters found on start as well as adapters that
are plugged in later on.
Some distributions use legacy "hciconfig hci0 up" in boot-scripts to
automatically enable controllers on start. But that is causing SMP
kernel code to not being properly initialized.
This patch allows distributions to automatically enable adapters in
race free manner even if no agent is provided eg. in login screen.
|
|
|
|
|
| |
The number of attempts and intervals maybe different causing the attempts
to not be incremented properly.
|
|
|
|
|
|
|
|
| |
This patch fixes the following error when bluez is compiled with clang:
plugins/policy.c:780:6: error: cast from 'int *' to 'size_t *' (aka 'unsigned long *') increases required alignment from 4 to 8 [-Werror,-Wcast-align]
(size_t *) &reconnect_intervals_len,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
| |
This adds ReconnectAttempts and ReconnectIntervals so platforms can fine
tune the reconnection strategy.
|
|
|
|
|
|
|
|
|
|
| |
If state of Control/Remote services changed from CONNECTING to
DISCONNECTED, and error is set to -EAGAIN, set random timer and try
reconnect. This approach is described in AVRCP Spec 1.5 4.1.1:
"If both devices open an AVCTP channel at the same time both channels
shall be closed and each device shall wait a random time
(not more than 1 s and not less than 100ms) and then try to open
the AVCTP channel again."
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If service becomes unavailable, due to e.g. the device being removed,
all the related timers should be removed as well otherwise it may cause
crashes such as the following:
Invalid read of size 8
at 0x4A6597: btd_device_get_service (device.c:5335)
by 0x40F49F: policy_connect_ct (policy.c:112)
by 0x4E7F552: ??? (in /usr/lib64/libglib-2.0.so.0.4200.1)
by 0x4E7EAEA: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.4200.1)
by 0x4E7EE87: ??? (in /usr/lib64/libglib-2.0.so.0.4200.1)
by 0x4E7F1B1: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.4200.1)
by 0x40BACF: main (main.c:631)
Address 0x73b9ba8 is 360 bytes inside a block of size 592 free'd
at 0x4C2ACE9: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
by 0x4E847FE: g_free (in /usr/lib64/libglib-2.0.so.0.4200.1)
by 0x49C83F: device_free (device.c:624)
by 0x4BDB29: remove_interface (object.c:658)
by 0x4BE701: g_dbus_unregister_interface (object.c:1382)
by 0x4A49DC: btd_device_unref (device.c:5173)
by 0x41DC46: avdtp_free (avdtp.c:1138)
by 0x41EE09: connection_lost (avdtp.c:1164)
by 0x422EA5: session_cb (avdtp.c:2263)
by 0x4E7EAEA: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.4200.1)
by 0x4E7EE87: ??? (in /usr/lib64/libglib-2.0.so.0.4200.1)
by 0x4E7F1B1: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.4200.1)
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This patch adds support for continuing reconnecting for several more
times (up to 3 minutes) even when a connection attempt fails.
|
| |
|
|
|
|
| |
The policy should only retry a limit number of times.
|
|
|
|
| |
The policy should only retry a limit number of times.
|
|
|
|
|
| |
policy plugin is a better place to have such a logic as it is already
handling other connection policies related to such profiles.
|
|
|
|
|
| |
policy plugin is a better place to have such a logic as it is already
handling other connection policies related to such profiles.
|
|
This moves audio device policy to a plugin and removes any dependency of
audio plugin to it.
|