Your browser does not allow scripts
Please click here to view a static table of contents without scripts
FT_W32_PurgeComm
Return to Introduction  Previous page  Next page
This function purges the device.

BOOL
FT_W32_PurgeComm
(FT_HANDLE ftHandle, DWORD dwFlags)




Parameters
ftHandle
Handle of the device.
dwFlags
Specifies the action to take. The action can be a combination of the following:
PURGE_TXABORT  
Terminate outstanding overlapped writes  
PURGE_RXABORT  
Terminate outstanding overlapped reads  
PURGE_TXCLEAR  
Clear the transmit buffer  
PURGE_RXCLEAR  
Clear the receive buffer  




Return Value
If the function is successful, the return value is nonzero.
If the function is unsuccessful, the return value is zero.

Example
This example shows how to purge the receive and transmit queues.

FT_HANDLE ftHandle; // setup by FT_W32_CreateFile

if (FT_W32_PurgeComm(ftHandle,PURGE_TXCLEAR|PURGE_RXCLEAR))
  ; // FT_W32_PurgeComm OK
else
  ; // FT_W32_PurgeComm failed