-
Notifications
You must be signed in to change notification settings - Fork 906
Fill in the usage page and usage id on linux with hidraw #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Fill in the usage page and usage id on linux with hidraw #6
Conversation
I'd very much like to be able to get usage page and usage through the hidraw backend. Would an updated patch of this be acceptable for merging? |
So that first commit has a couple problems:
|
I'm curious, 2 years further on, if this is getting any attention (mostly because U2F expects the implementer to find devices by their usage page and usage.) Yubico's libu2f-host library appears to have essentially patched this code in outside the hidapi library, but it seems like it would be a lot cleaner if there is a way to get an acceptable version of this branch merged in. |
Just banged my head against the wall for a few hours after running into this issue myself :( Would be really nice to have this working. I'll take a swing at improving the patch if necessary. |
our device (mooltipass) is a composite HID/HID. having this feature would be great. |
+1 |
Adapted from ApeironTuska's PR to PastaJ36/hidapi (PastaJ36/hidapi#1) Which was adapted from djpnewton's PR to signal11/hidapi (signal11/hidapi#6) Also addresses some of the issues mentioned in (signal11/hidapi#6) * hid_open_path and hid_enumerate both need to retrieve the usage page as the user may call hid_open_path directly without using hid_enumerate * Now using uses_numbered_reports() instead of duplicated code Includes additional interface fields that are useful in Linux when it's not possible (undesireable) to unbind the HID interface during a scan. * iInterface (only some devices use this, but can be very useful) * bInterfaceClass * bInterfaceSubClass * bInterfaceProtocol * bNumEndpoints TODO - macOS and Windows TODO - Test hid and libusb usage and usage page
Adapted from ApeironTuska's PR to PastaJ36/hidapi (PastaJ36/hidapi#1) Which was adapted from djpnewton's PR to signal11/hidapi (signal11/hidapi#6) Also addresses some of the issues mentioned in (signal11/hidapi#6) * hid_open_path and hid_enumerate both need to retrieve the usage page as the user may call hid_open_path directly without using hid_enumerate * Now using uses_numbered_reports() instead of duplicated code Includes additional interface fields that are useful in Linux when it's not possible (undesireable) to unbind the HID interface during a scan. * iInterface (only some devices use this, but can be very useful) * bInterfaceClass * bInterfaceSubClass * bInterfaceProtocol * bNumEndpoints TODO - macOS and Windows TODO - Test hid and libusb usage and usage page
Adapted from ApeironTuska's PR to PastaJ36/hidapi (PastaJ36/hidapi#1) Which was adapted from djpnewton's PR to signal11/hidapi (signal11/hidapi#6) Also addresses some of the issues mentioned in (signal11/hidapi#6) * hid_open_path and hid_enumerate both need to retrieve the usage page as the user may call hid_open_path directly without using hid_enumerate * Added get_hid_item_size() for hid parsing, used in both uses_numbered_reports() and get_usage()
Adapted from ApeironTuska's PR to PastaJ36/hidapi (PastaJ36/hidapi#1) Which was adapted from djpnewton's PR to signal11/hidapi (signal11/hidapi#6) Also addresses some of the issues mentioned in (signal11/hidapi#6) * hid_open_path and hid_enumerate both need to retrieve the usage page as the user may call hid_open_path directly without using hid_enumerate * Added get_hid_item_size() for hid parsing, used in both uses_numbered_reports() and get_usage() - hidtest-hidraw test - Device Found type: 308f 0015 path: /dev/hidraw10 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 0 Usage (page): 0x6 (0x1) Device Found type: 308f 0015 path: /dev/hidraw11 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 1 Usage (page): 0x6 (0x1) Device Found type: 308f 0015 path: /dev/hidraw12 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 2 Usage (page): 0x1 (0xc) Device Found type: 308f 0015 path: /dev/hidraw13 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 3 Usage (page): 0x2 (0x1) Device Found type: 308f 0015 path: /dev/hidraw14 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 4 Usage (page): 0x1100 (0xff1c)
Adapted from ApeironTuska's PR to PastaJ36/hidapi (PastaJ36/hidapi#1) Which was adapted from djpnewton's PR to signal11/hidapi (signal11/hidapi#6) Also addresses some of the issues mentioned in (signal11/hidapi#6) * hid_open_path and hid_enumerate both need to retrieve the usage page as the user may call hid_open_path directly without using hid_enumerate * Added get_hid_item_size() for hid parsing, used in both uses_numbered_reports() and get_usage() NOTE: This commit does not handle composite HID descriptors I am interested in adding support for composite descriptors though I still need to find a device with a composite descriptor to test it correctly - hidtest-hidraw test - Device Found type: 308f 0015 path: /dev/hidraw10 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 0 Usage (page): 0x6 (0x1) Device Found type: 308f 0015 path: /dev/hidraw11 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 1 Usage (page): 0x6 (0x1) Device Found type: 308f 0015 path: /dev/hidraw12 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 2 Usage (page): 0x1 (0xc) Device Found type: 308f 0015 path: /dev/hidraw13 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 3 Usage (page): 0x2 (0x1) Device Found type: 308f 0015 path: /dev/hidraw14 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 4 Usage (page): 0x1100 (0xff1c)
Adapted from ApeironTuska's PR to PastaJ36/hidapi (PastaJ36/hidapi#1) Which was adapted from djpnewton's PR to signal11/hidapi (signal11/hidapi#6) Also addresses some of the issues mentioned in (signal11/hidapi#6) * hid_open_path and hid_enumerate both need to retrieve the usage page as the user may call hid_open_path directly without using hid_enumerate * Added get_hid_item_size() for hid parsing, used in both uses_numbered_reports() and get_usage() NOTE: This commit does not handle composite HID descriptors I am interested in adding support for composite descriptors though I still need to find a device with a composite descriptor to test it correctly - hidtest-hidraw test - Device Found type: 308f 0015 path: /dev/hidraw10 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 0 Usage (page): 0x6 (0x1) Device Found type: 308f 0015 path: /dev/hidraw11 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 1 Usage (page): 0x6 (0x1) Device Found type: 308f 0015 path: /dev/hidraw12 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 2 Usage (page): 0x1 (0xc) Device Found type: 308f 0015 path: /dev/hidraw13 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 3 Usage (page): 0x2 (0x1) Device Found type: 308f 0015 path: /dev/hidraw14 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 4 Usage (page): 0x1100 (0xff1c)
Adapted from ApeironTuska's PR to PastaJ36/hidapi (PastaJ36/hidapi#1) Which was adapted from djpnewton's PR to signal11/hidapi (signal11/hidapi#6) Also addresses some of the issues mentioned in (signal11/hidapi#6) * hid_open_path and hid_enumerate both need to retrieve the usage page as the user may call hid_open_path directly without using hid_enumerate * Added get_hid_item_size() for hid parsing, used in both uses_numbered_reports() and get_hid_usage() NOTE: This commit does not handle composite HID descriptors I am interested in adding support for composite descriptors though I still need to find a device with a composite descriptor to test it correctly - hidtest-hidraw test - Device Found type: 308f 0015 path: /dev/hidraw10 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 0 Usage (page): 0x6 (0x1) Device Found type: 308f 0015 path: /dev/hidraw11 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 1 Usage (page): 0x6 (0x1) Device Found type: 308f 0015 path: /dev/hidraw12 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 2 Usage (page): 0x1 (0xc) Device Found type: 308f 0015 path: /dev/hidraw13 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 3 Usage (page): 0x2 (0x1) Device Found type: 308f 0015 path: /dev/hidraw14 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 4 Usage (page): 0x1100 (0xff1c)
Adapted from ApeironTuska's PR to PastaJ36/hidapi (PastaJ36/hidapi#1) Which was adapted from djpnewton's PR to signal11/hidapi (signal11/hidapi#6) Also addresses some of the issues mentioned in (signal11/hidapi#6) * hid_open_path and hid_enumerate both need to retrieve the usage page as the user may call hid_open_path directly without using hid_enumerate * Added get_hid_item_size() for hid parsing, used in both uses_numbered_reports() and get_hid_usage() NOTE: This commit does not handle composite HID descriptors I am interested in adding support for composite descriptors though I still need to find a device with a composite descriptor to test it correctly - hidtest-hidraw test - Device Found type: 308f 0015 path: /dev/hidraw10 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 0 Usage (page): 0x6 (0x1) Device Found type: 308f 0015 path: /dev/hidraw11 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 1 Usage (page): 0x6 (0x1) Device Found type: 308f 0015 path: /dev/hidraw12 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 2 Usage (page): 0x1 (0xc) Device Found type: 308f 0015 path: /dev/hidraw13 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 3 Usage (page): 0x2 (0x1) Device Found type: 308f 0015 path: /dev/hidraw14 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 4 Usage (page): 0x1100 (0xff1c)
Adapted from ApeironTuska's PR to PastaJ36/hidapi (PastaJ36/hidapi#1) Which was adapted from djpnewton's PR to signal11/hidapi (signal11/hidapi#6) Also addresses some of the issues mentioned in (signal11/hidapi#6) * hid_open_path and hid_enumerate both need to retrieve the usage page as the user may call hid_open_path directly without using hid_enumerate * Added get_hid_item_size() for hid parsing, used in both uses_numbered_reports() and get_hid_usage() NOTE: This commit does not handle composite HID descriptors I am interested in adding support for composite descriptors though I still need to find a device with a composite descriptor to test it correctly - hidtest-hidraw test - Device Found type: 308f 0015 path: /dev/hidraw10 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 0 Usage (page): 0x6 (0x1) Device Found type: 308f 0015 path: /dev/hidraw11 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 1 Usage (page): 0x6 (0x1) Device Found type: 308f 0015 path: /dev/hidraw12 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 2 Usage (page): 0x1 (0xc) Device Found type: 308f 0015 path: /dev/hidraw13 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 3 Usage (page): 0x2 (0x1) Device Found type: 308f 0015 path: /dev/hidraw14 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 4 Usage (page): 0x1100 (0xff1c)
Adapted from ApeironTuska's PR to PastaJ36/hidapi (PastaJ36/hidapi#1) Which was adapted from djpnewton's PR to signal11/hidapi (signal11/hidapi#6) Also addresses some of the issues mentioned in (signal11/hidapi#6) * hid_open_path and hid_enumerate both need to retrieve the usage page as the user may call hid_open_path directly without using hid_enumerate * Added get_hid_item_size() for hid parsing, used in both uses_numbered_reports() and get_hid_usage() NOTE: This commit does not handle composite HID descriptors I am interested in adding support for composite descriptors though I still need to find a device with a composite descriptor to test it correctly - hidtest-hidraw test - Device Found type: 308f 0015 path: /dev/hidraw10 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 0 Usage (page): 0x6 (0x1) Device Found type: 308f 0015 path: /dev/hidraw11 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 1 Usage (page): 0x6 (0x1) Device Found type: 308f 0015 path: /dev/hidraw12 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 2 Usage (page): 0x1 (0xc) Device Found type: 308f 0015 path: /dev/hidraw13 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 3 Usage (page): 0x2 (0x1) Device Found type: 308f 0015 path: /dev/hidraw14 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 4 Usage (page): 0x1100 (0xff1c)
Adapted from ApeironTuska's PR to PastaJ36/hidapi (PastaJ36/hidapi#1) Which was adapted from djpnewton's PR to signal11/hidapi (signal11/hidapi#6) Also addresses some of the issues mentioned in (signal11/hidapi#6) * hid_open_path and hid_enumerate both need to retrieve the usage page as the user may call hid_open_path directly without using hid_enumerate * Added get_hid_item_size() for hid parsing, used in both uses_numbered_reports() and get_hid_usage() NOTE: This commit does not handle composite HID descriptors I am interested in adding support for composite descriptors though I still need to find a device with a composite descriptor to test it correctly - hidtest-hidraw test - Device Found type: 308f 0015 path: /dev/hidraw10 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 0 Usage (page): 0x6 (0x1) Device Found type: 308f 0015 path: /dev/hidraw11 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 1 Usage (page): 0x6 (0x1) Device Found type: 308f 0015 path: /dev/hidraw12 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 2 Usage (page): 0x1 (0xc) Device Found type: 308f 0015 path: /dev/hidraw13 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 3 Usage (page): 0x2 (0x1) Device Found type: 308f 0015 path: /dev/hidraw14 serial_number: 53373100323943353230353139363032 - sam4s2 Manufacturer: Kiibohd Product: Keyboard - None PartialMap USBxUART Release: 4ac Interface: 4 Usage (page): 0x1100 (0xff1c)
No description provided.