PREV TOC HOME INDEX NEXT


ipm_GetQoSAlarmStatus( )


Termination Events | Cautions | Errors | Example | See Also

Name: int ipm_GetQoSAlarmStatus(nDeviceHandle, *pQoSAlarmInfo, usMode)
Inputs:

int nDeviceHandle

  • IP Media device handle

IPM_QOS_ALARM_STATUS *pQoSAlarmInfo

  • pointer to QoS alarm status structure

unsigned short usMode

  • async or sync mode setting
Returns:

0 on success

-1 on failure

Includes:

srllib.h

ipmlib.h

Category:

QoS

Mode:

asynchronous or synchronous

Platform:

DM/IP, HMP

Description

The ipm_GetQoSAlarmStatus( ) function retrieves the ON/OFF state of all QoS alarms enumerated in eIPM_QOS_TYPE. Quality of Service (QoS) alarms report the status of a media channel, they do not report board-level alarms.

Note: This function is not supported on Intel® NetStructure™ IPT Series boards.

Use ipm_ResetQoSAlarmStatus( ) to reset the QoS alarm state.

Parameter

Description

nDeviceHandle handle of the IP Media device
pQoSAlarmInfo pointer to structure that contains alarm identifier and alarm status values; see IPM_QOS_ALARM_STATUS for details.
usMode operation mode. Set to EV_ASYNC for asynchronous execution or to EV_SYNC for synchronous execution.

Termination Events

IPMEV_GET_QOS_ALARM_STATUS
indicates successful completion, that is, alarm status information was filled in. Use SRL functions to retrieve IPM_QOS_ALARM_STATUS structure fields.
IPMEV_ERROR
indicates the function failed.

Cautions

The function returns the status of all QoS alarms that are enumerated in eIPM_QOS_TYPE.

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_INTERNAL
Internal error
EIPM_INV_MODE
Invalid mode
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
    .
    .
    .
    */
    /*
    Query the alarm status for IP device handle, nDeviceHandle.
    ASSUMPTION: A valid nDeviceHandle was obtained from prior call to ipm_Open().
    */
    if(ipm_GetQoSAlarmStatus(nDeviceHandle, NULL, EV_ASYNC) == -1)
    {
        printf("ipm_GetQoSAlarmStatus failed for device name %s with error = %d\n",
            ATDV_NAMEP(nDeviceHandle), ATDV_LASTERR(nDeviceHandle));
        /*
        .
        .
        Perform Error Processing
        .
        .
        */
    } 
    /*
    .
    .
    . continue
    .
    */
} 
void CheckEvent()
{
    unsigned int i;
    int nEventType = sr_getevttype();
    int nDeviceID = sr_getevtdev();
    void* pVoid = sr_getevtdatap();
    IPM_QOS_ALARM_STATUS* pAlarmStatus;
    switch(nEventType)
    {
        /*
        .
        . Other events
        .
        */
        /* Expected reply to ipm_GetQoSAlarmStatus */
        case IPMEV_GET_QOS_ALARM_STATUS:
            pAlarmStatus = (IPM_QOS_ALARM_STATUS*)pVoid;
            printf("Received IPMEV_GET_QOS_ALARM_STATUS for device = %s\n",
                ATDV_NAMEP(nDeviceID));
            for(i=0; i < pAlarmStatus->unAlarmCount; ++i)
            {
                switch(pAlarmStatus->QoSData[i].eQoSType)
                {
                    case QOSTYPE_DTMFDISCARDED:
                        printf(" DTMFDISCARDED = %d\n",pAlarmStatus->QoSData[i].eAlarmState);
                        break;
                    case QOSTYPE_LOSTPACKETS:
                        printf(" LOSTPACKETS = %d\n",pAlarmStatus->QoSData[i].eAlarmState);
                        break;
                    case QOSTYPE_JITTER:
                        printf(" JITTER = %d\n",pAlarmStatus->QoSData[i].eAlarmState);
                        break;
                }
            }
            break;
        default:
            printf("Received unknown event = %d for device = %s\n",
                nEventType, ATDV_NAMEP(nDeviceID));
            break;
    }
} 

See Also


PREV TOC HOME INDEX NEXT

Click here to contact Telecom Support Resources

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