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.
PurgeComm | Clears input or output buffers | |
BOOL PurgeComm( HANDLE commHandle, DWORD action) | ||
commHandle | Handle to a comm port | |
action | The action(s) to perform | |
Returns TRUE on success |
Four actions are possible, one at a time or in combination with one another:
PURGE_TXABORT | Terminate all write operations |
PURGE_RXABORT | Terminate all read operations |
PURGE_TXCLEAR | Clear output buffer |
PURGE_RXCLEAR | Clear 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.