Event Services

A VCOMM client can receive notifications when communications events occur or when the receive and transmit queues pass specified thresholds. To receive notifications for events, call the _VCOMM_EnableCommNotification service. To receive notifications when queue thresholds are reached, call the _VCOMM_SetReadCallback and _VCOMM_SetWriteCallback services. All three services register client-defined callback functions with the port driver. For information about the callback functions, see the description of the CommNotifyProc function.

You receive notifications for communications events only if the events are enabled. To enable events, call the _VCOMM_SetCommEventMask service; this service specifies the event mask and, optionally, the address of the event variable. The event mask is a 32-bit variable that specifies the combination of enabled events. The event variable is a 32-bit variable that specifies the enabled events that were detected; the port driver updates the event variable at interrupt time when events occur. To determine which enabled events have occurred, call the _VCOMM_GetCommEventMask service; this service retrieves the detected events and clears the corresponding bits in the event variable.

If a hardware handshaking signal causes a notification, the parameters for CommNotifyProc identify the signal that changed but not the current state of the signal. To determine the current state of the clear to send (CTS), data set ready (DSR), receive line signal detect (RLSD), and ring signals, call the _VCOMM_GetModemStatus service.

See Also

CommNotifyProc, _VCOMM_EnableCommNotification, _VCOMM_GetCommEventMask, _VCOMM_GetModemStatus, _VCOMM_SetCommEventMask, _VCOMM_SetReadCallback, _VCOMM_SetWriteCallback