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

Physical device ID for Linux/hidraw #417

Closed
JoergAtGithub opened this issue May 18, 2022 · 2 comments
Closed

Physical device ID for Linux/hidraw #417

JoergAtGithub opened this issue May 18, 2022 · 2 comments
Labels
enhancement New feature or request hidraw Related to Linux/hidraw backend libusb Related to libusb backend

Comments

@JoergAtGithub
Copy link
Contributor

With hid_darwin_get_location_id (#378) and hid_winapi_get_container_id(#379) we have physical device identifiers for Windows and MacOS, but not for Linux.
The Chromium HID implementation uses the same identifiers for Windows and MacOS, but has also an implementation for hidraw. They use the sysfs path of the device node that represents the physical device as physical identifier. They implemented a recursive search to gather this information:
https://chromium.googlesource.com/chromium/src/+/refs/changes/62/3314562/3/services/device/hid/hid_service_linux.cc#138

@Youw Youw added enhancement New feature or request hidraw Related to Linux/hidraw backend libusb Related to libusb backend labels May 18, 2022
@Youw
Copy link
Member

Youw commented May 18, 2022

  • hidraw:
    once we have hid_get_path I believe it is enough to identify the physysical device, since paths like /dev/hidraw* are easily mapped to /sys/class/hidraw/hidraw*; that information should be more than enough for the application to get what it needs;
  • libusb:
    having hid_get_path we may say the very similar thing, as the path we generate (libusb backend: stabilize device path, superseeds: #117 #291) is the same as in /sys/bus/usb/devices/

@Youw
Copy link
Member

Youw commented Aug 21, 2022

Resolved by #432

@Youw Youw closed this as completed Aug 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hidraw Related to Linux/hidraw backend libusb Related to libusb backend
Projects
None yet
Development

No branches or pull requests

2 participants