libftdi Archives

Subject: Re: [PATCH] Re: c++ wraper: open(vid,pid) fails for devices with a missing iManufacturer, iProduct or iSerial

From: Matthias Janke <matthias.janke@xxxxxxxxxxxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Fri, 21 Jul 2017 16:28:56 +0200
Hi Thomas, 

Am Thu, 20 Jul 2017 18:00:54 +0200
schrieb Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>:

> Hi Matthias,
> 
> On Thursday, 13 July 2017 18:53:25 CEST Matthias Janke wrote:
> > I've appended a more proper patch to fix this behaviour. It extends
> > the argument list of get_strings_and_reopen() and get_strings(). I
> > introduced default arguments to make this API-break backwards
> > compatible.  These could, maybe at a later stage, be removed.  Whats
> > not clear to me is how to deal with open(struct libusb_device *dev).
> > Should in here get_strings_and_reopen() not completely removed?  
> 
> patch has been applied, thanks! I've massaged the changelog
> a little and replaced tabs with spaces in two places.

Thanks. I think I've messed up the logic in one open function. (Fixed
in the appended patch).


> > While this patch tries to minimize the api breakage. I'd suggest to
> > join get_strings_and_reopen()  and get_strings() and to make them
> > private. as they are only useful for vendor(), product() and
> > serial() while we should save the used stings in the member
> > variables after successfully opening a device based on their
> > usage.  
> 
> let's postpone any change like that for the next release,
> I really like to get this release shipped.

Yup. This was meant as longer term goal. I generaly think after c++11
the wrapper should get an overhaul to get rid of the return codes and
use exceptions, as they dont interfere with runtime anymore. 

> If nobody complains, I'll do a v1.4rc2 next week
> and hopefully that will be the final version 1.4, too.
> 
> Cheers,
> Thomas 


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



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

Attachment: 0001-follow-up-on-c-open-fix.-fixes-logic-in-open-with-lo.patch
Description: Text Data

Current Thread