[PATCH BlueZ] adapter: remove eir_data.flags in device_update_last_seen()

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

 



From: Joseph Hwang <josephsih@xxxxxxxxxxxx>

Bluez has difficulty in pairing with Apple Airpods. This issue is
caused by the incorrect selection of BD address type due to two factors:

(1) The LE advertising reports emitted by Airpods do not carry eir
    data flags.
(2) If the eir data flags is missing, the found device would not be
    considered as coming with bredr address for some historical
    obsolete reason.

This patch fixes (2) above.

Tested on Chrome OS by pairing with Airpods.
Without this patch, the pairing success rate is about 20%.
With this patch, the pairing success rate becomes almost 100%.

---
 src/adapter.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index 5e896a9f0..36bbed2dd 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -6628,14 +6628,8 @@ static void update_found_devices(struct btd_adapter *adapter,
 
 	device_update_last_seen(dev, bdaddr_type);
 
-	/*
-	 * FIXME: We need to check for non-zero flags first because
-	 * older kernels send separate adv_ind and scan_rsp. Newer
-	 * kernels send them merged, so once we know which mgmt version
-	 * supports this we can make the non-zero check conditional.
-	 */
-	if (bdaddr_type != BDADDR_BREDR && eir_data.flags &&
-					!(eir_data.flags & EIR_BREDR_UNSUP)) {
+	if (bdaddr_type != BDADDR_BREDR &&
+			!(eir_data.flags & EIR_BREDR_UNSUP)) {
 		device_set_bredr_support(dev);
 		/* Update last seen for BR/EDR in case its flag is set */
 		device_update_last_seen(dev, BDADDR_BREDR);
-- 
2.26.2




[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