From: Peter Schneider Date: Tue, 10 Jan 2012 10:09:11 +0000 (+0100) Subject: cpp-wrapper: when using get-string-and-reopen method without having set up the usb... X-Git-Tag: v1.0rc1~45 X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=commitdiff_plain;h=d3af9b2c485fc05df1f89285d0bf2e4d88ddfd38 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. --- 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)