ipm_GetParm( )
Termination Events | Cautions | Errors | Example | See Also
Name: int ipm_GetParm(nDeviceHandle, *pParmInfo, usMode) Inputs:
Returns: Includes: Category: Mode: Platform: Description
The ipm_GetParm( ) function retrieves the current value of a parameter.
To run this function asynchronously, set mode to EV_ASYNC. The function returns 0 if successful and the application must wait for the IPMEV_GETPARM event. Once the event has been returned, use SRL functions to retrieve parameter values.
To run this function synchronously, set mode to EV_SYNC. The function returns 0 if successful and the IPM_PARM_INFO structure fields will be filled in.
nDeviceHandle handle of the IP media device *pParmInfo pointer to structure that contains IP channel parameter values; see the IPM_PARM_INFO data structure page for details. usMode operation mode. Set to EV_ASYNC for asynchronous execution or to EV_SYNC for synchronous execution. Termination Events
- IPMEV_GET_PARM
- indicates successful completion, that is, the data structure IPM_PARM_INFO has been filled in. Use SRL functions to retrieve structure fields.
- IPMEV_ERROR
- indicates the function failed.
Cautions
Errors
If the function returns -1 to indicate failure, call ATDV_LASTERR( ) and ATDV_ERRMSGP( ) to return one of the following errors:
- EIPM_BADPARM
- Invalid parameter
- EIPM_FWERROR
- Firmware error
Example
#include <stdio.h> #include <srllib.h> #include <ipmlib.h> void CheckEvent(); typedef long int(*HDLR)(unsigned long); void main() { int nDeviceHandle; // Register event handler function with srl sr_enbhdlr( EV_ANYDEV ,EV_ANYEVT ,(HDLR)CheckEvent); /* . . Main Processing . . . */ /* ASSUMPTION: A valid nDeviceHandle was obtained from prior call to ipm_Open(). */ IPM_PARM_INFO ParmInfo; unsigned long ulParmValue = 0; ParmInfo.eParm = PARMCH_ECHOTAIL; ParmInfo.pvParmValue = &ulParmValue; if (ipm_GetParm(nDeviceHandle, &ParmInfo, EV_ASYNC)==-1) { printf("ipm_GetParm failed for device name %s with error = %d\n", ATDV_NAMEP(nDeviceHandle), ATDV_LASTERR(nDeviceHandle)); /* . . Perform Error Processing . . */ } ulParmValue = 0; ParmInfo.eParm = PARMCH_ECHOTAIL; if (ipm_GetParm(nDeviceHandle, &ParmInfo, EV_SYNC)==-1) { printf("%s: ipm_GetParm failed..exiting..!!!\n", ATDV_NAMEP(nDeviceHandle)); } else { printf("%s: ipm_GetParm(parm=0x%x,value=0x%x) ok %\n", ATDV_NAMEP(nDeviceHandle), ParmInfo.eParm, ulParmValue ); } /* . . . continue . */ } void CheckEvent() { int nEventType = sr_getevttype(); int nDeviceID = sr_getevtdev(); void* pVoid = sr_getevtdatap(); IPM_PARM_INFO* pParmInfo; switch(nEventType) { /* . . Other events . */ /* Expected reply to ipm_GetQoSAlarmStatus */ case IPMEV_GET_PARM: pParmInfo = (IPM_PARM_INFO*) pVoid; printf("Received IPMEV_GETPARM for device = %s\n", ATDV_NAMEP(nDeviceID)); printf("%s: parm=0x%x, ok %\n", ATDV_NAMEP(nDeviceID), pParmInfo->eParm); break; default: printf("Received unknown event = %d for device = %s\n", nEventType, ATDV_NAMEP(nDeviceID)); break; } }See Also
Click here to contact Telecom Support Resources
Copyright 2002, Intel Corporation