11.8. Other Communications Functions

There are several other communications functions that you may find useful in special situations. The PurgeComm function, for example, purges the contents of the input or output buffer.

PurgeCommClears input or output buffers
BOOL PurgeComm(
   HANDLE commHandle,
   DWORD action)
 
commHandleHandle to a comm port
actionThe action(s) to perform
Returns TRUE on success 

Four actions are possible, one at a time or in combination with one another:

PURGE_TXABORTTerminate all write operations
PURGE_RXABORTTerminate all read operations
PURGE_TXCLEARClear output buffer
PURGE_RXCLEARClear input buffer

The FileFlushBuffers function, on the other hand, flushes the output buffer to the receiver, subject to normal flow-control ...

Get Win32 System Services: The Heart of Windows® 98 and Windows® 2000 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.