Diff between 43ec488a22884a758f2254c28235aacacb96d5ee and 09c2d256473079f0a7a8cabcc10fc0ede5928226

Changed Files

File Additions Deletions Status
emulator/btdev.c +4 -1 modified
emulator/btdev.h +5 -1 modified
emulator/server.c +1 -1 modified
emulator/vhci.c +1 -1 modified

Full Patch

diff --git a/emulator/btdev.c b/emulator/btdev.c
index 8ec04eb..40f6149 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -38,6 +38,8 @@
 #define cpu_to_le16(val) (val)
 
 struct btdev {
+	enum btdev_type type;
+
 	struct btdev *conn;
 
 	btdev_send_func send_handler;
@@ -170,7 +172,7 @@ static void get_bdaddr(uint16_t id, uint8_t index, uint8_t *bdaddr)
 	bdaddr[5] = 0x00;
 }
 
-struct btdev *btdev_create(uint16_t id)
+struct btdev *btdev_create(enum btdev_type type, uint16_t id)
 {
 	struct btdev *btdev;
 	int index;
@@ -180,6 +182,7 @@ struct btdev *btdev_create(uint16_t id)
 		return NULL;
 
 	memset(btdev, 0, sizeof(*btdev));
+	btdev->type = type;
 
 	btdev->manufacturer = 63;
 	btdev->version = 0x06;
diff --git a/emulator/btdev.h b/emulator/btdev.h
index 7b211a2..b2f96cf 100644
--- a/emulator/btdev.h
+++ b/emulator/btdev.h
@@ -27,9 +27,13 @@
 typedef void (*btdev_send_func) (const void *data, uint16_t len,
 							void *user_data);
 
+enum btdev_type {
+	BTDEV_TYPE_BREDR,
+};
+
 struct btdev;
 
-struct btdev *btdev_create(uint16_t id);
+struct btdev *btdev_create(enum btdev_type type, uint16_t id);
 void btdev_destroy(struct btdev *btdev);
 
 void btdev_set_send_handler(struct btdev *btdev, btdev_send_func handler,
diff --git a/emulator/server.c b/emulator/server.c
index fa8f9c3..f2455e9 100644
--- a/emulator/server.c
+++ b/emulator/server.c
@@ -205,7 +205,7 @@ static void server_accept_callback(int fd, uint32_t events, void *user_data)
 		return;
 	}
 
-	client->btdev = btdev_create(server->id);
+	client->btdev = btdev_create(BTDEV_TYPE_BREDR, server->id);
 	if (!client->btdev) {
 		close(client->fd);
 		free(client);
diff --git a/emulator/vhci.c b/emulator/vhci.c
index 940e562..913ae81 100644
--- a/emulator/vhci.c
+++ b/emulator/vhci.c
@@ -104,7 +104,7 @@ struct vhci *vhci_open(enum vhci_type type, uint16_t id)
 		return NULL;
 	}
 
-	vhci->btdev = btdev_create(id);
+	vhci->btdev = btdev_create(BTDEV_TYPE_BREDR, id);
 	if (!vhci->btdev) {
 		close(vhci->fd);
 		free(vhci);