RFC: Add HID bus type in hid_device_info #308

Merged
DJm00n merged 3 commits from hid_bus_type into master 2022-09-10 11:18:09 -05:00
DJm00n commented 2021-07-22 06:22:09 -05:00 (Migrated from github.com)

It happens that Bluetooth HID gamepads are having the same VID/PID as when connected via USB (DualShock4 and DualSense for example). But they have different report descriptors and thus input/output reports. We need a way to differentiate them.

To address this I have added a new hid_bus_type enum and hid_bus_type bus_type field to hid_device_info struct:

typedef enum {
	/* Unknown bus type */
	HID_API_BUS_UNKNOWN = 0x00,

	/* USB bus
	   Specifications:
	   https://usb.org/hid */
	HID_API_BUS_USB = 0x01,

	/* Bluetooth or Bluetooth LE bus
	   Specifications:
	   https://www.bluetooth.com/specifications/specs/human-interface-device-profile-1-1-1/
	   https://www.bluetooth.com/specifications/specs/hid-service-1-0/
	   https://www.bluetooth.com/specifications/specs/hid-over-gatt-profile-1-0/ */
	HID_API_BUS_BLUETOOTH = 0x02,

	/* I2C bus
	   Specifications:
	   https://docs.microsoft.com/previous-versions/windows/hardware/design/dn642101(v=vs.85) */
	HID_API_BUS_I2C = 0x03,

	/* SPI bus
	   Specifications:
	   https://www.microsoft.com/download/details.aspx?id=103325 */
	HID_API_BUS_SPI = 0x04,
} hid_bus_type;

Implemented it for Windows, libusb, hidraw and MacOS backends.

It happens that Bluetooth HID gamepads are having the same VID/PID as when connected via USB (DualShock4 and DualSense for example). But they have different report descriptors and thus input/output reports. We need a way to differentiate them. To address this I have added a new `hid_bus_type` enum and `hid_bus_type bus_type` field to `hid_device_info` struct: ```c typedef enum { /* Unknown bus type */ HID_API_BUS_UNKNOWN = 0x00, /* USB bus Specifications: https://usb.org/hid */ HID_API_BUS_USB = 0x01, /* Bluetooth or Bluetooth LE bus Specifications: https://www.bluetooth.com/specifications/specs/human-interface-device-profile-1-1-1/ https://www.bluetooth.com/specifications/specs/hid-service-1-0/ https://www.bluetooth.com/specifications/specs/hid-over-gatt-profile-1-0/ */ HID_API_BUS_BLUETOOTH = 0x02, /* I2C bus Specifications: https://docs.microsoft.com/previous-versions/windows/hardware/design/dn642101(v=vs.85) */ HID_API_BUS_I2C = 0x03, /* SPI bus Specifications: https://www.microsoft.com/download/details.aspx?id=103325 */ HID_API_BUS_SPI = 0x04, } hid_bus_type; ``` Implemented it for Windows, libusb, hidraw and MacOS backends.
DJm00n commented 2021-07-22 08:37:51 -05:00 (Migrated from github.com)

Sony DualSense controller example.

Before:

Device Found
  type: 054c 0ce6
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002054c_pid&0ce6#8&3265df1c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: a0ab518cf90a
  Manufacturer: Sony Interactive Entertainment
  Product:      Wireless Controller
  Release:      0
  Interface:    -1
  Usage (page): 0x5 (0x1)

Device Found
  type: 054c 0ce6
  path: \\?\hid#vid_054c&pid_0ce6&mi_03#7&2a5e324d&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Sony Interactive Entertainment
  Product:      Wireless Controller
  Release:      100
  Interface:    3
  Usage (page): 0x5 (0x1)

After:

Device Found
  type: 054c 0ce6
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002054c_pid&0ce6#8&3265df1c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: a0ab518cf90a
  Manufacturer: Sony Interactive Entertainment
  Product:      Wireless Controller
  Release:      0
  Interface:    -1
  Usage (page): 0x5 (0x1)
  Bus type: 2
  
Device Found
  type: 054c 0ce6
  path: \\?\hid#vid_054c&pid_0ce6&mi_03#7&2a5e324d&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Sony Interactive Entertainment
  Product:      Wireless Controller
  Release:      100
  Interface:    3
  Usage (page): 0x5 (0x1)
  Bus type: 1
Sony DualSense controller example. Before: ``` Device Found type: 054c 0ce6 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002054c_pid&0ce6#8&3265df1c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: a0ab518cf90a Manufacturer: Sony Interactive Entertainment Product: Wireless Controller Release: 0 Interface: -1 Usage (page): 0x5 (0x1) Device Found type: 054c 0ce6 path: \\?\hid#vid_054c&pid_0ce6&mi_03#7&2a5e324d&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Sony Interactive Entertainment Product: Wireless Controller Release: 100 Interface: 3 Usage (page): 0x5 (0x1) ``` After: ``` Device Found type: 054c 0ce6 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002054c_pid&0ce6#8&3265df1c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: a0ab518cf90a Manufacturer: Sony Interactive Entertainment Product: Wireless Controller Release: 0 Interface: -1 Usage (page): 0x5 (0x1) Bus type: 2 Device Found type: 054c 0ce6 path: \\?\hid#vid_054c&pid_0ce6&mi_03#7&2a5e324d&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Sony Interactive Entertainment Product: Wireless Controller Release: 100 Interface: 3 Usage (page): 0x5 (0x1) Bus type: 1 ```
DJm00n commented 2021-07-22 08:38:31 -05:00 (Migrated from github.com)

I didn't test Linux version yet.

I didn't test Linux version yet.
DJm00n commented 2021-07-23 14:15:13 -05:00 (Migrated from github.com)

@mcuee @Youw can you test it on Linux?

@mcuee @Youw can you test it on Linux?
Youw commented 2021-07-23 16:18:21 -05:00 (Migrated from github.com)

Technically I could, but right now I'm a little short on time regarding everything, so I can only ask not to make any expectations when I'll do it
I can only promice that I will, and I'm also going to see if this can be implemented for macOS as well

Technically I could, but right now I'm a little short on time regarding everything, so I can only ask not to make any expectations _when_ I'll do it I can only promice that I will, and I'm also going to see if this can be implemented for macOS as well
mcuee commented 2021-07-23 20:23:36 -05:00 (Migrated from github.com)

Here is the test results on my Raspberry Pi 400 running 64bit Ubuntu Linux.

click to expand for the run log
hidapi_djm on  hid_bus_type via △ v3.18.4 took 3s ❯ ./hidtest/hidtest-libusb 
hidapi test/example tool. Compiled with hidapi version 0.11.0, runtime version 0.11.0.
Compile-time version matches runtime version of hidapi.

Device Found
  type: 04d9 0007
  path: 1-1.4:1.0
  serial_number: (null)
  Manufacturer: (null)
  Product:      (null)
  Release:      161
  Interface:    0
  Usage (page): 0x0 (0x0)
  Bus type: 1

Device Found
  type: 04d9 0007
  path: 1-1.4:1.1
  serial_number: (null)
  Manufacturer: (null)
  Product:      (null)
  Release:      161
  Interface:    1
  Usage (page): 0x0 (0x0)
  Bus type: 1

Device Found
  type: 047f c025
  path: 1-1.2.1.2.6:1.3
  serial_number: (null)
  Manufacturer: (null)
  Product:      (null)
  Release:      135
  Interface:    3
  Usage (page): 0x0 (0x0)
  Bus type: 1

Device Found
  type: 046d c52b
  path: 1-1.2.1.2.4:1.0
  serial_number: (null)
  Manufacturer: (null)
  Product:      (null)
  Release:      2410
  Interface:    0
  Usage (page): 0x0 (0x0)
  Bus type: 1

Device Found
  type: 046d c52b
  path: 1-1.2.1.2.4:1.1
  serial_number: (null)
  Manufacturer: (null)
  Product:      (null)
  Release:      2410
  Interface:    1
  Usage (page): 0x0 (0x0)
  Bus type: 1

Device Found
  type: 046d c52b
  path: 1-1.2.1.2.4:1.2
  serial_number: (null)
  Manufacturer: (null)
  Product:      (null)
  Release:      2410
  Interface:    2
  Usage (page): 0x0 (0x0)
  Bus type: 1

unable to open device

hidapi_djm on  hid_bus_type via △ v3.18.4 ❯ ./hidtest/hidtest-hidraw 
hidapi test/example tool. Compiled with hidapi version 0.11.0, runtime version 0.11.0.
Compile-time version matches runtime version of hidapi.

Device Found
  type: 046d 101b
  path: /dev/hidraw4
  serial_number: 101b-ae-8a-0c-8c
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x2 (0x1)
  Bus type: 1

Device Found
  type: 046d 101b
  path: /dev/hidraw4
  serial_number: 101b-ae-8a-0c-8c
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x1 (0x1)
  Bus type: 0

Device Found
  type: 046d 101b
  path: /dev/hidraw4
  serial_number: 101b-ae-8a-0c-8c
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x1 (0xff00)
  Bus type: 0

Device Found
  type: 046d 101b
  path: /dev/hidraw4
  serial_number: 101b-ae-8a-0c-8c
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x2 (0xff00)
  Bus type: 0

Device Found
  type: 046d 101b
  path: /dev/hidraw4
  serial_number: 101b-ae-8a-0c-8c
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x4 (0xff00)
  Bus type: 0

Device Found
  type: 046d 2008
  path: /dev/hidraw5
  serial_number: 2008-b6-b4-d3-96
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x6 (0x1)
  Bus type: 1

Device Found
  type: 046d 2008
  path: /dev/hidraw5
  serial_number: 2008-b6-b4-d3-96
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x1 (0xc)
  Bus type: 0

Device Found
  type: 046d 2008
  path: /dev/hidraw5
  serial_number: 2008-b6-b4-d3-96
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x80 (0x1)
  Bus type: 0

Device Found
  type: 046d 2008
  path: /dev/hidraw5
  serial_number: 2008-b6-b4-d3-96
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x88 (0xffbc)
  Bus type: 0

Device Found
  type: 046d 2008
  path: /dev/hidraw5
  serial_number: 2008-b6-b4-d3-96
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x1 (0xff00)
  Bus type: 0

Device Found
  type: 046d 2008
  path: /dev/hidraw5
  serial_number: 2008-b6-b4-d3-96
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x2 (0xff00)
  Bus type: 0

Device Found
  type: 046d 2008
  path: /dev/hidraw5
  serial_number: 2008-b6-b4-d3-96
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x4 (0xff00)
  Bus type: 0

Device Found
  type: 046d c52b
  path: /dev/hidraw2
  serial_number: 
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x1 (0xff00)
  Bus type: 1

Device Found
  type: 046d c52b
  path: /dev/hidraw2
  serial_number: 
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x2 (0xff00)
  Bus type: 0

Device Found
  type: 046d c52b
  path: /dev/hidraw2
  serial_number: 
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x4 (0xff00)
  Bus type: 0

Device Found
  type: 046d b010
  path: /dev/hidraw6
  serial_number: 34:88:5d:ab:0c:12
  Manufacturer: 
  Product:      Bluetooth Mouse M557
  Release:      0
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 2

Device Found
  type: 046d b010
  path: /dev/hidraw6
  serial_number: 34:88:5d:ab:0c:12
  Manufacturer: 
  Product:      Bluetooth Mouse M557
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0x1)
  Bus type: 0

Device Found
  type: 046d b010
  path: /dev/hidraw6
  serial_number: 34:88:5d:ab:0c:12
  Manufacturer: 
  Product:      Bluetooth Mouse M557
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 0

Device Found
  type: 046d b010
  path: /dev/hidraw6
  serial_number: 34:88:5d:ab:0c:12
  Manufacturer: 
  Product:      Bluetooth Mouse M557
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xff00)
  Bus type: 0

Device Found
  type: 046d b010
  path: /dev/hidraw6
  serial_number: 34:88:5d:ab:0c:12
  Manufacturer: 
  Product:      Bluetooth Mouse M557
  Release:      0
  Interface:    -1
  Usage (page): 0x2 (0xff00)
  Bus type: 0

Device Found
  type: 046d b010
  path: /dev/hidraw6
  serial_number: 34:88:5d:ab:0c:12
  Manufacturer: 
  Product:      Bluetooth Mouse M557
  Release:      0
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 0

Device Found
  type: 046d b010
  path: /dev/hidraw6
  serial_number: 34:88:5d:ab:0c:12
  Manufacturer: 
  Product:      Bluetooth Mouse M557
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 0

Device Found
  type: 047f c025
  path: /dev/hidraw3
  serial_number: CB13A3E40E8E47D6A40769C27E90A38E
  Manufacturer: Plantronics
  Product:      Plantronics C320-M
  Release:      135
  Interface:    3
  Usage (page): 0x1 (0xc)
  Bus type: 1

Device Found
  type: 047f c025
  path: /dev/hidraw3
  serial_number: CB13A3E40E8E47D6A40769C27E90A38E
  Manufacturer: Plantronics
  Product:      Plantronics C320-M
  Release:      135
  Interface:    3
  Usage (page): 0x5 (0xb)
  Bus type: 0

Device Found
  type: 047f c025
  path: /dev/hidraw3
  serial_number: CB13A3E40E8E47D6A40769C27E90A38E
  Manufacturer: Plantronics
  Product:      Plantronics C320-M
  Release:      135
  Interface:    3
  Usage (page): 0x1 (0xffa0)
  Bus type: 0

Device Found
  type: 04d9 0007
  path: /dev/hidraw0
  serial_number: 
  Manufacturer:  
  Product:      Raspberry Pi Internal Keyboard
  Release:      161
  Interface:    0
  Usage (page): 0x6 (0x1)
  Bus type: 1

Device Found
  type: 04d9 0007
  path: /dev/hidraw1
  serial_number: 
  Manufacturer:  
  Product:      Raspberry Pi Internal Keyboard
  Release:      161
  Interface:    1
  Usage (page): 0x1 (0xc)
  Bus type: 1

unable to open device

Here is the test results on my Raspberry Pi 400 running 64bit Ubuntu Linux. <details> <summary> click to expand for the run log </summary> ``` hidapi_djm on  hid_bus_type via △ v3.18.4 took 3s ❯ ./hidtest/hidtest-libusb hidapi test/example tool. Compiled with hidapi version 0.11.0, runtime version 0.11.0. Compile-time version matches runtime version of hidapi. Device Found type: 04d9 0007 path: 1-1.4:1.0 serial_number: (null) Manufacturer: (null) Product: (null) Release: 161 Interface: 0 Usage (page): 0x0 (0x0) Bus type: 1 Device Found type: 04d9 0007 path: 1-1.4:1.1 serial_number: (null) Manufacturer: (null) Product: (null) Release: 161 Interface: 1 Usage (page): 0x0 (0x0) Bus type: 1 Device Found type: 047f c025 path: 1-1.2.1.2.6:1.3 serial_number: (null) Manufacturer: (null) Product: (null) Release: 135 Interface: 3 Usage (page): 0x0 (0x0) Bus type: 1 Device Found type: 046d c52b path: 1-1.2.1.2.4:1.0 serial_number: (null) Manufacturer: (null) Product: (null) Release: 2410 Interface: 0 Usage (page): 0x0 (0x0) Bus type: 1 Device Found type: 046d c52b path: 1-1.2.1.2.4:1.1 serial_number: (null) Manufacturer: (null) Product: (null) Release: 2410 Interface: 1 Usage (page): 0x0 (0x0) Bus type: 1 Device Found type: 046d c52b path: 1-1.2.1.2.4:1.2 serial_number: (null) Manufacturer: (null) Product: (null) Release: 2410 Interface: 2 Usage (page): 0x0 (0x0) Bus type: 1 unable to open device hidapi_djm on  hid_bus_type via △ v3.18.4 ❯ ./hidtest/hidtest-hidraw hidapi test/example tool. Compiled with hidapi version 0.11.0, runtime version 0.11.0. Compile-time version matches runtime version of hidapi. Device Found type: 046d 101b path: /dev/hidraw4 serial_number: 101b-ae-8a-0c-8c Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x2 (0x1) Bus type: 1 Device Found type: 046d 101b path: /dev/hidraw4 serial_number: 101b-ae-8a-0c-8c Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x1 (0x1) Bus type: 0 Device Found type: 046d 101b path: /dev/hidraw4 serial_number: 101b-ae-8a-0c-8c Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x1 (0xff00) Bus type: 0 Device Found type: 046d 101b path: /dev/hidraw4 serial_number: 101b-ae-8a-0c-8c Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x2 (0xff00) Bus type: 0 Device Found type: 046d 101b path: /dev/hidraw4 serial_number: 101b-ae-8a-0c-8c Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x4 (0xff00) Bus type: 0 Device Found type: 046d 2008 path: /dev/hidraw5 serial_number: 2008-b6-b4-d3-96 Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x6 (0x1) Bus type: 1 Device Found type: 046d 2008 path: /dev/hidraw5 serial_number: 2008-b6-b4-d3-96 Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x1 (0xc) Bus type: 0 Device Found type: 046d 2008 path: /dev/hidraw5 serial_number: 2008-b6-b4-d3-96 Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x80 (0x1) Bus type: 0 Device Found type: 046d 2008 path: /dev/hidraw5 serial_number: 2008-b6-b4-d3-96 Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x88 (0xffbc) Bus type: 0 Device Found type: 046d 2008 path: /dev/hidraw5 serial_number: 2008-b6-b4-d3-96 Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x1 (0xff00) Bus type: 0 Device Found type: 046d 2008 path: /dev/hidraw5 serial_number: 2008-b6-b4-d3-96 Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x2 (0xff00) Bus type: 0 Device Found type: 046d 2008 path: /dev/hidraw5 serial_number: 2008-b6-b4-d3-96 Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x4 (0xff00) Bus type: 0 Device Found type: 046d c52b path: /dev/hidraw2 serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x1 (0xff00) Bus type: 1 Device Found type: 046d c52b path: /dev/hidraw2 serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x2 (0xff00) Bus type: 0 Device Found type: 046d c52b path: /dev/hidraw2 serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x4 (0xff00) Bus type: 0 Device Found type: 046d b010 path: /dev/hidraw6 serial_number: 34:88:5d:ab:0c:12 Manufacturer: Product: Bluetooth Mouse M557 Release: 0 Interface: -1 Usage (page): 0x2 (0x1) Bus type: 2 Device Found type: 046d b010 path: /dev/hidraw6 serial_number: 34:88:5d:ab:0c:12 Manufacturer: Product: Bluetooth Mouse M557 Release: 0 Interface: -1 Usage (page): 0x1 (0x1) Bus type: 0 Device Found type: 046d b010 path: /dev/hidraw6 serial_number: 34:88:5d:ab:0c:12 Manufacturer: Product: Bluetooth Mouse M557 Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 0 Device Found type: 046d b010 path: /dev/hidraw6 serial_number: 34:88:5d:ab:0c:12 Manufacturer: Product: Bluetooth Mouse M557 Release: 0 Interface: -1 Usage (page): 0x1 (0xff00) Bus type: 0 Device Found type: 046d b010 path: /dev/hidraw6 serial_number: 34:88:5d:ab:0c:12 Manufacturer: Product: Bluetooth Mouse M557 Release: 0 Interface: -1 Usage (page): 0x2 (0xff00) Bus type: 0 Device Found type: 046d b010 path: /dev/hidraw6 serial_number: 34:88:5d:ab:0c:12 Manufacturer: Product: Bluetooth Mouse M557 Release: 0 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 0 Device Found type: 046d b010 path: /dev/hidraw6 serial_number: 34:88:5d:ab:0c:12 Manufacturer: Product: Bluetooth Mouse M557 Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 0 Device Found type: 047f c025 path: /dev/hidraw3 serial_number: CB13A3E40E8E47D6A40769C27E90A38E Manufacturer: Plantronics Product: Plantronics C320-M Release: 135 Interface: 3 Usage (page): 0x1 (0xc) Bus type: 1 Device Found type: 047f c025 path: /dev/hidraw3 serial_number: CB13A3E40E8E47D6A40769C27E90A38E Manufacturer: Plantronics Product: Plantronics C320-M Release: 135 Interface: 3 Usage (page): 0x5 (0xb) Bus type: 0 Device Found type: 047f c025 path: /dev/hidraw3 serial_number: CB13A3E40E8E47D6A40769C27E90A38E Manufacturer: Plantronics Product: Plantronics C320-M Release: 135 Interface: 3 Usage (page): 0x1 (0xffa0) Bus type: 0 Device Found type: 04d9 0007 path: /dev/hidraw0 serial_number: Manufacturer: Product: Raspberry Pi Internal Keyboard Release: 161 Interface: 0 Usage (page): 0x6 (0x1) Bus type: 1 Device Found type: 04d9 0007 path: /dev/hidraw1 serial_number: Manufacturer: Product: Raspberry Pi Internal Keyboard Release: 161 Interface: 1 Usage (page): 0x1 (0xc) Bus type: 1 unable to open device ``` </details>
mcuee commented 2021-07-23 20:29:35 -05:00 (Migrated from github.com)

@DJm00n You can see that libusb backend output is expected. As for the hidraw backend, on one hand it seems to work, but on the other hand, many reports bus type "0". Is this expected by your design? Take note hidraw backend has the feature of ""split by usage_page/usage" as per https://github.com/libusb/hidapi/issues/287 .

@DJm00n You can see that libusb backend output is expected. As for the hidraw backend, on one hand it seems to work, but on the other hand, many reports bus type "0". Is this expected by your design? Take note hidraw backend has the feature of ""split by usage_page/usage" as per https://github.com/libusb/hidapi/issues/287 .
mcuee commented 2021-07-24 03:01:41 -05:00 (Migrated from github.com)

Under my Windows 10 laptop (Windows 10 Enterprise x64 20H2), it seems to me Microsoft HIDI2C device is not listed correctly.

click to expand
C:\work\hid\hidapi_djm\windows\x64\Release [ble_device_info ≡]> .\hidtest.exe
hidapi test/example tool. Compiled with hidapi version 0.11.0, runtime version 0.11.0.
Compile-time version matches runtime version of hidapi.

Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_01&col03#7&1ebb799e&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x80 (0x1)
  Bus type: 1

Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_01&col04#7&1ebb799e&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x1 (0xff00)
  Bus type: 1

Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_01&col05#7&1ebb799e&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x2 (0xff00)
  Bus type: 1

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col01#5&99b72d3&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 255

Device Found
  type: 8087 0a1e
  path: \\?\hid#intc816&col01#3&36a7043c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      200
  Interface:    -1
  Usage (page): 0xc (0x1)
  Bus type: 255

Device Found
  type: 044e 1212
  path: \\?\hid#vid_044e&pid_1212&col01&col02#7&290aacae&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 255

Device Found
  type: 8087 0a1e
  path: \\?\hid#intc816&col02#3&36a7043c&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      200
  Interface:    -1
  Usage (page): 0xd (0x1)
  Bus type: 255

Device Found
  type: 044e 1212
  path: \\?\hid#vid_044e&pid_1212&col01&col01#7&290aacae&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 255

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col02#5&99b72d3&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x5 (0xd)
  Bus type: 255

Device Found
  type: 047f c056
  path: \\?\hid#vid_047f&pid_c056&mi_03&col01#f&39e6f119&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: D1CEC32927974D5F9BD6B2AEBF2EA8E3
  Manufacturer: Plantronics
  Product:      Plantronics Blackwire 3220 Series
  Release:      210
  Interface:    3
  Usage (page): 0x1 (0xc)
  Bus type: 1

Device Found
  type: 045e 0000
  path: \\?\hid#converteddevice&col02#5&379854aa&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 255

Device Found
  type: 047f c056
  path: \\?\hid#vid_047f&pid_c056&mi_03&col02#f&39e6f119&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: D1CEC32927974D5F9BD6B2AEBF2EA8E3
  Manufacturer: Plantronics
  Product:      Plantronics Blackwire 3220 Series
  Release:      210
  Interface:    3
  Usage (page): 0x5 (0xb)
  Bus type: 1

Device Found
  type: 045e 0000
  path: \\?\hid#converteddevice&col03#5&379854aa&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x80 (0x1)
  Bus type: 255

Device Found
  type: 047f c056
  path: \\?\hid#vid_047f&pid_c056&mi_03&col03#f&39e6f119&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: D1CEC32927974D5F9BD6B2AEBF2EA8E3
  Manufacturer: Plantronics
  Product:      Plantronics Blackwire 3220 Series
  Release:      210
  Interface:    3
  Usage (page): 0x3 (0xffa0)
  Bus type: 1

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col03#5&99b72d3&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x1 (0xff01)
  Bus type: 255

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col04#5&99b72d3&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x1 (0xff02)
  Bus type: 255

Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_00#7&51bc424&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    0
  Usage (page): 0x6 (0x1)
  Bus type: 1

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col05#5&99b72d3&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0xe (0xd)
  Bus type: 255

Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_01&col01#7&1ebb799e&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x2 (0x1)
  Bus type: 1

Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_01&col02#7&1ebb799e&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x1 (0xc)
  Bus type: 1

Device Found
  type: 045e 0000
  path: \\?\hid#converteddevice&col01#5&379854aa&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 255

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col01#8&1cf1c1b9&2&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 2

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col02#8&1cf1c1b9&2&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 2

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col03#8&1cf1c1b9&2&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xff00)
  Bus type: 2

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col04#8&1cf1c1b9&2&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x2 (0xff00)
  Bus type: 2

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col05#8&1cf1c1b9&2&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 2

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col06#8&1cf1c1b9&2&0005#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 2

unable to open device
Under my Windows 10 laptop (Windows 10 Enterprise x64 20H2), it seems to me Microsoft HIDI2C device is not listed correctly. <details> <summary> click to expand </summary> ``` C:\work\hid\hidapi_djm\windows\x64\Release [ble_device_info ≡]> .\hidtest.exe hidapi test/example tool. Compiled with hidapi version 0.11.0, runtime version 0.11.0. Compile-time version matches runtime version of hidapi. Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_01&col03#7&1ebb799e&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x80 (0x1) Bus type: 1 Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_01&col04#7&1ebb799e&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x1 (0xff00) Bus type: 1 Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_01&col05#7&1ebb799e&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x2 (0xff00) Bus type: 1 Device Found type: 0488 121f path: \\?\hid#dell091a&col01#5&99b72d3&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x2 (0x1) Bus type: 255 Device Found type: 8087 0a1e path: \\?\hid#intc816&col01#3&36a7043c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 200 Interface: -1 Usage (page): 0xc (0x1) Bus type: 255 Device Found type: 044e 1212 path: \\?\hid#vid_044e&pid_1212&col01&col02#7&290aacae&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 255 Device Found type: 8087 0a1e path: \\?\hid#intc816&col02#3&36a7043c&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 200 Interface: -1 Usage (page): 0xd (0x1) Bus type: 255 Device Found type: 044e 1212 path: \\?\hid#vid_044e&pid_1212&col01&col01#7&290aacae&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x2 (0x1) Bus type: 255 Device Found type: 0488 121f path: \\?\hid#dell091a&col02#5&99b72d3&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x5 (0xd) Bus type: 255 Device Found type: 047f c056 path: \\?\hid#vid_047f&pid_c056&mi_03&col01#f&39e6f119&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: D1CEC32927974D5F9BD6B2AEBF2EA8E3 Manufacturer: Plantronics Product: Plantronics Blackwire 3220 Series Release: 210 Interface: 3 Usage (page): 0x1 (0xc) Bus type: 1 Device Found type: 045e 0000 path: \\?\hid#converteddevice&col02#5&379854aa&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 255 Device Found type: 047f c056 path: \\?\hid#vid_047f&pid_c056&mi_03&col02#f&39e6f119&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: D1CEC32927974D5F9BD6B2AEBF2EA8E3 Manufacturer: Plantronics Product: Plantronics Blackwire 3220 Series Release: 210 Interface: 3 Usage (page): 0x5 (0xb) Bus type: 1 Device Found type: 045e 0000 path: \\?\hid#converteddevice&col03#5&379854aa&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x80 (0x1) Bus type: 255 Device Found type: 047f c056 path: \\?\hid#vid_047f&pid_c056&mi_03&col03#f&39e6f119&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: D1CEC32927974D5F9BD6B2AEBF2EA8E3 Manufacturer: Plantronics Product: Plantronics Blackwire 3220 Series Release: 210 Interface: 3 Usage (page): 0x3 (0xffa0) Bus type: 1 Device Found type: 0488 121f path: \\?\hid#dell091a&col03#5&99b72d3&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x1 (0xff01) Bus type: 255 Device Found type: 0488 121f path: \\?\hid#dell091a&col04#5&99b72d3&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x1 (0xff02) Bus type: 255 Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_00#7&51bc424&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 0 Usage (page): 0x6 (0x1) Bus type: 1 Device Found type: 0488 121f path: \\?\hid#dell091a&col05#5&99b72d3&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0xe (0xd) Bus type: 255 Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_01&col01#7&1ebb799e&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x2 (0x1) Bus type: 1 Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_01&col02#7&1ebb799e&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x1 (0xc) Bus type: 1 Device Found type: 045e 0000 path: \\?\hid#converteddevice&col01#5&379854aa&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 255 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col01#8&1cf1c1b9&2&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x2 (0x1) Bus type: 2 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col02#8&1cf1c1b9&2&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 2 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col03#8&1cf1c1b9&2&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x1 (0xff00) Bus type: 2 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col04#8&1cf1c1b9&2&0003#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x2 (0xff00) Bus type: 2 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col05#8&1cf1c1b9&2&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 2 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col06#8&1cf1c1b9&2&0005#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 2 unable to open device ``` </details>
mcuee commented 2021-07-24 03:12:59 -05:00 (Migrated from github.com)

@DJm00n For the I2C HID device, you have the following codes for Windows.

	/* I2C HID devices have a special ACPI ID
	   https://docs.microsoft.com/windows-hardware/drivers/hid/plug-and-play-support-and-power-management */
	if (wcsstr(device_id, L"ACPI\\PNP0C50") != 0) {
		dev->bus_type = HID_BUS_I2C;
		goto close;
	}

And I checked the Microsoft I2CHID device in Device Manager "Human Interface Devices" section and indeed it has a "Compatible device id" and "Matching device id" value of "ACPI\PNP0C50".

@DJm00n For the I2C HID device, you have the following codes for Windows. ``` /* I2C HID devices have a special ACPI ID https://docs.microsoft.com/windows-hardware/drivers/hid/plug-and-play-support-and-power-management */ if (wcsstr(device_id, L"ACPI\\PNP0C50") != 0) { dev->bus_type = HID_BUS_I2C; goto close; } ``` And I checked the Microsoft I2CHID device in Device Manager "Human Interface Devices" section and indeed it has a "Compatible device id" and "Matching device id" value of "ACPI\\PNP0C50".
mcuee commented 2021-07-24 03:22:35 -05:00 (Migrated from github.com)

@DJm00n And for those "\?\hid#converteddevice", I am not exactly sure if 255 is the right one to use. I tend to think they are more like "virtual hid bus type". But I am okay as well if you use 255 if there are no better ways.

@DJm00n And for those "\\?\hid#converteddevice", I am not exactly sure if 255 is the right one to use. I tend to think they are more like "virtual hid bus type". But I am okay as well if you use 255 if there are no better ways.
mcuee commented 2021-07-24 03:30:19 -05:00 (Migrated from github.com)

@DJm00n From what I see, the following Windows codes are not good enough (just using "Device_InstanceId"). On the other hand, for the purpose of HIDAPI, maybe it is still okay. I do not think we can do much with the "Microsoft I2CHID device" anyway.

	/* Get the device id from parent devnode */
	len = 0;
	cr = CM_Get_DevNode_PropertyW(dev_node, &DEVPKEY_Device_InstanceId, &property_type, NULL, &len, 0);
	if (cr == CR_BUFFER_SMALL && property_type == DEVPROP_TYPE_STRING) {
		free(device_id);
		device_id = (wchar_t*)calloc(len, sizeof(BYTE));
		cr = CM_Get_DevNode_PropertyW(dev_node, &DEVPKEY_Device_InstanceId, &property_type, (PBYTE)device_id, &len, 0);
	}
@DJm00n From what I see, the following Windows codes are not good enough (just using "Device_InstanceId"). On the other hand, for the purpose of HIDAPI, maybe it is still okay. I do not think we can do much with the "Microsoft I2CHID device" anyway. ``` /* Get the device id from parent devnode */ len = 0; cr = CM_Get_DevNode_PropertyW(dev_node, &DEVPKEY_Device_InstanceId, &property_type, NULL, &len, 0); if (cr == CR_BUFFER_SMALL && property_type == DEVPROP_TYPE_STRING) { free(device_id); device_id = (wchar_t*)calloc(len, sizeof(BYTE)); cr = CM_Get_DevNode_PropertyW(dev_node, &DEVPKEY_Device_InstanceId, &property_type, (PBYTE)device_id, &len, 0); } ```
DJm00n commented 2021-07-24 05:43:28 -05:00 (Migrated from github.com)

@mcuee Thank you for testing it!

I don't have such I2C or SPI HID devices in person. So I need some further help.

Can you debug the code a bit and look what exact device_id (acquired with DEVPKEY_Device_InstanceId property) your devices are having?

For example you can add:

wprintf(L"DEVPKEY_Device_InstanceId: %s\n", device_id);

before if (wcsstr(...)) checks.

@mcuee Thank you for testing it! I don't have such I2C or SPI HID devices in person. So I need some further help. Can you debug the code a bit and look what exact `device_id` (acquired with `DEVPKEY_Device_InstanceId` property) your devices are having? For example you can add: ```cpp wprintf(L"DEVPKEY_Device_InstanceId: %s\n", device_id); ``` before `if (wcsstr(...))` checks.
mcuee commented 2021-07-24 07:50:48 -05:00 (Migrated from github.com)

@DJm00n This is what I get.

click to expand
C:\work\hid\hidapi_djm\windows\x64\Debug [ble_device_info ≡ +0 ~1 -0 !]> .\hidtest.exe
hidapi test/example tool. Compiled with hidapi version 0.11.0, runtime version 0.11.0.
Compile-time version matches runtime version of hidapi.

DEVPKEY_Device_InstanceId: USB\VID_046D&PID_C534&MI_01\6&1CFA36F4&0&0001
DEVPKEY_Device_InstanceId: USB\VID_046D&PID_C534&MI_01\6&1CFA36F4&0&0001
DEVPKEY_Device_InstanceId: USB\VID_046D&PID_C534&MI_01\6&1CFA36F4&0&0001
DEVPKEY_Device_InstanceId: ACPI\DELL091A\4&27F2A591&0
DEVPKEY_Device_InstanceId: ACPI\INT33D5\2&DABA3FF&0
DEVPKEY_Device_InstanceId: HID\VID_044E&PID_1212&COL01\6&298C10D6&0&0000
DEVPKEY_Device_InstanceId: ACPI\INT33D5\2&DABA3FF&0
DEVPKEY_Device_InstanceId: HID\VID_044E&PID_1212&COL01\6&298C10D6&0&0000
DEVPKEY_Device_InstanceId: ACPI\DELL091A\4&27F2A591&0
DEVPKEY_Device_InstanceId: USB\VID_047F&PID_C056&MI_03\E&3A27DC9B&0&0003
DEVPKEY_Device_InstanceId: BUTTONCONVERTER\CONVERTEDDEVICE\4&32F8A6A3&0&0
DEVPKEY_Device_InstanceId: USB\VID_047F&PID_C056&MI_03\E&3A27DC9B&0&0003
DEVPKEY_Device_InstanceId: BUTTONCONVERTER\CONVERTEDDEVICE\4&32F8A6A3&0&0
DEVPKEY_Device_InstanceId: USB\VID_047F&PID_C056&MI_03\E&3A27DC9B&0&0003
DEVPKEY_Device_InstanceId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB}_VID&0002046D_PID&B010\7&31D658D&0&34885DAB0C12_C00000000
DEVPKEY_Device_InstanceId: ACPI\DELL091A\4&27F2A591&0
DEVPKEY_Device_InstanceId: ACPI\DELL091A\4&27F2A591&0
DEVPKEY_Device_InstanceId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB}_VID&0002046D_PID&B010\7&31D658D&0&34885DAB0C12_C00000000
DEVPKEY_Device_InstanceId: USB\VID_046D&PID_C534&MI_00\6&1CFA36F4&0&0000
DEVPKEY_Device_InstanceId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB}_VID&0002046D_PID&B010\7&31D658D&0&34885DAB0C12_C00000000
DEVPKEY_Device_InstanceId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB}_VID&0002046D_PID&B010\7&31D658D&0&34885DAB0C12_C00000000
DEVPKEY_Device_InstanceId: ACPI\DELL091A\4&27F2A591&0
DEVPKEY_Device_InstanceId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB}_VID&0002046D_PID&B010\7&31D658D&0&34885DAB0C12_C00000000
DEVPKEY_Device_InstanceId: USB\VID_046D&PID_C534&MI_01\6&1CFA36F4&0&0001
DEVPKEY_Device_InstanceId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB}_VID&0002046D_PID&B010\7&31D658D&0&34885DAB0C12_C00000000
DEVPKEY_Device_InstanceId: USB\VID_046D&PID_C534&MI_01\6&1CFA36F4&0&0001
DEVPKEY_Device_InstanceId: BUTTONCONVERTER\CONVERTEDDEVICE\4&32F8A6A3&0&0
Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_01&col03#7&1ebb799e&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x80 (0x1)
  Bus type: 1

Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_01&col04#7&1ebb799e&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x1 (0xff00)
  Bus type: 1

Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_01&col05#7&1ebb799e&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x2 (0xff00)
  Bus type: 1

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col01#5&99b72d3&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 255

Device Found
  type: 8087 0a1e
  path: \\?\hid#intc816&col01#3&36a7043c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      200
  Interface:    -1
  Usage (page): 0xc (0x1)
  Bus type: 255

Device Found
  type: 044e 1212
  path: \\?\hid#vid_044e&pid_1212&col01&col02#7&290aacae&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 255

Device Found
  type: 8087 0a1e
  path: \\?\hid#intc816&col02#3&36a7043c&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      200
  Interface:    -1
  Usage (page): 0xd (0x1)
  Bus type: 255

Device Found
  type: 044e 1212
  path: \\?\hid#vid_044e&pid_1212&col01&col01#7&290aacae&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 255

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col02#5&99b72d3&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x5 (0xd)
  Bus type: 255

Device Found
  type: 047f c056
  path: \\?\hid#vid_047f&pid_c056&mi_03&col01#f&39e6f119&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: D1CEC32927974D5F9BD6B2AEBF2EA8E3
  Manufacturer: Plantronics
  Product:      Plantronics Blackwire 3220 Series
  Release:      210
  Interface:    3
  Usage (page): 0x1 (0xc)
  Bus type: 1

Device Found
  type: 045e 0000
  path: \\?\hid#converteddevice&col02#5&379854aa&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 255

Device Found
  type: 047f c056
  path: \\?\hid#vid_047f&pid_c056&mi_03&col02#f&39e6f119&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: D1CEC32927974D5F9BD6B2AEBF2EA8E3
  Manufacturer: Plantronics
  Product:      Plantronics Blackwire 3220 Series
  Release:      210
  Interface:    3
  Usage (page): 0x5 (0xb)
  Bus type: 1

Device Found
  type: 045e 0000
  path: \\?\hid#converteddevice&col03#5&379854aa&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x80 (0x1)
  Bus type: 255

Device Found
  type: 047f c056
  path: \\?\hid#vid_047f&pid_c056&mi_03&col03#f&39e6f119&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: D1CEC32927974D5F9BD6B2AEBF2EA8E3
  Manufacturer: Plantronics
  Product:      Plantronics Blackwire 3220 Series
  Release:      210
  Interface:    3
  Usage (page): 0x3 (0xffa0)
  Bus type: 1

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col05#8&1cf1c1b9&2&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 2

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col03#5&99b72d3&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x1 (0xff01)
  Bus type: 255

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col04#5&99b72d3&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x1 (0xff02)
  Bus type: 255

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col01#8&1cf1c1b9&2&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 2

Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_00#7&51bc424&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    0
  Usage (page): 0x6 (0x1)
  Bus type: 1

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col02#8&1cf1c1b9&2&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 2

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col03#8&1cf1c1b9&2&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xff00)
  Bus type: 2

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col05#5&99b72d3&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0xe (0xd)
  Bus type: 255

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col04#8&1cf1c1b9&2&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x2 (0xff00)
  Bus type: 2

Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_01&col01#7&1ebb799e&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x2 (0x1)
  Bus type: 1

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col06#8&1cf1c1b9&2&0005#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 2

Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_01&col02#7&1ebb799e&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x1 (0xc)
  Bus type: 1

Device Found
  type: 045e 0000
  path: \\?\hid#converteddevice&col01#5&379854aa&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 255

unable to open device
@DJm00n This is what I get. <details> <summary> click to expand </summary> ``` C:\work\hid\hidapi_djm\windows\x64\Debug [ble_device_info ≡ +0 ~1 -0 !]> .\hidtest.exe hidapi test/example tool. Compiled with hidapi version 0.11.0, runtime version 0.11.0. Compile-time version matches runtime version of hidapi. DEVPKEY_Device_InstanceId: USB\VID_046D&PID_C534&MI_01\6&1CFA36F4&0&0001 DEVPKEY_Device_InstanceId: USB\VID_046D&PID_C534&MI_01\6&1CFA36F4&0&0001 DEVPKEY_Device_InstanceId: USB\VID_046D&PID_C534&MI_01\6&1CFA36F4&0&0001 DEVPKEY_Device_InstanceId: ACPI\DELL091A\4&27F2A591&0 DEVPKEY_Device_InstanceId: ACPI\INT33D5\2&DABA3FF&0 DEVPKEY_Device_InstanceId: HID\VID_044E&PID_1212&COL01\6&298C10D6&0&0000 DEVPKEY_Device_InstanceId: ACPI\INT33D5\2&DABA3FF&0 DEVPKEY_Device_InstanceId: HID\VID_044E&PID_1212&COL01\6&298C10D6&0&0000 DEVPKEY_Device_InstanceId: ACPI\DELL091A\4&27F2A591&0 DEVPKEY_Device_InstanceId: USB\VID_047F&PID_C056&MI_03\E&3A27DC9B&0&0003 DEVPKEY_Device_InstanceId: BUTTONCONVERTER\CONVERTEDDEVICE\4&32F8A6A3&0&0 DEVPKEY_Device_InstanceId: USB\VID_047F&PID_C056&MI_03\E&3A27DC9B&0&0003 DEVPKEY_Device_InstanceId: BUTTONCONVERTER\CONVERTEDDEVICE\4&32F8A6A3&0&0 DEVPKEY_Device_InstanceId: USB\VID_047F&PID_C056&MI_03\E&3A27DC9B&0&0003 DEVPKEY_Device_InstanceId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB}_VID&0002046D_PID&B010\7&31D658D&0&34885DAB0C12_C00000000 DEVPKEY_Device_InstanceId: ACPI\DELL091A\4&27F2A591&0 DEVPKEY_Device_InstanceId: ACPI\DELL091A\4&27F2A591&0 DEVPKEY_Device_InstanceId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB}_VID&0002046D_PID&B010\7&31D658D&0&34885DAB0C12_C00000000 DEVPKEY_Device_InstanceId: USB\VID_046D&PID_C534&MI_00\6&1CFA36F4&0&0000 DEVPKEY_Device_InstanceId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB}_VID&0002046D_PID&B010\7&31D658D&0&34885DAB0C12_C00000000 DEVPKEY_Device_InstanceId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB}_VID&0002046D_PID&B010\7&31D658D&0&34885DAB0C12_C00000000 DEVPKEY_Device_InstanceId: ACPI\DELL091A\4&27F2A591&0 DEVPKEY_Device_InstanceId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB}_VID&0002046D_PID&B010\7&31D658D&0&34885DAB0C12_C00000000 DEVPKEY_Device_InstanceId: USB\VID_046D&PID_C534&MI_01\6&1CFA36F4&0&0001 DEVPKEY_Device_InstanceId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB}_VID&0002046D_PID&B010\7&31D658D&0&34885DAB0C12_C00000000 DEVPKEY_Device_InstanceId: USB\VID_046D&PID_C534&MI_01\6&1CFA36F4&0&0001 DEVPKEY_Device_InstanceId: BUTTONCONVERTER\CONVERTEDDEVICE\4&32F8A6A3&0&0 Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_01&col03#7&1ebb799e&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x80 (0x1) Bus type: 1 Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_01&col04#7&1ebb799e&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x1 (0xff00) Bus type: 1 Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_01&col05#7&1ebb799e&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x2 (0xff00) Bus type: 1 Device Found type: 0488 121f path: \\?\hid#dell091a&col01#5&99b72d3&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x2 (0x1) Bus type: 255 Device Found type: 8087 0a1e path: \\?\hid#intc816&col01#3&36a7043c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 200 Interface: -1 Usage (page): 0xc (0x1) Bus type: 255 Device Found type: 044e 1212 path: \\?\hid#vid_044e&pid_1212&col01&col02#7&290aacae&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 255 Device Found type: 8087 0a1e path: \\?\hid#intc816&col02#3&36a7043c&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 200 Interface: -1 Usage (page): 0xd (0x1) Bus type: 255 Device Found type: 044e 1212 path: \\?\hid#vid_044e&pid_1212&col01&col01#7&290aacae&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x2 (0x1) Bus type: 255 Device Found type: 0488 121f path: \\?\hid#dell091a&col02#5&99b72d3&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x5 (0xd) Bus type: 255 Device Found type: 047f c056 path: \\?\hid#vid_047f&pid_c056&mi_03&col01#f&39e6f119&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: D1CEC32927974D5F9BD6B2AEBF2EA8E3 Manufacturer: Plantronics Product: Plantronics Blackwire 3220 Series Release: 210 Interface: 3 Usage (page): 0x1 (0xc) Bus type: 1 Device Found type: 045e 0000 path: \\?\hid#converteddevice&col02#5&379854aa&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 255 Device Found type: 047f c056 path: \\?\hid#vid_047f&pid_c056&mi_03&col02#f&39e6f119&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: D1CEC32927974D5F9BD6B2AEBF2EA8E3 Manufacturer: Plantronics Product: Plantronics Blackwire 3220 Series Release: 210 Interface: 3 Usage (page): 0x5 (0xb) Bus type: 1 Device Found type: 045e 0000 path: \\?\hid#converteddevice&col03#5&379854aa&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x80 (0x1) Bus type: 255 Device Found type: 047f c056 path: \\?\hid#vid_047f&pid_c056&mi_03&col03#f&39e6f119&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: D1CEC32927974D5F9BD6B2AEBF2EA8E3 Manufacturer: Plantronics Product: Plantronics Blackwire 3220 Series Release: 210 Interface: 3 Usage (page): 0x3 (0xffa0) Bus type: 1 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col05#8&1cf1c1b9&2&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 2 Device Found type: 0488 121f path: \\?\hid#dell091a&col03#5&99b72d3&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x1 (0xff01) Bus type: 255 Device Found type: 0488 121f path: \\?\hid#dell091a&col04#5&99b72d3&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x1 (0xff02) Bus type: 255 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col01#8&1cf1c1b9&2&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x2 (0x1) Bus type: 2 Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_00#7&51bc424&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 0 Usage (page): 0x6 (0x1) Bus type: 1 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col02#8&1cf1c1b9&2&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 2 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col03#8&1cf1c1b9&2&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x1 (0xff00) Bus type: 2 Device Found type: 0488 121f path: \\?\hid#dell091a&col05#5&99b72d3&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0xe (0xd) Bus type: 255 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col04#8&1cf1c1b9&2&0003#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x2 (0xff00) Bus type: 2 Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_01&col01#7&1ebb799e&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x2 (0x1) Bus type: 1 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col06#8&1cf1c1b9&2&0005#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 2 Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_01&col02#7&1ebb799e&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x1 (0xc) Bus type: 1 Device Found type: 045e 0000 path: \\?\hid#converteddevice&col01#5&379854aa&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 255 unable to open device ``` </details>
mcuee commented 2021-07-24 07:57:17 -05:00 (Migrated from github.com)

@DJm00n The Microsoft I2C HID device has the following

DEVPKEY_Device_InstanceId: ACPI\DELL091A\4&27F2A591&0.

If I look at the Device Manager "Human Device Interface" entries, Device_InstanceId printed out is the same as what is listed as "Device Instance Path" in Device Manager.

The one you want to get here is "Compatible IDs" which has two values, "ACPI\PNP0C50" and "PNP0C50".

@DJm00n The Microsoft I2C HID device has the following ``` DEVPKEY_Device_InstanceId: ACPI\DELL091A\4&27F2A591&0. ``` If I look at the Device Manager "Human Device Interface" entries, Device_InstanceId printed out is the same as what is listed as "Device Instance Path" in Device Manager. The one you want to get here is "Compatible IDs" which has two values, "ACPI\PNP0C50" and "PNP0C50".
mcuee commented 2021-07-24 08:09:34 -05:00 (Migrated from github.com)

@DJm00n
From the link in your code,
https://docs.microsoft.com/en-us/windows-hardware/drivers/hid/plug-and-play-support-and-power-management

<html>

The ACPI 5.0 Specification includes support for HID Class Devices. the ACPI definitions for HID I²C are as follows.

Field Value ACPI object Format Comments
Compatible ID PNP0C50 _CID String in the format of ACPI0C50 or PNP0C50 CompatibleID
</html>
@DJm00n From the link in your code, https://docs.microsoft.com/en-us/windows-hardware/drivers/hid/plug-and-play-support-and-power-management <html> <body> <!--StartFragment--><p style="box-sizing: inherit; margin: 1rem 0px 0px; padding: 0px; outline-color: inherit; overflow-wrap: break-word; color: rgb(23, 23, 23); font-family: &quot;Segoe UI&quot;, SegoeUI, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">The ACPI 5.0 Specification includes support for HID Class Devices. the ACPI definitions for HID I²C are as follows.</p><div class="table-scroll-wrapper" style="box-sizing: inherit; outline-color: inherit; overflow: auto hidden; color: rgb(23, 23, 23); font-family: &quot;Segoe UI&quot;, SegoeUI, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"> Field | Value | ACPI object | Format | Comments -- | -- | -- | -- | -- Compatible ID | PNP0C50 | _CID | String in the format of ACPI0C50 or PNP0C50 | CompatibleID </div><!--EndFragment--> </body> </html>
mcuee commented 2021-07-24 08:12:14 -05:00 (Migrated from github.com)

Same for SPI HID device.
https://docs.microsoft.com/en-us/windows-hardware/drivers/hid/plug-and-play-for-spi

<html>

The ACPI 5.0 Specification includes support for HID Class Devices. the ACPI definitions for HID SPI are as follows.

Field Value ACPI object Format Comments
Hardware ID Vendor Specific _HID String in the format of VVVVdddd (e.g. MSFT0011) VendorID + DeviceID
Compatible ID PNP0C51 _CID String in the format of ACPIxxxx or PNPxxxx CompatibleID
</html>
Same for SPI HID device. https://docs.microsoft.com/en-us/windows-hardware/drivers/hid/plug-and-play-for-spi <html> <body> <!--StartFragment--><p style="box-sizing: inherit; margin: 1rem 0px 0px; padding: 0px; outline-color: inherit; overflow-wrap: break-word; color: rgb(23, 23, 23); font-family: &quot;Segoe UI&quot;, SegoeUI, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">The ACPI 5.0 Specification includes support for HID Class Devices. the ACPI definitions for HID SPI are as follows.</p><div class="table-scroll-wrapper" style="box-sizing: inherit; outline-color: inherit; overflow: auto hidden; color: rgb(23, 23, 23); font-family: &quot;Segoe UI&quot;, SegoeUI, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"> Field | Value | ACPI object | Format | Comments -- | -- | -- | -- | -- Hardware ID | Vendor Specific | _HID | String in the format of VVVVdddd (e.g. MSFT0011) | VendorID + DeviceID Compatible ID | PNP0C51 | _CID | String in the format of ACPIxxxx or PNPxxxx | CompatibleID </div><!--EndFragment--> </body> </html>
mcuee commented 2021-07-24 08:14:57 -05:00 (Migrated from github.com)

Compatible ID should work for your purpose, no matter it is USB, Bluetooth, I2C or SPI.
https://docs.microsoft.com/en-us/windows-hardware/drivers/install/compatible-ids

Compatible ID should work for your purpose, no matter it is USB, Bluetooth, I2C or SPI. https://docs.microsoft.com/en-us/windows-hardware/drivers/install/compatible-ids
mcuee commented 2021-07-24 08:18:31 -05:00 (Migrated from github.com)
More info about HID Transport under Windows https://docs.microsoft.com/en-us/windows-hardware/drivers/hid/hid-transports
mcuee commented 2021-07-24 09:20:21 -05:00 (Migrated from github.com)

Built-in device for my Dell Laptop (without any external USB/Bluetooth devices).

click to expand
C:\work\hid\hidapi_djm\windows\x64\Debug [ble_device_info ≡ +0 ~1 -0 !]> .\hidtest.exe
hidapi test/example tool. Compiled with hidapi version 0.11.0, runtime version 0.11.0.
Compile-time version matches runtime version of hidapi.

DEVPKEY_Device_InstanceId: ACPI\DELL091A\4&27F2A591&0
DEVPKEY_Device_InstanceId: ACPI\INT33D5\2&DABA3FF&0
DEVPKEY_Device_InstanceId: HID\VID_044E&PID_1212&COL01\6&298C10D6&0&0000
DEVPKEY_Device_InstanceId: ACPI\INT33D5\2&DABA3FF&0
DEVPKEY_Device_InstanceId: HID\VID_044E&PID_1212&COL01\6&298C10D6&0&0000
DEVPKEY_Device_InstanceId: ACPI\DELL091A\4&27F2A591&0
DEVPKEY_Device_InstanceId: BUTTONCONVERTER\CONVERTEDDEVICE\4&32F8A6A3&0&0
DEVPKEY_Device_InstanceId: BUTTONCONVERTER\CONVERTEDDEVICE\4&32F8A6A3&0&0
DEVPKEY_Device_InstanceId: ACPI\DELL091A\4&27F2A591&0
DEVPKEY_Device_InstanceId: ACPI\DELL091A\4&27F2A591&0
DEVPKEY_Device_InstanceId: ACPI\DELL091A\4&27F2A591&0
DEVPKEY_Device_InstanceId: BUTTONCONVERTER\CONVERTEDDEVICE\4&32F8A6A3&0&0
Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col01#5&99b72d3&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 255

Device Found
  type: 8087 0a1e
  path: \\?\hid#intc816&col01#3&36a7043c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      200
  Interface:    -1
  Usage (page): 0xc (0x1)
  Bus type: 255

Device Found
  type: 044e 1212
  path: \\?\hid#vid_044e&pid_1212&col01&col02#7&290aacae&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 255

Device Found
  type: 8087 0a1e
  path: \\?\hid#intc816&col02#3&36a7043c&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      200
  Interface:    -1
  Usage (page): 0xd (0x1)
  Bus type: 255

Device Found
  type: 044e 1212
  path: \\?\hid#vid_044e&pid_1212&col01&col01#7&290aacae&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 255

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col02#5&99b72d3&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x5 (0xd)
  Bus type: 255

Device Found
  type: 045e 0000
  path: \\?\hid#converteddevice&col02#5&379854aa&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 255

Device Found
  type: 045e 0000
  path: \\?\hid#converteddevice&col03#5&379854aa&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x80 (0x1)
  Bus type: 255

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col03#5&99b72d3&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x1 (0xff01)
  Bus type: 255

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col04#5&99b72d3&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x1 (0xff02)
  Bus type: 255

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col05#5&99b72d3&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0xe (0xd)
  Bus type: 255

Device Found
  type: 045e 0000
  path: \\?\hid#converteddevice&col01#5&379854aa&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 255

unable to open device
Built-in device for my Dell Laptop (without any external USB/Bluetooth devices). <details> <summary> click to expand </summary> ``` C:\work\hid\hidapi_djm\windows\x64\Debug [ble_device_info ≡ +0 ~1 -0 !]> .\hidtest.exe hidapi test/example tool. Compiled with hidapi version 0.11.0, runtime version 0.11.0. Compile-time version matches runtime version of hidapi. DEVPKEY_Device_InstanceId: ACPI\DELL091A\4&27F2A591&0 DEVPKEY_Device_InstanceId: ACPI\INT33D5\2&DABA3FF&0 DEVPKEY_Device_InstanceId: HID\VID_044E&PID_1212&COL01\6&298C10D6&0&0000 DEVPKEY_Device_InstanceId: ACPI\INT33D5\2&DABA3FF&0 DEVPKEY_Device_InstanceId: HID\VID_044E&PID_1212&COL01\6&298C10D6&0&0000 DEVPKEY_Device_InstanceId: ACPI\DELL091A\4&27F2A591&0 DEVPKEY_Device_InstanceId: BUTTONCONVERTER\CONVERTEDDEVICE\4&32F8A6A3&0&0 DEVPKEY_Device_InstanceId: BUTTONCONVERTER\CONVERTEDDEVICE\4&32F8A6A3&0&0 DEVPKEY_Device_InstanceId: ACPI\DELL091A\4&27F2A591&0 DEVPKEY_Device_InstanceId: ACPI\DELL091A\4&27F2A591&0 DEVPKEY_Device_InstanceId: ACPI\DELL091A\4&27F2A591&0 DEVPKEY_Device_InstanceId: BUTTONCONVERTER\CONVERTEDDEVICE\4&32F8A6A3&0&0 Device Found type: 0488 121f path: \\?\hid#dell091a&col01#5&99b72d3&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x2 (0x1) Bus type: 255 Device Found type: 8087 0a1e path: \\?\hid#intc816&col01#3&36a7043c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 200 Interface: -1 Usage (page): 0xc (0x1) Bus type: 255 Device Found type: 044e 1212 path: \\?\hid#vid_044e&pid_1212&col01&col02#7&290aacae&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 255 Device Found type: 8087 0a1e path: \\?\hid#intc816&col02#3&36a7043c&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 200 Interface: -1 Usage (page): 0xd (0x1) Bus type: 255 Device Found type: 044e 1212 path: \\?\hid#vid_044e&pid_1212&col01&col01#7&290aacae&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x2 (0x1) Bus type: 255 Device Found type: 0488 121f path: \\?\hid#dell091a&col02#5&99b72d3&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x5 (0xd) Bus type: 255 Device Found type: 045e 0000 path: \\?\hid#converteddevice&col02#5&379854aa&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 255 Device Found type: 045e 0000 path: \\?\hid#converteddevice&col03#5&379854aa&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x80 (0x1) Bus type: 255 Device Found type: 0488 121f path: \\?\hid#dell091a&col03#5&99b72d3&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x1 (0xff01) Bus type: 255 Device Found type: 0488 121f path: \\?\hid#dell091a&col04#5&99b72d3&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x1 (0xff02) Bus type: 255 Device Found type: 0488 121f path: \\?\hid#dell091a&col05#5&99b72d3&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0xe (0xd) Bus type: 255 Device Found type: 045e 0000 path: \\?\hid#converteddevice&col01#5&379854aa&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 255 unable to open device ``` </details>
DJm00n commented 2021-07-24 09:24:00 -05:00 (Migrated from github.com)

@mcuee Thank you! I’ll try to do a fix.

@mcuee Thank you! I’ll try to do a fix.
mcuee commented 2021-07-24 20:30:51 -05:00 (Migrated from github.com)

@DJm00n Yes the latest update seems to work fine.


C:\work\hid\hidapi_djm\windows\x64\Release [hid_bus_type ≡]> .\hidtest.exe
hidapi test/example tool. Compiled with hidapi version 0.11.0, runtime version 0.11.0.
Compile-time version matches runtime version of hidapi.

Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_01&col01#7&383a3a17&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x2 (0x1)
  Bus type: 1

Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_01&col02#7&383a3a17&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x1 (0xc)
  Bus type: 1

Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_01&col03#7&383a3a17&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x80 (0x1)
  Bus type: 1

Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_01&col04#7&383a3a17&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x1 (0xff00)
  Bus type: 1

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col01#5&99b72d3&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 3

Device Found
  type: 8087 0a1e
  path: \\?\hid#intc816&col01#3&36a7043c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      200
  Interface:    -1
  Usage (page): 0xc (0x1)
  Bus type: 255

Device Found
  type: 044e 1212
  path: \\?\hid#vid_044e&pid_1212&col01&col02#7&290aacae&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 255

Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_01&col05#7&383a3a17&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x2 (0xff00)
  Bus type: 1

Device Found
  type: 8087 0a1e
  path: \\?\hid#intc816&col02#3&36a7043c&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      200
  Interface:    -1
  Usage (page): 0xd (0x1)
  Bus type: 255

Device Found
  type: 044e 1212
  path: \\?\hid#vid_044e&pid_1212&col01&col01#7&290aacae&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 255

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col02#5&99b72d3&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x5 (0xd)
  Bus type: 3

Device Found
  type: 045e 0000
  path: \\?\hid#converteddevice&col02#5&379854aa&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 255

Device Found
  type: 045e 0000
  path: \\?\hid#converteddevice&col03#5&379854aa&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x80 (0x1)
  Bus type: 255

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col05#8&1cf1c1b9&2&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 2

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col03#5&99b72d3&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x1 (0xff01)
  Bus type: 3

Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_00#7&1c54b96&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    0
  Usage (page): 0x6 (0x1)
  Bus type: 1

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col04#5&99b72d3&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x1 (0xff02)
  Bus type: 3

Device Found
  type: 1915 1025
  path: \\?\hid#vid_1915&pid_1025&mi_03&col01#8&33bf0c65&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x2 (0x1)
  Bus type: 1

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col01#8&1cf1c1b9&2&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 2

Device Found
  type: 1915 1025
  path: \\?\hid#vid_1915&pid_1025&mi_03&col02#8&33bf0c65&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x1 (0xc)
  Bus type: 1

Device Found
  type: 1915 1025
  path: \\?\hid#vid_1915&pid_1025&mi_02#8&b545e9c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
  serial_number:
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    2
  Usage (page): 0x6 (0x1)
  Bus type: 1

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col02#8&1cf1c1b9&2&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 2

Device Found
  type: 1915 1025
  path: \\?\hid#vid_1915&pid_1025&mi_03&col03#8&33bf0c65&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x80 (0x1)
  Bus type: 1

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col03#8&1cf1c1b9&2&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xff00)
  Bus type: 2

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col05#5&99b72d3&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0xe (0xd)
  Bus type: 3

Device Found
  type: 1915 1025
  path: \\?\hid#vid_1915&pid_1025&mi_03&col04#8&33bf0c65&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x0 (0xff00)
  Bus type: 1

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col04#8&1cf1c1b9&2&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x2 (0xff00)
  Bus type: 2

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col06#8&1cf1c1b9&2&0005#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 2

Device Found
  type: 045e 0000
  path: \\?\hid#converteddevice&col01#5&379854aa&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 255

unable to open device
@DJm00n Yes the latest update seems to work fine. ``` C:\work\hid\hidapi_djm\windows\x64\Release [hid_bus_type ≡]> .\hidtest.exe hidapi test/example tool. Compiled with hidapi version 0.11.0, runtime version 0.11.0. Compile-time version matches runtime version of hidapi. Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_01&col01#7&383a3a17&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x2 (0x1) Bus type: 1 Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_01&col02#7&383a3a17&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x1 (0xc) Bus type: 1 Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_01&col03#7&383a3a17&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x80 (0x1) Bus type: 1 Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_01&col04#7&383a3a17&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x1 (0xff00) Bus type: 1 Device Found type: 0488 121f path: \\?\hid#dell091a&col01#5&99b72d3&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x2 (0x1) Bus type: 3 Device Found type: 8087 0a1e path: \\?\hid#intc816&col01#3&36a7043c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 200 Interface: -1 Usage (page): 0xc (0x1) Bus type: 255 Device Found type: 044e 1212 path: \\?\hid#vid_044e&pid_1212&col01&col02#7&290aacae&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 255 Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_01&col05#7&383a3a17&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x2 (0xff00) Bus type: 1 Device Found type: 8087 0a1e path: \\?\hid#intc816&col02#3&36a7043c&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 200 Interface: -1 Usage (page): 0xd (0x1) Bus type: 255 Device Found type: 044e 1212 path: \\?\hid#vid_044e&pid_1212&col01&col01#7&290aacae&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x2 (0x1) Bus type: 255 Device Found type: 0488 121f path: \\?\hid#dell091a&col02#5&99b72d3&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x5 (0xd) Bus type: 3 Device Found type: 045e 0000 path: \\?\hid#converteddevice&col02#5&379854aa&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 255 Device Found type: 045e 0000 path: \\?\hid#converteddevice&col03#5&379854aa&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x80 (0x1) Bus type: 255 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col05#8&1cf1c1b9&2&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 2 Device Found type: 0488 121f path: \\?\hid#dell091a&col03#5&99b72d3&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x1 (0xff01) Bus type: 3 Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_00#7&1c54b96&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 0 Usage (page): 0x6 (0x1) Bus type: 1 Device Found type: 0488 121f path: \\?\hid#dell091a&col04#5&99b72d3&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x1 (0xff02) Bus type: 3 Device Found type: 1915 1025 path: \\?\hid#vid_1915&pid_1025&mi_03&col01#8&33bf0c65&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x2 (0x1) Bus type: 1 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col01#8&1cf1c1b9&2&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x2 (0x1) Bus type: 2 Device Found type: 1915 1025 path: \\?\hid#vid_1915&pid_1025&mi_03&col02#8&33bf0c65&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x1 (0xc) Bus type: 1 Device Found type: 1915 1025 path: \\?\hid#vid_1915&pid_1025&mi_02#8&b545e9c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 2 Usage (page): 0x6 (0x1) Bus type: 1 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col02#8&1cf1c1b9&2&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 2 Device Found type: 1915 1025 path: \\?\hid#vid_1915&pid_1025&mi_03&col03#8&33bf0c65&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x80 (0x1) Bus type: 1 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col03#8&1cf1c1b9&2&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x1 (0xff00) Bus type: 2 Device Found type: 0488 121f path: \\?\hid#dell091a&col05#5&99b72d3&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0xe (0xd) Bus type: 3 Device Found type: 1915 1025 path: \\?\hid#vid_1915&pid_1025&mi_03&col04#8&33bf0c65&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x0 (0xff00) Bus type: 1 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col04#8&1cf1c1b9&2&0003#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x2 (0xff00) Bus type: 2 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col06#8&1cf1c1b9&2&0005#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 2 Device Found type: 045e 0000 path: \\?\hid#converteddevice&col01#5&379854aa&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 255 unable to open device ```
mcuee commented 2021-07-24 20:37:20 -05:00 (Migrated from github.com)

With added debug print, so I think the latest update is good.


diff --git a/windows/hid.c b/windows/hid.c
index 2631382..23d2acf 100644
--- a/windows/hid.c
+++ b/windows/hid.c
@@ -417,7 +417,7 @@ static void hid_internal_get_info(struct hid_device_info* dev)
        {
                /* Normalize to upper case */
                for (wchar_t* p = compatible_id; *p; ++p) *p = towupper(*p);
-
+               wprintf(L"DEVPKEY_Device_CompatibleId: %s\n", compatible_id);
                /* USB devices
                   https://docs.microsoft.com/windows-hardware/drivers/hid/plug-and-play-support
                   https://docs.microsoft.com/windows-hardware/drivers/install/standard-usb-identifiers *
click to expand
C:\work\hid\hidapi_djm\windows\x64\Release [hid_bus_type ≡]> .\hidtest.exe
hidapi test/example tool. Compiled with hidapi version 0.11.0, runtime version 0.11.0.
Compile-time version matches runtime version of hidapi.

DEVPKEY_Device_CompatibleId: USB\CLASS_03&SUBCLASS_01&PROT_02
DEVPKEY_Device_CompatibleId: USB\CLASS_03&SUBCLASS_01&PROT_02
DEVPKEY_Device_CompatibleId: USB\CLASS_03&SUBCLASS_01&PROT_02
DEVPKEY_Device_CompatibleId: USB\CLASS_03&SUBCLASS_01&PROT_02
DEVPKEY_Device_CompatibleId: ACPI\PNP0C50
DEVPKEY_Device_CompatibleId: PTP_HID_DEVICE
DEVPKEY_Device_CompatibleId: USB\CLASS_03&SUBCLASS_01&PROT_02
DEVPKEY_Device_CompatibleId: PTP_HID_DEVICE
DEVPKEY_Device_CompatibleId: ACPI\PNP0C50
DEVPKEY_Device_CompatibleId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB}
DEVPKEY_Device_CompatibleId: ACPI\PNP0C50
DEVPKEY_Device_CompatibleId: USB\CLASS_03&SUBCLASS_01&PROT_01
DEVPKEY_Device_CompatibleId: ACPI\PNP0C50
DEVPKEY_Device_CompatibleId: USB\CLASS_03&SUBCLASS_00&PROT_00
DEVPKEY_Device_CompatibleId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB}
DEVPKEY_Device_CompatibleId: USB\CLASS_03&SUBCLASS_00&PROT_00
DEVPKEY_Device_CompatibleId: USB\CLASS_03&SUBCLASS_01&PROT_01
DEVPKEY_Device_CompatibleId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB}
DEVPKEY_Device_CompatibleId: USB\CLASS_03&SUBCLASS_00&PROT_00
DEVPKEY_Device_CompatibleId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB}
DEVPKEY_Device_CompatibleId: ACPI\PNP0C50
DEVPKEY_Device_CompatibleId: USB\CLASS_03&SUBCLASS_00&PROT_00
DEVPKEY_Device_CompatibleId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB}
DEVPKEY_Device_CompatibleId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB}
Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_01&col01#7&383a3a17&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x2 (0x1)
  Bus type: 1

Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_01&col02#7&383a3a17&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x1 (0xc)
  Bus type: 1

Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_01&col03#7&383a3a17&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x80 (0x1)
  Bus type: 1

Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_01&col04#7&383a3a17&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x1 (0xff00)
  Bus type: 1

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col01#5&99b72d3&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 3

Device Found
  type: 8087 0a1e
  path: \\?\hid#intc816&col01#3&36a7043c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      200
  Interface:    -1
  Usage (page): 0xc (0x1)
  Bus type: 255

Device Found
  type: 044e 1212
  path: \\?\hid#vid_044e&pid_1212&col01&col02#7&290aacae&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 255

Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_01&col05#7&383a3a17&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x2 (0xff00)
  Bus type: 1

Device Found
  type: 8087 0a1e
  path: \\?\hid#intc816&col02#3&36a7043c&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      200
  Interface:    -1
  Usage (page): 0xd (0x1)
  Bus type: 255

Device Found
  type: 044e 1212
  path: \\?\hid#vid_044e&pid_1212&col01&col01#7&290aacae&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 255

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col02#5&99b72d3&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x5 (0xd)
  Bus type: 3

Device Found
  type: 045e 0000
  path: \\?\hid#converteddevice&col02#5&379854aa&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 255

Device Found
  type: 045e 0000
  path: \\?\hid#converteddevice&col03#5&379854aa&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x80 (0x1)
  Bus type: 255

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col05#8&1cf1c1b9&2&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 2

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col03#5&99b72d3&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x1 (0xff01)
  Bus type: 3

Device Found
  type: 046d c534
  path: \\?\hid#vid_046d&pid_c534&mi_00#7&1c54b96&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    0
  Usage (page): 0x6 (0x1)
  Bus type: 1

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col04#5&99b72d3&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x1 (0xff02)
  Bus type: 3

Device Found
  type: 1915 1025
  path: \\?\hid#vid_1915&pid_1025&mi_03&col01#8&33bf0c65&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x2 (0x1)
  Bus type: 1

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col01#8&1cf1c1b9&2&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 2

Device Found
  type: 1915 1025
  path: \\?\hid#vid_1915&pid_1025&mi_03&col02#8&33bf0c65&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x1 (0xc)
  Bus type: 1

Device Found
  type: 1915 1025
  path: \\?\hid#vid_1915&pid_1025&mi_02#8&b545e9c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
  serial_number:
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    2
  Usage (page): 0x6 (0x1)
  Bus type: 1

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col02#8&1cf1c1b9&2&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 2

Device Found
  type: 1915 1025
  path: \\?\hid#vid_1915&pid_1025&mi_03&col03#8&33bf0c65&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x80 (0x1)
  Bus type: 1

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col03#8&1cf1c1b9&2&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xff00)
  Bus type: 2

Device Found
  type: 0488 121f
  path: \\?\hid#dell091a&col05#5&99b72d3&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0xe (0xd)
  Bus type: 3

Device Found
  type: 1915 1025
  path: \\?\hid#vid_1915&pid_1025&mi_03&col04#8&33bf0c65&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x0 (0xff00)
  Bus type: 1

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col04#8&1cf1c1b9&2&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x2 (0xff00)
  Bus type: 2

Device Found
  type: 046d b010
  path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col06#8&1cf1c1b9&2&0005#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 2

Device Found
  type: 045e 0000
  path: \\?\hid#converteddevice&col01#5&379854aa&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 255

unable to open device
With added debug print, so I think the latest update is good. ``` diff --git a/windows/hid.c b/windows/hid.c index 2631382..23d2acf 100644 --- a/windows/hid.c +++ b/windows/hid.c @@ -417,7 +417,7 @@ static void hid_internal_get_info(struct hid_device_info* dev) { /* Normalize to upper case */ for (wchar_t* p = compatible_id; *p; ++p) *p = towupper(*p); - + wprintf(L"DEVPKEY_Device_CompatibleId: %s\n", compatible_id); /* USB devices https://docs.microsoft.com/windows-hardware/drivers/hid/plug-and-play-support https://docs.microsoft.com/windows-hardware/drivers/install/standard-usb-identifiers * ``` <details> <summary> click to expand </summary> ``` C:\work\hid\hidapi_djm\windows\x64\Release [hid_bus_type ≡]> .\hidtest.exe hidapi test/example tool. Compiled with hidapi version 0.11.0, runtime version 0.11.0. Compile-time version matches runtime version of hidapi. DEVPKEY_Device_CompatibleId: USB\CLASS_03&SUBCLASS_01&PROT_02 DEVPKEY_Device_CompatibleId: USB\CLASS_03&SUBCLASS_01&PROT_02 DEVPKEY_Device_CompatibleId: USB\CLASS_03&SUBCLASS_01&PROT_02 DEVPKEY_Device_CompatibleId: USB\CLASS_03&SUBCLASS_01&PROT_02 DEVPKEY_Device_CompatibleId: ACPI\PNP0C50 DEVPKEY_Device_CompatibleId: PTP_HID_DEVICE DEVPKEY_Device_CompatibleId: USB\CLASS_03&SUBCLASS_01&PROT_02 DEVPKEY_Device_CompatibleId: PTP_HID_DEVICE DEVPKEY_Device_CompatibleId: ACPI\PNP0C50 DEVPKEY_Device_CompatibleId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB} DEVPKEY_Device_CompatibleId: ACPI\PNP0C50 DEVPKEY_Device_CompatibleId: USB\CLASS_03&SUBCLASS_01&PROT_01 DEVPKEY_Device_CompatibleId: ACPI\PNP0C50 DEVPKEY_Device_CompatibleId: USB\CLASS_03&SUBCLASS_00&PROT_00 DEVPKEY_Device_CompatibleId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB} DEVPKEY_Device_CompatibleId: USB\CLASS_03&SUBCLASS_00&PROT_00 DEVPKEY_Device_CompatibleId: USB\CLASS_03&SUBCLASS_01&PROT_01 DEVPKEY_Device_CompatibleId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB} DEVPKEY_Device_CompatibleId: USB\CLASS_03&SUBCLASS_00&PROT_00 DEVPKEY_Device_CompatibleId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB} DEVPKEY_Device_CompatibleId: ACPI\PNP0C50 DEVPKEY_Device_CompatibleId: USB\CLASS_03&SUBCLASS_00&PROT_00 DEVPKEY_Device_CompatibleId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB} DEVPKEY_Device_CompatibleId: BTHENUM\{00001124-0000-1000-8000-00805F9B34FB} Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_01&col01#7&383a3a17&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x2 (0x1) Bus type: 1 Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_01&col02#7&383a3a17&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x1 (0xc) Bus type: 1 Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_01&col03#7&383a3a17&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x80 (0x1) Bus type: 1 Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_01&col04#7&383a3a17&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x1 (0xff00) Bus type: 1 Device Found type: 0488 121f path: \\?\hid#dell091a&col01#5&99b72d3&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x2 (0x1) Bus type: 3 Device Found type: 8087 0a1e path: \\?\hid#intc816&col01#3&36a7043c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 200 Interface: -1 Usage (page): 0xc (0x1) Bus type: 255 Device Found type: 044e 1212 path: \\?\hid#vid_044e&pid_1212&col01&col02#7&290aacae&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 255 Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_01&col05#7&383a3a17&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x2 (0xff00) Bus type: 1 Device Found type: 8087 0a1e path: \\?\hid#intc816&col02#3&36a7043c&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 200 Interface: -1 Usage (page): 0xd (0x1) Bus type: 255 Device Found type: 044e 1212 path: \\?\hid#vid_044e&pid_1212&col01&col01#7&290aacae&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x2 (0x1) Bus type: 255 Device Found type: 0488 121f path: \\?\hid#dell091a&col02#5&99b72d3&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x5 (0xd) Bus type: 3 Device Found type: 045e 0000 path: \\?\hid#converteddevice&col02#5&379854aa&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 255 Device Found type: 045e 0000 path: \\?\hid#converteddevice&col03#5&379854aa&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x80 (0x1) Bus type: 255 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col05#8&1cf1c1b9&2&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 2 Device Found type: 0488 121f path: \\?\hid#dell091a&col03#5&99b72d3&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x1 (0xff01) Bus type: 3 Device Found type: 046d c534 path: \\?\hid#vid_046d&pid_c534&mi_00#7&1c54b96&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 0 Usage (page): 0x6 (0x1) Bus type: 1 Device Found type: 0488 121f path: \\?\hid#dell091a&col04#5&99b72d3&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x1 (0xff02) Bus type: 3 Device Found type: 1915 1025 path: \\?\hid#vid_1915&pid_1025&mi_03&col01#8&33bf0c65&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x2 (0x1) Bus type: 1 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col01#8&1cf1c1b9&2&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x2 (0x1) Bus type: 2 Device Found type: 1915 1025 path: \\?\hid#vid_1915&pid_1025&mi_03&col02#8&33bf0c65&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x1 (0xc) Bus type: 1 Device Found type: 1915 1025 path: \\?\hid#vid_1915&pid_1025&mi_02#8&b545e9c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 2 Usage (page): 0x6 (0x1) Bus type: 1 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col02#8&1cf1c1b9&2&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 2 Device Found type: 1915 1025 path: \\?\hid#vid_1915&pid_1025&mi_03&col03#8&33bf0c65&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x80 (0x1) Bus type: 1 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col03#8&1cf1c1b9&2&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x1 (0xff00) Bus type: 2 Device Found type: 0488 121f path: \\?\hid#dell091a&col05#5&99b72d3&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0xe (0xd) Bus type: 3 Device Found type: 1915 1025 path: \\?\hid#vid_1915&pid_1025&mi_03&col04#8&33bf0c65&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x0 (0xff00) Bus type: 1 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col04#8&1cf1c1b9&2&0003#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x2 (0xff00) Bus type: 2 Device Found type: 046d b010 path: \\?\hid#{00001124-0000-1000-8000-00805f9b34fb}_vid&0002046d_pid&b010&col06#8&1cf1c1b9&2&0005#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 2 Device Found type: 045e 0000 path: \\?\hid#converteddevice&col01#5&379854aa&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 255 unable to open device ``` </details>
mcuee commented 2021-07-25 01:23:57 -05:00 (Migrated from github.com)

It is also good for BLE device.

Device Found
  type: 16c0 05df
  path: \\?\hid#{00001812-0000-1000-8000-00805f9b34fb}_dev_vid&0216c0_pid&05df_rev&0100_30aea44c4efa#9&38bb9e5a&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      100
  Interface:    -1
  Usage (page): 0x100 (0xff00)
  Bus type: 2

Device Found
  type: 16c0 05df
  path: \\?\hid#{00001812-0000-1000-8000-00805f9b34fb}_dev_vid&0216c0_pid&05df_rev&0100_30aea44c4efa#9&f97cf65&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      100
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 2
It is also good for BLE device. ``` Device Found type: 16c0 05df path: \\?\hid#{00001812-0000-1000-8000-00805f9b34fb}_dev_vid&0216c0_pid&05df_rev&0100_30aea44c4efa#9&38bb9e5a&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 100 Interface: -1 Usage (page): 0x100 (0xff00) Bus type: 2 Device Found type: 16c0 05df path: \\?\hid#{00001812-0000-1000-8000-00805f9b34fb}_dev_vid&0216c0_pid&05df_rev&0100_30aea44c4efa#9&f97cf65&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 100 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 2 ```
DJm00n commented 2021-07-26 03:47:50 -05:00 (Migrated from github.com)

@mcuee

As for the hidraw backend, on one hand it seems to work, but on the other hand, many reports bus type "0". Is this expected by your design?

I have fixed it. Please check when you have a time.

@mcuee > As for the hidraw backend, on one hand it seems to work, but on the other hand, many reports bus type "0". Is this expected by your design? I have fixed it. Please check when you have a time.
mcuee commented 2021-07-26 08:25:07 -05:00 (Migrated from github.com)

@DJm00n Yes the latest git is okay for Linux (tested with my Raspberry Pi 400 running Ubuntu 64bit Linux).

hidapi_djm/build on  hid_bus_type [?] via △ v3.18.4 ❯ ./hidtest/hidtest_hidraw
hidapi test/example tool. Compiled with hidapi version 0.11.0, runtime version 0.11.0.
Compile-time version matches runtime version of hidapi.

Device Found
  type: 046d 101b
  path: /dev/hidraw3
  serial_number: 101b-ae-8a-0c-8c
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x2 (0x1)
  Bus type: 1

Device Found
  type: 046d 101b
  path: /dev/hidraw3
  serial_number: 101b-ae-8a-0c-8c
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x1 (0x1)
  Bus type: 1

Device Found
  type: 046d 101b
  path: /dev/hidraw3
  serial_number: 101b-ae-8a-0c-8c
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x1 (0xff00)
  Bus type: 1

Device Found
  type: 046d 101b
  path: /dev/hidraw3
  serial_number: 101b-ae-8a-0c-8c
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x2 (0xff00)
  Bus type: 1

Device Found
  type: 046d 101b
  path: /dev/hidraw3
  serial_number: 101b-ae-8a-0c-8c
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x4 (0xff00)
  Bus type: 1

Device Found
  type: 046d 2008
  path: /dev/hidraw4
  serial_number: 2008-b6-b4-d3-96
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x6 (0x1)
  Bus type: 1

Device Found
  type: 046d 2008
  path: /dev/hidraw4
  serial_number: 2008-b6-b4-d3-96
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x1 (0xc)
  Bus type: 1

Device Found
  type: 046d 2008
  path: /dev/hidraw4
  serial_number: 2008-b6-b4-d3-96
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x80 (0x1)
  Bus type: 1

Device Found
  type: 046d 2008
  path: /dev/hidraw4
  serial_number: 2008-b6-b4-d3-96
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x88 (0xffbc)
  Bus type: 1

Device Found
  type: 046d 2008
  path: /dev/hidraw4
  serial_number: 2008-b6-b4-d3-96
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x1 (0xff00)
  Bus type: 1

Device Found
  type: 046d 2008
  path: /dev/hidraw4
  serial_number: 2008-b6-b4-d3-96
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x2 (0xff00)
  Bus type: 1

Device Found
  type: 046d 2008
  path: /dev/hidraw4
  serial_number: 2008-b6-b4-d3-96
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x4 (0xff00)
  Bus type: 1

Device Found
  type: 046d c52b
  path: /dev/hidraw2
  serial_number: 
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x1 (0xff00)
  Bus type: 1

Device Found
  type: 046d c52b
  path: /dev/hidraw2
  serial_number: 
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x2 (0xff00)
  Bus type: 1

Device Found
  type: 046d c52b
  path: /dev/hidraw2
  serial_number: 
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2410
  Interface:    2
  Usage (page): 0x4 (0xff00)
  Bus type: 1

Device Found
  type: 04d9 0007
  path: /dev/hidraw0
  serial_number: 
  Manufacturer:  
  Product:      Raspberry Pi Internal Keyboard
  Release:      161
  Interface:    0
  Usage (page): 0x6 (0x1)
  Bus type: 1

Device Found
  type: 04d9 0007
  path: /dev/hidraw1
  serial_number: 
  Manufacturer:  
  Product:      Raspberry Pi Internal Keyboard
  Release:      161
  Interface:    1
  Usage (page): 0x1 (0xc)
  Bus type: 1

unable to open device

@DJm00n Yes the latest git is okay for Linux (tested with my Raspberry Pi 400 running Ubuntu 64bit Linux). ``` hidapi_djm/build on  hid_bus_type [?] via △ v3.18.4 ❯ ./hidtest/hidtest_hidraw hidapi test/example tool. Compiled with hidapi version 0.11.0, runtime version 0.11.0. Compile-time version matches runtime version of hidapi. Device Found type: 046d 101b path: /dev/hidraw3 serial_number: 101b-ae-8a-0c-8c Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x2 (0x1) Bus type: 1 Device Found type: 046d 101b path: /dev/hidraw3 serial_number: 101b-ae-8a-0c-8c Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x1 (0x1) Bus type: 1 Device Found type: 046d 101b path: /dev/hidraw3 serial_number: 101b-ae-8a-0c-8c Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x1 (0xff00) Bus type: 1 Device Found type: 046d 101b path: /dev/hidraw3 serial_number: 101b-ae-8a-0c-8c Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x2 (0xff00) Bus type: 1 Device Found type: 046d 101b path: /dev/hidraw3 serial_number: 101b-ae-8a-0c-8c Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x4 (0xff00) Bus type: 1 Device Found type: 046d 2008 path: /dev/hidraw4 serial_number: 2008-b6-b4-d3-96 Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x6 (0x1) Bus type: 1 Device Found type: 046d 2008 path: /dev/hidraw4 serial_number: 2008-b6-b4-d3-96 Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x1 (0xc) Bus type: 1 Device Found type: 046d 2008 path: /dev/hidraw4 serial_number: 2008-b6-b4-d3-96 Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x80 (0x1) Bus type: 1 Device Found type: 046d 2008 path: /dev/hidraw4 serial_number: 2008-b6-b4-d3-96 Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x88 (0xffbc) Bus type: 1 Device Found type: 046d 2008 path: /dev/hidraw4 serial_number: 2008-b6-b4-d3-96 Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x1 (0xff00) Bus type: 1 Device Found type: 046d 2008 path: /dev/hidraw4 serial_number: 2008-b6-b4-d3-96 Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x2 (0xff00) Bus type: 1 Device Found type: 046d 2008 path: /dev/hidraw4 serial_number: 2008-b6-b4-d3-96 Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x4 (0xff00) Bus type: 1 Device Found type: 046d c52b path: /dev/hidraw2 serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x1 (0xff00) Bus type: 1 Device Found type: 046d c52b path: /dev/hidraw2 serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x2 (0xff00) Bus type: 1 Device Found type: 046d c52b path: /dev/hidraw2 serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2410 Interface: 2 Usage (page): 0x4 (0xff00) Bus type: 1 Device Found type: 04d9 0007 path: /dev/hidraw0 serial_number: Manufacturer: Product: Raspberry Pi Internal Keyboard Release: 161 Interface: 0 Usage (page): 0x6 (0x1) Bus type: 1 Device Found type: 04d9 0007 path: /dev/hidraw1 serial_number: Manufacturer: Product: Raspberry Pi Internal Keyboard Release: 161 Interface: 1 Usage (page): 0x1 (0xc) Bus type: 1 unable to open device ```
DJm00n commented 2021-07-26 08:27:24 -05:00 (Migrated from github.com)

@Youw could you please review the code?

@Youw could you please review the code?
Youw (Migrated from github.com) reviewed 2021-07-28 06:48:39 -05:00
Youw (Migrated from github.com) left a comment

This looks good.
Since this PR is targeting master, and not a separate feature branch, lets finish with all platforms (macOS) first, before we merge it.

Also, I'd like to finish #309 separately first, as I already mentioned.

This looks good. Since this PR is targeting master, and not a separate feature branch, lets finish with all platforms (macOS) first, before we merge it. Also, I'd like to finish #309 separately first, as I already mentioned.
Youw (Migrated from github.com) commented 2021-07-28 06:47:27 -05:00

we've already faced a name conflict with hid_init (on some of the BSD platforms);
let's prefix it as HID_API_ or HIDAPI_ instead of just HID_ to decrease the chance of name conflict

we've already faced a name conflict with `hid_init` (on some of the BSD platforms); let's prefix it as `HID_API_` or `HIDAPI_` instead of just `HID_` to decrease the chance of name conflict
Youw (Migrated from github.com) commented 2021-07-28 06:39:53 -05:00

(minor)
my first though when I've seen close is that you'd close the entire dev, which in fact is more like final or end

(minor) my first though when I've seen `close` is that you'd close the entire `dev`, which in fact is more like `final` or `end`
Youw (Migrated from github.com) commented 2021-07-28 06:44:15 -05:00

since wcsstr returns a pointer (not an index) lets compare it to NULL

		if (wcsstr(compatible_id, L"USB") != NULL) {

same applies below

since `wcsstr` returns a pointer (not an index) lets compare it to `NULL` ```suggestion if (wcsstr(compatible_id, L"USB") != NULL) { ``` same applies below
DJm00n (Migrated from github.com) reviewed 2021-08-03 08:18:34 -05:00
DJm00n (Migrated from github.com) commented 2021-08-03 08:18:34 -05:00

done

done
DJm00n (Migrated from github.com) reviewed 2021-08-03 08:18:39 -05:00
DJm00n (Migrated from github.com) commented 2021-08-03 08:18:38 -05:00

done

done
DJm00n (Migrated from github.com) reviewed 2021-08-03 08:18:42 -05:00
DJm00n (Migrated from github.com) commented 2021-08-03 08:18:42 -05:00

done

done
mcuee commented 2021-08-06 00:48:58 -05:00 (Migrated from github.com)

@DJm00n You may want to disable the following warnings.

1>C:\work\hid\hidapi_bustype\windows\hid.c(423,6): warning C4996: 'mbstowcs': This function or variable may be unsafe. Consider using mbstowcs_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\work\hid\hidapi_bustype\windows\hid.c(1169,2): warning C4996: 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\work\hid\hidapi_bustype\windows\hid.c(1179,2): warning C4996: 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
1>C:\work\hid\hidapi_bustype\windows\hid.c(1189,2): warning C4996: 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

@DJm00n You may want to disable the following warnings. ``` 1>C:\work\hid\hidapi_bustype\windows\hid.c(423,6): warning C4996: 'mbstowcs': This function or variable may be unsafe. Consider using mbstowcs_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1>C:\work\hid\hidapi_bustype\windows\hid.c(1169,2): warning C4996: 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1>C:\work\hid\hidapi_bustype\windows\hid.c(1179,2): warning C4996: 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 1>C:\work\hid\hidapi_bustype\windows\hid.c(1189,2): warning C4996: 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. ```
mcuee commented 2022-02-05 21:26:18 -06:00 (Migrated from github.com)

Maybe this one can be considered for next release 0.12? Or maybe 0.13?

Maybe this one can be considered for next release 0.12? Or maybe 0.13?
JoergAtGithub (Migrated from github.com) reviewed 2022-04-25 13:32:24 -05:00
JoergAtGithub (Migrated from github.com) commented 2022-04-25 13:32:23 -05:00
        wchar_t [] bus_type = get_string_property(dev, CFSTR(kIOHIDTransportKey));
        if (wcsstr(bus_type, kIOHIDTransportUSBValue) != NULL) {
            cur_dev->bus_type = HID_API_BUS_USB;
        } else if (wcsstr(bus_type, kIOHIDTransportBluetoothValue ) != NULL || wcsstr(bus_type, kIOHIDTransportBluetoothLowEnergyValue) != NULL) {
            cur_dev->bus_type = HID_API_BUS_BLUETOOTH;
        } else if (wcsstr(bus_type, kIOHIDTransportI2CValue) != NULL) {
            cur_dev->bus_type = HID_API_BUS_I2C;
        } else  if (wcsstr(bus_type, kIOHIDTransportSPIValue) != NULL) {
            cur_dev->bus_type = HID_API_BUS_SPI;
        } else {
            // kIOHIDTransportAIDBValue
            // kIOHIDTransportSerialValue
            // kIOHIDTransportIAPValue
            // kIOHIDTransportAirPlayValue
            // kIOHIDTransportSPUValue
	    cur_dev->bus_type = HID_API_BUS_UNKNOWN;
	}
```suggestion wchar_t [] bus_type = get_string_property(dev, CFSTR(kIOHIDTransportKey)); if (wcsstr(bus_type, kIOHIDTransportUSBValue) != NULL) { cur_dev->bus_type = HID_API_BUS_USB; } else if (wcsstr(bus_type, kIOHIDTransportBluetoothValue ) != NULL || wcsstr(bus_type, kIOHIDTransportBluetoothLowEnergyValue) != NULL) { cur_dev->bus_type = HID_API_BUS_BLUETOOTH; } else if (wcsstr(bus_type, kIOHIDTransportI2CValue) != NULL) { cur_dev->bus_type = HID_API_BUS_I2C; } else if (wcsstr(bus_type, kIOHIDTransportSPIValue) != NULL) { cur_dev->bus_type = HID_API_BUS_SPI; } else { // kIOHIDTransportAIDBValue // kIOHIDTransportSerialValue // kIOHIDTransportIAPValue // kIOHIDTransportAirPlayValue // kIOHIDTransportSPUValue cur_dev->bus_type = HID_API_BUS_UNKNOWN; } ```
JoergAtGithub (Migrated from github.com) reviewed 2022-04-25 13:33:58 -05:00
JoergAtGithub (Migrated from github.com) commented 2022-04-25 13:33:58 -05:00

The suggested code is not tested, as I do not have access to a Mac.

The suggested code is not tested, as I do not have access to a Mac.
DJm00n commented 2022-07-14 14:02:45 -05:00 (Migrated from github.com)

Hey @Youw!

I have added MacOS implementation (KUDOS @JoergAtGithub) and updated this PR. Need someone who can test MacOS implementation.

Hey @Youw! I have added MacOS implementation (KUDOS @JoergAtGithub) and updated this PR. Need someone who can test MacOS implementation.
Youw (Migrated from github.com) reviewed 2022-07-14 17:01:08 -05:00
Youw (Migrated from github.com) left a comment

Checked (and fixed a bit) macOS implementation - looks good.

Windows implementation doesn't seem to have the UNKNOWN fallback.

I suggest having numeric value 0x00 as a value for HID_API_BUS_UNKNOWN, so a zero-initialized hid_device will have the bus_type field set to a valid value.

Checked (and fixed a bit) macOS implementation - looks good. Windows implementation doesn't seem to have the UNKNOWN fallback. I suggest having numeric value 0x00 as a value for `HID_API_BUS_UNKNOWN`, so a zero-initialized `hid_device` will have the `bus_type` field set to a valid value.
Youw commented 2022-07-14 17:04:06 -05:00 (Migrated from github.com)

Sample on my mac machine:

hidapi test/example tool. Compiled with hidapi version 0.12.0, runtime version 0.12.0.
Compile-time version matches runtime version of hidapi.

Device Found
  type: 05ac 0341
  path: DevSrvsID:4294969267
  serial_number: FM714170104N4Q8BG+EMN
  Manufacturer: Apple Inc.
  Product:      Apple Internal Keyboard / Trackpad
  Release:      175
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 4

Device Found
  type: 05ac 0341
  path: DevSrvsID:4294969267
  serial_number: FM714170104N4Q8BG+EMN
  Manufacturer: Apple Inc.
  Product:      Apple Internal Keyboard / Trackpad
  Release:      175
  Interface:    -1
  Usage (page): 0x1 (0x1)
  Bus type: 4

Device Found
  type: 05ac 0341
  path: DevSrvsID:4294969267
  serial_number: FM714170104N4Q8BG+EMN
  Manufacturer: Apple Inc.
  Product:      Apple Internal Keyboard / Trackpad
  Release:      175
  Interface:    -1
  Usage (page): 0x5 (0xd)
  Bus type: 4

Device Found
  type: 05ac 0341
  path: DevSrvsID:4294969267
  serial_number: FM714170104N4Q8BG+EMN
  Manufacturer: Apple Inc.
  Product:      Apple Internal Keyboard / Trackpad
  Release:      175
  Interface:    -1
  Usage (page): 0xc (0xff00)
  Bus type: 4

Device Found
  type: 0000 0000
  path: DevSrvsID:4294968672
  serial_number: 
  Manufacturer: Apple
  Product:      
  Release:      0
  Interface:    -1
  Usage (page): 0x4 (0xff00)
  Bus type: 255

Device Found
  type: 0000 0000
  path: DevSrvsID:4294968540
  serial_number: 
  Manufacturer: Apple
  Product:      Headset
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 255

Device Found
  type: 05ac 0341
  path: DevSrvsID:4294970482
  serial_number: 
  Manufacturer: 
  Product:      Keyboard Backlight
  Release:      0
  Interface:    -1
  Usage (page): 0xf (0xff00)
  Bus type: 1

Device Found
  type: 05ac 0341
  path: DevSrvsID:4294969269
  serial_number: FM714170104N4Q8BG+EMN
  Manufacturer: Apple Inc.
  Product:      Apple Internal Keyboard / Trackpad
  Release:      175
  Interface:    -1
  Usage (page): 0xd (0xff00)
  Bus type: 4

Device Found
  type: 05ac 0341
  path: DevSrvsID:4294969271
  serial_number: FM714170104N4Q8BG+EMN
  Manufacturer: Apple Inc.
  Product:      Apple Internal Keyboard / Trackpad
  Release:      175
  Interface:    -1
  Usage (page): 0x3 (0xff00)
  Bus type: 4

Device Found
  type: 0000 0000
  path: DevSrvsID:4294969019
  serial_number: 
  Manufacturer: APPL
  Product:      BTM
  Release:      0
  Interface:    -1
  Usage (page): 0x48 (0xff00)
  Bus type: 255

Device Found
  type: 0000 0000
  path: DevSrvsID:4294968689
  serial_number: 
  Manufacturer: Apple
  Product:      
  Release:      0
  Interface:    -1
  Usage (page): 0xff (0xff00)
  Bus type: 255

Device Found
  type: 05ac 8600
  path: DevSrvsID:4294970620
  serial_number: 
  Manufacturer: 
  Product:      TouchBarUserDevice
  Release:      0
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 255

Device Found
  type: 05ac 0341
  path: DevSrvsID:4294969264
  serial_number: FM714170104N4Q8BG+EMN
  Manufacturer: Apple Inc.
  Product:      Apple Internal Keyboard / Trackpad
  Release:      175
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 4

Device Found
  type: 0000 0000
  path: DevSrvsID:4294969290
  serial_number: 
  Manufacturer: Apple
  Product:      
  Release:      0
  Interface:    -1
  Usage (page): 0x4 (0xd)
  Bus type: 4

Device Found
  type: 05ac 0341
  path: DevSrvsID:4294969259
  serial_number: FM714170104N4Q8BG+EMN
  Manufacturer: Apple Inc.
  Product:      Apple Internal Keyboard / Trackpad
  Release:      175
  Interface:    -1
  Usage (page): 0xb (0xff00)
  Bus type: 4

unable to open device
Sample on my mac machine: ``` hidapi test/example tool. Compiled with hidapi version 0.12.0, runtime version 0.12.0. Compile-time version matches runtime version of hidapi. Device Found type: 05ac 0341 path: DevSrvsID:4294969267 serial_number: FM714170104N4Q8BG+EMN Manufacturer: Apple Inc. Product: Apple Internal Keyboard / Trackpad Release: 175 Interface: -1 Usage (page): 0x2 (0x1) Bus type: 4 Device Found type: 05ac 0341 path: DevSrvsID:4294969267 serial_number: FM714170104N4Q8BG+EMN Manufacturer: Apple Inc. Product: Apple Internal Keyboard / Trackpad Release: 175 Interface: -1 Usage (page): 0x1 (0x1) Bus type: 4 Device Found type: 05ac 0341 path: DevSrvsID:4294969267 serial_number: FM714170104N4Q8BG+EMN Manufacturer: Apple Inc. Product: Apple Internal Keyboard / Trackpad Release: 175 Interface: -1 Usage (page): 0x5 (0xd) Bus type: 4 Device Found type: 05ac 0341 path: DevSrvsID:4294969267 serial_number: FM714170104N4Q8BG+EMN Manufacturer: Apple Inc. Product: Apple Internal Keyboard / Trackpad Release: 175 Interface: -1 Usage (page): 0xc (0xff00) Bus type: 4 Device Found type: 0000 0000 path: DevSrvsID:4294968672 serial_number: Manufacturer: Apple Product: Release: 0 Interface: -1 Usage (page): 0x4 (0xff00) Bus type: 255 Device Found type: 0000 0000 path: DevSrvsID:4294968540 serial_number: Manufacturer: Apple Product: Headset Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 255 Device Found type: 05ac 0341 path: DevSrvsID:4294970482 serial_number: Manufacturer: Product: Keyboard Backlight Release: 0 Interface: -1 Usage (page): 0xf (0xff00) Bus type: 1 Device Found type: 05ac 0341 path: DevSrvsID:4294969269 serial_number: FM714170104N4Q8BG+EMN Manufacturer: Apple Inc. Product: Apple Internal Keyboard / Trackpad Release: 175 Interface: -1 Usage (page): 0xd (0xff00) Bus type: 4 Device Found type: 05ac 0341 path: DevSrvsID:4294969271 serial_number: FM714170104N4Q8BG+EMN Manufacturer: Apple Inc. Product: Apple Internal Keyboard / Trackpad Release: 175 Interface: -1 Usage (page): 0x3 (0xff00) Bus type: 4 Device Found type: 0000 0000 path: DevSrvsID:4294969019 serial_number: Manufacturer: APPL Product: BTM Release: 0 Interface: -1 Usage (page): 0x48 (0xff00) Bus type: 255 Device Found type: 0000 0000 path: DevSrvsID:4294968689 serial_number: Manufacturer: Apple Product: Release: 0 Interface: -1 Usage (page): 0xff (0xff00) Bus type: 255 Device Found type: 05ac 8600 path: DevSrvsID:4294970620 serial_number: Manufacturer: Product: TouchBarUserDevice Release: 0 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 255 Device Found type: 05ac 0341 path: DevSrvsID:4294969264 serial_number: FM714170104N4Q8BG+EMN Manufacturer: Apple Inc. Product: Apple Internal Keyboard / Trackpad Release: 175 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 4 Device Found type: 0000 0000 path: DevSrvsID:4294969290 serial_number: Manufacturer: Apple Product: Release: 0 Interface: -1 Usage (page): 0x4 (0xd) Bus type: 4 Device Found type: 05ac 0341 path: DevSrvsID:4294969259 serial_number: FM714170104N4Q8BG+EMN Manufacturer: Apple Inc. Product: Apple Internal Keyboard / Trackpad Release: 175 Interface: -1 Usage (page): 0xb (0xff00) Bus type: 4 unable to open device ```
JoergAtGithub commented 2022-07-14 17:09:31 -05:00 (Migrated from github.com)

How is the headset connected?

How is the headset connected?
Youw commented 2022-07-14 17:13:59 -05:00 (Migrated from github.com)

The funny thing - it is not connected.

And the bus type for it is "Audio" (looked up in the debugger).

The funny thing - it is not connected. And the bus type for it is `"Audio"` (looked up in the debugger).
DJm00n commented 2022-07-15 10:25:24 -05:00 (Migrated from github.com)

@Youw good point. updated.

@Youw good point. updated.
mcuee commented 2022-07-15 23:48:51 -05:00 (Migrated from github.com)

Still looks good under Windows.

 MINGW64 /c/work/libusb/hidapi_pr308/build_mingw64/hidtest
$ cmake -G"MSYS Makefiles" -D CMAKE_BUILD_TYPE=RelWithDebInfo -D HIDAPI_BUILD_HIDTEST=ON -B build_mingw64
...
$ cmake --build build_mingw64
...
$ cp ./build_mingw64/src/windows/libhidapi.dll ./build_mingw64/hidtest

$ ./build_mingw64/hidtest//hidtest.exe
hidapi test/example tool. Compiled with hidapi version 0.12.0, runtime version 0.12.0.
Compile-time version matches runtime version of hidapi.

Device Found
  type: 8087 0a1e
  path: \\?\HID#INTC816#3&d2322f2&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      200
  Interface:    -1
  Usage (page): 0xd (0x1)
  Bus type: 0

Device Found
  type: 06cb cd40
  path: \\?\HID#SYNA7DAB&Col01#5&2f64dfea&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      501
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 3

Device Found
  type: 06cb cd40
  path: \\?\HID#SYNA7DAB&Col02#5&2f64dfea&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      501
  Interface:    -1
  Usage (page): 0x5 (0xd)
  Bus type: 3

Device Found
  type: 06cb cd40
  path: \\?\HID#SYNA7DAB&Col03#5&2f64dfea&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      501
  Interface:    -1
  Usage (page): 0xe (0xd)
  Bus type: 3

Device Found
  type: 06cb cd40
  path: \\?\HID#SYNA7DAB&Col04#5&2f64dfea&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      501
  Interface:    -1
  Usage (page): 0x1 (0xff00)
  Bus type: 3

Device Found
  type: 046d c52b
  path: \\?\HID#VID_046D&PID_C52B&MI_01&Col01#7&1119bfb4&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      1203
  Interface:    1
  Usage (page): 0x2 (0x1)
  Bus type: 1

Device Found
  type: 045e 0000
  path: \\?\HID#ConvertedDevice&Col02#5&32cf90e6&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 0

Device Found
  type: 046d c52b
  path: \\?\HID#VID_046D&PID_C52B&MI_01&Col02#7&1119bfb4&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      1203
  Interface:    1
  Usage (page): 0x1 (0xc)
  Bus type: 1

Device Found
  type: 045e 0000
  path: \\?\HID#ConvertedDevice&Col03#5&32cf90e6&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x80 (0x1)
  Bus type: 0

Device Found
  type: 046d c52b
  path: \\?\HID#VID_046D&PID_C52B&MI_01&Col03#7&1119bfb4&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      1203
  Interface:    1
  Usage (page): 0x80 (0x1)
  Bus type: 1

Device Found
  type: deed feed
  path: \\?\HID#10251229#3&9d5d338&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Acer Inc
  Product:      Acer Airplane Mode Controller
  Release:      101
  Interface:    -1
  Usage (page): 0xc (0x1)
  Bus type: 0

Device Found
  type: 045e 0000
  path: \\?\HID#ConvertedDevice&Col01#5&32cf90e6&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\KBD
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 0

Device Found
  type: 046d c52b
  path: \\?\HID#VID_046D&PID_C52B&MI_01&Col04#7&1119bfb4&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      1203
  Interface:    1
  Usage (page): 0x88 (0xffbc)
  Bus type: 1

Device Found
  type: 046d c52b
  path: \\?\HID#VID_046D&PID_C52B&MI_02&Col01#7&12bd7e0e&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      1203
  Interface:    2
  Usage (page): 0x1 (0xff00)
  Bus type: 1

Device Found
  type: 046d c52b
  path: \\?\HID#VID_046D&PID_C52B&MI_02&Col02#7&12bd7e0e&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      1203
  Interface:    2
  Usage (page): 0x2 (0xff00)
  Bus type: 1

Device Found
  type: 046d c52b
  path: \\?\HID#VID_046D&PID_C52B&MI_02&Col03#7&12bd7e0e&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      1203
  Interface:    2
  Usage (page): 0x4 (0xff00)
  Bus type: 1

Device Found
  type: 046d c52b
  path: \\?\HID#VID_046D&PID_C52B&MI_00#7&34f0fd76&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\KBD
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      1203
  Interface:    0
  Usage (page): 0x6 (0x1)
  Bus type: 1

unable to open device

Still looks good under Windows. ``` MINGW64 /c/work/libusb/hidapi_pr308/build_mingw64/hidtest $ cmake -G"MSYS Makefiles" -D CMAKE_BUILD_TYPE=RelWithDebInfo -D HIDAPI_BUILD_HIDTEST=ON -B build_mingw64 ... $ cmake --build build_mingw64 ... $ cp ./build_mingw64/src/windows/libhidapi.dll ./build_mingw64/hidtest $ ./build_mingw64/hidtest//hidtest.exe hidapi test/example tool. Compiled with hidapi version 0.12.0, runtime version 0.12.0. Compile-time version matches runtime version of hidapi. Device Found type: 8087 0a1e path: \\?\HID#INTC816#3&d2322f2&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 200 Interface: -1 Usage (page): 0xd (0x1) Bus type: 0 Device Found type: 06cb cd40 path: \\?\HID#SYNA7DAB&Col01#5&2f64dfea&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 501 Interface: -1 Usage (page): 0x2 (0x1) Bus type: 3 Device Found type: 06cb cd40 path: \\?\HID#SYNA7DAB&Col02#5&2f64dfea&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 501 Interface: -1 Usage (page): 0x5 (0xd) Bus type: 3 Device Found type: 06cb cd40 path: \\?\HID#SYNA7DAB&Col03#5&2f64dfea&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 501 Interface: -1 Usage (page): 0xe (0xd) Bus type: 3 Device Found type: 06cb cd40 path: \\?\HID#SYNA7DAB&Col04#5&2f64dfea&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 501 Interface: -1 Usage (page): 0x1 (0xff00) Bus type: 3 Device Found type: 046d c52b path: \\?\HID#VID_046D&PID_C52B&MI_01&Col01#7&1119bfb4&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 1203 Interface: 1 Usage (page): 0x2 (0x1) Bus type: 1 Device Found type: 045e 0000 path: \\?\HID#ConvertedDevice&Col02#5&32cf90e6&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 0 Device Found type: 046d c52b path: \\?\HID#VID_046D&PID_C52B&MI_01&Col02#7&1119bfb4&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 1203 Interface: 1 Usage (page): 0x1 (0xc) Bus type: 1 Device Found type: 045e 0000 path: \\?\HID#ConvertedDevice&Col03#5&32cf90e6&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x80 (0x1) Bus type: 0 Device Found type: 046d c52b path: \\?\HID#VID_046D&PID_C52B&MI_01&Col03#7&1119bfb4&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 1203 Interface: 1 Usage (page): 0x80 (0x1) Bus type: 1 Device Found type: deed feed path: \\?\HID#10251229#3&9d5d338&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Acer Inc Product: Acer Airplane Mode Controller Release: 101 Interface: -1 Usage (page): 0xc (0x1) Bus type: 0 Device Found type: 045e 0000 path: \\?\HID#ConvertedDevice&Col01#5&32cf90e6&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\KBD serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 0 Device Found type: 046d c52b path: \\?\HID#VID_046D&PID_C52B&MI_01&Col04#7&1119bfb4&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 1203 Interface: 1 Usage (page): 0x88 (0xffbc) Bus type: 1 Device Found type: 046d c52b path: \\?\HID#VID_046D&PID_C52B&MI_02&Col01#7&12bd7e0e&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 1203 Interface: 2 Usage (page): 0x1 (0xff00) Bus type: 1 Device Found type: 046d c52b path: \\?\HID#VID_046D&PID_C52B&MI_02&Col02#7&12bd7e0e&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 1203 Interface: 2 Usage (page): 0x2 (0xff00) Bus type: 1 Device Found type: 046d c52b path: \\?\HID#VID_046D&PID_C52B&MI_02&Col03#7&12bd7e0e&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 1203 Interface: 2 Usage (page): 0x4 (0xff00) Bus type: 1 Device Found type: 046d c52b path: \\?\HID#VID_046D&PID_C52B&MI_00#7&34f0fd76&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\KBD serial_number: Manufacturer: Logitech Product: USB Receiver Release: 1203 Interface: 0 Usage (page): 0x6 (0x1) Bus type: 1 unable to open device ```
mcuee commented 2022-07-16 00:25:20 -05:00 (Migrated from github.com)

And it is also good for macOS.


mcuee@mcuees-Mac-mini hidapi_pr308 % ./build_darwin/hidtest/hidtest
hidapi test/example tool. Compiled with hidapi version 0.12.0, runtime version 0.12.0.
Compile-time version matches runtime version of hidapi.

Device Found
  type: 1915 1025
  path: DevSrvsID:4294969659
  serial_number: 
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x2 (0x1)
  Bus type: 1

Device Found
  type: 1915 1025
  path: DevSrvsID:4294969659
  serial_number: 
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x1 (0x1)
  Bus type: 1

Device Found
  type: 1915 1025
  path: DevSrvsID:4294969659
  serial_number: 
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x1 (0xc)
  Bus type: 1

Device Found
  type: 1915 1025
  path: DevSrvsID:4294969659
  serial_number: 
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x80 (0x1)
  Bus type: 1

Device Found
  type: 1915 1025
  path: DevSrvsID:4294969659
  serial_number: 
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x0 (0xff00)
  Bus type: 1

Device Found
  type: 1915 1025
  path: DevSrvsID:4294969661
  serial_number: 
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    2
  Usage (page): 0x6 (0x1)
  Bus type: 1

Device Found
  type: 045e 082f
  path: DevSrvsID:4294969867
  serial_number: 734762612322
  Manufacturer: Microsoft
  Product:      Microsoft Bluetooth Mouse
  Release:      212
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 0

Device Found
  type: 045e 082f
  path: DevSrvsID:4294969867
  serial_number: 734762612322
  Manufacturer: Microsoft
  Product:      Microsoft Bluetooth Mouse
  Release:      212
  Interface:    -1
  Usage (page): 0x1 (0x1)
  Bus type: 0

Device Found
  type: 045e 082f
  path: DevSrvsID:4294969867
  serial_number: 734762612322
  Manufacturer: Microsoft
  Product:      Microsoft Bluetooth Mouse
  Release:      212
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 0

Device Found
  type: 045e 082f
  path: DevSrvsID:4294969867
  serial_number: 734762612322
  Manufacturer: Microsoft
  Product:      Microsoft Bluetooth Mouse
  Release:      212
  Interface:    -1
  Usage (page): 0x212 (0xff07)
  Bus type: 0

Device Found
  type: 046d b33d
  path: DevSrvsID:4294969883
  serial_number: f4-73-35-4b-c5-aa
  Manufacturer: Unknown
  Product:      Keyboard K480
  Release:      2803
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 2

Device Found
  type: 046d b33d
  path: DevSrvsID:4294969883
  serial_number: f4-73-35-4b-c5-aa
  Manufacturer: Unknown
  Product:      Keyboard K480
  Release:      2803
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 2

Device Found
  type: 046d b33d
  path: DevSrvsID:4294969883
  serial_number: f4-73-35-4b-c5-aa
  Manufacturer: Unknown
  Product:      Keyboard K480
  Release:      2803
  Interface:    -1
  Usage (page): 0x80 (0x1)
  Bus type: 2

Device Found
  type: 046d b33d
  path: DevSrvsID:4294969883
  serial_number: f4-73-35-4b-c5-aa
  Manufacturer: Unknown
  Product:      Keyboard K480
  Release:      2803
  Interface:    -1
  Usage (page): 0x1 (0xff00)
  Bus type: 2

Device Found
  type: 046d b33d
  path: DevSrvsID:4294969883
  serial_number: f4-73-35-4b-c5-aa
  Manufacturer: Unknown
  Product:      Keyboard K480
  Release:      2803
  Interface:    -1
  Usage (page): 0x2 (0xff00)
  Bus type: 2

Device Found
  type: 0000 0000
  path: DevSrvsID:4294968515
  serial_number: 
  Manufacturer: Apple
  Product:      Headset
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 0

Device Found
  type: 0000 0000
  path: DevSrvsID:4294968878
  serial_number: 
  Manufacturer: APPL
  Product:      BTM
  Release:      0
  Interface:    -1
  Usage (page): 0x48 (0xff00)
  Bus type: 0

Device Found
  type: 0000 0000
  path: DevSrvsID:4294969138
  serial_number: 
  Manufacturer: Apple
  Product:      
  Release:      0
  Interface:    -1
  Usage (page): 0xff (0xff00)
  Bus type: 0

unable to open device
And it is also good for macOS. ``` mcuee@mcuees-Mac-mini hidapi_pr308 % ./build_darwin/hidtest/hidtest hidapi test/example tool. Compiled with hidapi version 0.12.0, runtime version 0.12.0. Compile-time version matches runtime version of hidapi. Device Found type: 1915 1025 path: DevSrvsID:4294969659 serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x2 (0x1) Bus type: 1 Device Found type: 1915 1025 path: DevSrvsID:4294969659 serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x1 (0x1) Bus type: 1 Device Found type: 1915 1025 path: DevSrvsID:4294969659 serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x1 (0xc) Bus type: 1 Device Found type: 1915 1025 path: DevSrvsID:4294969659 serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x80 (0x1) Bus type: 1 Device Found type: 1915 1025 path: DevSrvsID:4294969659 serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x0 (0xff00) Bus type: 1 Device Found type: 1915 1025 path: DevSrvsID:4294969661 serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 2 Usage (page): 0x6 (0x1) Bus type: 1 Device Found type: 045e 082f path: DevSrvsID:4294969867 serial_number: 734762612322 Manufacturer: Microsoft Product: Microsoft Bluetooth Mouse Release: 212 Interface: -1 Usage (page): 0x2 (0x1) Bus type: 0 Device Found type: 045e 082f path: DevSrvsID:4294969867 serial_number: 734762612322 Manufacturer: Microsoft Product: Microsoft Bluetooth Mouse Release: 212 Interface: -1 Usage (page): 0x1 (0x1) Bus type: 0 Device Found type: 045e 082f path: DevSrvsID:4294969867 serial_number: 734762612322 Manufacturer: Microsoft Product: Microsoft Bluetooth Mouse Release: 212 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 0 Device Found type: 045e 082f path: DevSrvsID:4294969867 serial_number: 734762612322 Manufacturer: Microsoft Product: Microsoft Bluetooth Mouse Release: 212 Interface: -1 Usage (page): 0x212 (0xff07) Bus type: 0 Device Found type: 046d b33d path: DevSrvsID:4294969883 serial_number: f4-73-35-4b-c5-aa Manufacturer: Unknown Product: Keyboard K480 Release: 2803 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 2 Device Found type: 046d b33d path: DevSrvsID:4294969883 serial_number: f4-73-35-4b-c5-aa Manufacturer: Unknown Product: Keyboard K480 Release: 2803 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 2 Device Found type: 046d b33d path: DevSrvsID:4294969883 serial_number: f4-73-35-4b-c5-aa Manufacturer: Unknown Product: Keyboard K480 Release: 2803 Interface: -1 Usage (page): 0x80 (0x1) Bus type: 2 Device Found type: 046d b33d path: DevSrvsID:4294969883 serial_number: f4-73-35-4b-c5-aa Manufacturer: Unknown Product: Keyboard K480 Release: 2803 Interface: -1 Usage (page): 0x1 (0xff00) Bus type: 2 Device Found type: 046d b33d path: DevSrvsID:4294969883 serial_number: f4-73-35-4b-c5-aa Manufacturer: Unknown Product: Keyboard K480 Release: 2803 Interface: -1 Usage (page): 0x2 (0xff00) Bus type: 2 Device Found type: 0000 0000 path: DevSrvsID:4294968515 serial_number: Manufacturer: Apple Product: Headset Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 0 Device Found type: 0000 0000 path: DevSrvsID:4294968878 serial_number: Manufacturer: APPL Product: BTM Release: 0 Interface: -1 Usage (page): 0x48 (0xff00) Bus type: 0 Device Found type: 0000 0000 path: DevSrvsID:4294969138 serial_number: Manufacturer: Apple Product: Release: 0 Interface: -1 Usage (page): 0xff (0xff00) Bus type: 0 unable to open device ```
DJm00n commented 2022-07-16 01:23:38 -05:00 (Migrated from github.com)

@mcuee thanks! “Microsoft Bluetooth Mouse” - what kind of mouse is that? Looks like bus type is not detected in this case? Does it use some kind of custom driver?

@mcuee thanks! “Microsoft Bluetooth Mouse” - what kind of mouse is that? Looks like bus type is not detected in this case? Does it use some kind of custom driver?
mcuee commented 2022-07-16 03:16:26 -05:00 (Migrated from github.com)

thanks! “Microsoft Bluetooth Mouse” - what kind of mouse is that? Looks like bus type is not detected in this case? Does it use some kind of custom driver?

I have the Logitech K480 bluetooth keyboard and Microsoft Bluetooth Mouse.

The MS Bluetooth Mouse seems to use Bluetooth Low Energy.
https://www.microsoft.com/en-sg/d/microsoft-bluetooth-mouse/8qbx2w3xsp2h?activetab=pivot:techspecstab
Connection interface: Bluetooth® Low Energy compatible 4.0/4.1/4.2/5.0

Not so sure if you need to deal with BLE specially.


mcuee@mcuees-Mac-mini ~ % system_profiler SPBluetoothDataType
Bluetooth:

      Bluetooth Controller:
          Address: 4C:20:B8:E1:4C:F8
          State: On
          Chipset: BCM_4378
          Discoverable: Off
          Firmware Version: 19.6.482.2793
          Product ID: 0x0001
          Supported services: 0x382039 < HFP AVRCP A2DP HID Braille AACP GATT Serial >
          Transport: PCIe
          Vendor ID: 0x004C (Apple)
      Connected:
          Keyboard K480:
              Address: F4:73:35:4B:C5:AA
              Vendor ID: 0x046D
              Product ID: 0xB33D
              Firmware Version: 40.0.3
              Minor Type: Keyboard
              Services: 0x800020 < HID ACL >
          Microsoft Bluetooth Mouse:
              Address: C8:3B:57:79:31:AA
              Vendor ID: 0x045E
              Product ID: 0x082F
              Battery Level: 100%
              Firmware Version: V2.12
              Minor Type: Mouse
              Services: 0x400000 < BLE >
      Not Connected:
          Bluetooth Mouse M557:
              Address: 34:88:5D:AB:0C:12
              Vendor ID: 0x046D
              Product ID: 0xB010
              Firmware Version: 0.0.0
              Minor Type: Mouse
          Xbox Wireless Controller:
              Address: 9C:AA:1B:1C:CA:E2
              Vendor ID: 0x045E
              Product ID: 0x02FD
              Firmware Version: 0.0.0
              Minor Type: Gamepad
> thanks! “Microsoft Bluetooth Mouse” - what kind of mouse is that? Looks like bus type is not detected in this case? Does it use some kind of custom driver? I have the Logitech K480 bluetooth keyboard and Microsoft Bluetooth Mouse. The MS Bluetooth Mouse seems to use Bluetooth Low Energy. https://www.microsoft.com/en-sg/d/microsoft-bluetooth-mouse/8qbx2w3xsp2h?activetab=pivot:techspecstab Connection interface: Bluetooth® Low Energy compatible 4.0/4.1/4.2/5.0 Not so sure if you need to deal with BLE specially. ``` mcuee@mcuees-Mac-mini ~ % system_profiler SPBluetoothDataType Bluetooth: Bluetooth Controller: Address: 4C:20:B8:E1:4C:F8 State: On Chipset: BCM_4378 Discoverable: Off Firmware Version: 19.6.482.2793 Product ID: 0x0001 Supported services: 0x382039 < HFP AVRCP A2DP HID Braille AACP GATT Serial > Transport: PCIe Vendor ID: 0x004C (Apple) Connected: Keyboard K480: Address: F4:73:35:4B:C5:AA Vendor ID: 0x046D Product ID: 0xB33D Firmware Version: 40.0.3 Minor Type: Keyboard Services: 0x800020 < HID ACL > Microsoft Bluetooth Mouse: Address: C8:3B:57:79:31:AA Vendor ID: 0x045E Product ID: 0x082F Battery Level: 100% Firmware Version: V2.12 Minor Type: Mouse Services: 0x400000 < BLE > Not Connected: Bluetooth Mouse M557: Address: 34:88:5D:AB:0C:12 Vendor ID: 0x046D Product ID: 0xB010 Firmware Version: 0.0.0 Minor Type: Mouse Xbox Wireless Controller: Address: 9C:AA:1B:1C:CA:E2 Vendor ID: 0x045E Product ID: 0x02FD Firmware Version: 0.0.0 Minor Type: Gamepad ```
Youw commented 2022-07-16 07:16:42 -05:00 (Migrated from github.com)

@mcuee can you modify the code locally a bit, to print
CFStringGetCStringPtr((CFStringRef)transport_prop, kCFStringEncodingMacRoman) ?
So we could check what is the Transport as detected by IOHIDManager

@mcuee can you modify the code locally a bit, to print `CFStringGetCStringPtr((CFStringRef)transport_prop, kCFStringEncodingMacRoman)` ? So we could check what is the Transport as detected by `IOHIDManager`
mcuee commented 2022-07-16 07:31:21 -05:00 (Migrated from github.com)

Test results under Linux Ubuntu 20.04 (dual boot with the above Windows 11 machine) and it seems to be fine.

mcuee@UbuntuSwift3:~/build/hidapi_pr308$ ./build_linux/hidtest/hidtest_hidraw 
hidapi test/example tool. Compiled with hidapi version 0.12.0, runtime version 0.12.0.
Compile-time version matches runtime version of hidapi.

Device Found
  type: 046d 400a
  path: /dev/hidraw2
  serial_number: 400a-49-13-e7-23
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      1203
  Interface:    2
  Usage (page): 0x2 (0x1)
  Bus type: 1

Device Found
  type: 046d 400a
  path: /dev/hidraw2
  serial_number: 400a-49-13-e7-23
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      1203
  Interface:    2
  Usage (page): 0x1 (0x1)
  Bus type: 1

Device Found
  type: 046d 400a
  path: /dev/hidraw2
  serial_number: 400a-49-13-e7-23
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      1203
  Interface:    2
  Usage (page): 0x1 (0xff00)
  Bus type: 1

Device Found
  type: 046d 400a
  path: /dev/hidraw2
  serial_number: 400a-49-13-e7-23
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      1203
  Interface:    2
  Usage (page): 0x2 (0xff00)
  Bus type: 1

Device Found
  type: 046d 400a
  path: /dev/hidraw2
  serial_number: 400a-49-13-e7-23
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      1203
  Interface:    2
  Usage (page): 0x4 (0xff00)
  Bus type: 1

Device Found
  type: 046d c52b
  path: /dev/hidraw1
  serial_number: 
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      1203
  Interface:    2
  Usage (page): 0x1 (0xff00)
  Bus type: 1

Device Found
  type: 046d c52b
  path: /dev/hidraw1
  serial_number: 
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      1203
  Interface:    2
  Usage (page): 0x2 (0xff00)
  Bus type: 1

Device Found
  type: 046d c52b
  path: /dev/hidraw1
  serial_number: 
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      1203
  Interface:    2
  Usage (page): 0x4 (0xff00)
  Bus type: 1

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 3

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0x1)
  Bus type: 3

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x5 (0xd)
  Bus type: 3

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x22 (0xd)
  Bus type: 3

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x22 (0xd)
  Bus type: 3

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x22 (0xd)
  Bus type: 3

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x22 (0xd)
  Bus type: 3

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x22 (0xd)
  Bus type: 3

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0xe (0xd)
  Bus type: 3

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x22 (0xd)
  Bus type: 3

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x22 (0xd)
  Bus type: 3

Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xff00)
  Bus type: 3

unable to open device

mcuee@UbuntuSwift3:~/build/hidapi_pr308$ ./build_linux/hidtest/hidtest_libusb 
hidapi test/example tool. Compiled with hidapi version 0.12.0, runtime version 0.12.0.
Compile-time version matches runtime version of hidapi.

Device Found
  type: 046d c52b
  path: 3-3:1.0
  serial_number: (null)
  Manufacturer: (null)
  Product:      (null)
  Release:      1203
  Interface:    0
  Usage (page): 0x0 (0x0)
  Bus type: 1

Device Found
  type: 046d c52b
  path: 3-3:1.1
  serial_number: (null)
  Manufacturer: (null)
  Product:      (null)
  Release:      1203
  Interface:    1
  Usage (page): 0x0 (0x0)
  Bus type: 1

Device Found
  type: 046d c52b
  path: 3-3:1.2
  serial_number: (null)
  Manufacturer: (null)
  Product:      (null)
  Release:      1203
  Interface:    2
  Usage (page): 0x0 (0x0)
  Bus type: 1

unable to open device


Test results under Linux Ubuntu 20.04 (dual boot with the above Windows 11 machine) and it seems to be fine. ``` mcuee@UbuntuSwift3:~/build/hidapi_pr308$ ./build_linux/hidtest/hidtest_hidraw hidapi test/example tool. Compiled with hidapi version 0.12.0, runtime version 0.12.0. Compile-time version matches runtime version of hidapi. Device Found type: 046d 400a path: /dev/hidraw2 serial_number: 400a-49-13-e7-23 Manufacturer: Logitech Product: USB Receiver Release: 1203 Interface: 2 Usage (page): 0x2 (0x1) Bus type: 1 Device Found type: 046d 400a path: /dev/hidraw2 serial_number: 400a-49-13-e7-23 Manufacturer: Logitech Product: USB Receiver Release: 1203 Interface: 2 Usage (page): 0x1 (0x1) Bus type: 1 Device Found type: 046d 400a path: /dev/hidraw2 serial_number: 400a-49-13-e7-23 Manufacturer: Logitech Product: USB Receiver Release: 1203 Interface: 2 Usage (page): 0x1 (0xff00) Bus type: 1 Device Found type: 046d 400a path: /dev/hidraw2 serial_number: 400a-49-13-e7-23 Manufacturer: Logitech Product: USB Receiver Release: 1203 Interface: 2 Usage (page): 0x2 (0xff00) Bus type: 1 Device Found type: 046d 400a path: /dev/hidraw2 serial_number: 400a-49-13-e7-23 Manufacturer: Logitech Product: USB Receiver Release: 1203 Interface: 2 Usage (page): 0x4 (0xff00) Bus type: 1 Device Found type: 046d c52b path: /dev/hidraw1 serial_number: Manufacturer: Logitech Product: USB Receiver Release: 1203 Interface: 2 Usage (page): 0x1 (0xff00) Bus type: 1 Device Found type: 046d c52b path: /dev/hidraw1 serial_number: Manufacturer: Logitech Product: USB Receiver Release: 1203 Interface: 2 Usage (page): 0x2 (0xff00) Bus type: 1 Device Found type: 046d c52b path: /dev/hidraw1 serial_number: Manufacturer: Logitech Product: USB Receiver Release: 1203 Interface: 2 Usage (page): 0x4 (0xff00) Bus type: 1 Device Found type: 06cb cd40 path: /dev/hidraw0 serial_number: Manufacturer: Product: SYNA7DAB:01 06CB:CD40 Release: 0 Interface: -1 Usage (page): 0x2 (0x1) Bus type: 3 Device Found type: 06cb cd40 path: /dev/hidraw0 serial_number: Manufacturer: Product: SYNA7DAB:01 06CB:CD40 Release: 0 Interface: -1 Usage (page): 0x1 (0x1) Bus type: 3 Device Found type: 06cb cd40 path: /dev/hidraw0 serial_number: Manufacturer: Product: SYNA7DAB:01 06CB:CD40 Release: 0 Interface: -1 Usage (page): 0x5 (0xd) Bus type: 3 Device Found type: 06cb cd40 path: /dev/hidraw0 serial_number: Manufacturer: Product: SYNA7DAB:01 06CB:CD40 Release: 0 Interface: -1 Usage (page): 0x22 (0xd) Bus type: 3 Device Found type: 06cb cd40 path: /dev/hidraw0 serial_number: Manufacturer: Product: SYNA7DAB:01 06CB:CD40 Release: 0 Interface: -1 Usage (page): 0x22 (0xd) Bus type: 3 Device Found type: 06cb cd40 path: /dev/hidraw0 serial_number: Manufacturer: Product: SYNA7DAB:01 06CB:CD40 Release: 0 Interface: -1 Usage (page): 0x22 (0xd) Bus type: 3 Device Found type: 06cb cd40 path: /dev/hidraw0 serial_number: Manufacturer: Product: SYNA7DAB:01 06CB:CD40 Release: 0 Interface: -1 Usage (page): 0x22 (0xd) Bus type: 3 Device Found type: 06cb cd40 path: /dev/hidraw0 serial_number: Manufacturer: Product: SYNA7DAB:01 06CB:CD40 Release: 0 Interface: -1 Usage (page): 0x22 (0xd) Bus type: 3 Device Found type: 06cb cd40 path: /dev/hidraw0 serial_number: Manufacturer: Product: SYNA7DAB:01 06CB:CD40 Release: 0 Interface: -1 Usage (page): 0xe (0xd) Bus type: 3 Device Found type: 06cb cd40 path: /dev/hidraw0 serial_number: Manufacturer: Product: SYNA7DAB:01 06CB:CD40 Release: 0 Interface: -1 Usage (page): 0x22 (0xd) Bus type: 3 Device Found type: 06cb cd40 path: /dev/hidraw0 serial_number: Manufacturer: Product: SYNA7DAB:01 06CB:CD40 Release: 0 Interface: -1 Usage (page): 0x22 (0xd) Bus type: 3 Device Found type: 06cb cd40 path: /dev/hidraw0 serial_number: Manufacturer: Product: SYNA7DAB:01 06CB:CD40 Release: 0 Interface: -1 Usage (page): 0x1 (0xff00) Bus type: 3 unable to open device mcuee@UbuntuSwift3:~/build/hidapi_pr308$ ./build_linux/hidtest/hidtest_libusb hidapi test/example tool. Compiled with hidapi version 0.12.0, runtime version 0.12.0. Compile-time version matches runtime version of hidapi. Device Found type: 046d c52b path: 3-3:1.0 serial_number: (null) Manufacturer: (null) Product: (null) Release: 1203 Interface: 0 Usage (page): 0x0 (0x0) Bus type: 1 Device Found type: 046d c52b path: 3-3:1.1 serial_number: (null) Manufacturer: (null) Product: (null) Release: 1203 Interface: 1 Usage (page): 0x0 (0x0) Bus type: 1 Device Found type: 046d c52b path: 3-3:1.2 serial_number: (null) Manufacturer: (null) Product: (null) Release: 1203 Interface: 2 Usage (page): 0x0 (0x0) Bus type: 1 unable to open device ```
DJm00n commented 2022-07-16 07:52:53 -05:00 (Migrated from github.com)

Oh.
image
But kIOHIDTransportBluetoothLowEnergyValue is BluetoothLowEnergy. That's...unexpected.
Update: MacOS 12.2.1.

Oh. <img width="693" alt="image" src="https://user-images.githubusercontent.com/1285934/179355637-ecf4a21f-f43c-4817-b5c1-cb33948bb9c4.png"> But `kIOHIDTransportBluetoothLowEnergyValue` is `BluetoothLowEnergy`. That's...unexpected. Update: MacOS 12.2.1.
mcuee commented 2022-07-16 07:57:08 -05:00 (Migrated from github.com)

Oh. image But kIOHIDTransportBluetoothLowEnergyValue is BluetoothLowEnergy. That's...unexpected.

That is exactly the reason.

> Oh. <img alt="image" width="693" src="https://user-images.githubusercontent.com/1285934/179355637-ecf4a21f-f43c-4817-b5c1-cb33948bb9c4.png"> But `kIOHIDTransportBluetoothLowEnergyValue` is `BluetoothLowEnergy`. That's...unexpected. That is exactly the reason.
mcuee commented 2022-07-16 07:59:05 -05:00 (Migrated from github.com)

@mcuee can you modify the code locally a bit, to print CFStringGetCStringPtr((CFStringRef)transport_prop, kCFStringEncodingMacRoman) ? So we could check what is the Transport as detected by IOHIDManager

As mentioned by @DJm00n, somehow macOS 12.4 comes out with Bluetooth Low Energy. However, kIOHIDTransportBluetoothLowEnergyValue is BluetoothLowEnergy

mcuee@mcuees-Mac-mini hidapi_pr308 % git diff
diff --git a/mac/hid.c b/mac/hid.c
index 25b912f..0f0b68e 100644
--- a/mac/hid.c
+++ b/mac/hid.c
@@ -456,7 +456,7 @@ static struct hid_device_info *create_device_info_with_usage(IOHIDDeviceRef dev,
 
        /* Bus Type */
        transport_prop = IOHIDDeviceGetProperty(dev, CFSTR(kIOHIDTransportKey));
-
+       printf("%s\n", CFStringGetCStringPtr((CFStringRef)transport_prop, kCFStringEncodingMacRoman));
        if (transport_prop != NULL && CFGetTypeID(transport_prop) == CFStringGetTypeID()) {
                if (CFStringCompare((CFStringRef)transport_prop, CFSTR(kIOHIDTransportUSBValue), 0) == kCFCompareEqualTo) {
                        cur_dev->bus_type = HID_API_BUS_USB;
mcuee@mcuees-Mac-mini hidapi_pr308 % ./build_darwin_print/hidtest/hidtest
hidapi test/example tool. Compiled with hidapi version 0.12.0, runtime version 0.12.0.
Compile-time version matches runtime version of hidapi.

(null)
(null)
(null)
(null)
(null)
(null)
(null)
(null)
(null)
(null)
(null)
Bluetooth Low Energy
Bluetooth Low Energy
Bluetooth Low Energy
Bluetooth Low Energy
(null)
(null)
(null)
Device Found
  type: 1915 1025
  path: DevSrvsID:4294969646
  serial_number: 
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x2 (0x1)
  Bus type: 1

Device Found
  type: 1915 1025
  path: DevSrvsID:4294969646
  serial_number: 
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x1 (0x1)
  Bus type: 1

Device Found
  type: 1915 1025
  path: DevSrvsID:4294969646
  serial_number: 
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x1 (0xc)
  Bus type: 1

Device Found
  type: 1915 1025
  path: DevSrvsID:4294969646
  serial_number: 
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x80 (0x1)
  Bus type: 1

Device Found
  type: 1915 1025
  path: DevSrvsID:4294969646
  serial_number: 
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x0 (0xff00)
  Bus type: 1

Device Found
  type: 046d b33d
  path: DevSrvsID:4294969894
  serial_number: f4-73-35-4b-c5-aa
  Manufacturer: Unknown
  Product:      Keyboard K480
  Release:      2803
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 2

Device Found
  type: 046d b33d
  path: DevSrvsID:4294969894
  serial_number: f4-73-35-4b-c5-aa
  Manufacturer: Unknown
  Product:      Keyboard K480
  Release:      2803
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 2

Device Found
  type: 046d b33d
  path: DevSrvsID:4294969894
  serial_number: f4-73-35-4b-c5-aa
  Manufacturer: Unknown
  Product:      Keyboard K480
  Release:      2803
  Interface:    -1
  Usage (page): 0x80 (0x1)
  Bus type: 2

Device Found
  type: 046d b33d
  path: DevSrvsID:4294969894
  serial_number: f4-73-35-4b-c5-aa
  Manufacturer: Unknown
  Product:      Keyboard K480
  Release:      2803
  Interface:    -1
  Usage (page): 0x1 (0xff00)
  Bus type: 2

Device Found
  type: 046d b33d
  path: DevSrvsID:4294969894
  serial_number: f4-73-35-4b-c5-aa
  Manufacturer: Unknown
  Product:      Keyboard K480
  Release:      2803
  Interface:    -1
  Usage (page): 0x2 (0xff00)
  Bus type: 2

Device Found
  type: 1915 1025
  path: DevSrvsID:4294969642
  serial_number: 
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    2
  Usage (page): 0x6 (0x1)
  Bus type: 1

Device Found
  type: 045e 082f
  path: DevSrvsID:4294969798
  serial_number: 734762612322
  Manufacturer: Microsoft
  Product:      Microsoft Bluetooth Mouse
  Release:      212
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 0

Device Found
  type: 045e 082f
  path: DevSrvsID:4294969798
  serial_number: 734762612322
  Manufacturer: Microsoft
  Product:      Microsoft Bluetooth Mouse
  Release:      212
  Interface:    -1
  Usage (page): 0x1 (0x1)
  Bus type: 0

Device Found
  type: 045e 082f
  path: DevSrvsID:4294969798
  serial_number: 734762612322
  Manufacturer: Microsoft
  Product:      Microsoft Bluetooth Mouse
  Release:      212
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 0

Device Found
  type: 045e 082f
  path: DevSrvsID:4294969798
  serial_number: 734762612322
  Manufacturer: Microsoft
  Product:      Microsoft Bluetooth Mouse
  Release:      212
  Interface:    -1
  Usage (page): 0x212 (0xff07)
  Bus type: 0

Device Found
  type: 0000 0000
  path: DevSrvsID:4294968504
  serial_number: 
  Manufacturer: Apple
  Product:      Headset
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 0

Device Found
  type: 0000 0000
  path: DevSrvsID:4294968863
  serial_number: 
  Manufacturer: APPL
  Product:      BTM
  Release:      0
  Interface:    -1
  Usage (page): 0x48 (0xff00)
  Bus type: 0

Device Found
  type: 0000 0000
  path: DevSrvsID:4294969143
  serial_number: 
  Manufacturer: Apple
  Product:      
  Release:      0
  Interface:    -1
  Usage (page): 0xff (0xff00)
  Bus type: 0

unable to open device

> @mcuee can you modify the code locally a bit, to print `CFStringGetCStringPtr((CFStringRef)transport_prop, kCFStringEncodingMacRoman)` ? So we could check what is the Transport as detected by `IOHIDManager` As mentioned by @DJm00n, somehow macOS 12.4 comes out with `Bluetooth Low Energy`. However, `kIOHIDTransportBluetoothLowEnergyValue` is `BluetoothLowEnergy` ``` mcuee@mcuees-Mac-mini hidapi_pr308 % git diff diff --git a/mac/hid.c b/mac/hid.c index 25b912f..0f0b68e 100644 --- a/mac/hid.c +++ b/mac/hid.c @@ -456,7 +456,7 @@ static struct hid_device_info *create_device_info_with_usage(IOHIDDeviceRef dev, /* Bus Type */ transport_prop = IOHIDDeviceGetProperty(dev, CFSTR(kIOHIDTransportKey)); - + printf("%s\n", CFStringGetCStringPtr((CFStringRef)transport_prop, kCFStringEncodingMacRoman)); if (transport_prop != NULL && CFGetTypeID(transport_prop) == CFStringGetTypeID()) { if (CFStringCompare((CFStringRef)transport_prop, CFSTR(kIOHIDTransportUSBValue), 0) == kCFCompareEqualTo) { cur_dev->bus_type = HID_API_BUS_USB; mcuee@mcuees-Mac-mini hidapi_pr308 % ./build_darwin_print/hidtest/hidtest hidapi test/example tool. Compiled with hidapi version 0.12.0, runtime version 0.12.0. Compile-time version matches runtime version of hidapi. (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) (null) Bluetooth Low Energy Bluetooth Low Energy Bluetooth Low Energy Bluetooth Low Energy (null) (null) (null) Device Found type: 1915 1025 path: DevSrvsID:4294969646 serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x2 (0x1) Bus type: 1 Device Found type: 1915 1025 path: DevSrvsID:4294969646 serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x1 (0x1) Bus type: 1 Device Found type: 1915 1025 path: DevSrvsID:4294969646 serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x1 (0xc) Bus type: 1 Device Found type: 1915 1025 path: DevSrvsID:4294969646 serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x80 (0x1) Bus type: 1 Device Found type: 1915 1025 path: DevSrvsID:4294969646 serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x0 (0xff00) Bus type: 1 Device Found type: 046d b33d path: DevSrvsID:4294969894 serial_number: f4-73-35-4b-c5-aa Manufacturer: Unknown Product: Keyboard K480 Release: 2803 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 2 Device Found type: 046d b33d path: DevSrvsID:4294969894 serial_number: f4-73-35-4b-c5-aa Manufacturer: Unknown Product: Keyboard K480 Release: 2803 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 2 Device Found type: 046d b33d path: DevSrvsID:4294969894 serial_number: f4-73-35-4b-c5-aa Manufacturer: Unknown Product: Keyboard K480 Release: 2803 Interface: -1 Usage (page): 0x80 (0x1) Bus type: 2 Device Found type: 046d b33d path: DevSrvsID:4294969894 serial_number: f4-73-35-4b-c5-aa Manufacturer: Unknown Product: Keyboard K480 Release: 2803 Interface: -1 Usage (page): 0x1 (0xff00) Bus type: 2 Device Found type: 046d b33d path: DevSrvsID:4294969894 serial_number: f4-73-35-4b-c5-aa Manufacturer: Unknown Product: Keyboard K480 Release: 2803 Interface: -1 Usage (page): 0x2 (0xff00) Bus type: 2 Device Found type: 1915 1025 path: DevSrvsID:4294969642 serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 2 Usage (page): 0x6 (0x1) Bus type: 1 Device Found type: 045e 082f path: DevSrvsID:4294969798 serial_number: 734762612322 Manufacturer: Microsoft Product: Microsoft Bluetooth Mouse Release: 212 Interface: -1 Usage (page): 0x2 (0x1) Bus type: 0 Device Found type: 045e 082f path: DevSrvsID:4294969798 serial_number: 734762612322 Manufacturer: Microsoft Product: Microsoft Bluetooth Mouse Release: 212 Interface: -1 Usage (page): 0x1 (0x1) Bus type: 0 Device Found type: 045e 082f path: DevSrvsID:4294969798 serial_number: 734762612322 Manufacturer: Microsoft Product: Microsoft Bluetooth Mouse Release: 212 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 0 Device Found type: 045e 082f path: DevSrvsID:4294969798 serial_number: 734762612322 Manufacturer: Microsoft Product: Microsoft Bluetooth Mouse Release: 212 Interface: -1 Usage (page): 0x212 (0xff07) Bus type: 0 Device Found type: 0000 0000 path: DevSrvsID:4294968504 serial_number: Manufacturer: Apple Product: Headset Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 0 Device Found type: 0000 0000 path: DevSrvsID:4294968863 serial_number: Manufacturer: APPL Product: BTM Release: 0 Interface: -1 Usage (page): 0x48 (0xff00) Bus type: 0 Device Found type: 0000 0000 path: DevSrvsID:4294969143 serial_number: Manufacturer: Apple Product: Release: 0 Interface: -1 Usage (page): 0xff (0xff00) Bus type: 0 unable to open device ```
DJm00n commented 2022-07-16 08:17:00 -05:00 (Migrated from github.com)

I have pushed a fix. Just checking for "Bluetooth" prefix now.

I have pushed a fix. Just checking for "Bluetooth" prefix now.
Youw (Migrated from github.com) approved these changes 2022-07-16 08:18:43 -05:00
mcuee commented 2022-07-16 08:20:05 -05:00 (Migrated from github.com)

I have pushed a fix. Just checking for "Bluetooth" prefix now.

Why not match both Bluetooth Low Energy and kIOHIDTransportBluetoothLowEnergyValue (=BluetoothLowEnergy) for BLE device under macOS?

> I have pushed a fix. Just checking for "Bluetooth" prefix now. Why not match both `Bluetooth Low Energy` and `kIOHIDTransportBluetoothLowEnergyValue` (=`BluetoothLowEnergy`) for BLE device under macOS?
DJm00n commented 2022-07-16 08:22:44 -05:00 (Migrated from github.com)

@mcuee CurrentCFStringHasPrefix((CFStringRef)transport_prop, CFSTR(kIOHIDTransportBluetoothValue)) check will match for "Bluetooth", "BluetoothLowEnergy" and "Bluetooth Low Energy" strings.

@mcuee Current`CFStringHasPrefix((CFStringRef)transport_prop, CFSTR(kIOHIDTransportBluetoothValue))` check will match for "Bluetooth", "BluetoothLowEnergy" and "Bluetooth Low Energy" strings.
Youw commented 2022-07-16 08:23:12 -05:00 (Migrated from github.com)

It would make 3 matches, which will break, once Apple deside to invent somethink like Bluetooth_Low_Energy

It would make 3 matches, which will break, once Apple deside to invent somethink like `Bluetooth_Low_Energy`
DJm00n commented 2022-07-16 08:25:33 -05:00 (Migrated from github.com)

@Youw or "Bluetooth LE" or "Bluetooth Smart" like it was named before :)

@Youw or "Bluetooth LE" or "Bluetooth Smart" like it was named before :)
mcuee commented 2022-07-16 08:35:03 -05:00 (Migrated from github.com)

@Youw and @DJm00n
Ok, I understand.

Now it is fine under macOS.

mcuee@mcuees-Mac-mini hidapi_pr308 % cd hidapi_pr308
mcuee@mcuees-Mac-mini hidapi_pr308 % git checkout hid_bus_type
mcuee@mcuees-Mac-mini hidapi_pr308 % cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo -D HIDAPI_BUILD_HIDTEST=ON -B build_darwin
mcuee@mcuees-Mac-mini hidapi_pr308 % cmake --build build_darwin

mcuee@mcuees-Mac-mini hidapi_pr308 % ./build_darwin/hidtest/hidtest 
hidapi test/example tool. Compiled with hidapi version 0.12.0, runtime version 0.12.0.
Compile-time version matches runtime version of hidapi.

Device Found
  type: 0000 0000
  path: DevSrvsID:4294968863
  serial_number: 
  Manufacturer: APPL
  Product:      BTM
  Release:      0
  Interface:    -1
  Usage (page): 0x48 (0xff00)
  Bus type: 0

Device Found
  type: 0000 0000
  path: DevSrvsID:4294969143
  serial_number: 
  Manufacturer: Apple
  Product:      
  Release:      0
  Interface:    -1
  Usage (page): 0xff (0xff00)
  Bus type: 0

Device Found
  type: 1915 1025
  path: DevSrvsID:4294969646
  serial_number: 
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x2 (0x1)
  Bus type: 1

Device Found
  type: 1915 1025
  path: DevSrvsID:4294969646
  serial_number: 
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x1 (0x1)
  Bus type: 1

Device Found
  type: 1915 1025
  path: DevSrvsID:4294969646
  serial_number: 
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x1 (0xc)
  Bus type: 1

Device Found
  type: 1915 1025
  path: DevSrvsID:4294969646
  serial_number: 
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x80 (0x1)
  Bus type: 1

Device Found
  type: 1915 1025
  path: DevSrvsID:4294969646
  serial_number: 
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    3
  Usage (page): 0x0 (0xff00)
  Bus type: 1

Device Found
  type: 1915 1025
  path: DevSrvsID:4294969642
  serial_number: 
  Manufacturer: ZY.Ltd
  Product:      ZY Control Mic
  Release:      173
  Interface:    2
  Usage (page): 0x6 (0x1)
  Bus type: 1

Device Found
  type: 045e 082f
  path: DevSrvsID:4294969798
  serial_number: 734762612322
  Manufacturer: Microsoft
  Product:      Microsoft Bluetooth Mouse
  Release:      212
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 2

Device Found
  type: 045e 082f
  path: DevSrvsID:4294969798
  serial_number: 734762612322
  Manufacturer: Microsoft
  Product:      Microsoft Bluetooth Mouse
  Release:      212
  Interface:    -1
  Usage (page): 0x1 (0x1)
  Bus type: 2

Device Found
  type: 045e 082f
  path: DevSrvsID:4294969798
  serial_number: 734762612322
  Manufacturer: Microsoft
  Product:      Microsoft Bluetooth Mouse
  Release:      212
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 2

Device Found
  type: 045e 082f
  path: DevSrvsID:4294969798
  serial_number: 734762612322
  Manufacturer: Microsoft
  Product:      Microsoft Bluetooth Mouse
  Release:      212
  Interface:    -1
  Usage (page): 0x212 (0xff07)
  Bus type: 2

Device Found
  type: 046d b33d
  path: DevSrvsID:4294969894
  serial_number: f4-73-35-4b-c5-aa
  Manufacturer: Unknown
  Product:      Keyboard K480
  Release:      2803
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 2

Device Found
  type: 046d b33d
  path: DevSrvsID:4294969894
  serial_number: f4-73-35-4b-c5-aa
  Manufacturer: Unknown
  Product:      Keyboard K480
  Release:      2803
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 2

Device Found
  type: 046d b33d
  path: DevSrvsID:4294969894
  serial_number: f4-73-35-4b-c5-aa
  Manufacturer: Unknown
  Product:      Keyboard K480
  Release:      2803
  Interface:    -1
  Usage (page): 0x80 (0x1)
  Bus type: 2

Device Found
  type: 046d b33d
  path: DevSrvsID:4294969894
  serial_number: f4-73-35-4b-c5-aa
  Manufacturer: Unknown
  Product:      Keyboard K480
  Release:      2803
  Interface:    -1
  Usage (page): 0x1 (0xff00)
  Bus type: 2

Device Found
  type: 046d b33d
  path: DevSrvsID:4294969894
  serial_number: f4-73-35-4b-c5-aa
  Manufacturer: Unknown
  Product:      Keyboard K480
  Release:      2803
  Interface:    -1
  Usage (page): 0x2 (0xff00)
  Bus type: 2

Device Found
  type: 0000 0000
  path: DevSrvsID:4294968504
  serial_number: 
  Manufacturer: Apple
  Product:      Headset
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 0

unable to open device
@Youw and @DJm00n Ok, I understand. Now it is fine under macOS. ``` mcuee@mcuees-Mac-mini hidapi_pr308 % cd hidapi_pr308 mcuee@mcuees-Mac-mini hidapi_pr308 % git checkout hid_bus_type mcuee@mcuees-Mac-mini hidapi_pr308 % cmake -D CMAKE_BUILD_TYPE=RelWithDebInfo -D HIDAPI_BUILD_HIDTEST=ON -B build_darwin mcuee@mcuees-Mac-mini hidapi_pr308 % cmake --build build_darwin mcuee@mcuees-Mac-mini hidapi_pr308 % ./build_darwin/hidtest/hidtest hidapi test/example tool. Compiled with hidapi version 0.12.0, runtime version 0.12.0. Compile-time version matches runtime version of hidapi. Device Found type: 0000 0000 path: DevSrvsID:4294968863 serial_number: Manufacturer: APPL Product: BTM Release: 0 Interface: -1 Usage (page): 0x48 (0xff00) Bus type: 0 Device Found type: 0000 0000 path: DevSrvsID:4294969143 serial_number: Manufacturer: Apple Product: Release: 0 Interface: -1 Usage (page): 0xff (0xff00) Bus type: 0 Device Found type: 1915 1025 path: DevSrvsID:4294969646 serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x2 (0x1) Bus type: 1 Device Found type: 1915 1025 path: DevSrvsID:4294969646 serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x1 (0x1) Bus type: 1 Device Found type: 1915 1025 path: DevSrvsID:4294969646 serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x1 (0xc) Bus type: 1 Device Found type: 1915 1025 path: DevSrvsID:4294969646 serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x80 (0x1) Bus type: 1 Device Found type: 1915 1025 path: DevSrvsID:4294969646 serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 3 Usage (page): 0x0 (0xff00) Bus type: 1 Device Found type: 1915 1025 path: DevSrvsID:4294969642 serial_number: Manufacturer: ZY.Ltd Product: ZY Control Mic Release: 173 Interface: 2 Usage (page): 0x6 (0x1) Bus type: 1 Device Found type: 045e 082f path: DevSrvsID:4294969798 serial_number: 734762612322 Manufacturer: Microsoft Product: Microsoft Bluetooth Mouse Release: 212 Interface: -1 Usage (page): 0x2 (0x1) Bus type: 2 Device Found type: 045e 082f path: DevSrvsID:4294969798 serial_number: 734762612322 Manufacturer: Microsoft Product: Microsoft Bluetooth Mouse Release: 212 Interface: -1 Usage (page): 0x1 (0x1) Bus type: 2 Device Found type: 045e 082f path: DevSrvsID:4294969798 serial_number: 734762612322 Manufacturer: Microsoft Product: Microsoft Bluetooth Mouse Release: 212 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 2 Device Found type: 045e 082f path: DevSrvsID:4294969798 serial_number: 734762612322 Manufacturer: Microsoft Product: Microsoft Bluetooth Mouse Release: 212 Interface: -1 Usage (page): 0x212 (0xff07) Bus type: 2 Device Found type: 046d b33d path: DevSrvsID:4294969894 serial_number: f4-73-35-4b-c5-aa Manufacturer: Unknown Product: Keyboard K480 Release: 2803 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 2 Device Found type: 046d b33d path: DevSrvsID:4294969894 serial_number: f4-73-35-4b-c5-aa Manufacturer: Unknown Product: Keyboard K480 Release: 2803 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 2 Device Found type: 046d b33d path: DevSrvsID:4294969894 serial_number: f4-73-35-4b-c5-aa Manufacturer: Unknown Product: Keyboard K480 Release: 2803 Interface: -1 Usage (page): 0x80 (0x1) Bus type: 2 Device Found type: 046d b33d path: DevSrvsID:4294969894 serial_number: f4-73-35-4b-c5-aa Manufacturer: Unknown Product: Keyboard K480 Release: 2803 Interface: -1 Usage (page): 0x1 (0xff00) Bus type: 2 Device Found type: 046d b33d path: DevSrvsID:4294969894 serial_number: f4-73-35-4b-c5-aa Manufacturer: Unknown Product: Keyboard K480 Release: 2803 Interface: -1 Usage (page): 0x2 (0xff00) Bus type: 2 Device Found type: 0000 0000 path: DevSrvsID:4294968504 serial_number: Manufacturer: Apple Product: Headset Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 0 unable to open device ```
mcuee commented 2022-07-17 22:14:42 -05:00 (Migrated from github.com)

One last test result under Windows 10 and it seems to be okay as well.

C:\work\hid\hidapi_pr308\windows\x64\Release [hid_bus_type ≡]> .\hidtest.exe
hidapi test/example tool. Compiled with hidapi version 0.12.0, runtime version 0.12.0.
Compile-time version matches runtime version of hidapi.

Device Found
  type: 046d b010
  path: \\?\HID#{00001124-0000-1000-8000-00805f9b34fb}_VID&0002046d_PID&b010&Col03#8&1cf1c1b9&5&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xff00)
  Bus type: 2

Device Found
  type: 046d b010
  path: \\?\HID#{00001124-0000-1000-8000-00805f9b34fb}_VID&0002046d_PID&b010&Col04#8&1cf1c1b9&5&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x2 (0xff00)
  Bus type: 2

Device Found
  type: 046d c534
  path: \\?\HID#VID_046D&PID_C534&MI_01&Col03#7&7e9f97e&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x80 (0x1)
  Bus type: 1

Device Found
  type: 0488 121f
  path: \\?\HID#DELL091A&Col01#5&99b72d3&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 3

Device Found
  type: 046d b010
  path: \\?\HID#{00001124-0000-1000-8000-00805f9b34fb}_VID&0002046d_PID&b010&Col05#8&1cf1c1b9&5&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}\KBD
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 2

Device Found
  type: 046d b010
  path: \\?\HID#{00001124-0000-1000-8000-00805f9b34fb}_VID&0002046d_PID&b010&Col06#8&1cf1c1b9&5&0005#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 2

Device Found
  type: 8087 0a1e
  path: \\?\HID#INTC816&Col01#3&36a7043c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      200
  Interface:    -1
  Usage (page): 0xc (0x1)
  Bus type: 0

Device Found
  type: 044e 1212
  path: \\?\HID#Vid_044E&Pid_1212&Col01&Col02#7&290aacae&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}\KBD
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 0

Device Found
  type: 8087 0a1e
  path: \\?\HID#INTC816&Col02#3&36a7043c&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      200
  Interface:    -1
  Usage (page): 0xd (0x1)
  Bus type: 0

Device Found
  type: 044e 1212
  path: \\?\HID#Vid_044E&Pid_1212&Col01&Col01#7&290aacae&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 0

Device Found
  type: 046d c534
  path: \\?\HID#VID_046D&PID_C534&MI_01&Col04#7&7e9f97e&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x1 (0xff00)
  Bus type: 1

Device Found
  type: 0488 121f
  path: \\?\HID#DELL091A&Col02#5&99b72d3&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x5 (0xd)
  Bus type: 3

Device Found
  type: 413c b06e
  path: \\?\HID#VID_413C&PID_B06E#c&37ff1248&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      101
  Interface:    -1
  Usage (page): 0xda (0xffda)
  Bus type: 1

Device Found
  type: 047f c056
  path: \\?\HID#VID_047F&PID_C056&MI_03&Col01#f&39e6f119&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: D1CEC32927974D5F9BD6B2AEBF2EA8E3
  Manufacturer: Plantronics
  Product:      Plantronics Blackwire 3220 Series
  Release:      210
  Interface:    3
  Usage (page): 0x1 (0xc)
  Bus type: 1

Device Found
  type: 045e 0000
  path: \\?\HID#ConvertedDevice&Col02#5&379854aa&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 0

Device Found
  type: 047f c056
  path: \\?\HID#VID_047F&PID_C056&MI_03&Col02#f&39e6f119&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: D1CEC32927974D5F9BD6B2AEBF2EA8E3
  Manufacturer: Plantronics
  Product:      Plantronics Blackwire 3220 Series
  Release:      210
  Interface:    3
  Usage (page): 0x5 (0xb)
  Bus type: 1

Device Found
  type: 045e 0000
  path: \\?\HID#ConvertedDevice&Col03#5&379854aa&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x80 (0x1)
  Bus type: 0

Device Found
  type: 047f c056
  path: \\?\HID#VID_047F&PID_C056&MI_03&Col03#f&39e6f119&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: D1CEC32927974D5F9BD6B2AEBF2EA8E3
  Manufacturer: Plantronics
  Product:      Plantronics Blackwire 3220 Series
  Release:      210
  Interface:    3
  Usage (page): 0x3 (0xffa0)
  Bus type: 1

Device Found
  type: 046d c534
  path: \\?\HID#VID_046D&PID_C534&MI_01&Col05#7&7e9f97e&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x2 (0xff00)
  Bus type: 1

Device Found
  type: 0488 121f
  path: \\?\HID#DELL091A&Col03#5&99b72d3&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x1 (0xff01)
  Bus type: 3

Device Found
  type: 046d c534
  path: \\?\HID#VID_046D&PID_C534&MI_00#7&32158c2f&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\KBD
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    0
  Usage (page): 0x6 (0x1)
  Bus type: 1

Device Found
  type: 413c 2107
  path: \\?\HID#VID_413C&PID_2107#e&1de7f0c0&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\KBD
  serial_number:
  Manufacturer: DELL
  Product:      Dell USB Entry Keyboard
  Release:      178
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 1

Device Found
  type: 0488 121f
  path: \\?\HID#DELL091A&Col04#5&99b72d3&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0x1 (0xff02)
  Bus type: 3

Device Found
  type: 046d c534
  path: \\?\HID#VID_046D&PID_C534&MI_01&Col01#7&7e9f97e&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x2 (0x1)
  Bus type: 1

Device Found
  type: 046d c077
  path: \\?\HID#VID_046D&PID_C077#e&fde55df&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Optical Mouse
  Release:      7200
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 1

Device Found
  type: 0488 121f
  path: \\?\HID#DELL091A&Col05#5&99b72d3&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      40d
  Interface:    -1
  Usage (page): 0xe (0xd)
  Bus type: 3

Device Found
  type: 046d b010
  path: \\?\HID#{00001124-0000-1000-8000-00805f9b34fb}_VID&0002046d_PID&b010&Col01#8&1cf1c1b9&5&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 2

Device Found
  type: 413c b06f
  path: \\?\HID#VID_413C&PID_B06F#d&3624b04c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      101
  Interface:    -1
  Usage (page): 0xda (0xffda)
  Bus type: 1

Device Found
  type: 046d c534
  path: \\?\HID#VID_046D&PID_C534&MI_01&Col02#7&7e9f97e&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Logitech
  Product:      USB Receiver
  Release:      2901
  Interface:    1
  Usage (page): 0x1 (0xc)
  Bus type: 1

Device Found
  type: 045e 0000
  path: \\?\HID#ConvertedDevice&Col01#5&379854aa&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\KBD
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 0

Device Found
  type: 046d b010
  path: \\?\HID#{00001124-0000-1000-8000-00805f9b34fb}_VID&0002046d_PID&b010&Col02#8&1cf1c1b9&5&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 34885dab0c12
  Manufacturer: Logitech
  Product:      Logitech Bluetooth Wireless Mouse
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 2

unable to open device
One last test result under Windows 10 and it seems to be okay as well. ``` C:\work\hid\hidapi_pr308\windows\x64\Release [hid_bus_type ≡]> .\hidtest.exe hidapi test/example tool. Compiled with hidapi version 0.12.0, runtime version 0.12.0. Compile-time version matches runtime version of hidapi. Device Found type: 046d b010 path: \\?\HID#{00001124-0000-1000-8000-00805f9b34fb}_VID&0002046d_PID&b010&Col03#8&1cf1c1b9&5&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x1 (0xff00) Bus type: 2 Device Found type: 046d b010 path: \\?\HID#{00001124-0000-1000-8000-00805f9b34fb}_VID&0002046d_PID&b010&Col04#8&1cf1c1b9&5&0003#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x2 (0xff00) Bus type: 2 Device Found type: 046d c534 path: \\?\HID#VID_046D&PID_C534&MI_01&Col03#7&7e9f97e&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x80 (0x1) Bus type: 1 Device Found type: 0488 121f path: \\?\HID#DELL091A&Col01#5&99b72d3&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x2 (0x1) Bus type: 3 Device Found type: 046d b010 path: \\?\HID#{00001124-0000-1000-8000-00805f9b34fb}_VID&0002046d_PID&b010&Col05#8&1cf1c1b9&5&0004#{4d1e55b2-f16f-11cf-88cb-001111000030}\KBD serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 2 Device Found type: 046d b010 path: \\?\HID#{00001124-0000-1000-8000-00805f9b34fb}_VID&0002046d_PID&b010&Col06#8&1cf1c1b9&5&0005#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 2 Device Found type: 8087 0a1e path: \\?\HID#INTC816&Col01#3&36a7043c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 200 Interface: -1 Usage (page): 0xc (0x1) Bus type: 0 Device Found type: 044e 1212 path: \\?\HID#Vid_044E&Pid_1212&Col01&Col02#7&290aacae&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}\KBD serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 0 Device Found type: 8087 0a1e path: \\?\HID#INTC816&Col02#3&36a7043c&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 200 Interface: -1 Usage (page): 0xd (0x1) Bus type: 0 Device Found type: 044e 1212 path: \\?\HID#Vid_044E&Pid_1212&Col01&Col01#7&290aacae&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x2 (0x1) Bus type: 0 Device Found type: 046d c534 path: \\?\HID#VID_046D&PID_C534&MI_01&Col04#7&7e9f97e&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x1 (0xff00) Bus type: 1 Device Found type: 0488 121f path: \\?\HID#DELL091A&Col02#5&99b72d3&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x5 (0xd) Bus type: 3 Device Found type: 413c b06e path: \\?\HID#VID_413C&PID_B06E#c&37ff1248&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 101 Interface: -1 Usage (page): 0xda (0xffda) Bus type: 1 Device Found type: 047f c056 path: \\?\HID#VID_047F&PID_C056&MI_03&Col01#f&39e6f119&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: D1CEC32927974D5F9BD6B2AEBF2EA8E3 Manufacturer: Plantronics Product: Plantronics Blackwire 3220 Series Release: 210 Interface: 3 Usage (page): 0x1 (0xc) Bus type: 1 Device Found type: 045e 0000 path: \\?\HID#ConvertedDevice&Col02#5&379854aa&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 0 Device Found type: 047f c056 path: \\?\HID#VID_047F&PID_C056&MI_03&Col02#f&39e6f119&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: D1CEC32927974D5F9BD6B2AEBF2EA8E3 Manufacturer: Plantronics Product: Plantronics Blackwire 3220 Series Release: 210 Interface: 3 Usage (page): 0x5 (0xb) Bus type: 1 Device Found type: 045e 0000 path: \\?\HID#ConvertedDevice&Col03#5&379854aa&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x80 (0x1) Bus type: 0 Device Found type: 047f c056 path: \\?\HID#VID_047F&PID_C056&MI_03&Col03#f&39e6f119&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: D1CEC32927974D5F9BD6B2AEBF2EA8E3 Manufacturer: Plantronics Product: Plantronics Blackwire 3220 Series Release: 210 Interface: 3 Usage (page): 0x3 (0xffa0) Bus type: 1 Device Found type: 046d c534 path: \\?\HID#VID_046D&PID_C534&MI_01&Col05#7&7e9f97e&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x2 (0xff00) Bus type: 1 Device Found type: 0488 121f path: \\?\HID#DELL091A&Col03#5&99b72d3&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x1 (0xff01) Bus type: 3 Device Found type: 046d c534 path: \\?\HID#VID_046D&PID_C534&MI_00#7&32158c2f&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\KBD serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 0 Usage (page): 0x6 (0x1) Bus type: 1 Device Found type: 413c 2107 path: \\?\HID#VID_413C&PID_2107#e&1de7f0c0&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\KBD serial_number: Manufacturer: DELL Product: Dell USB Entry Keyboard Release: 178 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 1 Device Found type: 0488 121f path: \\?\HID#DELL091A&Col04#5&99b72d3&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0x1 (0xff02) Bus type: 3 Device Found type: 046d c534 path: \\?\HID#VID_046D&PID_C534&MI_01&Col01#7&7e9f97e&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x2 (0x1) Bus type: 1 Device Found type: 046d c077 path: \\?\HID#VID_046D&PID_C077#e&fde55df&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Optical Mouse Release: 7200 Interface: -1 Usage (page): 0x2 (0x1) Bus type: 1 Device Found type: 0488 121f path: \\?\HID#DELL091A&Col05#5&99b72d3&0&0004#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 9999 Manufacturer: Microsoft Product: HIDI2C Device Release: 40d Interface: -1 Usage (page): 0xe (0xd) Bus type: 3 Device Found type: 046d b010 path: \\?\HID#{00001124-0000-1000-8000-00805f9b34fb}_VID&0002046d_PID&b010&Col01#8&1cf1c1b9&5&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x2 (0x1) Bus type: 2 Device Found type: 413c b06f path: \\?\HID#VID_413C&PID_B06F#d&3624b04c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Product: Release: 101 Interface: -1 Usage (page): 0xda (0xffda) Bus type: 1 Device Found type: 046d c534 path: \\?\HID#VID_046D&PID_C534&MI_01&Col02#7&7e9f97e&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: Manufacturer: Logitech Product: USB Receiver Release: 2901 Interface: 1 Usage (page): 0x1 (0xc) Bus type: 1 Device Found type: 045e 0000 path: \\?\HID#ConvertedDevice&Col01#5&379854aa&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\KBD serial_number: Manufacturer: Product: Release: 0 Interface: -1 Usage (page): 0x6 (0x1) Bus type: 0 Device Found type: 046d b010 path: \\?\HID#{00001124-0000-1000-8000-00805f9b34fb}_VID&0002046d_PID&b010&Col02#8&1cf1c1b9&5&0001#{4d1e55b2-f16f-11cf-88cb-001111000030} serial_number: 34885dab0c12 Manufacturer: Logitech Product: Logitech Bluetooth Wireless Mouse Release: 0 Interface: -1 Usage (page): 0x1 (0xc) Bus type: 2 unable to open device ```
mcuee commented 2022-08-16 04:44:44 -05:00 (Migrated from github.com)

@Youw

Just wondering if this can be merged for 0.13 release. Thanks.

@Youw Just wondering if this can be merged for 0.13 release. Thanks.
Youw commented 2022-08-16 05:46:21 -05:00 (Migrated from github.com)

Yes, probably. Just need to resolve the conflicts.

Yes, probably. Just need to resolve the conflicts.
mcuee commented 2022-08-16 05:49:28 -05:00 (Migrated from github.com)

@DJm00n
Please help to resolve the mergeing conflicts. Thanks.

@DJm00n Please help to resolve the mergeing conflicts. Thanks.
Youw (Migrated from github.com) reviewed 2022-08-16 05:53:42 -05:00
Youw (Migrated from github.com) commented 2022-08-16 05:53:41 -05:00

I'm afraid that having this member here breaks the ABI.
A safer change would be:


			/** Pointer to the next device */
			struct hid_device_info *next;

			/** Underlying bus type
			    Since version 0.13.0, @ref HID_API_VERSION >= HID_API_MAKE_VERSION(0, 13, 0)
			*/
			hid_bus_type bus_type;
I'm afraid that having this member here breaks the ABI. A safer change would be: ```suggestion /** Pointer to the next device */ struct hid_device_info *next; /** Underlying bus type Since version 0.13.0, @ref HID_API_VERSION >= HID_API_MAKE_VERSION(0, 13, 0) */ hid_bus_type bus_type; ```
Youw (Migrated from github.com) approved these changes 2022-09-10 11:10:43 -05:00
Youw (Migrated from github.com) left a comment

Fixed merge conflict and applied review comments.

Fixed merge conflict and applied review comments.
jonasmalacofilho commented 2023-01-05 22:16:05 -06:00 (Migrated from github.com)

If I'm not mistaken, this breaks the ABI. I'm in no position to argue whether that's fine or not here, but given https://github.com/libusb/hidapi/issues/292#issuecomment-869194346,

Practically speaking, each new HIDAPI release always been API/ABI backward compatible with previouse releases.

it might be worth adding a note about this in the 0.13.0 release notes.

If I'm not mistaken, this breaks the ABI. I'm in no position to argue whether that's fine or not here, but given https://github.com/libusb/hidapi/issues/292#issuecomment-869194346, > Practically speaking, each new HIDAPI release always been API/ABI backward compatible with previouse releases. it might be worth adding a note about this in the 0.13.0 release notes.
Youw commented 2023-01-06 03:12:23 -06:00 (Migrated from github.com)

I haven't performed any specific tests, but it shouldn't break the ABI, since we added the new field at the end of the struct.
And all of the handling (allocation/deallocation) is done with the API functions.

I haven't performed any specific tests, but it shouldn't break the ABI, since we added the new field at the end of the struct. And all of the handling (allocation/deallocation) is done with the API functions.
jonasmalacofilho commented 2023-01-06 23:54:48 -06:00 (Migrated from github.com)

@Youw,

You're right.

I wasn't completely sure that the new field being added at the end of the struct was sufficient, and had also hit (but not yet looked into) an invalid read with valgrind when running an executable built against 0.12.0 with 0.13.0.

But it turned out that the valgrind error was unrelated to this (see #497). And since we only manipulate hid_device_info through pointers, I agree that it's size doesn't matter.

Sorry for the noise.

@Youw, You're right. I wasn't completely sure that the new field being added at the end of the struct was sufficient, and had also hit (but not yet looked into) an invalid read with valgrind when running an executable built against 0.12.0 with 0.13.0. But it turned out that the valgrind error was unrelated to this (see #497). And since we only manipulate `hid_device_info` through pointers, I agree that it's size doesn't matter. Sorry for the noise.
Sign in to join this conversation.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-libusb/hidapi!308
No description provided.