cpp-wrapper: when using get-string-and-reopen method without having set up the usb...
authorPeter Schneider <pitpompej@arcor.de>
Tue, 10 Jan 2012 10:09:11 +0000 (11:09 +0100)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 16 Jan 2012 14:39:42 +0000 (15:39 +0100)
ftdipp/ftdi.cpp

index 5e45dce..f1c1cef 100644 (file)
@@ -316,6 +316,11 @@ int Context::get_strings()
 
 int Context::get_strings_and_reopen()
 {
+    if ( d->dev == 0 )
+    {
+        d->dev = libusb_get_device(d->ftdi->usb_dev);
+    }
+
     // Get device strings (closes device)
     int ret=get_strings();
     if (ret < 0)