DiMgslMonitorEvents


Prototype  
NTSTATUS DiMgslMonitorEvents( void *Handle,
                              ULONG EventMask,
                              PULONG Events );
Parameters  
Handle
handle to open port
EventMask
ULONG containing bit flags that indicate which events should cause the function to return:
 
MgslEvent_DsrActive (1)
MgslEvent_DsrInactive (1)
MgslEvent_CtsActive
MgslEvent_CtsInactive
MgslEvent_DcdActive
MgslEvent_DcdInactive
MgslEvent_RiActive (1)
MgslEvent_RiInactive (1)
MgslEvent_ExitHuntMode(2)
MgslEvent_IdleReceived (2)

Events
pointer to ULONG to hold returned event bit flags
Return Value  
STATUS_SUCCESS
one of the specified events already occurred
STATUS_INVALID_HANDLE
Handle is invalid
STATUS_INVALID_PARAMETER
Events is invalid.
STATUS_PENDING
waiting for event to occur

Monitor the port events as specified by EventMask. *Events is set to the state of ALL events at the time of the function call.

If one or more of the events specified in EventMask already exists, STATUS_SUCCESS is returned. Example: If MgslEvent_DcdActive is specified in EventMask and DCD is already active, ERROR_SUCCESS is returned with MgslEvent_DcdActive (and possibly other events) set in *Events.

If none of the specified events has already occurred, STATUS_PENDING is returned. When a specified event occurs, the API calls the EventReady callback with detected events and disables monitoring of all events.

Calling this function resets any currently monitored events to the new EventMask. Calling this function with EventMask set to zero disables the monitoring of all events.

MgslEvent_ExitHuntMode occurs when the receiver is enabled and a flag is received, causing the receiver to exit hunt mode. This is useful for detecting idling flags transmitted from the remote station. This event occurs on the first received flag and does not occur again until the receiver returns to hunt mode (after receiving an idle) and another flag is received.


MgslEvent_IdleReceived occurs when the receiver is enabled and encounters 15 consecutive ones (idle sequence) and the receiver is placed in hunt mode (looking for a flag). This event does not occur again until the receiver has received a flag (exit hunt mode) and another idle is received.


Previous Contents Next