signal11 / hidapi

A Simple library for communicating with USB and Bluetooth HID devices on Linux, Mac, and Windows.
http://www.signal11.us/oss/hidapi/
Other
2.47k stars 901 forks source link

Windows: enumerate simple devices #418

Open Qbicz opened 5 years ago

Qbicz commented 5 years ago

Right now, in hid_open it is checked if the connected devices have "HIDClass" driver name. This is true for composite devices, but some simple HID devices only have "Mouse" or "Keyboard" driver name.

With this change, one can enumerate and open these devices.

Signed-off-by: Kubicz, Filip filip.kubicz@nordicsemi.no

Qbicz commented 5 years ago

One of devices that cannot be opened is Dell MS116t, but any mouse which is not part of composite device should be affected.

Qbicz commented 5 years ago

The driver name in question is received from SetupDiGetDeviceRegistryPropertyA() https://docs.microsoft.com/en-us/windows/desktop/api/setupapi/nf-setupapi-setupdigetdeviceregistrypropertya

iwpz commented 5 years ago

this is useful. my work need to check that if OS have a scanning gun in my list, on my computer works good,but on one of my company's comuputer doesn't working. On that PC hid_enumerate() return nothing,(on my and others' PC hid_enumerate() return mouse/keyboard/scanning gun. but when i add what this commit changed,its working!

Qbicz commented 5 years ago

@iwpz I had similar situation. I turned out I could enumerate my device only when some other equipment (headphones) were attached!