11.4. Getting Communications Events

The communications functions provide a way to detect certain communications events, and these events can improve the responsiveness of your programs. We can improve on Listing 11.1 to some degree by using an event character.

The API is able to sense any of the following events:

EV_BREAKBreak was sent in the input
EV_CTSThe CTS line changed
EV_DSRThe DSR line changed
EV_ERRAn error was detected: CE_FRAME, CE_OVERRUN, and CE_RXPARITY are possible
EV_RINGThe modem sensed a ring
EV_RLSDThe DCD line changed
EV_RXCHARA character was received
EV_RXFLAGThe special event character (as indicated by the EvtChar field in the DCB) was received
EV_TXEMPTYThe last character of the last WriteFile operation was sent

The event most ...

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.