From 946e51cdc39f44b8abcf4c149b36212e6f499511 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 31 Jan 2013 14:11:46 -0600 Subject: [PATCH] emulator: Create separate BR/EDR, BR/EDR/LE and LE vhci types --- emulator/vhci.c | 12 +++++++++++- emulator/vhci.h | 2 ++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/emulator/vhci.c b/emulator/vhci.c index 52876ba91..8fddef7ab 100644 --- a/emulator/vhci.c +++ b/emulator/vhci.c @@ -37,6 +37,8 @@ #include "btdev.h" #include "vhci.h" +#define uninitialized_var(x) x = x + struct vhci { enum vhci_type type; int fd; @@ -83,9 +85,17 @@ static void vhci_read_callback(int fd, uint32_t events, void *user_data) struct vhci *vhci_open(enum vhci_type type) { struct vhci *vhci; + enum btdev_type uninitialized_var(btdev_type); switch (type) { + case VHCI_TYPE_BREDRLE: + btdev_type = BTDEV_TYPE_BREDRLE; + break; case VHCI_TYPE_BREDR: + btdev_type = BTDEV_TYPE_BREDR; + break; + case VHCI_TYPE_LE: + btdev_type = BTDEV_TYPE_LE; break; case VHCI_TYPE_AMP: return NULL; @@ -104,7 +114,7 @@ struct vhci *vhci_open(enum vhci_type type) return NULL; } - vhci->btdev = btdev_create(BTDEV_TYPE_BREDR, 0x23); + vhci->btdev = btdev_create(btdev_type, 0x23); if (!vhci->btdev) { close(vhci->fd); free(vhci); diff --git a/emulator/vhci.h b/emulator/vhci.h index a9d80692b..b9ae63fc1 100644 --- a/emulator/vhci.h +++ b/emulator/vhci.h @@ -25,7 +25,9 @@ #include enum vhci_type { + VHCI_TYPE_BREDRLE, VHCI_TYPE_BREDR, + VHCI_TYPE_LE, VHCI_TYPE_AMP, }; -- 2.47.3