libftdi Archives

Subject: Re: Use libusb 1.0

From: Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Mon, 10 Aug 2009 09:37:44 +0200
Hello Jie,

On Sunday, 9. August 2009 16:44:54 Jie Zhang wrote:
> I have almost done the coding. Before sending out the patch, I need to
> know what's the best way to deal with libusb 0.1.
>
> Should we still keep support for libusb 0.1 because libusb 1.0 is not
> supported on Windows?

Thanks for your coding effort, it's highly appreciated!
We should try to keep libusb 0.1 support.

> If so, which is the best way to do it?
>
> 1. Add a lot of #if...#else...#endif in source code. There will be too
> many such cases. The code will look very ugly.

Yes, too ugly :-)

> 2. Use new files for libusb 1.0, such as ftdi.c for libusb 0.1 and
> ftdi-new.c for libusb 1.0. We can use some #if...#else...#endif in
> ftdi.h. There would be much code duplications between these two files.
>
> 3. Use a branch for libusb 0.1. This way the code will be kept clean. I
> prefer this way. We can roll out a last release which support libusb 0.1
> API and in future we will not support libusb 0.1 in new releases. If
> people want to use libftdi with libusb 0.1, they can use that release.

Would it be possible to move the libusb interface into an abstraction layer?
Most libftdi functions are using usb_control_msg(),
so only a few functions need "specialization".

Cheers,
Thomas


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

Current Thread