libftdi Archives

Subject: Re: ftdipp

From: Marek Vavruša <marek@xxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Tue, 7 Apr 2009 18:10:19 +0200
> 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

Attachment: signature.asc
Description: This is a digitally signed message part.

Current Thread