33 lines
1.2 KiB
Diff
33 lines
1.2 KiB
Diff
From 3a908f611b0ea84e3388215ae800d9bec05b10b6 Mon Sep 17 00:00:00 2001
|
|
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
|
|
Date: Tue, 23 Aug 2016 12:58:03 +0300
|
|
Subject: [PATCH 4/7] core/device: Prefer bonded bearers when connecting
|
|
|
|
When attempting to connect a dual-mode device prefer bonded bearer if
|
|
only one has been marked as bonded. This prevents connecting to a
|
|
different bearer after pairing is complete and cross transport pairing
|
|
is not supported.
|
|
|
|
Upstream-Status: Inappropriate [DEY specific]
|
|
---
|
|
src/device.c | 6 ++++++
|
|
1 file changed, 6 insertions(+)
|
|
|
|
diff --git a/src/device.c b/src/device.c
|
|
index 0b13a3190539..ade74e58a3bf 100644
|
|
--- a/src/device.c
|
|
+++ b/src/device.c
|
|
@@ -1742,6 +1742,12 @@ static uint8_t select_conn_bearer(struct btd_device *dev)
|
|
time_t bredr_last = NVAL_TIME, le_last = NVAL_TIME;
|
|
time_t current = time(NULL);
|
|
|
|
+ /* Prefer bonded bearer in case only one is bonded */
|
|
+ if (dev->bredr_state.bonded && !dev->le_state.bonded )
|
|
+ return BDADDR_BREDR;
|
|
+ else if (!dev->bredr_state.bonded && dev->le_state.bonded)
|
|
+ return dev->bdaddr_type;
|
|
+
|
|
if (dev->bredr_seen) {
|
|
bredr_last = current - dev->bredr_seen;
|
|
if (bredr_last > SEEN_TRESHHOLD)
|