Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Jul 2010 19:21:45 +0200
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        Peer Stritzinger <peerst@gmail.com>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: FreeBSD 8: libusb async mode + select(2) = nogo?
Message-ID:  <201007231921.45803.hselasky@c2i.net>
In-Reply-To: <AANLkTi=a__R7gNvE371zs1vNpMXLFXS-09joihFQc-_H@mail.gmail.com>
References:  <AANLkTikk7L-63c6wQb0YKoYovGKPcT932Lc9n6mRrmK9@mail.gmail.com> <201007231657.47682.hselasky@c2i.net> <AANLkTi=a__R7gNvE371zs1vNpMXLFXS-09joihFQc-_H@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 23 July 2010 19:12:46 Peer Stritzinger wrote:
> Hi,
> 
> On Fri, Jul 23, 2010 at 4:57 PM, Hans Petter Selasky <hselasky@c2i.net> 
wrote:
> > What are the polling flags you are using?
> 
> Do you mean the libusb_pollfd entries?
> 
> They are:
> 
> {fd = 0x7, events = 0x1}
> {fd = 0xc, events = 0x45}
> 
> I translate these into select(2) params like this:
> 
> nfds = 0xc, readfds = {__fds_bits = {0x1080, 0x0 <repeats 31 times>}},
>   writefds = {__fds_bits = {0x1000, 0x0 <repeats 31 times>}}, exceptfds = {
>     __fds_bits = {0x0 <repeats 32 times>}},
> 
> And call select with timeout = NULL (since libusb_get_next_timeout returned
> 0)

Should work, but it might be that the second poll, when you try to process the 
events, don't work like expected. After any event on the two fd's you should 
call "libusb_handle_events_locked()" using a "tv = NULL".

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007231921.45803.hselasky>