|
| 1 | +# This is a sample udev file for HIDAPI devices which lets unprivileged |
| 2 | +# users who are physically present at the system (not remote users) access |
| 3 | +# HID devices. |
| 4 | + |
| 5 | +# If you are using the libusb implementation of hidapi (libusb/hid.c), then |
| 6 | +# use something like the following line, substituting the VID and PID with |
| 7 | +# those of your device. |
| 8 | + |
| 9 | +# HIDAPI/libusb |
| 10 | +SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="003f", TAG+="uaccess" |
| 11 | + |
| 12 | +# If you are using the hidraw implementation (linux/hid.c), then do something |
| 13 | +# like the following, substituting the VID and PID with your device. |
| 14 | + |
| 15 | +# HIDAPI/hidraw |
| 16 | +KERNEL=="hidraw*", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="003f", TAG+="uaccess" |
| 17 | + |
| 18 | +# Once done, optionally rename this file for your application, and drop it into |
| 19 | +# /etc/udev/rules.d. Note that these rules must have priorty before 70-uaccess.rules |
| 20 | +# for example, name the file /etc/udev/rules.d/69-my-application-hid.rules. |
| 21 | +# Then, replug your device or run: |
| 22 | +# sudo udevadm control --reload-rules && sudo udevadm trigger |
| 23 | + |
| 24 | +# Note that the hexadecimal values for VID and PID are case sensitive and |
| 25 | +# must be lower case. |
| 26 | + |
| 27 | +# TAG+="uaccess" only gives permission to physically present users, which |
| 28 | +# is appropriate in most scenarios. If you require remote access to the |
| 29 | +# device, add |
| 30 | +# GROUP="plugdev", MODE="660" |
| 31 | +# to the end of the udev rule lines, add your user to the plugdev group with: |
| 32 | +# usermod -aG plugdev USERNAME |
| 33 | +# then log out and log back in (or restart the system). |
0 commit comments