|
From: Tim R. <ti...@pr...> - 2006-10-31 23:19:10
|
Brice Rebsamen wrote: >Hello, > >I have a USB barcode scanner that acts like a keyboard: whenever a >barcode is read it sends the code where the keyboard would normally >write. I am writing some code in C to read from the scanner. This is >my first application using libusb, and it is the first time I am >working with a USB device. >I found out how to open the usb device, detach the kernel driver and >claim the interface. I got this information by reading the code of the >phidget library that makes use of libusb. To read from the phidgets >they call usb_interrupt_read. So I am doing the same but I get >nothing, although I am managing to read 8 bytes, always the same: 0 0 >30 0 0 0 0 0 >What's wrong? I pasted my code below (I removed error checking code). > > Why do you think you should be getting 8 bytes? Have you read the report descriptors so you know exactly what data to expect? Have you read any of the USB HID Class Spec? Some devices only return data when you send them a request to read. -- Tim Roberts, ti...@pr... Providenza & Boekelheide, Inc. |