Diff between 5c6eb25dfd56ca4c97d98b32cb5de4a6788bffa9 and dda571b9192125804f288d29d488e930c590edde

Changed Files

File Additions Deletions Status
src/shared/hciemu.c +14 -0 modified

Full Patch

diff --git a/src/shared/hciemu.c b/src/shared/hciemu.c
index 90c21f3..0ea191f 100644
--- a/src/shared/hciemu.c
+++ b/src/shared/hciemu.c
@@ -35,6 +35,9 @@
 
 #include <glib.h>
 
+#include <bluetooth/bluetooth.h>
+#include <bluetooth/hci.h>
+
 #include "monitor/bt.h"
 #include "emulator/btdev.h"
 #include "emulator/bthost.h"
@@ -201,6 +204,8 @@ static guint create_source_btdev(int fd, struct btdev *btdev)
 static bool create_vhci(struct hciemu *hciemu)
 {
 	struct btdev *btdev;
+	uint8_t create_req[2];
+	ssize_t written;
 	int fd;
 
 	btdev = btdev_create(hciemu->btdev_type, 0x00);
@@ -215,6 +220,15 @@ static bool create_vhci(struct hciemu *hciemu)
 		return false;
 	}
 
+	create_req[0] = HCI_VENDOR_PKT;
+	create_req[1] = HCI_BREDR;
+	written = write(fd, create_req, sizeof(create_req));
+	if (written < 0) {
+		close(fd);
+		btdev_destroy(btdev);
+		return false;
+	}
+
 	hciemu->master_dev = btdev;
 
 	hciemu->master_source = create_source_btdev(fd, btdev);