libusb / hidapi

A Simple cross-platform library for communicating with HID devices
https://libusb.info/hidapi/
Other
1.69k stars 399 forks source link

hidraw: report only Top-Level Usage_page/Usage pairs as 'unique' devices #601

Closed Youw closed 1 year ago

Youw commented 1 year ago

To be consistent with Windows/macOS (OS-level implementations).

Fixes: #298 Fixes: #454

Youw commented 1 year ago

~I haven't tested it properly yet, but at least the PR should give an idea what's wrong/what the fix is.~

Youw commented 1 year ago

@haata I'd appreciate if you could check/review it as the original author of this routine.

mcuee commented 1 year ago

This seems to help comparied to git main.

If we ignore the two Windows pseudo HID devices (path: \\?\HID#ConvertedDevice&xxxxxxx) and Acer Airplane Mode Controller and Portable Device Control device with path: \\?\HID#INTC816#3&d2322f2&0&0000, this PR seems to be good for the 2.4G Mouse and the track-pad.

Please take note that I did not connect the bluetooth mouse to Linux so that one is correct.

Output from Ubuntu 20.04 Linux (not using sudo to print the report descriptors)

mcuee@UbuntuSwift3:~/build/hid/hidapi_pr601$ ./hidtest/hidtest-hidraw 
hidapi test/example tool. Compiled with hidapi version 0.14.0, runtime version 0.14.0.
Compile-time version matches runtime version of hidapi.

Device Found
  type: 1ea7 0064
  path: /dev/hidraw1
  serial_number: 
  Manufacturer: (null)
  Product:      2.4G Mouse
  Release:      200
  Interface:    0
  Usage (page): 0x1 (0xffb5)
  Bus type: 1 (USB)

  Report Descriptor: Unable to open device by path
Device Found
  type: 1ea7 0064
  path: /dev/hidraw1
  serial_number: 
  Manufacturer: (null)
  Product:      2.4G Mouse
  Release:      200
  Interface:    0
  Usage (page): 0x2 (0x1)
  Bus type: 1 (USB)

  Report Descriptor: Unable to open device by path
Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 3 (I2C)

  Report Descriptor: Unable to open device by path
Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x5 (0xd)
  Bus type: 3 (I2C)

  Report Descriptor: Unable to open device by path
Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0xe (0xd)
  Bus type: 3 (I2C)

  Report Descriptor: Unable to open device by path
Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xff00)
  Bus type: 3 (I2C)

  Report Descriptor: Unable to open device by path
unable to open device

mcuee@UbuntuSwift3:~/build/hid/hidapi$ ./hidtest/hidtest-hidraw 
hidapi test/example tool. Compiled with hidapi version 0.14.0, runtime version 0.14.0.
Compile-time version matches runtime version of hidapi.

Device Found
  type: 1ea7 0064
  path: /dev/hidraw1
  serial_number: 
  Manufacturer: (null)
  Product:      2.4G Mouse
  Release:      200
  Interface:    0
  Usage (page): 0x1 (0xffb5)
  Bus type: 1 (USB)

  Report Descriptor: Unable to open device by path
Device Found
  type: 1ea7 0064
  path: /dev/hidraw1
  serial_number: 
  Manufacturer: (null)
  Product:      2.4G Mouse
  Release:      200
  Interface:    0
  Usage (page): 0x2 (0x1)
  Bus type: 1 (USB)

  Report Descriptor: Unable to open device by path
Device Found
  type: 1ea7 0064
  path: /dev/hidraw1
  serial_number: 
  Manufacturer: (null)
  Product:      2.4G Mouse
  Release:      200
  Interface:    0
  Usage (page): 0x1 (0x1)
  Bus type: 1 (USB)

  Report Descriptor: Unable to open device by path
Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 3 (I2C)

  Report Descriptor: Unable to open device by path
Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0x1)
  Bus type: 3 (I2C)

  Report Descriptor: Unable to open device by path
Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x5 (0xd)
  Bus type: 3 (I2C)

  Report Descriptor: Unable to open device by path
Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x22 (0xd)
  Bus type: 3 (I2C)

  Report Descriptor: Unable to open device by path
Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x22 (0xd)
  Bus type: 3 (I2C)

  Report Descriptor: Unable to open device by path
Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x22 (0xd)
  Bus type: 3 (I2C)

  Report Descriptor: Unable to open device by path
Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x22 (0xd)
  Bus type: 3 (I2C)

  Report Descriptor: Unable to open device by path
Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x22 (0xd)
  Bus type: 3 (I2C)

  Report Descriptor: Unable to open device by path
Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0xe (0xd)
  Bus type: 3 (I2C)

  Report Descriptor: Unable to open device by path
Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x22 (0xd)
  Bus type: 3 (I2C)

  Report Descriptor: Unable to open device by path
Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x22 (0xd)
  Bus type: 3 (I2C)

  Report Descriptor: Unable to open device by path
Device Found
  type: 06cb cd40
  path: /dev/hidraw0
  serial_number: 
  Manufacturer: 
  Product:      SYNA7DAB:01 06CB:CD40
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xff00)
  Bus type: 3 (I2C)

  Report Descriptor: Unable to open device by path
unable to open device

Windows 11 output from git main (dual boot laptop, so the devices should be the same).

MINGW64 /c/work/hid/hidapi
$ ./hidtest/hidtest.exe
hidapi test/example tool. Compiled with hidapi version 0.14.0, runtime version 0.14.0.
Compile-time version matches runtime version of hidapi.

Device Found
  type: 045e 0916
  path: \\?\HID#{00001812-0000-1000-8000-00805f9b34fb}_Dev_VID&02045e_PID&0916_REV&0110_f338080e09c4&Col01#9&1937f32c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: f338080e09c4
  Manufacturer: Microsoft
  Product:      BluetoothMouse3600
  Release:      110
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 2 (Bluetooth)

  Report Descriptor: (100 bytes)
0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x09, 0x02, 0xa1, 0x02,
0x09, 0x01, 0xa1, 0x00, 0x85, 0x1a, 0x05, 0x09, 0x19, 0x01,
0x29, 0x05, 0x15, 0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x05,
0x81, 0x02, 0x75, 0x03, 0x95, 0x01, 0x81, 0x03, 0x05, 0x01,
0x09, 0x30, 0x09, 0x31, 0x16, 0x01, 0x80, 0x26, 0xff, 0x7f,
0x75, 0x10, 0x95, 0x02, 0x81, 0x06, 0x09, 0x00, 0xa1, 0x02,
0x09, 0x38, 0x16, 0x01, 0x80, 0x26, 0xff, 0x7f, 0x75, 0x10,
0x95, 0x01, 0x81, 0x06, 0xc0, 0x09, 0x00, 0xa1, 0x02, 0x05,
0x0c, 0x0a, 0x38, 0x02, 0x16, 0x01, 0x80, 0x26, 0xff, 0x7f,
0x75, 0x10, 0x95, 0x01, 0x81, 0x06, 0xc0, 0xc0, 0xc0, 0xc0,
Device Found
  type: 045e 0916
  path: \\?\HID#{00001812-0000-1000-8000-00805f9b34fb}_Dev_VID&02045e_PID&0916_REV&0110_f338080e09c4&Col02#9&1937f32c&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: f338080e09c4
  Manufacturer: Microsoft
  Product:      BluetoothMouse3600
  Release:      110
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 2 (Bluetooth)

  Report Descriptor: (58 bytes)
0x05, 0x0c, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x27, 0x06, 0x00,
0xff, 0x0a, 0x0a, 0xfa, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75,
0x08, 0x95, 0x13, 0x81, 0x02, 0x85, 0x22, 0x0a, 0x0a, 0xfa,
0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x13, 0xb1,
0x02, 0x85, 0x24, 0x0a, 0x0a, 0xfa, 0x15, 0x00, 0x26, 0xff,
0x00, 0x75, 0x08, 0x95, 0x13, 0xb1, 0x02, 0xc0,
Device Found
  type: 045e 0916
  path: \\?\HID#{00001812-0000-1000-8000-00805f9b34fb}_Dev_VID&02045e_PID&0916_REV&0110_f338080e09c4&Col03#9&1937f32c&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: f338080e09c4
  Manufacturer: Microsoft
  Product:      BluetoothMouse3600
  Release:      110
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 2 (Bluetooth)

  Report Descriptor: (78 bytes)
0x05, 0x0c, 0x09, 0x01, 0xa1, 0x01, 0x05, 0x01, 0x09, 0x02,
0xa1, 0x02, 0x85, 0x1f, 0x05, 0x0c, 0x0a, 0x38, 0x02, 0x16,
0x01, 0x80, 0x26, 0xff, 0x7f, 0x75, 0x10, 0x95, 0x01, 0x81,
0x06, 0x85, 0x17, 0x06, 0x00, 0xff, 0x0a, 0x0f, 0xff, 0x15,
0x00, 0x25, 0x01, 0x35, 0x01, 0x45, 0x10, 0x75, 0x02, 0x95,
0x02, 0xb1, 0x02, 0x0a, 0x04, 0xff, 0x15, 0x00, 0x25, 0x01,
0x75, 0x01, 0x95, 0x01, 0x35, 0x00, 0x45, 0x00, 0xb1, 0x02,
0x75, 0x03, 0x95, 0x01, 0xb1, 0x03, 0xc0, 0xc0,
Device Found
  type: 8087 0a1e
  path: \\?\HID#INTC816#3&d2322f2&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      200
  Interface:    -1
  Usage (page): 0xd (0x1)
  Bus type: 0 (Unknown)

  Report Descriptor: (50 bytes)
0x05, 0x01, 0x09, 0x0d, 0xa1, 0x01, 0x09, 0x0d, 0xa1, 0x02,
0x85, 0x1c, 0x09, 0x81, 0x15, 0x00, 0x25, 0x01, 0x75, 0x01,
0x95, 0x01, 0x81, 0x02, 0x75, 0x07, 0x95, 0x01, 0x81, 0x03,
0x09, 0xcb, 0x15, 0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x01,
0xb1, 0x02, 0x75, 0x07, 0x95, 0x01, 0xb1, 0x03, 0xc0, 0xc0,
Device Found
  type: 06cb cd40
  path: \\?\HID#SYNA7DAB&Col01#5&2f64dfea&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      501
  Interface:    -1
  Usage (page): 0x2 (0x1)
  Bus type: 3 (I2C)

  Report Descriptor: (52 bytes)
0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x09, 0x01, 0xa1, 0x00,
0x85, 0x02, 0x05, 0x09, 0x19, 0x01, 0x29, 0x02, 0x15, 0x00,
0x25, 0x01, 0x75, 0x01, 0x95, 0x02, 0x81, 0x02, 0x75, 0x06,
0x95, 0x01, 0x81, 0x03, 0x05, 0x01, 0x09, 0x30, 0x09, 0x31,
0x15, 0x81, 0x25, 0x7f, 0x75, 0x08, 0x95, 0x02, 0x81, 0x06,
0xc0, 0xc0,
Device Found
  type: 06cb cd40
  path: \\?\HID#SYNA7DAB&Col02#5&2f64dfea&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      501
  Interface:    -1
  Usage (page): 0x5 (0xd)
  Bus type: 3 (I2C)

  Report Descriptor: (610 bytes)
0x05, 0x0d, 0x09, 0x05, 0xa1, 0x01, 0x09, 0x22, 0xa1, 0x02,
0x85, 0x03, 0x09, 0x47, 0x09, 0x42, 0x15, 0x00, 0x25, 0x01,
0x75, 0x01, 0x95, 0x02, 0x81, 0x02, 0x09, 0x51, 0x15, 0x00,
0x25, 0x05, 0x75, 0x03, 0x95, 0x01, 0x81, 0x02, 0x75, 0x03,
0x95, 0x01, 0x81, 0x03, 0x05, 0x01, 0x09, 0x30, 0x15, 0x00,
0x26, 0xc8, 0x04, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x55, 0x0e,
0x65, 0x11, 0x75, 0x10, 0x95, 0x01, 0x81, 0x02, 0x09, 0x31,
0x15, 0x00, 0x26, 0xe8, 0x02, 0x35, 0x00, 0x46, 0x6c, 0x02,
0x75, 0x10, 0x95, 0x01, 0x81, 0x02, 0xc0, 0x05, 0x0d, 0x09,
0x22, 0xa1, 0x02, 0x09, 0x47, 0x09, 0x42, 0x15, 0x00, 0x25,
0x01, 0x75, 0x01, 0x95, 0x02, 0x45, 0x00, 0x55, 0x00, 0x65,
0x00, 0x81, 0x02, 0x09, 0x51, 0x15, 0x00, 0x25, 0x05, 0x35,
0x00, 0x46, 0x6c, 0x02, 0x55, 0x0e, 0x65, 0x11, 0x75, 0x03,
0x95, 0x01, 0x81, 0x02, 0x75, 0x03, 0x95, 0x01, 0x81, 0x03,
0x05, 0x01, 0x09, 0x30, 0x15, 0x00, 0x26, 0xc8, 0x04, 0x35,
0x00, 0x46, 0xfc, 0x03, 0x75, 0x10, 0x95, 0x01, 0x81, 0x02,
0x09, 0x31, 0x15, 0x00, 0x26, 0xe8, 0x02, 0x35, 0x00, 0x46,
0x6c, 0x02, 0x75, 0x10, 0x95, 0x01, 0x81, 0x02, 0xc0, 0x05,
0x0d, 0x09, 0x22, 0xa1, 0x02, 0x09, 0x47, 0x09, 0x42, 0x15,
0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x02, 0x45, 0x00, 0x55,
0x00, 0x65, 0x00, 0x81, 0x02, 0x09, 0x51, 0x15, 0x00, 0x25,
0x05, 0x35, 0x00, 0x46, 0x6c, 0x02, 0x55, 0x0e, 0x65, 0x11,
0x75, 0x03, 0x95, 0x01, 0x81, 0x02, 0x75, 0x03, 0x95, 0x01,
0x81, 0x03, 0x05, 0x01, 0x09, 0x30, 0x15, 0x00, 0x26, 0xc8,
0x04, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x75, 0x10, 0x95, 0x01,
0x81, 0x02, 0x09, 0x31, 0x15, 0x00, 0x26, 0xe8, 0x02, 0x35,
0x00, 0x46, 0x6c, 0x02, 0x75, 0x10, 0x95, 0x01, 0x81, 0x02,
0xc0, 0x05, 0x0d, 0x09, 0x22, 0xa1, 0x02, 0x09, 0x47, 0x09,
0x42, 0x15, 0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x02, 0x45,
0x00, 0x55, 0x00, 0x65, 0x00, 0x81, 0x02, 0x09, 0x51, 0x15,
0x00, 0x25, 0x05, 0x35, 0x00, 0x46, 0x6c, 0x02, 0x55, 0x0e,
0x65, 0x11, 0x75, 0x03, 0x95, 0x01, 0x81, 0x02, 0x75, 0x03,
0x95, 0x01, 0x81, 0x03, 0x05, 0x01, 0x09, 0x30, 0x15, 0x00,
0x26, 0xc8, 0x04, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x75, 0x10,
0x95, 0x01, 0x81, 0x02, 0x09, 0x31, 0x15, 0x00, 0x26, 0xe8,
0x02, 0x35, 0x00, 0x46, 0x6c, 0x02, 0x75, 0x10, 0x95, 0x01,
0x81, 0x02, 0xc0, 0x05, 0x0d, 0x09, 0x22, 0xa1, 0x02, 0x09,
0x47, 0x09, 0x42, 0x15, 0x00, 0x25, 0x01, 0x75, 0x01, 0x95,
0x02, 0x45, 0x00, 0x55, 0x00, 0x65, 0x00, 0x81, 0x02, 0x09,
0x51, 0x15, 0x00, 0x25, 0x05, 0x35, 0x00, 0x46, 0x6c, 0x02,
0x55, 0x0e, 0x65, 0x11, 0x75, 0x03, 0x95, 0x01, 0x81, 0x02,
0x75, 0x03, 0x95, 0x01, 0x81, 0x03, 0x05, 0x01, 0x09, 0x30,
0x15, 0x00, 0x26, 0xc8, 0x04, 0x35, 0x00, 0x46, 0xfc, 0x03,
0x75, 0x10, 0x95, 0x01, 0x81, 0x02, 0x09, 0x31, 0x15, 0x00,
0x26, 0xe8, 0x02, 0x35, 0x00, 0x46, 0x6c, 0x02, 0x75, 0x10,
0x95, 0x01, 0x81, 0x02, 0xc0, 0x05, 0x0d, 0x09, 0x56, 0x15,
0x00, 0x27, 0xff, 0xff, 0x00, 0x00, 0x35, 0x00, 0x47, 0xff,
0xff, 0x00, 0x00, 0x55, 0x0c, 0x66, 0x01, 0x10, 0x75, 0x10,
0x95, 0x01, 0x81, 0x02, 0x09, 0x54, 0x15, 0x00, 0x25, 0x7f,
0x75, 0x08, 0x95, 0x01, 0x81, 0x02, 0x05, 0x09, 0x09, 0x01,
0x15, 0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x01, 0x45, 0x00,
0x55, 0x00, 0x65, 0x00, 0x81, 0x02, 0x75, 0x07, 0x95, 0x01,
0x81, 0x03, 0x85, 0x08, 0x05, 0x0d, 0x09, 0x55, 0x09, 0x59,
0x15, 0x00, 0x25, 0x0f, 0x35, 0x00, 0x47, 0xff, 0xff, 0x00,
0x00, 0x55, 0x0c, 0x66, 0x01, 0x10, 0x75, 0x04, 0x95, 0x02,
0xb1, 0x02, 0x85, 0x0d, 0x09, 0x60, 0x15, 0x00, 0x25, 0x01,
0x75, 0x01, 0x95, 0x01, 0x45, 0x00, 0x55, 0x00, 0x65, 0x00,
0xb1, 0x02, 0x75, 0x07, 0x95, 0x01, 0xb1, 0x03, 0x85, 0x07,
0x06, 0x00, 0xff, 0x09, 0xc5, 0x15, 0x00, 0x26, 0xff, 0x00,
0x35, 0x00, 0x47, 0xff, 0xff, 0x00, 0x00, 0x55, 0x0c, 0x66,
0x01, 0x10, 0x75, 0x08, 0x96, 0x00, 0x01, 0xb1, 0x02, 0xc0,
Device Found
  type: 06cb cd40
  path: \\?\HID#SYNA7DAB&Col03#5&2f64dfea&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      501
  Interface:    -1
  Usage (page): 0xe (0xd)
  Bus type: 3 (I2C)

  Report Descriptor: (71 bytes)
0x05, 0x0d, 0x09, 0x0e, 0xa1, 0x01, 0x09, 0x22, 0xa1, 0x02,
0x85, 0x04, 0x09, 0x52, 0x15, 0x00, 0x25, 0x0a, 0x35, 0x00,
0x47, 0xff, 0xff, 0x00, 0x00, 0x55, 0x0c, 0x66, 0x01, 0x10,
0x75, 0x08, 0x95, 0x01, 0xb1, 0x02, 0xc0, 0x09, 0x22, 0xa1,
0x00, 0x85, 0x06, 0x09, 0x57, 0x09, 0x58, 0x15, 0x00, 0x25,
0x01, 0x75, 0x01, 0x95, 0x02, 0x45, 0x00, 0x55, 0x00, 0x65,
0x00, 0xb1, 0x02, 0x75, 0x06, 0x95, 0x01, 0xb1, 0x03, 0xc0,
0xc0,
Device Found
  type: 06cb cd40
  path: \\?\HID#SYNA7DAB&Col04#5&2f64dfea&0&0003#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number: 9999
  Manufacturer: Microsoft
  Product:      HIDI2C Device
  Release:      501
  Interface:    -1
  Usage (page): 0x1 (0xff00)
  Bus type: 3 (I2C)

  Report Descriptor: (110 bytes)
0x06, 0x00, 0xff, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x0b, 0x09,
0x04, 0x15, 0x00, 0x26, 0xff, 0x00, 0x35, 0x00, 0x47, 0xff,
0xff, 0x00, 0x00, 0x55, 0x0c, 0x66, 0x01, 0x10, 0x75, 0x08,
0x95, 0x3d, 0x81, 0x02, 0x85, 0x0c, 0x09, 0x05, 0x15, 0x00,
0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x3d, 0x81, 0x02, 0x85,
0x09, 0x09, 0x02, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08,
0x95, 0x14, 0x91, 0x02, 0x85, 0x0a, 0x09, 0x03, 0x15, 0x00,
0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x14, 0x91, 0x02, 0x85,
0x0f, 0x09, 0x06, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08,
0x95, 0x03, 0xb1, 0x02, 0x85, 0x0e, 0x09, 0x07, 0x15, 0x00,
0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x01, 0xb1, 0x02, 0xc0,
Device Found
  type: 045e 0000
  path: \\?\HID#ConvertedDevice&Col02#5&32cf90e6&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x1 (0xc)
  Bus type: 0 (Unknown)

  Report Descriptor: (32 bytes)
0x05, 0x0c, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x02, 0x09, 0xe9,
0x09, 0xea, 0x0a, 0x21, 0x02, 0x15, 0x00, 0x25, 0x01, 0x75,
0x01, 0x95, 0x03, 0x81, 0x02, 0x75, 0x05, 0x95, 0x01, 0x81,
0x03, 0xc0,
Device Found
  type: 045e 0000
  path: \\?\HID#ConvertedDevice&Col03#5&32cf90e6&0&0002#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x80 (0x1)
  Bus type: 0 (Unknown)

  Report Descriptor: (27 bytes)
0x05, 0x01, 0x09, 0x80, 0xa1, 0x01, 0x85, 0x03, 0x09, 0x81,
0x15, 0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x01, 0x81, 0x02,
0x75, 0x07, 0x95, 0x01, 0x81, 0x03, 0xc0,
Device Found
  type: deed feed
  path: \\?\HID#10251229#3&9d5d338&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: Acer Inc
  Product:      Acer Airplane Mode Controller
  Release:      101
  Interface:    -1
  Usage (page): 0xc (0x1)
  Bus type: 0 (Unknown)

  Report Descriptor: (27 bytes)
0x05, 0x01, 0x09, 0x0c, 0xa1, 0x01, 0x85, 0x01, 0x09, 0xc6,
0x15, 0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x01, 0x81, 0x06,
0x75, 0x07, 0x95, 0x01, 0x81, 0x03, 0xc0,
Device Found
  type: 045e 0000
  path: \\?\HID#ConvertedDevice&Col01#5&32cf90e6&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\KBD
  serial_number:
  Manufacturer:
  Product:
  Release:      0
  Interface:    -1
  Usage (page): 0x6 (0x1)
  Bus type: 0 (Unknown)

  Report Descriptor: (37 bytes)
0x05, 0x01, 0x09, 0x06, 0xa1, 0x01, 0x85, 0x01, 0x05, 0x07,
0x09, 0x69, 0x09, 0x6a, 0x09, 0x6b, 0x09, 0x6c, 0x09, 0xe3,
0x09, 0x4c, 0x09, 0xe2, 0x09, 0xe0, 0x15, 0x00, 0x25, 0x01,
0x75, 0x01, 0x95, 0x08, 0x81, 0x02, 0xc0,
Device Found
  type: 1ea7 0064
  path: \\?\HID#VID_1EA7&PID_0064&Col01#6&1bdfd61d&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: (Standard system devices)
  Product:      2.4G Mouse
  Release:      200
  Interface:    0
  Usage (page): 0x1 (0xffb5)
  Bus type: 1 (USB)

  Report Descriptor: (36 bytes)
0x06, 0xb5, 0xff, 0x09, 0x01, 0xa1, 0x01, 0x85, 0xb5, 0x09,
0x02, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x07,
0x81, 0x02, 0x09, 0x02, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75,
0x08, 0x95, 0x07, 0x91, 0x02, 0xc0,
Device Found
  type: 1ea7 0064
  path: \\?\HID#VID_1EA7&PID_0064&Col02#6&1bdfd61d&0&0001#{4d1e55b2-f16f-11cf-88cb-001111000030}
  serial_number:
  Manufacturer: (Standard system devices)
  Product:      2.4G Mouse
  Release:      200
  Interface:    0
  Usage (page): 0x2 (0x1)
  Bus type: 1 (USB)

  Report Descriptor: (75 bytes)
0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x09, 0x01, 0xa1, 0x00,
0x85, 0x02, 0x05, 0x09, 0x19, 0x01, 0x29, 0x08, 0x15, 0x00,
0x25, 0x01, 0x75, 0x01, 0x95, 0x08, 0x81, 0x02, 0x05, 0x01,
0x09, 0x30, 0x09, 0x31, 0x16, 0x01, 0xf8, 0x26, 0xff, 0x07,
0x75, 0x0c, 0x95, 0x02, 0x81, 0x06, 0x09, 0x38, 0x15, 0x81,
0x25, 0x7f, 0x75, 0x08, 0x95, 0x01, 0x81, 0x06, 0x05, 0x0c,
0x0a, 0x38, 0x02, 0x15, 0x81, 0x25, 0x7f, 0x75, 0x08, 0x95,
0x01, 0x81, 0x06, 0xc0, 0xc0,
unable to open device

More detailed Linux output using Ubuntu 23.04, using sudo to dump the report descriptors.

click for the details ``` ubuntu@ubuntu:~/build/libusb/hidapi_pr601$ sudo ./hidtest/hidtest-hidraw hidapi test/example tool. Compiled with hidapi version 0.14.0, runtime version 0.14.0. Compile-time version matches runtime version of hidapi. Device Found type: 1ea7 0064 path: /dev/hidraw1 serial_number: Manufacturer: (null) Product: 2.4G Mouse Release: 200 Interface: 0 Usage (page): 0x1 (0xffb5) Bus type: 1 (USB) Report Descriptor: (105 bytes) 0x06, 0xb5, 0xff, 0x09, 0x01, 0xa1, 0x01, 0x85, 0xb5, 0x09, 0x02, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x07, 0x81, 0x02, 0x09, 0x02, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x07, 0x91, 0x02, 0xc0, 0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x02, 0x09, 0x01, 0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x08, 0x15, 0x00, 0x25, 0x01, 0x95, 0x08, 0x75, 0x01, 0x81, 0x02, 0x05, 0x01, 0x09, 0x30, 0x09, 0x31, 0x16, 0x01, 0xf8, 0x26, 0xff, 0x07, 0x75, 0x0c, 0x95, 0x02, 0x81, 0x06, 0x09, 0x38, 0x15, 0x81, 0x25, 0x7f, 0x75, 0x08, 0x95, 0x01, 0x81, 0x06, 0x05, 0x0c, 0x0a, 0x38, 0x02, 0x95, 0x01, 0x81, 0x06, 0xc0, 0xc0, Device Found type: 1ea7 0064 path: /dev/hidraw1 serial_number: Manufacturer: (null) Product: 2.4G Mouse Release: 200 Interface: 0 Usage (page): 0x2 (0x1) Bus type: 1 (USB) Report Descriptor: (105 bytes) 0x06, 0xb5, 0xff, 0x09, 0x01, 0xa1, 0x01, 0x85, 0xb5, 0x09, 0x02, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x07, 0x81, 0x02, 0x09, 0x02, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x07, 0x91, 0x02, 0xc0, 0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x02, 0x09, 0x01, 0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x08, 0x15, 0x00, 0x25, 0x01, 0x95, 0x08, 0x75, 0x01, 0x81, 0x02, 0x05, 0x01, 0x09, 0x30, 0x09, 0x31, 0x16, 0x01, 0xf8, 0x26, 0xff, 0x07, 0x75, 0x0c, 0x95, 0x02, 0x81, 0x06, 0x09, 0x38, 0x15, 0x81, 0x25, 0x7f, 0x75, 0x08, 0x95, 0x01, 0x81, 0x06, 0x05, 0x0c, 0x0a, 0x38, 0x02, 0x95, 0x01, 0x81, 0x06, 0xc0, 0xc0, Device Found type: 06cb cd40 path: /dev/hidraw0 serial_number: Manufacturer: Product: SYNA7DAB:01 06CB:CD40 Release: 0 Interface: -1 Usage (page): 0x2 (0x1) Bus type: 3 (I2C) Report Descriptor: (665 bytes) 0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x02, 0x09, 0x01, 0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x02, 0x15, 0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x02, 0x81, 0x02, 0x95, 0x06, 0x81, 0x01, 0x05, 0x01, 0x09, 0x30, 0x09, 0x31, 0x15, 0x81, 0x25, 0x7f, 0x75, 0x08, 0x95, 0x02, 0x81, 0x06, 0xc0, 0xc0, 0x05, 0x0d, 0x09, 0x05, 0xa1, 0x01, 0x85, 0x03, 0x05, 0x0d, 0x09, 0x22, 0xa1, 0x02, 0x15, 0x00, 0x25, 0x01, 0x09, 0x47, 0x09, 0x42, 0x95, 0x02, 0x75, 0x01, 0x81, 0x02, 0x95, 0x01, 0x75, 0x03, 0x25, 0x05, 0x09, 0x51, 0x81, 0x02, 0x75, 0x01, 0x95, 0x03, 0x81, 0x03, 0x05, 0x01, 0x15, 0x00, 0x26, 0xc8, 0x04, 0x75, 0x10, 0x55, 0x0e, 0x65, 0x11, 0x09, 0x30, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x95, 0x01, 0x81, 0x02, 0x46, 0x6c, 0x02, 0x26, 0xe8, 0x02, 0x09, 0x31, 0x81, 0x02, 0xc0, 0x05, 0x0d, 0x09, 0x22, 0xa1, 0x02, 0x15, 0x00, 0x25, 0x01, 0x09, 0x47, 0x09, 0x42, 0x95, 0x02, 0x75, 0x01, 0x81, 0x02, 0x95, 0x01, 0x75, 0x03, 0x25, 0x05, 0x09, 0x51, 0x81, 0x02, 0x75, 0x01, 0x95, 0x03, 0x81, 0x03, 0x05, 0x01, 0x15, 0x00, 0x26, 0xc8, 0x04, 0x75, 0x10, 0x55, 0x0e, 0x65, 0x11, 0x09, 0x30, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x95, 0x01, 0x81, 0x02, 0x46, 0x6c, 0x02, 0x26, 0xe8, 0x02, 0x09, 0x31, 0x81, 0x02, 0xc0, 0x05, 0x0d, 0x09, 0x22, 0xa1, 0x02, 0x15, 0x00, 0x25, 0x01, 0x09, 0x47, 0x09, 0x42, 0x95, 0x02, 0x75, 0x01, 0x81, 0x02, 0x95, 0x01, 0x75, 0x03, 0x25, 0x05, 0x09, 0x51, 0x81, 0x02, 0x75, 0x01, 0x95, 0x03, 0x81, 0x03, 0x05, 0x01, 0x15, 0x00, 0x26, 0xc8, 0x04, 0x75, 0x10, 0x55, 0x0e, 0x65, 0x11, 0x09, 0x30, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x95, 0x01, 0x81, 0x02, 0x46, 0x6c, 0x02, 0x26, 0xe8, 0x02, 0x09, 0x31, 0x81, 0x02, 0xc0, 0x05, 0x0d, 0x09, 0x22, 0xa1, 0x02, 0x15, 0x00, 0x25, 0x01, 0x09, 0x47, 0x09, 0x42, 0x95, 0x02, 0x75, 0x01, 0x81, 0x02, 0x95, 0x01, 0x75, 0x03, 0x25, 0x05, 0x09, 0x51, 0x81, 0x02, 0x75, 0x01, 0x95, 0x03, 0x81, 0x03, 0x05, 0x01, 0x15, 0x00, 0x26, 0xc8, 0x04, 0x75, 0x10, 0x55, 0x0e, 0x65, 0x11, 0x09, 0x30, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x95, 0x01, 0x81, 0x02, 0x46, 0x6c, 0x02, 0x26, 0xe8, 0x02, 0x09, 0x31, 0x81, 0x02, 0xc0, 0x05, 0x0d, 0x09, 0x22, 0xa1, 0x02, 0x15, 0x00, 0x25, 0x01, 0x09, 0x47, 0x09, 0x42, 0x95, 0x02, 0x75, 0x01, 0x81, 0x02, 0x95, 0x01, 0x75, 0x03, 0x25, 0x05, 0x09, 0x51, 0x81, 0x02, 0x75, 0x01, 0x95, 0x03, 0x81, 0x03, 0x05, 0x01, 0x15, 0x00, 0x26, 0xc8, 0x04, 0x75, 0x10, 0x55, 0x0e, 0x65, 0x11, 0x09, 0x30, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x95, 0x01, 0x81, 0x02, 0x46, 0x6c, 0x02, 0x26, 0xe8, 0x02, 0x09, 0x31, 0x81, 0x02, 0xc0, 0x05, 0x0d, 0x55, 0x0c, 0x66, 0x01, 0x10, 0x47, 0xff, 0xff, 0x00, 0x00, 0x27, 0xff, 0xff, 0x00, 0x00, 0x75, 0x10, 0x95, 0x01, 0x09, 0x56, 0x81, 0x02, 0x09, 0x54, 0x25, 0x7f, 0x95, 0x01, 0x75, 0x08, 0x81, 0x02, 0x05, 0x09, 0x09, 0x01, 0x25, 0x01, 0x75, 0x01, 0x95, 0x01, 0x81, 0x02, 0x95, 0x07, 0x81, 0x03, 0x05, 0x0d, 0x85, 0x08, 0x09, 0x55, 0x09, 0x59, 0x75, 0x04, 0x95, 0x02, 0x25, 0x0f, 0xb1, 0x02, 0x85, 0x0d, 0x09, 0x60, 0x75, 0x01, 0x95, 0x01, 0x15, 0x00, 0x25, 0x01, 0xb1, 0x02, 0x95, 0x07, 0xb1, 0x03, 0x85, 0x07, 0x06, 0x00, 0xff, 0x09, 0xc5, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x96, 0x00, 0x01, 0xb1, 0x02, 0xc0, 0x05, 0x0d, 0x09, 0x0e, 0xa1, 0x01, 0x85, 0x04, 0x09, 0x22, 0xa1, 0x02, 0x09, 0x52, 0x15, 0x00, 0x25, 0x0a, 0x75, 0x08, 0x95, 0x01, 0xb1, 0x02, 0xc0, 0x09, 0x22, 0xa1, 0x00, 0x85, 0x06, 0x09, 0x57, 0x09, 0x58, 0x75, 0x01, 0x95, 0x02, 0x25, 0x01, 0xb1, 0x02, 0x95, 0x06, 0xb1, 0x03, 0xc0, 0xc0, 0x06, 0x00, 0xff, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x09, 0x09, 0x02, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x14, 0x91, 0x02, 0x85, 0x0a, 0x09, 0x03, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x14, 0x91, 0x02, 0x85, 0x0b, 0x09, 0x04, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x3d, 0x81, 0x02, 0x85, 0x0c, 0x09, 0x05, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x3d, 0x81, 0x02, 0x85, 0x0f, 0x09, 0x06, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x03, 0xb1, 0x02, 0x85, 0x0e, 0x09, 0x07, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x01, 0xb1, 0x02, 0xc0, Device Found type: 06cb cd40 path: /dev/hidraw0 serial_number: Manufacturer: Product: SYNA7DAB:01 06CB:CD40 Release: 0 Interface: -1 Usage (page): 0x5 (0xd) Bus type: 3 (I2C) Report Descriptor: (665 bytes) 0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x02, 0x09, 0x01, 0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x02, 0x15, 0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x02, 0x81, 0x02, 0x95, 0x06, 0x81, 0x01, 0x05, 0x01, 0x09, 0x30, 0x09, 0x31, 0x15, 0x81, 0x25, 0x7f, 0x75, 0x08, 0x95, 0x02, 0x81, 0x06, 0xc0, 0xc0, 0x05, 0x0d, 0x09, 0x05, 0xa1, 0x01, 0x85, 0x03, 0x05, 0x0d, 0x09, 0x22, 0xa1, 0x02, 0x15, 0x00, 0x25, 0x01, 0x09, 0x47, 0x09, 0x42, 0x95, 0x02, 0x75, 0x01, 0x81, 0x02, 0x95, 0x01, 0x75, 0x03, 0x25, 0x05, 0x09, 0x51, 0x81, 0x02, 0x75, 0x01, 0x95, 0x03, 0x81, 0x03, 0x05, 0x01, 0x15, 0x00, 0x26, 0xc8, 0x04, 0x75, 0x10, 0x55, 0x0e, 0x65, 0x11, 0x09, 0x30, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x95, 0x01, 0x81, 0x02, 0x46, 0x6c, 0x02, 0x26, 0xe8, 0x02, 0x09, 0x31, 0x81, 0x02, 0xc0, 0x05, 0x0d, 0x09, 0x22, 0xa1, 0x02, 0x15, 0x00, 0x25, 0x01, 0x09, 0x47, 0x09, 0x42, 0x95, 0x02, 0x75, 0x01, 0x81, 0x02, 0x95, 0x01, 0x75, 0x03, 0x25, 0x05, 0x09, 0x51, 0x81, 0x02, 0x75, 0x01, 0x95, 0x03, 0x81, 0x03, 0x05, 0x01, 0x15, 0x00, 0x26, 0xc8, 0x04, 0x75, 0x10, 0x55, 0x0e, 0x65, 0x11, 0x09, 0x30, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x95, 0x01, 0x81, 0x02, 0x46, 0x6c, 0x02, 0x26, 0xe8, 0x02, 0x09, 0x31, 0x81, 0x02, 0xc0, 0x05, 0x0d, 0x09, 0x22, 0xa1, 0x02, 0x15, 0x00, 0x25, 0x01, 0x09, 0x47, 0x09, 0x42, 0x95, 0x02, 0x75, 0x01, 0x81, 0x02, 0x95, 0x01, 0x75, 0x03, 0x25, 0x05, 0x09, 0x51, 0x81, 0x02, 0x75, 0x01, 0x95, 0x03, 0x81, 0x03, 0x05, 0x01, 0x15, 0x00, 0x26, 0xc8, 0x04, 0x75, 0x10, 0x55, 0x0e, 0x65, 0x11, 0x09, 0x30, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x95, 0x01, 0x81, 0x02, 0x46, 0x6c, 0x02, 0x26, 0xe8, 0x02, 0x09, 0x31, 0x81, 0x02, 0xc0, 0x05, 0x0d, 0x09, 0x22, 0xa1, 0x02, 0x15, 0x00, 0x25, 0x01, 0x09, 0x47, 0x09, 0x42, 0x95, 0x02, 0x75, 0x01, 0x81, 0x02, 0x95, 0x01, 0x75, 0x03, 0x25, 0x05, 0x09, 0x51, 0x81, 0x02, 0x75, 0x01, 0x95, 0x03, 0x81, 0x03, 0x05, 0x01, 0x15, 0x00, 0x26, 0xc8, 0x04, 0x75, 0x10, 0x55, 0x0e, 0x65, 0x11, 0x09, 0x30, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x95, 0x01, 0x81, 0x02, 0x46, 0x6c, 0x02, 0x26, 0xe8, 0x02, 0x09, 0x31, 0x81, 0x02, 0xc0, 0x05, 0x0d, 0x09, 0x22, 0xa1, 0x02, 0x15, 0x00, 0x25, 0x01, 0x09, 0x47, 0x09, 0x42, 0x95, 0x02, 0x75, 0x01, 0x81, 0x02, 0x95, 0x01, 0x75, 0x03, 0x25, 0x05, 0x09, 0x51, 0x81, 0x02, 0x75, 0x01, 0x95, 0x03, 0x81, 0x03, 0x05, 0x01, 0x15, 0x00, 0x26, 0xc8, 0x04, 0x75, 0x10, 0x55, 0x0e, 0x65, 0x11, 0x09, 0x30, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x95, 0x01, 0x81, 0x02, 0x46, 0x6c, 0x02, 0x26, 0xe8, 0x02, 0x09, 0x31, 0x81, 0x02, 0xc0, 0x05, 0x0d, 0x55, 0x0c, 0x66, 0x01, 0x10, 0x47, 0xff, 0xff, 0x00, 0x00, 0x27, 0xff, 0xff, 0x00, 0x00, 0x75, 0x10, 0x95, 0x01, 0x09, 0x56, 0x81, 0x02, 0x09, 0x54, 0x25, 0x7f, 0x95, 0x01, 0x75, 0x08, 0x81, 0x02, 0x05, 0x09, 0x09, 0x01, 0x25, 0x01, 0x75, 0x01, 0x95, 0x01, 0x81, 0x02, 0x95, 0x07, 0x81, 0x03, 0x05, 0x0d, 0x85, 0x08, 0x09, 0x55, 0x09, 0x59, 0x75, 0x04, 0x95, 0x02, 0x25, 0x0f, 0xb1, 0x02, 0x85, 0x0d, 0x09, 0x60, 0x75, 0x01, 0x95, 0x01, 0x15, 0x00, 0x25, 0x01, 0xb1, 0x02, 0x95, 0x07, 0xb1, 0x03, 0x85, 0x07, 0x06, 0x00, 0xff, 0x09, 0xc5, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x96, 0x00, 0x01, 0xb1, 0x02, 0xc0, 0x05, 0x0d, 0x09, 0x0e, 0xa1, 0x01, 0x85, 0x04, 0x09, 0x22, 0xa1, 0x02, 0x09, 0x52, 0x15, 0x00, 0x25, 0x0a, 0x75, 0x08, 0x95, 0x01, 0xb1, 0x02, 0xc0, 0x09, 0x22, 0xa1, 0x00, 0x85, 0x06, 0x09, 0x57, 0x09, 0x58, 0x75, 0x01, 0x95, 0x02, 0x25, 0x01, 0xb1, 0x02, 0x95, 0x06, 0xb1, 0x03, 0xc0, 0xc0, 0x06, 0x00, 0xff, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x09, 0x09, 0x02, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x14, 0x91, 0x02, 0x85, 0x0a, 0x09, 0x03, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x14, 0x91, 0x02, 0x85, 0x0b, 0x09, 0x04, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x3d, 0x81, 0x02, 0x85, 0x0c, 0x09, 0x05, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x3d, 0x81, 0x02, 0x85, 0x0f, 0x09, 0x06, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x03, 0xb1, 0x02, 0x85, 0x0e, 0x09, 0x07, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x01, 0xb1, 0x02, 0xc0, Device Found type: 06cb cd40 path: /dev/hidraw0 serial_number: Manufacturer: Product: SYNA7DAB:01 06CB:CD40 Release: 0 Interface: -1 Usage (page): 0xe (0xd) Bus type: 3 (I2C) Report Descriptor: (665 bytes) 0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x02, 0x09, 0x01, 0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x02, 0x15, 0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x02, 0x81, 0x02, 0x95, 0x06, 0x81, 0x01, 0x05, 0x01, 0x09, 0x30, 0x09, 0x31, 0x15, 0x81, 0x25, 0x7f, 0x75, 0x08, 0x95, 0x02, 0x81, 0x06, 0xc0, 0xc0, 0x05, 0x0d, 0x09, 0x05, 0xa1, 0x01, 0x85, 0x03, 0x05, 0x0d, 0x09, 0x22, 0xa1, 0x02, 0x15, 0x00, 0x25, 0x01, 0x09, 0x47, 0x09, 0x42, 0x95, 0x02, 0x75, 0x01, 0x81, 0x02, 0x95, 0x01, 0x75, 0x03, 0x25, 0x05, 0x09, 0x51, 0x81, 0x02, 0x75, 0x01, 0x95, 0x03, 0x81, 0x03, 0x05, 0x01, 0x15, 0x00, 0x26, 0xc8, 0x04, 0x75, 0x10, 0x55, 0x0e, 0x65, 0x11, 0x09, 0x30, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x95, 0x01, 0x81, 0x02, 0x46, 0x6c, 0x02, 0x26, 0xe8, 0x02, 0x09, 0x31, 0x81, 0x02, 0xc0, 0x05, 0x0d, 0x09, 0x22, 0xa1, 0x02, 0x15, 0x00, 0x25, 0x01, 0x09, 0x47, 0x09, 0x42, 0x95, 0x02, 0x75, 0x01, 0x81, 0x02, 0x95, 0x01, 0x75, 0x03, 0x25, 0x05, 0x09, 0x51, 0x81, 0x02, 0x75, 0x01, 0x95, 0x03, 0x81, 0x03, 0x05, 0x01, 0x15, 0x00, 0x26, 0xc8, 0x04, 0x75, 0x10, 0x55, 0x0e, 0x65, 0x11, 0x09, 0x30, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x95, 0x01, 0x81, 0x02, 0x46, 0x6c, 0x02, 0x26, 0xe8, 0x02, 0x09, 0x31, 0x81, 0x02, 0xc0, 0x05, 0x0d, 0x09, 0x22, 0xa1, 0x02, 0x15, 0x00, 0x25, 0x01, 0x09, 0x47, 0x09, 0x42, 0x95, 0x02, 0x75, 0x01, 0x81, 0x02, 0x95, 0x01, 0x75, 0x03, 0x25, 0x05, 0x09, 0x51, 0x81, 0x02, 0x75, 0x01, 0x95, 0x03, 0x81, 0x03, 0x05, 0x01, 0x15, 0x00, 0x26, 0xc8, 0x04, 0x75, 0x10, 0x55, 0x0e, 0x65, 0x11, 0x09, 0x30, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x95, 0x01, 0x81, 0x02, 0x46, 0x6c, 0x02, 0x26, 0xe8, 0x02, 0x09, 0x31, 0x81, 0x02, 0xc0, 0x05, 0x0d, 0x09, 0x22, 0xa1, 0x02, 0x15, 0x00, 0x25, 0x01, 0x09, 0x47, 0x09, 0x42, 0x95, 0x02, 0x75, 0x01, 0x81, 0x02, 0x95, 0x01, 0x75, 0x03, 0x25, 0x05, 0x09, 0x51, 0x81, 0x02, 0x75, 0x01, 0x95, 0x03, 0x81, 0x03, 0x05, 0x01, 0x15, 0x00, 0x26, 0xc8, 0x04, 0x75, 0x10, 0x55, 0x0e, 0x65, 0x11, 0x09, 0x30, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x95, 0x01, 0x81, 0x02, 0x46, 0x6c, 0x02, 0x26, 0xe8, 0x02, 0x09, 0x31, 0x81, 0x02, 0xc0, 0x05, 0x0d, 0x09, 0x22, 0xa1, 0x02, 0x15, 0x00, 0x25, 0x01, 0x09, 0x47, 0x09, 0x42, 0x95, 0x02, 0x75, 0x01, 0x81, 0x02, 0x95, 0x01, 0x75, 0x03, 0x25, 0x05, 0x09, 0x51, 0x81, 0x02, 0x75, 0x01, 0x95, 0x03, 0x81, 0x03, 0x05, 0x01, 0x15, 0x00, 0x26, 0xc8, 0x04, 0x75, 0x10, 0x55, 0x0e, 0x65, 0x11, 0x09, 0x30, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x95, 0x01, 0x81, 0x02, 0x46, 0x6c, 0x02, 0x26, 0xe8, 0x02, 0x09, 0x31, 0x81, 0x02, 0xc0, 0x05, 0x0d, 0x55, 0x0c, 0x66, 0x01, 0x10, 0x47, 0xff, 0xff, 0x00, 0x00, 0x27, 0xff, 0xff, 0x00, 0x00, 0x75, 0x10, 0x95, 0x01, 0x09, 0x56, 0x81, 0x02, 0x09, 0x54, 0x25, 0x7f, 0x95, 0x01, 0x75, 0x08, 0x81, 0x02, 0x05, 0x09, 0x09, 0x01, 0x25, 0x01, 0x75, 0x01, 0x95, 0x01, 0x81, 0x02, 0x95, 0x07, 0x81, 0x03, 0x05, 0x0d, 0x85, 0x08, 0x09, 0x55, 0x09, 0x59, 0x75, 0x04, 0x95, 0x02, 0x25, 0x0f, 0xb1, 0x02, 0x85, 0x0d, 0x09, 0x60, 0x75, 0x01, 0x95, 0x01, 0x15, 0x00, 0x25, 0x01, 0xb1, 0x02, 0x95, 0x07, 0xb1, 0x03, 0x85, 0x07, 0x06, 0x00, 0xff, 0x09, 0xc5, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x96, 0x00, 0x01, 0xb1, 0x02, 0xc0, 0x05, 0x0d, 0x09, 0x0e, 0xa1, 0x01, 0x85, 0x04, 0x09, 0x22, 0xa1, 0x02, 0x09, 0x52, 0x15, 0x00, 0x25, 0x0a, 0x75, 0x08, 0x95, 0x01, 0xb1, 0x02, 0xc0, 0x09, 0x22, 0xa1, 0x00, 0x85, 0x06, 0x09, 0x57, 0x09, 0x58, 0x75, 0x01, 0x95, 0x02, 0x25, 0x01, 0xb1, 0x02, 0x95, 0x06, 0xb1, 0x03, 0xc0, 0xc0, 0x06, 0x00, 0xff, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x09, 0x09, 0x02, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x14, 0x91, 0x02, 0x85, 0x0a, 0x09, 0x03, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x14, 0x91, 0x02, 0x85, 0x0b, 0x09, 0x04, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x3d, 0x81, 0x02, 0x85, 0x0c, 0x09, 0x05, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x3d, 0x81, 0x02, 0x85, 0x0f, 0x09, 0x06, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x03, 0xb1, 0x02, 0x85, 0x0e, 0x09, 0x07, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x01, 0xb1, 0x02, 0xc0, Device Found type: 06cb cd40 path: /dev/hidraw0 serial_number: Manufacturer: Product: SYNA7DAB:01 06CB:CD40 Release: 0 Interface: -1 Usage (page): 0x1 (0xff00) Bus type: 3 (I2C) Report Descriptor: (665 bytes) 0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x85, 0x02, 0x09, 0x01, 0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x02, 0x15, 0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x02, 0x81, 0x02, 0x95, 0x06, 0x81, 0x01, 0x05, 0x01, 0x09, 0x30, 0x09, 0x31, 0x15, 0x81, 0x25, 0x7f, 0x75, 0x08, 0x95, 0x02, 0x81, 0x06, 0xc0, 0xc0, 0x05, 0x0d, 0x09, 0x05, 0xa1, 0x01, 0x85, 0x03, 0x05, 0x0d, 0x09, 0x22, 0xa1, 0x02, 0x15, 0x00, 0x25, 0x01, 0x09, 0x47, 0x09, 0x42, 0x95, 0x02, 0x75, 0x01, 0x81, 0x02, 0x95, 0x01, 0x75, 0x03, 0x25, 0x05, 0x09, 0x51, 0x81, 0x02, 0x75, 0x01, 0x95, 0x03, 0x81, 0x03, 0x05, 0x01, 0x15, 0x00, 0x26, 0xc8, 0x04, 0x75, 0x10, 0x55, 0x0e, 0x65, 0x11, 0x09, 0x30, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x95, 0x01, 0x81, 0x02, 0x46, 0x6c, 0x02, 0x26, 0xe8, 0x02, 0x09, 0x31, 0x81, 0x02, 0xc0, 0x05, 0x0d, 0x09, 0x22, 0xa1, 0x02, 0x15, 0x00, 0x25, 0x01, 0x09, 0x47, 0x09, 0x42, 0x95, 0x02, 0x75, 0x01, 0x81, 0x02, 0x95, 0x01, 0x75, 0x03, 0x25, 0x05, 0x09, 0x51, 0x81, 0x02, 0x75, 0x01, 0x95, 0x03, 0x81, 0x03, 0x05, 0x01, 0x15, 0x00, 0x26, 0xc8, 0x04, 0x75, 0x10, 0x55, 0x0e, 0x65, 0x11, 0x09, 0x30, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x95, 0x01, 0x81, 0x02, 0x46, 0x6c, 0x02, 0x26, 0xe8, 0x02, 0x09, 0x31, 0x81, 0x02, 0xc0, 0x05, 0x0d, 0x09, 0x22, 0xa1, 0x02, 0x15, 0x00, 0x25, 0x01, 0x09, 0x47, 0x09, 0x42, 0x95, 0x02, 0x75, 0x01, 0x81, 0x02, 0x95, 0x01, 0x75, 0x03, 0x25, 0x05, 0x09, 0x51, 0x81, 0x02, 0x75, 0x01, 0x95, 0x03, 0x81, 0x03, 0x05, 0x01, 0x15, 0x00, 0x26, 0xc8, 0x04, 0x75, 0x10, 0x55, 0x0e, 0x65, 0x11, 0x09, 0x30, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x95, 0x01, 0x81, 0x02, 0x46, 0x6c, 0x02, 0x26, 0xe8, 0x02, 0x09, 0x31, 0x81, 0x02, 0xc0, 0x05, 0x0d, 0x09, 0x22, 0xa1, 0x02, 0x15, 0x00, 0x25, 0x01, 0x09, 0x47, 0x09, 0x42, 0x95, 0x02, 0x75, 0x01, 0x81, 0x02, 0x95, 0x01, 0x75, 0x03, 0x25, 0x05, 0x09, 0x51, 0x81, 0x02, 0x75, 0x01, 0x95, 0x03, 0x81, 0x03, 0x05, 0x01, 0x15, 0x00, 0x26, 0xc8, 0x04, 0x75, 0x10, 0x55, 0x0e, 0x65, 0x11, 0x09, 0x30, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x95, 0x01, 0x81, 0x02, 0x46, 0x6c, 0x02, 0x26, 0xe8, 0x02, 0x09, 0x31, 0x81, 0x02, 0xc0, 0x05, 0x0d, 0x09, 0x22, 0xa1, 0x02, 0x15, 0x00, 0x25, 0x01, 0x09, 0x47, 0x09, 0x42, 0x95, 0x02, 0x75, 0x01, 0x81, 0x02, 0x95, 0x01, 0x75, 0x03, 0x25, 0x05, 0x09, 0x51, 0x81, 0x02, 0x75, 0x01, 0x95, 0x03, 0x81, 0x03, 0x05, 0x01, 0x15, 0x00, 0x26, 0xc8, 0x04, 0x75, 0x10, 0x55, 0x0e, 0x65, 0x11, 0x09, 0x30, 0x35, 0x00, 0x46, 0xfc, 0x03, 0x95, 0x01, 0x81, 0x02, 0x46, 0x6c, 0x02, 0x26, 0xe8, 0x02, 0x09, 0x31, 0x81, 0x02, 0xc0, 0x05, 0x0d, 0x55, 0x0c, 0x66, 0x01, 0x10, 0x47, 0xff, 0xff, 0x00, 0x00, 0x27, 0xff, 0xff, 0x00, 0x00, 0x75, 0x10, 0x95, 0x01, 0x09, 0x56, 0x81, 0x02, 0x09, 0x54, 0x25, 0x7f, 0x95, 0x01, 0x75, 0x08, 0x81, 0x02, 0x05, 0x09, 0x09, 0x01, 0x25, 0x01, 0x75, 0x01, 0x95, 0x01, 0x81, 0x02, 0x95, 0x07, 0x81, 0x03, 0x05, 0x0d, 0x85, 0x08, 0x09, 0x55, 0x09, 0x59, 0x75, 0x04, 0x95, 0x02, 0x25, 0x0f, 0xb1, 0x02, 0x85, 0x0d, 0x09, 0x60, 0x75, 0x01, 0x95, 0x01, 0x15, 0x00, 0x25, 0x01, 0xb1, 0x02, 0x95, 0x07, 0xb1, 0x03, 0x85, 0x07, 0x06, 0x00, 0xff, 0x09, 0xc5, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x96, 0x00, 0x01, 0xb1, 0x02, 0xc0, 0x05, 0x0d, 0x09, 0x0e, 0xa1, 0x01, 0x85, 0x04, 0x09, 0x22, 0xa1, 0x02, 0x09, 0x52, 0x15, 0x00, 0x25, 0x0a, 0x75, 0x08, 0x95, 0x01, 0xb1, 0x02, 0xc0, 0x09, 0x22, 0xa1, 0x00, 0x85, 0x06, 0x09, 0x57, 0x09, 0x58, 0x75, 0x01, 0x95, 0x02, 0x25, 0x01, 0xb1, 0x02, 0x95, 0x06, 0xb1, 0x03, 0xc0, 0xc0, 0x06, 0x00, 0xff, 0x09, 0x01, 0xa1, 0x01, 0x85, 0x09, 0x09, 0x02, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x14, 0x91, 0x02, 0x85, 0x0a, 0x09, 0x03, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x14, 0x91, 0x02, 0x85, 0x0b, 0x09, 0x04, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x3d, 0x81, 0x02, 0x85, 0x0c, 0x09, 0x05, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x3d, 0x81, 0x02, 0x85, 0x0f, 0x09, 0x06, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x03, 0xb1, 0x02, 0x85, 0x0e, 0x09, 0x07, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x01, 0xb1, 0x02, 0xc0, unable to open device ```
Youw commented 1 year ago

06cb cd40 is a perfect device to test this change, thanks.

Yeap, all looks good.

JoergAtGithub commented 1 year ago

In general this is an improvements, but the HID standard does not define something like a usage pair. While there must be always a Usage Page and a Usage defined (due to the clause on top of page 25 of the class specification), only the Usage is relevant for the collection. The sole purpose of the Usage Page item is to to conserve space in a report descriptor by setting the high order 16 bits of a subsequent usages. But this is only one variant. The report descriptor can also contain the 'Extended Usage' of 32Bit, in this case, the usage page has no meaning for the collection. Example:

Usage Page                        05 01
Usage                             09 06
Collection                        A1 01
End Collection                    C0

The same meaning for the collection with extended 32Bit Usage:

Usage                             0B 06 00 01 00,
Collection                        A1 01
End Collection                    C0

And you could also do this - than the Usage Page item influences only the second collection:

Usage Page                        05 01
Usage                             0B 99 99 99 99,
Collection                        A1 01
End Collection                    C0
Usage                             09 06
Collection                        A1 01
End Collection                    C0

To implement this correct, the Usage Page should only be use in https://github.com/libusb/hidapi/blob/78c6adec7c98adb3c51ab750021b84be6c998203/linux/hid.c#L361-L364 here the 32 Bit extended usage value has to be defined. Depending on the size of the Usage 0, 1, 2, or 4 Bytes of the Usage Page value have to be used to fill the missing bytes of the 32Bit usage value, which defines the nature of the following collection.

mcuee commented 1 year ago

I think this looks good.

@mcuee do you know if that device is HID compliant? You can only run this on windows, but https://www.usb.org/compliancetools has USB3CV (that's usually what you want). The hid test can be quite useful in this case.

The device 06cb:cd40 is not a USB HID device, but rather I2C-HID (touch pad).

Youw commented 1 year ago

Thanks @JoergAtGithub.

The same meaning for the collection with extended 32Bit Usage:

Usage                             0B 06 00 01 00,
Collection                        A1 01
End Collection                    C0

To support this case I'd need to have access to at least one device that implements 32-bit usage in the descriptor. I'll keep a support of that to #454 for now.

And you could also do this - than the Usage Page item influences only the second collection:

Usage Page                        05 01
Usage                             0B 99 99 99 99,
Collection                        A1 01
End Collection                    C0
Usage                             09 06
Collection                        A1 01
End Collection                    C0

I suspected something like that might be the case but wasn't sure. I'll try to implement that case as part of this PR.

mcuee commented 1 year ago

@JoergAtGithub

Do you have such a device with 32bit usage? Would you please post the HID Report Descriptor of that device? I will see if I can find one or change my test device to have that.

Youw commented 1 year ago

I will see if I can find one or change my test device to have that.

Oh, we could craft/change any descriptor for that.

Youw commented 1 year ago

I'll keep a support of that to https://github.com/libusb/hidapi/issues/454 for now.

It was easier than I thought.

Youw commented 1 year ago

If any issues - will fix those later in master