Skip to content

Search for DTBs fails if other FTDI devices are present #454

@BranislavRistic

Description

@BranislavRistic

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)

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:

enumCount = enumPos = 0;

enumCount = enumPos = 0;

enumCount = enumPos = 0;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions