On Mon, 2 Apr 2007, Andy Stewart wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Tim Keller wrote:
This is what I would do.
1. Install "lsusb". It behaves much like lspci so you can what devices are on your system.
When you do a "lsusb" it'll list what devices are hanging off of each USB bus. Do a before and after so you can see the major/minor numbers.
2. When you know the devices major and minor number you can write a program using libusb that'll look for the device, open the device if it exists, take posession of it and then read data to and from it, hopefully. http://libusb.sourceforge.net/doc/examples-code.html
Looking at that example, I don't think it would be too hard to whip up a program to open the device and then loop until there's input and then dump it on the screen.
Thanks, Tim.
HI Tim,
Thanks for the tip about libusb. I have lsusb installed, and I also have usbview.
I'm surprised that I can't find the proper thing to "cat" to see output from the barcode reader. That would be the shell equivalent of what you propose. If I could find that, I'd be in business. I'm 99% certain that I'm looking in the right place. Now, I wonder if it is possible that the barcode reader is defective.......hummmmm.
Once I find the right file to "cat", whipping up a program to grab the bytes and deal with them would be fairly trivial, I agree.
Thanks!
Andy
It might be that the device needs some initialization before it will start returning data. I wouldn't expect this for a HID device, but since the event* nodes aren't showing anything, who knows... In the kernel, it would be interesting to see what happens if you turn on DEBUG in hid-input.c, which currently contains, #undef DEBUG ... static void hidinput_configure_usage() ... goto ignore; // lots of these gotos! -jamieg ... ignore: #ifdef DEBUG printk("IGNORED\n"); #endif -Jamie