diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2021-10-14 14:38:34 -0700 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2021-10-18 13:04:24 -0700 |
commit | 16f01989c213bd4770a2e20a16210da2d1354325 (patch) | |
tree | 69bf54bb6d2ead92efb116b73b249f7cfa1ea238 /emulator/main.c | |
parent | beb5cc05e8b0c4f83b562a95d5a313f4d5ed2b65 (diff) | |
download | bluez-16f01989c213bd4770a2e20a16210da2d1354325.tar.gz |
vhci: Read the controller index
This makes vhci instance read its controller index assigned by the
kernel and also introduces vhci_get_btdev so it can be used by the
likes of hciemu.
Diffstat (limited to 'emulator/main.c')
-rw-r--r-- | emulator/main.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/emulator/main.c b/emulator/main.c index aa269c3f0..f64d46a5e 100644 --- a/emulator/main.c +++ b/emulator/main.c @@ -17,12 +17,14 @@ #include <stdlib.h> #include <stdbool.h> #include <getopt.h> +#include <sys/uio.h> #include "src/shared/mainloop.h" #include "src/shared/util.h" #include "serial.h" #include "server.h" +#include "btdev.h" #include "vhci.h" #include "amp.h" #include "le.h" @@ -90,7 +92,7 @@ int main(int argc, char *argv[]) int letest_count = 0; int amptest_count = 0; int vhci_count = 0; - enum vhci_type vhci_type = VHCI_TYPE_BREDRLE; + enum btdev_type type = BTDEV_TYPE_BREDRLE52; int i; mainloop_init(); @@ -120,13 +122,13 @@ int main(int argc, char *argv[]) vhci_count = 1; break; case 'L': - vhci_type = VHCI_TYPE_LE; + type = BTDEV_TYPE_LE; break; case 'B': - vhci_type = VHCI_TYPE_BREDR; + type = BTDEV_TYPE_BREDR; break; case 'A': - vhci_type = VHCI_TYPE_AMP; + type = BTDEV_TYPE_AMP; break; case 'U': if (optarg) @@ -182,7 +184,7 @@ int main(int argc, char *argv[]) for (i = 0; i < vhci_count; i++) { struct vhci *vhci; - vhci = vhci_open(vhci_type); + vhci = vhci_open(type); if (!vhci) { fprintf(stderr, "Failed to open Virtual HCI device\n"); return EXIT_FAILURE; |