libftdi Archives

Subject: RE: ftdipp

From: "Leahy, Chris M. (Xetron)" <Chris.Leahy@xxxxxxx>
To: <libftdi@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 10 Apr 2009 08:49:43 -0500
> > On Friday, 3. April 2009 18:48:47 Leahy, Chris M. (Xetron) wrote:
> > I've been working on a project that uses libftdi. Recently I decided

> > to try the ftdipp bindings and I had a few questions about them.
> > 
> > In Context::open(int vendor, ...) ftdi_usb_open or
ftdi_usb_open_desc 
> > is called, then ftdi_usb_open_dev is called. ftdi_usb_open_dev is 
> > called by both ftdi_usb_open and ftdi_usb_open_desc so is there any 
> > reason to call it twice?
> > 
> > In both versions of Context::open, get_strings is called after the 
> > device is opened. This seems to be a bug as the documentation for 
> > ftdi_usb_get_strings says that ftdi_usb_get_strings should only be 
> > used with ftdi_usb_find_all because it closes the internal "usb_dev"

> > after use.
> 
> Hello Chris,
> 
> it's been several months, but I believe the second 
> ftdi_usb_open_dev() was supposed to be after 
> ftdi_usb_get_strings(). I'll check it as I get home and send patch.
> 
> As you also stated, ftdi_usb_get_strings() closes usb_dev, 
> which I think is undesirable side effect. How about closing 
> the device in ftdi_usb_find_all() loop instead?
> 
> Marek
> 

Having the ftdi_usb_open_dev() after ftdi_usb_get_strings() makes more
sense.
The usb_dev should be open after Context::open finishes in that case. Do
you
need to call ftdi_usb_get_strings() in Context::open?

Chris

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

Current Thread