libftdi Archives

Subject: Re: Any reason to call usb_set_configuration()

From: Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Cc: Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>, "Richard A. Smith" <richard@xxxxxxxxxx>
Date: Mon, 27 Jul 2009 18:14:04 +0200
>>>>> "Xiaofan" == Xiaofan Chen <xiaofanc@xxxxxxxxx> writes:

    Xiaofan> On Mon, Jul 27, 2009 at 5:47 PM, Uwe
    Xiaofan> Bonnes<bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
    >> Is there perhaps an API to find out if setting the configuration is
    >> needed?
    >> 
    >> Perhaps we can make the code dependant on that?
    >> 

    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.

Bye
-- 
Uwe Bonnes                bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread