How to use file descriptor monitoring with FTDI D2XX direct drivers?

Hi,
I connected an FT4232H mini module to the USB host port of my mangOH Green board, and the kernel automatically created 4 extra tty devices (ttyUSB1, ttyUSB2, ttyUSB3 and ttyUSB4).

I managed to ‘unbind’ my ttyUSBx devices to unload the VCP driver, so, that my application can use the D2XX driver functionality.
My project .cdef file refers to libftd2xx.so.1.4.6 (ARM v5 soft-float) and my sources include ftd2xx.h.
I am able to use the FTDI API functions FT_Open(), FT_Read(), FT_Write(), … to create a serial communication channel via the FTDI chip device.

How can I use file descriptor monitoring and POLLIN/POLLOUT event handling for the serial communication on this type of FT_ devices ?
FT_Open() does not return a file descriptor, but, uses an FT_HANDLE.
Do I need to make a conversion between FT_HANDLE and File Descriptor?

Greetings,
annaertd

I think you better use the monitoring API (FT_W32_WaitCommEvent???) from FTDI if you already can use API functions FT_Open(), FT_Read(), FT_Write(), … to create a serial communication channel via the FTDI chip device.

I assumed the FT_W32_xxx functions are Windows only and not for Legato applications, or not?

What APIs do the libftd2xx.so.1.4.6 provide to you in linux?

I’ve included the ftd2xx header file.

ftd2xx.h (40.0 KB)

seems it is not inside “#ifdef _WIN32”