diff mbox series

[BlueZ,2/2] device: Restart temporary timer while connecting

Message ID 20230817224103.3042055-2-luiz.dentz@gmail.com (mailing list archive)
State Accepted
Commit 0004eb06d5d9a2f27521d9ce3b206d6f3f82c61e
Headers show
Series [BlueZ,1/2] device: Don't attempt to set auto_connect for devices using RPAs | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/IncrementalBuild success Incremental Build PASS

Commit Message

Luiz Augusto von Dentz Aug. 17, 2023, 10:41 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If the device is temporary restart its timer when attempt to connect to
it since it can interrupt the connection attempt prematurely while it
still scanning, etc.
---
 src/device.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/src/device.c b/src/device.c
index f6b0167bf55b..9b58e0c4e6c5 100644
--- a/src/device.c
+++ b/src/device.c
@@ -5754,6 +5754,10 @@  int device_connect_le(struct btd_device *dev)
 	/* Keep this, so we can cancel the connection */
 	dev->att_io = io;
 
+	/* Restart temporary timer to give it time to connect/pair, etc. */
+	if (dev->temporary)
+		set_temporary_timer(dev, btd_opts.tmpto);
+
 	return 0;
 }