On Sat, Aug 8, 2020 at 4:13 AM Tim Roberts <timr@probo.com> wrote:
On Aug 7, 2020, at 9:44 AM, Laszlo Papp <lpapp@kde.org> wrote:
>
> I am trying to use libusb in a simple polling main function, but it looks like the file descriptors are always getting POLLOUT in the revents member of the structure even if an incoming message is being triggered, i.e. for reading. Is this expected? Is there anything I am doing wrong?

That’s the way it works.  Timer timeouts and other special events fire as POLLIN, USB traffic is POLLOUT.  You need to be handling the USB events in order, so there’s no reason to have some bypass others.

Hi Tim,

Thank you so much for your prompt reply. So, as I understand, this is expected behavior even for an input bulk endpoint?

My confusion came from using poll earlier in serial port or ethernet (socket) context. We used to get POLLIN set by poll in the revents member when data was available for reading, not POLLOUT. So, usb works differently?
 

Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.



_______________________________________________
libusb-devel mailing list
libusb-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-devel