From: Jon Norenberg <jon@no...> - 2009-03-12 22:22:33
I am submitting an async read on bulk endpoint 0x82 and then I call
libusb_get_next_timeout() which returns over 500,000 seconds for the
timeout that I am supposed to pass to select.
If I am waiting on the libusb fds (POLLOUT), will select ever work on
the fds with a read or will the lib just set the timeout very low so
that libusb_handle_events_timeout() will be called and allow the read
to complete. I read in past emails that libusb does not need POLLIN
in order to complete and async read when using select.
The code is currently in a test mode where we submit an async read
then write some data out using a sync write. The write completes, but
the read callback is not called. If I force a small timout (2 seconds
for exampled) then after the write, the select timeouts out and it
calls libusb_handle_events_timeout() which in turns eventually gets
the read callback called.
The async read has 0 as a timeout so it will wait forever. I am a
little confused on how the async read works, does it work through the
select timeout or will the fds really work? If the fds mode should
work, then I need to ask what could be going wrong so that the read
callback is not being called.
From: Tim Roberts <timr@pr...> - 2009-03-12 22:47:46
Jon Norenberg wrote:
> I am submitting an async read on bulk endpoint 0x82 and then I call
> libusb_get_next_timeout() which returns over 500,000 seconds for the
> timeout that I am supposed to pass to select.
Is libusb_get_next_timeout succeeding (that is, returning non-zero)?
> The async read has 0 as a timeout so it will wait forever.
If that's the only pending URB, then libusb_get_next_timeout is probably
returning 0 and leaving the timeval structure unchanged.
Tim Roberts, timr@...
Providenza & Boekelheide, Inc.