Skip to contentSkip to conversation

core: Only page device once per connect attempt

PATCH Applied Luiz Augusto von Dentz 2 participants 2 messages Jun 12, 2013 – Jun 13, 2013 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 core: Only page device once per connect attempt

From: Luiz Augusto von Dentz <[email protected]>

In case of EHOSTDOWN/page timeout the code should not proceed with the next profile as it is very likely it will fail again, moreover the page timeout is configurable and should be enough for getting a response from the remote device in a reasonable time.

---
 src/device.c | 4 ++++
 1 file changed, 4 insertions(+)
src/device.c +4 -0
index 5cb5460..0f75c60 100644
@@ -1164,6 +1164,9 @@ static void device_profile_connected(struct btd_device *dev,
 	if (dev->pending == NULL)
 		return;
 
+	if (!dev->connected && err == -EHOSTDOWN)
+		goto done;
+
 	pending = dev->pending->data;
 	l = find_service_with_profile(dev->pending, profile);
 	if (l != NULL)
@@ -1179,6 +1182,7 @@ static void device_profile_connected(struct btd_device *dev,
 	if (connect_next(dev) == 0)
 		return;
 
+done:
 	if (!dev->connect)
 		return;
 
Signature · 1 line
1.8.1.4
#1 lore raw

Hi Luiz,

Quoted 7 lines · Luiz Augusto von Dentz

In case of EHOSTDOWN/page timeout the code should not proceed with the next profile as it is very likely it will fail again, moreover the page timeout is configurable and should be enough for getting a response from the remote device in a reasonable time.

---
 src/device.c | 4 ++++
 1 file changed, 4 insertions(+)

Applied. Thanks.

Johan