PREV TOC HOME INDEX NEXT


ipm_SetQoSThreshold( )


Termination Events | Cautions | Errors | Example | See Also

Name: int ipm_SetQoSThreshold(nDeviceHandle, *pInfo, usMode)
Inputs:

int nDeviceHandle

  • IP Media device handle

IPM_QOS_THRESHOLD_INFO *pQoSThresholdInfo

  • pointer to QoS alarm threshold 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, IPT, HMP

Description

The ipm_SetQoSThreshold( ) function changes QoS alarm threshold settings. Quality of Service (QoS) alarms report the status of a media channel, they do not report board-level alarms. Use this function to set the trigger levels for QoS alarms. This function can be called at any time, including when a session is in progress.

If mode is EV_SYNC, the function returns 0 if successful; otherwise -1 is returned. The current QoS alarm identifier's settings are returned via the pointer to IPM_QOS_THRESHOLD_INFO.

Parameter

Description

nDeviceHandle handle of the IP Media device
pQoSThresholdInfo pointer to IPM_QOS_THRESHOLD_INFO structure which contains one or more IPM_QOS_THRESHOLD_DATA structures
usMode operation mode. Set to EV_ASYNC for asynchronous execution or to EV_SYNC for synchronous execution.

Termination Events

IPMEV_SET_QOS_THRESHOLD_INFO
indicates successful completion, that is, alarm QoS threshold levels were modified. Use SRL functions to retrieve IPM_QOS_THRESHOLD_INFO 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_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;
    IPM_QOS_THRESHOLD_INFO mySetQosThresholdInfo;
    // Register event handler function with srl
    sr_enbhdlr( EV_ANYDEV ,EV_ANYEVT ,(HDLR)CheckEvent);
    /*
    .
    .
    Main Processing
    .
    .
    .
    */
    /*
    Change two alarm threshold settings for IP device handle, nDeviceHandle.
    ASSUMPTION: A valid nDeviceHandle was obtained from prior call to ipm_Open().
    */
    mySetQosThresholdInfo.unCount = 2;
    mySetQosThresholdInfo.QoSThresholdData[0].eQoSType = QOSTYPE_LOSTPACKETS;
    mySetQosThresholdInfo.QoSThresholdData[0].unTimeInterval = 10;
    mySetQosThresholdInfo.QoSThresholdData[0].unDebounceOn = 100;
    mySetQosThresholdInfo.QoSThresholdData[0].unDebounceOff = 100;
    mySetQosThresholdInfo.QoSThresholdData[0].unFaultThreshold = 20;
    mySetQosThresholdInfo.QoSThresholdData[0].unPercentSuccessThreshold = 60;
    mySetQosThresholdInfo.QoSThresholdData[0].unPercentFailThreshold = 40;
    mySetQosThresholdInfo.QoSThresholdData[1].eQoSType = QOSTYPE_JITTER;
    mySetQosThresholdInfo.QoSThresholdData[1].unTimeInterval = 50;
    mySetQosThresholdInfo.QoSThresholdData[1].unDebounceOn = 200;
    mySetQosThresholdInfo.QoSThresholdData[1].unDebounceOff = 600;
    mySetQosThresholdInfo.QoSThresholdData[1].unFaultThreshold = 60;
    mySetQosThresholdInfo.QoSThresholdData[1].unPercentSuccessThreshold = 60;
    mySetQosThresholdInfo.QoSThresholdData[1].unPercentFailThreshold = 40;
    if(ipm_SetQoSThreshold(nDeviceHandle, &mySetQosThresholdInfo, EV_ASYNC) == -1)
    {
        printf("ipm_SetQoSThreshold failed for device name = %s with error = %d\n",
            ATDV_NAMEP(nDeviceHandle), ATDV_LASTERR(nDeviceHandle));
            /*
            .
            .
            Perform Error Processing
            .
            .
        */
    }
    /*
    .
    .
    . continue
    .
    */
} 
void CheckEvent()
{
    //Get event type and associated data
    int nEventType = sr_getevttype();
    int nDeviceID = sr_getevtdev();
    switch(nEventType)
    {
    /*
    .
    . Other events
    .
        */
        /* Expected reply to ipm_SetQoSThreshold */
    case IPMEV_SET_QOS_THRESHOLD_INFO:
        printf("Received IPMEV_SET_QOS_THRESHOLD_INFO for device = %s\n",
            ATDV_NAMEP(nDeviceID));
        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