All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v1] device: Fix Pair method not setting auto_connect
@ 2024-08-29 20:18 Luiz Augusto von Dentz
  2024-08-29 22:01 ` [BlueZ,v1] " bluez.test.bot
  2024-08-30 15:50 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2024-08-29 20:18 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

Due to commit 507ba12483c3 ("profile: Remove probe_on_discover")
disable_auto_connect may be set when a service is probed but the device
is still temporary which is normally the result of service being
discovered over advertisement rather than connection.

To fix this the Device.Pair method needs to check if the
disable_auto_connect flag has been set and then reset it set auto_connect
which is similar to how Device.Connect works.
---
 src/device.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/device.c b/src/device.c
index 1a5e8a7caa27..0f18c8c7f54e 100644
--- a/src/device.c
+++ b/src/device.c
@@ -3114,6 +3114,11 @@ static DBusMessage *pair_device(DBusConnection *conn, DBusMessage *msg,
 	 * this in the ATT connect callback)
 	 */
 	if (bdaddr_type != BDADDR_BREDR) {
+		if (device->disable_auto_connect) {
+			device->disable_auto_connect = FALSE;
+			device_set_auto_connect(device, TRUE);
+		}
+
 		if (!state->connected && btd_le_connect_before_pairing())
 			err = device_connect_le(device);
 		else
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-30 15:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-29 20:18 [PATCH BlueZ v1] device: Fix Pair method not setting auto_connect Luiz Augusto von Dentz
2024-08-29 22:01 ` [BlueZ,v1] " bluez.test.bot
2024-08-30 15:50 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.