From 9d31f827ed9abb214b25e49fc4f098f450a513b9 Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Mon, 2 Jul 2018 14:58:37 +0200 Subject: [PATCH] windows-winusb: ignore virtual Bluetooth adapter provided by VMware --- platform/windows/hci_transport_h2_winusb.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/platform/windows/hci_transport_h2_winusb.c b/platform/windows/hci_transport_h2_winusb.c index 1352a5825..caf5b1a13 100644 --- a/platform/windows/hci_transport_h2_winusb.c +++ b/platform/windows/hci_transport_h2_winusb.c @@ -328,6 +328,12 @@ static int usb_is_known_bluetooth_device(const char * device_path){ return 0; } +static int usb_is_vmware_bluetooth_adapter(const char * device_path){ + // VMware Vendor ID 0e0f + const char * pos = strstr(device_path, "\\usb#vid_0e0f&pid"); + return pos ? 1 : 0; +} + #ifdef ENABLE_SCO_OVER_HCI static void sco_ring_init(void){ sco_ring_write = 0; @@ -936,6 +942,14 @@ static int usb_try_open_device(const char * device_path){ USB_INTERFACE_DESCRIPTOR usb_interface_descriptor; result = WinUsb_QueryInterfaceSettings(usb_interface_0_handle, 0, &usb_interface_descriptor); if (!result) goto exit_on_error; + + // ignore virtual Bluetooth adapter of VMware + if (usb_is_vmware_bluetooth_adapter(device_path) { + log_info("Ignoring simulated VMware Bluetooth adapter"); + usb_free_resources(); + return -1; + } + // if (usb_interface_descriptor.bInterfaceClass != 0xe0 || usb_interface_descriptor.bInterfaceSubClass != 0x01 ||