[sane-devel] sanei_usb and libusb_timeout
m. allan noah
Wed, 1 Dec 2004 14:39:54 -0500 (EST)
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed
On Wed, 1 Dec 2004, Henning Meier-Geinitz wrote:
> On Wed, Dec 01, 2004 at 02:54:59PM +0100, René Rebe wrote:
>> the default timeout passed to libusb of 30 seconds is quite a bit long.
>> So recovering from errors is already quite annoying for some use cases.
>> Now I have a situation where I expect an error to happen for some models
>> and adjust the code-path of future commands due to this. An initial
>> timeout for the error that might happen for 50% of the scanners attached
>> is quite long ....
>> So I propose the hand libusb_timeout into the hands of the backend
>> author. Does anyone see problems with this? (except of [tiny] API
>> changes :-()
> That's a good idea.
> Maybe something like this:
> sanei_usb_set_timeout (SANE_Int msecs)
> #ifdef HAVE_LIBUSB
> libusb_timeout = msecs;
> DBG (5, "sanei_usb_set_timeout: set timeout to %d msecs\n", msecs);
> return SANE_STATUS_GOOD;
> DBG (3, "sanei_usb_set_timeout: libusb support missing\n");
> return SANE_STATUS_UNSUPPORTED;
> That's completey untested.
is there any value to makeing this function call have a more generic name,
like sanei_set_timeout() which could perhaps be a noop in the scsi case
for now? is variable timeout ever going to apply to scsi?
"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