Hi Thomas, Am Thu, 20 Jul 2017 18:00:54 +0200 schrieb Thomas Jarosch <[email protected]>:
> 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 > [email protected] -- libftdi - see http://www.intra2net.com/en/developer/libftdi for details. To unsubscribe send a mail to [email protected]
>From 3d95983043194019eb2d7bb567cc01b2b295fe2e Mon Sep 17 00:00:00 2001 From: Matthias Janke <[email protected]> Date: Fri, 21 Jul 2017 16:10:15 +0200 Subject: [PATCH] follow-up on c++ open() fix. fixes logic in open() with long argument list. --- ftdipp/ftdi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ftdipp/ftdi.cpp b/ftdipp/ftdi.cpp index bdd85f5..7bf4ca6 100644 --- a/ftdipp/ftdi.cpp +++ b/ftdipp/ftdi.cpp @@ -106,7 +106,7 @@ int Context::open(int vendor, int product, const std::string& description, const if (ret < 0) return ret; - return get_strings_and_reopen(false,description.empty(),serial.empty()); + return get_strings_and_reopen(false,!description.empty(),!serial.empty()); } int Context::open(const std::string& description) -- 2.13.3
