Skip to content

Commit

Permalink
Documentation: path fixes
Browse files Browse the repository at this point in the history
hid-libusb.c was renamed hid.c long ago but documentation wasn't
updated.
  • Loading branch information
diegoherranz authored and signal11 committed Sep 20, 2016
1 parent 901512e commit 1f615ef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.txt
Expand Up @@ -29,7 +29,7 @@ hidraw nodes associated with them. Keyboards, mice, and some other devices
which are blacklisted from having hidraw nodes will not work. Fortunately,
for nearly all the uses of hidraw, this is not a problem.

Linux/FreeBSD/libusb (libusb/hid-libusb.c):
Linux/FreeBSD/libusb (libusb/hid.c):
This back-end uses libusb-1.0 to communicate directly to a USB device. This
back-end will of course not work with Bluetooth devices.

Expand Down
10 changes: 3 additions & 7 deletions linux/README.txt
@@ -1,6 +1,6 @@

There are two implementations of HIDAPI for Linux. One (hid.c) uses the
Linux hidraw driver, and the other (hid-libusb.c) uses libusb. Which one you
There are two implementations of HIDAPI for Linux. One (linux/hid.c) uses the
Linux hidraw driver, and the other (libusb/hid.c) uses libusb. Which one you
use depends on your application. Complete functionality of the hidraw
version depends on patches to the Linux kernel which are not currently in
the mainline. These patches have to do with sending and receiving feature
Expand All @@ -9,13 +9,9 @@ device, bypassing any Linux HID driver. The disadvantage of the libusb
version is that it will only work with USB devices, while the hidraw
implementation will work with Bluetooth devices as well.

To use HIDAPI, simply drop either hid.c or hid-libusb.c into your
To use HIDAPI, simply drop either linux/hid.c or libusb/hid.c into your
application and build using the build parameters in the Makefile.

By default, on Linux, the Makefile in this directory is configured to use
the libusb implementation. To switch to the hidraw implementation, simply
change hid-libusb.c to hid.c in the Makefile.


Libusb Implementation notes
----------------------------
Expand Down
7 changes: 4 additions & 3 deletions udev/99-hid.rules
Expand Up @@ -2,7 +2,7 @@
# to 0666 (world readable/writable) for a specified device on Linux systems.


# If you are using the libusb implementation of hidapi (hid-libusb.c), then
# If you are using the libusb implementation of hidapi (libusb/hid.c), then
# use something like the following line, substituting the VID and PID with
# those of your device. Note that for kernels before 2.6.24, you will need
# to substitute "usb" with "usb_device". It shouldn't hurt to use two lines
Expand All @@ -12,8 +12,9 @@
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="003f", MODE="0666"


# If you are using the hidraw implementation, then do something like the
# following, substituting the VID and PID with your device. Busnum 1 is USB.
# If you are using the hidraw implementation (linux/hid.c), then do something
# like the following, substituting the VID and PID with your device. Busnum 1
# is USB.

# HIDAPI/hidraw
KERNEL=="hidraw*", ATTRS{busnum}=="1", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="003f", MODE="0666"
Expand Down

0 comments on commit 1f615ef

Please sign in to comment.