[libhid-discuss] Multiple duplicate interfaces?
Charles Lepple
clepple at ghz.cc
Sun Oct 3 13:12:40 UTC 2010
On Oct 2, 2010, at 9:52 PM, Frank Rizzo wrote:
> JACKPOT! I'm using hid_interrupt_read on ep 0x81, and getting the
> key data 1 key at a time, in scan codes. (Which is FINE with me!
> I'm an old DOS programmer, I'm used to scan codes).
>
> I used usbsnoop to capture a couple of transactions, and have a
> complete list of the scan codes for the numbers, and the <CR>. I
> should now have no problem whipping up a quick app that does exactly
> what I need.
Glad that works.
At this point, the value-add of libhid is about nil, since the Usage
path for this device is just one level deep. hid_force_open() is
simply a wrapper for the libusb_detach_kernel_driver_np(), and
hid_interrupt_read() is just some parameter conversion and error
checking for libusb_interrupt_read():
http://libhid.alioth.debian.org/doc/hid__opening_8c-source.html#l00241
http://libhid.alioth.debian.org/doc/hid__exchange_8c-source.html#l00332
You could probably implement what you need in a dozen lines or so by
calling libusb directly. I haven't tried HIDAPI that Peter mentioned,
but it sounds like it might offer a more portable solution.
More information about the libhid-discuss
mailing list