From d3af9b2c485fc05df1f89285d0bf2e4d88ddfd38 Mon Sep 17 00:00:00 2001 From: Peter Schneider Date: Tue, 10 Jan 2012 11:09:11 +0100 Subject: [PATCH] cpp-wrapper: when using get-string-and-reopen method without having set up the usb-device the currently opened usb-device is retreived from the usb-device-handle used in the ftdi context. this fixes the open methods of the cpp wrapper that do not get an usb-device by parameter. --- ftdipp/ftdi.cpp | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/ftdipp/ftdi.cpp b/ftdipp/ftdi.cpp index 5e45dce..f1c1cef 100644 --- a/ftdipp/ftdi.cpp +++ b/ftdipp/ftdi.cpp @@ -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) -- 1.7.1