Diff between e3f36f586c8f128dd4f696f715640e74d7907bc4 and dce0b7df9b6294961e0b355234a87391dc187b1e

Changed Files

File Additions Deletions Status
src/adapter.c +6 -4 modified

Full Patch

diff --git a/src/adapter.c b/src/adapter.c
index 9de161b..5af8489 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -5373,6 +5373,7 @@ static void update_found_devices(struct btd_adapter *adapter,
 					const bdaddr_t *bdaddr,
 					uint8_t bdaddr_type, int8_t rssi,
 					bool confirm, bool legacy,
+					bool not_connectable,
 					const uint8_t *data, uint8_t data_len)
 {
 	struct btd_device *dev;
@@ -5501,6 +5502,10 @@ static void update_found_devices(struct btd_adapter *adapter,
 	return;
 
 connect_le:
+	/* Ignore non-connectable events */
+	if (not_connectable)
+		return;
+
 	/*
 	 * If we're in the process of stopping passive scanning and
 	 * connecting another (or maybe even the same) LE device just
@@ -5563,15 +5568,12 @@ static void device_found_callback(uint16_t index, uint16_t length,
 	DBG("hci%u addr %s, rssi %d flags 0x%04x eir_len %u",
 			index, addr, ev->rssi, flags, eir_len);
 
-	/* Ignore non-connectable events for now */
-	if (flags & MGMT_DEV_FOUND_NOT_CONNECTABLE)
-		return;
-
 	confirm_name = (flags & MGMT_DEV_FOUND_CONFIRM_NAME);
 	legacy = (flags & MGMT_DEV_FOUND_LEGACY_PAIRING);
 
 	update_found_devices(adapter, &ev->addr.bdaddr, ev->addr.type,
 					ev->rssi, confirm_name, legacy,
+					flags & MGMT_DEV_FOUND_NOT_CONNECTABLE,
 					eir, eir_len);
 }