diff --git a/src/shared/hciemu.c b/src/shared/hciemu.c
index e921740..97ea84e 100644
--- a/src/shared/hciemu.c
+++ b/src/shared/hciemu.c
struct hciemu {
gint ref_count;
+ enum btdev_type btdev_type;
struct bthost *host_stack;
struct btdev *master_dev;
struct btdev *client_dev;
const char *str;
int fd, i;
- btdev = btdev_create(BTDEV_TYPE_BREDRLE, 0x00);
+ btdev = btdev_create(hciemu->btdev_type, 0x00);
if (!btdev)
return false;
struct bthost *bthost;
int sv[2];
- btdev = btdev_create(BTDEV_TYPE_BREDRLE, 0x00);
+ btdev = btdev_create(hciemu->btdev_type, 0x00);
if (!btdev)
return false;
return FALSE;
}
-struct hciemu *hciemu_new(void)
+struct hciemu *hciemu_new(enum hciemu_type type)
{
struct hciemu *hciemu;
if (!hciemu)
return NULL;
+ switch (type) {
+ case HCIEMU_TYPE_BREDRLE:
+ hciemu->btdev_type = BTDEV_TYPE_BREDRLE;
+ break;
+ case HCIEMU_TYPE_BREDR:
+ hciemu->btdev_type = BTDEV_TYPE_BREDR;
+ break;
+ case HCIEMU_TYPE_LE:
+ hciemu->btdev_type = BTDEV_TYPE_LE;
+ break;
+ default:
+ return NULL;
+ }
+
if (!create_vhci(hciemu)) {
g_free(hciemu);
return NULL;
diff --git a/src/shared/hciemu.h b/src/shared/hciemu.h
index 4c2afca..0b2da35 100644
--- a/src/shared/hciemu.h
+++ b/src/shared/hciemu.h
struct hciemu;
-struct hciemu *hciemu_new(void);
+enum hciemu_type {
+ HCIEMU_TYPE_BREDRLE,
+ HCIEMU_TYPE_BREDR,
+ HCIEMU_TYPE_LE,
+};
+
+struct hciemu *hciemu_new(enum hciemu_type type);
struct hciemu *hciemu_ref(struct hciemu *hciemu);
void hciemu_unref(struct hciemu *hciemu);