Diff between 3d52be78216ef33224918775c348e947ae61494e and e3924049506cf0a6583dc5b1eef99c3918fd0b59

Changed Files

File Additions Deletions Status
emulator/btdev.c +9 -1 modified

Full Patch

diff --git a/emulator/btdev.c b/emulator/btdev.c
index 63d10e1..c127c0b 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -905,11 +905,19 @@ static bool adv_match(struct btdev *scan, struct btdev *adv)
 	return !memcmp(scan_addr(scan), adv->le_adv_direct_addr, 6);
 }
 
+static bool adv_connectable(struct btdev *btdev)
+{
+	if (!btdev->le_adv_enable)
+		return false;
+
+	return btdev->le_adv_type != 0x03;
+}
+
 static void le_conn_request(struct btdev *btdev, const uint8_t *bdaddr)
 {
 	struct btdev *remote = find_btdev_by_bdaddr(bdaddr);
 
-	if (remote && remote->le_adv_enable && adv_match(btdev, remote))
+	if (remote && adv_connectable(remote) && adv_match(btdev, remote))
 		le_conn_complete(btdev, bdaddr, 0);
 	else
 		le_conn_complete(btdev, bdaddr,