[PATCH BlueZ 4/5] device: Fix pairing with dual mode devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We'll prefer to pair services on connected bearer first.

There was a problem with pairing, that select_conn_bearer returned BR/EDR
even when we have connection to LE bearer only. In these situation we should
pair over connected bearer, since connection to another bearer can fail.
---
 src/device.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/device.c b/src/device.c
index 5a39a6f83..367e2f046 100644
--- a/src/device.c
+++ b/src/device.c
@@ -3017,6 +3017,11 @@ static DBusMessage *pair_device(DBusConnection *conn, DBusMessage *msg,
 		bdaddr_type = device->bdaddr_type;
 	else if (device->le_state.bonded)
 		bdaddr_type = BDADDR_BREDR;
+	else if (device->bredr_state.connected && !device->le_state.connected)
+		bdaddr_type = BDADDR_BREDR;
+	else if (!device->bredr_state.connected && device->le_state.connected)
+		bdaddr_type = device->bdaddr_type == BDADDR_BREDR
+			? BDADDR_LE_PUBLIC : device->bdaddr_type;
 	else
 		bdaddr_type = select_conn_bearer(device);
 
-- 
2.34.1




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux