ipm_GetXmitSlot( )
Termination Events | Cautions | Errors | Example | See Also
Name: int ipm_GetXmitSlot(nDeviceHandle, *pTimeslotInfo, usMode) Inputs:
Returns: Includes: Category: Mode: Platform: Description
The ipm_GetXmitSlot( ) function returns TDM time slot information for an IP channel.
nDeviceHandle handle of the IP Media device pTimeslotInfo pointer to structure that describes the time slot number, time slot type, and bus encoding format; see SC_TSINFO for details. usMode operation mode. Set to EV_ASYNC for asynchronous execution or to EV_SYNC for synchronous execution. Termination Events
- IPMEV_GET_XMITTS_INFO
- indicates successful completion, that is, the TDM time slot information data structure was filled in. Use SRL functions to retrieve SC_TSINFO 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
- EIPM_INTERNAL
- Internal error
- EIPM_INV_STATE
- Invalid state. Initial command did not complete before another function call was made.
- EIPM_SYSTEM
- System 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 . . . */ /* Get the timeslot information for IP device handle, nDeviceHandle. ASSUMPTION: A valid nDeviceHandle was obtained from prior call to ipm_Open(). */ if(ipm_GetXmitSlot(nDeviceHandle, NULL, EV_ASYNC) == -1) { printf("ipm_GetXmitSlot failed for device name = %s with error = %d\n", ATDV_NAMEP(nDeviceHandle), ATDV_LASTERR(nDeviceHandle)); /* . . Perform Error Processing . . */ } /* . . . continue . */ } void CheckEvent() { int nEventType = sr_getevttype(); int nDeviceID = sr_getevtdev(); void* pVoid = sr_getevtdatap(); SC_TSINFO* pTimeSlotInfo; switch(nEventType) { /* . . Other events . */ /* Expected reply to ipm_GetXmitSlot */ case IPMEV_GET_XMITTS_INFO: pTimeSlotInfo = (SC_TSINFO*)pVoid; printf("Received IPMEV_GET_XMITTS_INFO for device = %s\n", ATDV_NAMEP(nDeviceID)); printf("Timeslot number %d\n", *(pTimeSlotInfo->sc_tsarrayp)); 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