On Tue, Jul 28, 2009 at 12:14 AM, Uwe
Bonnes<[email protected]> wrote:
>    Xiaofan> If libftdi switches to libusb 1.0 (it should be trival to
>    Xiaofan> switch to the synchronous API of libusb 1.0), then you can use
>    Xiaofan> this API function: libusb_get_configuration. You check if the
>    Xiaofan> configuration is valid (typically 1), then you can skip
>    Xiaofan> libusb_set_configuration(). If it is zero, then you call
>    Xiaofan> libusb_set_configuration().
>    Xiaofan> http://libusb.sourceforge.net/api-1.0/group__dev.html
>
>    Xiaofan> There are other advantages to switch to libusb 1.0 since it
>    Xiaofan> supports asynchronous transfer. Currently it is only working
>    Xiaofan> under Linux and Mac OS X.
>
>    Xiaofan> For libusb 0.1, there is no direct API function to do this.
>    Xiaofan> But you can probably do similar things.
>
> There is one disadvantage:
>
> There is libusb-0.1 for Win32, but no libusb-1 yet.
>
> For example my xc3sprog uses libusb-0.1 for Win32.

I know that. But libftdi is already using platform specific code
like the Linux sysfs for async mode. It can always choose
to use libusb 1.0 for Linux and Mac OS X; and libusb 0.1
for Windows and BSDs.

By the way, libusb-win32 0.1 does support async mode
with the following APIs (not well documented).

http://libusb-win32.svn.sourceforge.net/viewvc/libusb-win32/trunk/libusb/src/usb.h?view=markup
  375   int usb_isochronous_setup_async(usb_dev_handle *dev, void **context,
  376                                   unsigned char ep, int pktsize);
  377   int usb_bulk_setup_async(usb_dev_handle *dev, void **context,
  378                            unsigned char ep);
  379   int usb_interrupt_setup_async(usb_dev_handle *dev, void **context,
  380                                 unsigned char ep);
  381
  382   int usb_submit_async(void *context, char *bytes, int size);
  383   int usb_reap_async(void *context, int timeout);
  384   int usb_reap_async_nocancel(void *context, int timeout);
  385   int usb_cancel_async(void *context);
  386   int usb_free_async(void **context);

-- 
Xiaofan http://mcuee.blogspot.com

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to [email protected]

Reply via email to