hidapi icon indicating copy to clipboard operation
hidapi copied to clipboard

Windows: enumerate simple devices

Open Qbicz opened this issue 5 years ago • 4 comments

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 [email protected]

Qbicz avatar Jan 08 '19 14:01 Qbicz

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

Qbicz avatar Jan 08 '19 14:01 Qbicz

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

Qbicz avatar Jan 08 '19 14:01 Qbicz

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!

iwpz avatar Mar 12 '19 08:03 iwpz

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

Qbicz avatar Mar 12 '19 08:03 Qbicz