Eric Pang wrote:
> I have an old app that uses libftdi which uses libusb-0.1. I need to
> upgrade my app so it receives an event when there is something to read
> on the usb device. To do that it seems that I need to upgrade my libftdi
> to use libusb-0.9.4 via the libusb-compat library, then in my app, I can
> call libusb_get_pollfds to get the libusb file descriptor and then call
> select() to wait for a message on the receive buffer.
No, you can't mix them in that way. But your question is kind of
redundant for 2 reasons:
1. Porting a libusb-0.1 app to the equivalent (synchronous) API in
libusb-1.0 is really easy. So, if you have libusb-0.1 code, you have
little excuse not to be using libusb-1.0.
2. libusb-0.1 is not an event-driven API, so is not appropriate for the
design you are trying to meet. You need to rethink and rework your
application anyway, it's not just a case of bolting on a function call
or two. I would recommend the libusb-1.0 asynchronous API to meet your