Waits for an event to occur for a specified communications device. The set of events that this function monitors is contained in the event mask associated with the device handle.
BOOLEAN WaitCommEvent( COMMHANDLE hComm, // handle to comm device LPDWORD lpEvtMask, // event type DWORD dwMilliseconds // timeout in milliseconds );
hComm 
lpEvtMask 
| Value | Description | 
|---|---|
| EV_BREAK | A break was detected on input. | 
| EV_CTS | The CTS (clear-to-send) signal changed state. | 
| EV_DSR | The DSR (data-set-ready) signal changed state. | 
| EV_ERR | A line-status error occurred. Line-status errors are CE_FRAME, CE_OVERRUN, and CE_RXPARITY. | 
| EV_RING | A ring indicator was detected. | 
| EV_RLSD | The RLSD (receive-line-signal-detect) signal changed state. | 
| EV_RXCHAR | A character was received and placed in the input buffer. | 
| EV_RXFLAG | The event character was received and placed in the input buffer. The event character is specified in the device's DCB structure, which is applied to a serial port by using SetCommState. | 
| EV_TXEMPTY | The last character in the output buffer was sent. | 
dwMilliseconds 
NO_WAIT | 
The thread does not wait. | 
WAIT_FOREVER | 
The thread waits for its request to be fully satisfied. | 
1-655349 | 
Calling thread goes to sleep for this many milliseconds, after which it awakes. 
 Note: The kernel converts milliseconds to high-level ticks  | 
0 (zero) 
E_DISCONNECTED 
E_PARAM 
E_TIME 
This function monitors a set of events for a specified communications resource. To set and query the current event mask of a communications resource, use SetCommMask and GetCommMask.
| Versions | Defined in | Include | Link to | 
|---|---|---|---|
| INtime 3.1 | intime/rt/include/comm.h | comm.h | comm.lib |