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 From [email protected] Fri Dec 8 22:37:06 2006 From: [email protected] (Alessandro Zummo) Date: Fri Dec 8 22:37:22 2006 Subject: [sane-devel] coolscan2 in infrared mode Message-ID: <20061208223706.5bc030d6@inspiron> Reading the docs, it seems this should be enough to obtain the infrared channel from my LS-2000: SANE_DEBUG_COOLSCAN2=200 scanimage --format=tiff --batch-count=2 --infrared=yes --resolution=300 however, what I've got so far is: [...] Scanned page 1. (scanner status = 5) Scanning page 2 [coolscan2] sane_start() called. scanimage: sane_start: Invalid argument [coolscan2] sane_cancel() called while scanning. [coolscan2] cs2_issue_cmd(): opcode = 0xc0, n_send = 6, n_recv = 0. [coolscan2] sane_close() called. [coolscan2] sane_exit() called. I think this is because s->scanning is never set to false and thus sane_start fails. this patch seems to fix it: diff -u -r1.10 coolscan2.c --- coolscan2.c 11 Jun 2006 21:35:19 -0000 1.10 +++ coolscan2.c 8 Dec 2006 21:35:55 -0000 @@ -1482,6 +1482,7 @@ if (xfer_len_out == 0) /* no more data */ { *len = 0; + s->scanning = SANE_FALSE; return SANE_STATUS_EOF; } @@ -1533,6 +1534,7 @@ if (xfer_len_line == 0) /* no more data */ { *len = 0; + s->scanning = SANE_FALSE; return SANE_STATUS_EOF; } -- Best regards, Alessandro Zummo, Tower Technologies - Turin, Italy http://www.towertech.it
