C++ API: Add support to open devices with missing product / serial strings
authorMatthias Janke <janke@physi.uni-heidelberg.de>
Thu, 13 Jul 2017 16:10:44 +0000 (18:10 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Thu, 20 Jul 2017 15:51:24 +0000 (17:51 +0200)
commit5a7f320ddb926d0919ebfac20a9fc4a327dfc762
treecc9065dd3868a4170275fd5a0bfb970d45393b65
parent7c2a6851e1a7544504c58db0e9a21cd87c0bf117
C++ API: Add support to open devices with missing product / serial strings

The C++ API and C API differ in how they open a device. The C API only
considers the user supplied strings iVendor, iProduct and iSerial to open a device.

The C++ API behaves differently. After opening the device with specific supplied strings,
it tries to read all strings via get_strings_and_reopen().
This fails if one string like iSerial is not defined
in the descriptor. As such the whole open() operation fails
and the C++ API would only open devices with complete descriptors.

This commit fixes this behaviour, by extending the get_strings_and_reopen()
and get_strings() argument lists, to configure the strings to read.
ftdipp/ftdi.cpp
ftdipp/ftdi.hpp