(FT_HANDLE ftHandle, LPFTTIMEOUTS lpftTimeouts)
Handle of the device.
Pointer to an FTTIMEOUTS structure to store timeout information.
If the function is successful, the return value is nonzero.
If the function is unsuccessful, the return value is zero.
Timeouts are calculated using the information in the FTTIMEOUTS structure.
For read requests, the number of bytes to be read is multiplied by the total timeout multiplier, and added to the total timeout constant. So, if TS is an FTTIMEOUTS structure and the number of bytes to read is dwToRead, the read timeout, rdTO, is calculated as follows.
rdTO = (dwToRead * TS.ReadTotalTimeoutMultiplier) + TS.ReadTotalTimeoutConstant
For write requests, the number of bytes to be written is multiplied by the total timeout multiplier, and added to the total timeout constant. So, if TS is an FTTIMEOUTS structure and the number of bytes to write is dwToWrite, the write timeout, wrTO, is calculated as follows.
wrTO = (dwToWrite * TS.WriteTotalTimeoutMultiplier) + TS.WriteTotalTimeoutConstant
Linux ignores the ReadIntervalTimeout, ReadTotalTimeoutMultiplier and WriteTotalTimeoutMultiplier currently.
This example shows how to setup a read timeout of 100 milliseconds and a write timeout of 200 milliseconds.
FT_HANDLE ftHandle; // setup by FT_W32_CreateFile
ftTS.ReadIntervalTimeout = 0;
ftTS.ReadTotalTimeoutMultiplier = 0;
ftTS.ReadTotalTimeoutConstant = 100;
ftTS.WriteTotalTimeoutMultiplier = 0;
ftTS.WriteTotalTimeoutConstant = 200;
; // FT_W32_SetCommTimeouts OK
; // FT_W32_SetCommTimeouts failed