diff mbox series

[BlueZ,v1,2/2] gas: Fix default PPCP connection intervals

Message ID 20240612191145.1379415-2-luiz.dentz@gmail.com (mailing list archive)
State Accepted
Commit 0b02371e2b15295d45bf2c8bf7faf39ce48d6953
Headers show
Series [BlueZ,v1,1/2] device: Fix storing conn parameters without first attempting to use them | 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 June 12, 2024, 7:11 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If the remove sets 0xffff switch to using 30-50ms as that is the
recommended values for GAP as 7.5ms-4s seems to be causing problems on
some controllers.
---
 profiles/gap/gas.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/profiles/gap/gas.c b/profiles/gap/gas.c
index b50a9c03acd1..dbe5f003bfba 100644
--- a/profiles/gap/gas.c
+++ b/profiles/gap/gas.c
@@ -182,19 +182,19 @@  static void read_ppcp_cb(bool success, uint8_t att_ecode,
 	latency = get_le16(&value[4]);
 	timeout = get_le16(&value[6]);
 
+	/* 0xffff indicates no specific min/max */
+	if (min_interval == 0xffff)
+		min_interval = 0x0018; /* 30.0ms */
+
+	if (max_interval == 0xffff)
+		max_interval = 0x0028; /* 50.0ms */
+
 	DBG("GAP Peripheral Preferred Connection Parameters:");
 	DBG("\tMinimum connection interval: %u", min_interval);
 	DBG("\tMaximum connection interval: %u", max_interval);
 	DBG("\tSlave latency: %u", latency);
 	DBG("\tConnection Supervision timeout multiplier: %u", timeout);
 
-	/* 0xffff indicates no specific min/max */
-	if (min_interval == 0xffff)
-		min_interval = 6;
-
-	if (max_interval == 0xffff)
-		max_interval = 3200;
-
 	/* avoid persisting connection parameters that are not valid */
 	if (min_interval > max_interval ||
 	    min_interval < 6 || max_interval > 3200) {