I have a Honeywell 1400g barcode scanner which identifies itself as:
| Vendor |
Product |
Serial |
| 0x0c2e |
0x0b87 |
17338B352C |
It has two endpoints:
|
Endpoint 1 |
Endpoint 2 |
| UsagePage |
-116 |
140 |
On Windows and MacOS, I can use UsagePage to distinguish between the two. We toss out the -116 and keep the 140 and we have the proper device and can read HID data from it.
Unfortunately, the two endpoints are causing trouble when claiming the device in Linux: both UsagePage values return zero.
The source of hid.c makes this appear intentional:
/* Uncomment to enable the retrieval of Usage and Usage Page in
hid_enumerate(). Warning, on platforms different from FreeBSD
this is very invasive as it requires the detach
and re-attach of the kernel driver. See comments inside hid_enumerate().
libusb HIDAPI programs are encouraged to use the interface number
instead to differentiate between interfaces on a composite HID device. */
/*#define INVASIVE_GET_USAGE*/
Although the documentation recommends to use interface number, for the hardware I'm testing on, interface number is the same between devices. How do other users handle edge-cases where HID returns two device matches on the same physical device on Linux?
I have a Honeywell 1400g barcode scanner which identifies itself as:
It has two endpoints:
On Windows and MacOS, I can use UsagePage to distinguish between the two. We toss out the
-116and keep the140and we have the proper device and can read HID data from it.Unfortunately, the two endpoints are causing trouble when claiming the device in Linux: both UsagePage values return zero.
The source of
hid.cmakes this appear intentional:Although the documentation recommends to use interface number, for the hardware I'm testing on, interface number is the same between devices. How do other users handle edge-cases where HID returns two device matches on the same physical device on Linux?