gc_SetAlarmParm( )
Termination Events | Cautions | Errors | Example | See Also
Description
The gc_SetAlarmParm( ) function sets the data associated with the alarm parameter for one or more alarm number and parameter ID pairs. The alarm number and parameter set ID pairs are specified in ALARM_PARM_FIELD in the alarm_parm_list list.
The parameter set ID identifies a set of associated parameters as defined by the alarm source object (ASO). An example of one parameter set is the parameters that can be set by the dt_setparm( ) function. Another example of a parameter set is the parameters that are set by the dt_setalarm( ) function. Both functions are in the Springware DT library.
Examples of alarm parameters that can be set include timing parameters and maximum number of errors. Parameters can be set on either a line device basis or an ASO ID basis.
linedev Global Call line device handle aso_id alarm source object (ASO) ID. Use the gc_AlarmSourceObjectNameToID( ) function to obtain the ASO ID for the desired alarm source object. ALARM_SOURCE_ID_NETWORK_ID can be used if the network ASO ID is not known. ParmSetID identifies a set of associated parameters alarm_parm_list points to the alarm parameter list. See ALARM_PARM_LIST for a description of the fields in the ALARM_PARM_LIST data structure. mode set to EV_SYNC for synchronous mode (only synchronous mode is supported) Termination Events
Cautions
- The alarm parameters are alarm source object dependent. Detailed knowledge of the alarm source object is necessary in order to use these parameters properly.
- The exact usage of the ALARM_PARM_FIELD of alarm_parm_list is dependent upon (alarm source object, parameter set ID) pair.
- It is important that the Global Call API is able to call the alarm source object's underlying functions with the exact same syntax used by the functions. To ensure proper use of the alarm source object variables, see the appropriate documentation.
Errors
If this function returns <0 to indicate failure, use the gc_ErrorInfo( ) function to retrieve the reason for the error. See the "Error Handling" section in the Global Call API Programming Guide. All Global Call error codes are defined in the gcerr.h file. If the error returned is technology specific, see the technology-specific error header file(s) for the error definition (for example, ccerr.h or isdnerr.h file for the ISDN call control library).
Example
#include <stdio.h> #include <stdlib.h> #include <gclib.h> #include <gcerr.h> #include <dtilib.h> /* for ASO symbols */ int main(int argc, char **argc) { int rc; ALARM_PARM_LIST alarm_parm_list; /* perform application initialization */ /* assumes gc_Start() has already been successfully called */ /* init all to 0 */ memset(&alarm_parm_list, '\0', sizeof(ALARM_PARM_LIST)); /* set 1 parameter */ alarm_parm_list.n_parms = 1; /* set # of out of frame errors to allow before sending an alarm */ alarm_parm_list.alarm_parm_fields[0].alarm_parm_number.intvalue = DTG_OOFMAX; /* 3 is only used as an example and has no signficance */ alarm_parm_list.alarm_parm_fields[0].alarm_parm_data.intvalue = 3; /* Set for all of Springware T1 */ rc = gc_SetAlarmParm(0, ALARM_SOURCE_ID_SPRINGWARE_T1, ParmSetID_parm, &alarm_parm_list, EV_SYNC); if (rc < 0) { /* get and process the error */ } /* continue with the application */ }See Also
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation