SetCommEventMask

2.x

  UINT FAR* SetCommEventMask(idComDev, fuEvtMask)    
  int idComDev; /* device to enable, */  
  UINT fuEvtMask; /* events to enable, */  

The SetCommEventMask function enables events in the event word of the specified communications device.

Parameters

idComDev

Specifies the communications device to be enabled. The OpenComm function returns this value.

fuEvtMask

Specifies which events are to be enabled. This parameter can be any combination of the following values:

Value Meaning

EV_BREAK Set when a break is detected on input.
EV_CTS Set when the CTS (clear-to-send) signal changes state.
EV_CTSS Set to indicate the current state of the CTS signal.
EV_DSR Set when the DSR (data-set-ready) signal changes state.
EV_ERR Set when a line-status error occurs. Line-status errors are CE_FRAME, CE_OVERRUN, and CE_RXPARITY.
EV_PERR Set when a printer error is detected on a parallel device. Errors are CE_DNS, CE_IOE, CE_LOOP, and CE_PTO.
EV_RING Set to indicate the state of ring indicator during the last modem interrupt.
EV_RLSD Set when the RLSD (receive-line-signal-detect) signal changes state.
EV_RLSDS Set to indicate the current state of the RLSD signal.
EV_RXCHAR Set when any character is received and placed in the receiving queue.
EV_RXFLAG Set when the event character is received and placed in the receiving queue. The event character is specified in the device's control block.
EV_TXEMPTY Set when the last character in the transmission queue is sent.

Return Value

The return value is a pointer to the event word for the specified communications device, if the function is successful. Each bit in the event word specifies whether a given event has occurred. A bit is 1 if the event has occurred.

Comments

Only enabled events are recorded. The GetCommEventMask function retrieves and clears the event word.

See Also

GetCommEventMask, OpenComm