-
Notifications
You must be signed in to change notification settings - Fork 47
Description
We are using DTBs together with FTDI based USB-RS232 cables. While the cables are attached to the ftdi_sio driver, which provides /dev/ttyUSB nodes, the DTBs are excluded in order to be accessible by the FTDI D2XX interface.
When pxar is searching for DTBs it traverses a list of devices found by the FTDI D2XX library (which includes all FTDI devices), it tries to also get the description for the USB cables which are claimed by the ftdi_sio driver and fails (FT_ListDevices returns 'FT_ERROR(2) device not found'). At that point the search is terminated prematurely (see line 84)
pxar/core/usb/USBInterface.libftd2xx.cc
Lines 81 to 86 in e17df08
| ftdiStatus = FT_ListDevices(reinterpret_cast<PVOID>(enumPos), name, FT_LIST_BY_INDEX); | |
| if (ftdiStatus != FT_OK) | |
| { | |
| enumCount = enumPos = 0; | |
| return false; | |
| } |
This means that depending on the order of the devices listed by the FTDI library, the DTBs will be found or not. Removing line 84 and incrementing enumPos like for the successful case mitigates this issue and works in our case.
Is there a reason to terminate the search when encountering an inaccessible device?
Same statements can be found here:
pxar/core/usb/USBInterface.libftd2xx.cc
Line 100 in e17df08
| enumCount = enumPos = 0; |
pxar/core/usb/USBInterface.libftdi.cc
Line 198 in e17df08
| enumCount = enumPos = 0; |
pxar/core/usb/USBInterface.libftdi.cc
Line 232 in e17df08
| enumCount = enumPos = 0; |