PREV TOC HOME INDEX NEXT


ipm_GetXmitSlot( )


Termination Events | Cautions | Errors | Example | See Also

Name: int ipm_GetXmitSlot(nDeviceHandle, *pTimeslotInfo, usMode)
Inputs:

int nDeviceHandle

  • IP Media device handle

SC_TSINFO *pTimeslotInfo

  • pointer to time slot info structure

unsigned short usMode

  • async or sync mode setting
Returns:

0 on success

-1 on failure

Includes:

srllib.h

ipmlib.h

Category:

System Control

Mode:

asynchronous or synchronous

Platform:

DM/IP, IPT, HMP

Description

The ipm_GetXmitSlot( ) function returns TDM time slot information for an IP channel.

Parameter

Description

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

None.

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

None.


PREV TOC HOME INDEX NEXT

Click here to contact Telecom Support Resources

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