Skip to content
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

Fill in the Usage Page and Usage on Linux with hidraw #1

Merged
merged 2 commits into from
Apr 4, 2019
Merged

Fill in the Usage Page and Usage on Linux with hidraw #1

merged 2 commits into from
Apr 4, 2019

Conversation

ApeironTsuka
Copy link

Adapted from djpnewton's PR to signal11/hidapi (signal11#6)

The main complaint upstream for the PR back-in-the-day was the C99 dependency (removed that from here) which was understandable.

@PastaJ36 PastaJ36 merged commit a9e21a7 into PastaJ36:master Apr 4, 2019
@PastaJ36
Copy link
Owner

PastaJ36 commented Apr 4, 2019

Seems good. Haven't verified the functionality, but I saw on discord that the usage pages you got were correct. Thanks

haata added a commit to haata/hidapi that referenced this pull request Jan 13, 2020
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
haata added a commit to haata/hidapi that referenced this pull request Jan 19, 2020
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
haata added a commit to haata/hidapi that referenced this pull request Jan 21, 2020
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()
haata added a commit to haata/hidapi that referenced this pull request Jan 22, 2020
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)
haata added a commit to haata/hidapi that referenced this pull request Jan 22, 2020
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)
haata added a commit to haata/hidapi that referenced this pull request Jan 22, 2020
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)
haata added a commit to haata/hidapi that referenced this pull request Jan 22, 2020
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)
haata added a commit to haata/hidapi that referenced this pull request Jan 27, 2020
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)
haata added a commit to haata/hidapi that referenced this pull request Mar 13, 2020
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)
haata added a commit to haata/hidapi that referenced this pull request May 24, 2020
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)
haata added a commit to haata/hidapi that referenced this pull request Nov 18, 2020
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants