Skip to content

Commit 76d4ffd

Browse files
committed
Windows: enumerate simple devices
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. One of devices that cannot be opened is Dell MS116t, but any mouse which is not part of composite device can be affected. With this change, one can enumerate and open these devices. Signed-off-by: Kubicz, Filip <filip.kubicz@nordicsemi.no>
1 parent baaec21 commit 76d4ffd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

windows/hid.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,9 @@ struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned shor
358358
if (!res)
359359
goto cont;
360360

361-
if (strcmp(driver_name, "HIDClass") == 0) {
361+
if ((strcmp(driver_name, "HIDClass") == 0) ||
362+
(strcmp(driver_name, "Mouse") == 0) ||
363+
(strcmp(driver_name, "Keyboard") == 0)) {
362364
/* See if there's a driver bound. */
363365
res = SetupDiGetDeviceRegistryPropertyA(device_info_set, &devinfo_data,
364366
SPDRP_DRIVER, NULL, (PBYTE)driver_name, sizeof(driver_name), NULL);

0 commit comments

Comments
 (0)