Previous Page Table Of ContentsHome IndexNext Page


6.5.  Event Mechanism 

The IP Gateway (Global Call) demo uses the SRL mechanism to retrieve events. When an event occurs, SRL calls event handlers automatically. All events are received by the SRL and then passed to the callback_hdlr( ) function for handling.

In the initialization phase of the demo the gateInitialize( ) function sets up the call-back handler, by calling PDLsr_enbhdlr( ).

There is an endless loop {while(1)} in the main( ) function in the Gatemain.c file. In that loop, the application waits forever for a keyboard event by calling the waitForKey( ) function. The event must be handled immediately and event-specific information should be retrieved before the next call to waitForKey( ).

When the next event occurs or when a time-out is reached, the waitForKey( ) returns and the call-back handler function is called automatically.

When the R4/Global Call event is received, the callback_hdlr( ) function performs the following:

  1. Calls gc_GetMetaEvent( ) to get the event
  2. If the event is for a board, the application calls rasProcessEvent( ) to process it.
  3. Otherwise, the application calls gc_GetUsrAttr( ) and then calls either ipGetEvent( ) to process the IP event, or pstnGetEvent( ) to process the PSTN event.

Normal application exit events don't enter the SRL. The main( ) function calls PDLSetApplicationExitPath( ) before initialization. In Linux, this function sets the signals (SIGINT, SIGTERM, SIGABRT) for making the appropriate exit from the application. In Windows, this function enables the detection of CTRL_CLOSE_EVENT (closing the window).


Previous PageTable Of ContentsTop Of PageIndexNext Page

Click here to contact Telecom Support Resources

Copyright 2002, Intel Corporation
All rights reserved
This page generated October, 2002