[sane-devel] Libusb - reads and writes?

m. allan noah anoah at pfeiffer.edu
Fri Dec 8 22:07:01 CET 2006


On Fri, 8 Dec 2006, René Kjellerup wrote:

>
>
> On Fri, 8 Dec 2006, m. allan noah
>
>> On Thu, 7 Dec 2006, René Kjellerup wrote:
>>
>>> So the primary question is, which endpoint does one write to, and
>>> which does one read from?
>>
>> the in/out identifiers are written from the perspective of the host, not
> the device. so you read in and write out. just as a check, the IN endpoint
> will > have its high bit set (0x80).
>>
> Thanks
>
>> it is not unusual to get timeout errors and other weirdness on your first
> command to the device, some fujitsu scanners require you to call TEST UNIT
> READY several times with a really short timeout and ignore the errors before
> they will play.
>
> :) well being used to TCP connections, I'd never expected USB communication
> to be so inconsistent.
>
> Should I fill the scanner's endpoint buffer before reading? Or will a few
> one byte writes do?
> Anyone know how Canon's scanners like it? [:)]

haha- oh, you're serious? you have to write a properly formatted command 
before you read. sending single bytes is a great way to confuse the 
scanner.

get a trace on windows using benoit's usbsniffer, and work from that.

post links to the traces on this list if you need some help.

allan

>
> Best regards
> René Kjellerup
> -- as life grows older, I gain experience.
>
>>
>> allan
>>
>> --
>> "so don't tell us it can't be done, putting down what you don't know.
>> money isn't our god, integrity will free our souls" - Max Cavalera
>
>

-- 
"so don't tell us it can't be done, putting down what you don't know.
money isn't our god, integrity will free our souls" - Max Cavalera


More information about the sane-devel mailing list