User`s guide

Dialogic
®
System Release 6.0 PCI for Windows
®
Release Update, Rev 62 — January 30, 2008 125
Dialogic Corporation
return -1;
}
if (!a_CDPVarParms)
{
/* Process the error */
return -1;
}
/* Support setting multiple CDP variables in a single gc_SetConfigData() function call */
for (index1 = 0; index1 < a_NumParms; index1 ++)
{
/* Find the {setID, parmID, valueType} of each CDP variable by its name: e.g.,
"CDP_ANI_ENABLED" in pdk_ar_r2_io.cdp */
t_result = QueryParmID(a_PDKProtocolID, a_CDPVarParms[index1].name, &t_SetID, &t_ParmID,
&t_ValType);
if (t_result)
{
/* Process the error */
gc_util_delete_parm_blk(t_pParmBlk);
return t_result;
}
if (t_SetID != PRSET_TSC_VARIABLE)
{
/* Not a CDP variable parameter */
gc_util_delete_parm_blk(t_pParmBlk);
return -1;
}
/* Insert new definition for CDP variable signals, dependent on the value data type */
switch (t_ValType)
{
case GC_VALUE_INT:
t_IntVal = *((int*)a_CDPVarParms[index1].valuep);
gc_util_insert_parm_val(&t_pParmBlk, t_SetID, t_ParmID, sizeof(int), t_IntVal);
printf("Set Integer Value:%d (0x%x) to parmID:0x%x",
t_IntVal, t_IntVal, t_ParmID);
break;
case GC_VALUE_STRING:
t_StrSize = strlen((char *)a_CDPVarParms[index1].valuep) + 1;
gc_util_insert_parm_ref(&t_pParmBlk, t_SetID, t_ParmID, t_StrSize, (char *)
a_CDPVarParms[index1].valuep);
printf("Set String Value:%s to parmID:0x%x",
(char *) a_CDPVarParms[index1].valuep, t_ParmID);
break;
case GC_VALUE_ULONG:
t_ULongVal = *((unsigned long *)a_CDPVarParms[index1].valuep);
gc_util_insert_parm_val(&t_pParmBlk, t_SetID, t_ParmID, sizeof(unsigned long),
t_ULongVal);
printf("Set Long Value:%d (0x%x) to parmID:0x%x",
t_ULongVal, t_ULongVal, t_ParmID);
break;
case GC_VALUE_UCHAR:
t_UCharVal = *((unsigned char *)a_CDPVarParms[index1].valuep);
gc_util_insert_parm_val(&t_pParmBlk, t_SetID, t_ParmID, sizeof(unsigned char),
t_UCharVal);
printf("Set Char Value:%d(0x%x) to parmID:0x%x",
t_UCharVal, t_UCharVal, t_ParmID);
break;
default:
/* Process the error here */
printf("!!!!Invalid value type for protocolID:%d to CDP variable(name:%s,
set_id:0x%x, parm_id:0x%x, valtype:%d)",
a_PDKProtocolID, a_CDPVarParms[index1].name, t_SetID, t_ParmID,
t_ValType);
gc_util_delete_parm_blk(t_pParmBlk);
return -1;
break;
}
}