
Description | Cautions | Example | Errors | See Also
Name: |
int dx_getparm(dev,parm,valuep) | |
Inputs: |
int dev |
|
unsigned long parm |
| |
void *valuep |
| |
Returns: |
0 if success | |
-1 if failure | ||
Includes: |
srllib.h | |
dxxxlib.h | ||
Category: |
Configuration | |
The dx_getparm( ) function returns the current parameter settings for an open device. dx_getparm( ) can only obtain the value of one parameter at a time. The channel must be idle (i.e., no I/O function running) when calling dx_getparm( ).
The function parameters are defined as follows:
Parameter |
Description |
dev |
specifies the valid Dialogic device handle obtained when a board or channel was opened using dx_open( ). |
parm |
specifies the define for the parameter type whose value is to be returned in the variable pointed to by valuep. |
Board and channel parameter defines, defaults and descriptions are listed in Chapter 6. Voice Device Parameters. | |
valuep |
points to the variable where the value of the parameter specified in parm should be returned. |
| |
We highly recommend that you clear the variable the parameter value is returned to prior to calling dx_getparm( ), as illustrated in the example below. The variable whose address is passed to should be of a size sufficient to hold the value of the parameter. See the function description for more information.
#include <stdio.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <windows.h>
main()
{
int bddev;
unsigned short parmval;
/* open the board using dx_open( ). Obtain board device descriptor in
* bddev
*/
if ((bddev = dx_open("dxxxB1",NULL)) == -1) {
/* process error */
}
parmval = 0; /* CLEAR parmval */
/* get the number of channels on the board. DXBD_CHNUM is of type
* unsigned short as specified by the PM_SHORT define in the definition
* for DXBD_CHNUM in dxxxlib.h. The size of the variable parmval is
* sufficient to hold the value of DXBD_CHNUM.
*/
if (dx_getparm(bddev, DXBD_CHNUM, (void *)&parmval) == -1) {
/* process error */
}
printf("\nNumber of channels on board = %d",parmval);
.
.
}
If this function returns -1 to indicate failure, use ATDV_LASTERR( ) and ATDV_ERRMSGP( ) to retrieve one of the following error reasons:
|
EDX_BADPARM |
|
EDX_SYSTEM |
|
EDX_BUSY |
|
Click here to contact Dialogic Customer Engineering
Copyright 2002, Dialogic Corporation