Hello and a happy new year,

as I wrote about a year ago there is a bug in the cpp wrapper of the libftdi 
that prevents the three open methods, that does not get the usb-device as 
parameter, from working properly and keeping the connection opened. 
The patch added to this mail solves this bug only with a minor change in the 
corresponding open functions in the cpp wrapper.
The patch attached is dedicated to libftdi0.19 but the same problem should be 
fixed within the cpp wrapper of libftdi1.

Bye

pit

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to [email protected]   
>From 4ebc2eaead0fdfebed0110987de367a0a76160d2 Mon Sep 17 00:00:00 2001
From: Peter Schneider <[email protected]>
Date: Tue, 3 Jan 2012 10:44:55 +0100
Subject: [PATCH] Fixes the three open methods of the cpp wrapper that do not
 get an usb-device parameter as they have never really
 worked yet.

---
 ftdipp/ftdi.cpp |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/ftdipp/ftdi.cpp b/ftdipp/ftdi.cpp
index 8511a91..5868405 100644
--- a/ftdipp/ftdi.cpp
+++ b/ftdipp/ftdi.cpp
@@ -85,6 +85,8 @@ int Context::open(int vendor, int product)
     if (ret < 0)
        return ret;
 
+    d->dev = usb_device(d->ftdi->usb_dev);
+
     return get_strings_and_reopen();
 }
 
@@ -104,6 +106,8 @@ int Context::open(int vendor, int product, const std::string& description, const
     if (ret < 0)
        return ret;
 
+    d->dev = usb_device(d->ftdi->usb_dev);
+
     return get_strings_and_reopen();
 }
 
@@ -114,6 +118,8 @@ int Context::open(const std::string& description)
     if (ret < 0)
        return ret;
 
+    d->dev = usb_device(d->ftdi->usb_dev);
+
     return get_strings_and_reopen();
 }
 
-- 
1.7.5.4

Reply via email to