[libhid-discuss] reading from a barcode scanner that acts like a keyboard

Brice Rebsamen brice.brice at gmail.com
Wed Nov 8 11:33:48 CET 2006


Thank you Charles for these valuable information, thanks a lot. I have a
deeper understanding now. Still need help though.

>      Endpoint Descriptor:
>        bLength                 7
>        bDescriptorType         5
>        bEndpointAddress     0x81  EP 1 IN
>       bmAttributes            3
>          Transfer Type            Interrupt
>          Synch Type               None
>          Usage Type               Data
>        wMaxPacketSize     0x0008  1x 8 bytes
>        bInterval              10
>
> bInterval suggests that you poll the device every 10 milliseconds.
> Sometimes, you need to send a SET_IDLE request to start the data flowing:
> http://www.ghz.cc/~clepple/libhid/doc/html/hid__exchange_8c.html#
> c96f8781c3ce92199eda3d18c98406e3
> Then, you can use hid_interrupt_read() to read reports. Unfortunately,
this function does not
> integrate well with the rest of libhid, so you will need to calculate byte
offsets by hand
> as I have done above.

What am I supposed to receive from hid_interrupt_read?
8 bytes I thought, but then they are always the same one. I tried with 65
bytes, just in case, but I get mostly the same bytes too, mostly zeros.
Can you detail a bit more? What do you mean by calculate byte offset? Is it
that I should receive 65 bytes and then interpret it bit per bit to retrieve
control keys, padding, leds, keycodes..?


Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.alioth.debian.org/pipermail/libhid-discuss/attachments/20061108/d5e80eb8/attachment.html


More information about the libhid-discuss mailing list