[libhid-discuss] example program kills hiddev device node
Charles Lepple
clepple at ghz.cc
Sun Nov 11 22:05:58 UTC 2007
[Please don't cross-post. Thanks.]
On Nov 11, 2007, at 4:17 PM, Tino Keitel wrote:
> I tried to use a tool called hidmon to control man TFT over USB. That
> worked a few times, but now I noticed that the hiddev device node in
> /dev/usb/ went away. I didn't kow why. I rebooted the computer,
> changed
> from Linux 2.6.23.1 to 2.6.22, powercycled the TFT, without luck. As
> soon as I use hidmon, the device node is gone.
>
> Now I compiled the libhid test program test_libhid.c and got the same
> effect. It seems like hid_force_open() kills the device, as udev
> receives a remote udevent.
This is intentional. libhid is a cross-platform alternative to the
Linux hiddev API, and as such, it detaches the kernel hiddev driver
from the device (technically, from the HID interface, but USB devices
often only have one interface). This is necessary for libhid or
libusb to claim the device exclusively. Since the kernel hiddev
driver no longer sees the device, udev removes the device node. (The
usbdevfs node still remains, and that is what libusb and libhid use
to communicate with the device.)
--
Charles Lepple
More information about the libhid-discuss
mailing list