Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This function retrieves the event mask value for a specified communication device.
Syntax
BOOL GetCommMask( HANDLE hFile, LPDWORD lpEvtMask ); |
Parameters
- hFile
-
[in] Handle to the communication device, returned by the CreateFilefunction.
- lpEvtMask
-
[out] Long pointer to the 32-bit variable to be filled with a mask of events currently enabled. The following table shows possible values.
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 DCBstructure, which is applied to a serial port by using the SetCommStatefunction.
EV_TXEMPTY
The last character in the output buffer was sent.
Return Value
Nonzero indicates success. Zero indicates failure. To obtain extended error data, call the GetLastErrorfunction.
Remarks
The GetCommMaskfunction uses a 32-bit mask variable to indicate the set of events that can be monitored for a particular communication resource.
A handle to the communication resource can be specified in a call to the WaitCommEventfunction, which waits for an event to occur.
To modify the event mask of a communication resource, use the SetCommMaskfunction.
Requirements
Header | winbase.h |
Library | Serdev.lib |
Windows Embedded CE | Windows CE 1.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |
See Also
Reference
Serial Communications FunctionsSetCommMask
SetCommState
WaitCommEvent
DCB