Your browser does not allow scripts
Please click here to view a static table of contents without scripts
FT_SetTimeouts
Return to Introduction  Previous page  Next page
This function sets the read and write timeouts for the device.

FT_STATUS
FT_SetTimeouts
(FT_HANDLE ftHandle, DWORD dwReadTimeout, DWORD dwWriteTimeout)




Parameters
ftHandle
Handle of the device.
dwReadTimeout
Read timeout in milliseconds.
dwWriteTimeout
Write timeout in milliseconds.




Return Value
FT_OK if successful, otherwise the return value is an FT error code.



Example
This sample shows how to set a read timeout of 5 seconds and a write timeout of 1 second.

FT_HANDLE ftHandle; 
FT_STATUS ftStatus;

ftStatus = FT_Open(0, &ftHandle);
if(ftStatus != FT_OK) {
   // FT_Open failed
   return;
}
ftStatus = FT_SetTimeouts(ftHandle,5000,1000);
if (ftStatus == FT_OK) {
    // FT_SetTimeouts OK
}
else {
    // FT_SetTimeouts failed
}

FT_Close(ftHandle);