[libhid-discuss] Multiple duplicate interfaces?

Frank Rizzo thefrankrizzo at hotmail.com
Sat Oct 2 21:41:50 UTC 2010


> If you detach it from the OS, you will have to handle all of the HID 
> keyboard transactions. libhid doesn't do any of that for you.

I'm sure it's obvious by now, but this is my first foray into USB 
programming, so I'm not sure what you mean.  I want to be the receiver of 
the barcode data that comes in from the scanner as a string of bytes, 
terminated by a <CR>.  Currently, whatever program has the "input focus" 
(for lack of a better term), gets this input.  I want to stop that.  It is 
my belief that the keyboard is mostly a "transmit-only" device, with the 
exceptions being the commands to toggle the LEDs.
Is this an incorrect assumption?

> Right. There is a comment about 3/4th of the way through 
> http://svn.debian.org/wsvn/libhid/trunk/test/test_libhid.c that explains 
> how to find the path from lsusb output.

OK, and I am ASSUMING that the correct path for this device is 0x00010006, 
0x00070000 because I have this:

Item(Global): Usage Page, data= [ 0x01 ] 1
Item(Local ): Usage, data= [ 0x06 ] 6
[...]
Item(Global): Usage Page, data= [ 0x07 ] 7
                            Keyboard
Item(Local ): Usage Minimum, data= [ 0x00 ] 0
                            No Event
Item(Local ): Usage Maximum, data= [ 0xff 0x00 ] 255
                            (null)
Item(Main  ): Input, data= [ 0x00 ] 0


Does this seem sane?  (If not, you have my lsusb dump back a couple of 
messages ago, could you throw me a pointer?)

Frank

 




More information about the libhid-discuss mailing list