
Description | Cautions | Example | Errors
Name: |
int d42_getparm(devh, parmnum, parmvalp) | |
Inputs: |
int devh |
|
int parmnum |
| |
void *parmvalp |
| |
Returns: |
ED42_NOERROR |
|
Includes: |
D42LIB.H | |
Mode: |
synchronous | |
Supports: |
D/42-SL, D/42-SX, D/42-NS, D/42-NE2 | |
The d42_getparm( ) function retrieves a D/42-xx channel or board parameter and places it in the application buffer (parmvalp). Depending on the parameter retrieved, the data returned can be either a character string or an integer
Additional notes and a list of board and channel parameters that can be retrieved for parmnum (see Table 4 and Table 5) are provided under the d42_setparm( ) function.
Parameter |
Description |
devh: |
specifies the valid board device or channel device descriptor obtained by a call to dx_open( ) |
parmnum: |
specifies the define for the parameter type whose value is to be returned in the variable pointed to by parmvalp (see Table 4 and Table 5) |
parmvalp: |
pointer to the application variable that will receive the parameter value |
When retrieving a parameter, the application passes a pointer to a variable that will contain the actual parameter value. This variable should be treated as an unsigned integer for all parameters except D4BD_MSGACCESSON and D4BD_MSGACCESSOFF. Both D4BD_MSGACCESSON and D4BD_MSGACCESSOFF should be treated as ASCIIZ strings (char *). The application should cast the parmvalp parameter to a (void *) to avoid compiler warnings.
void main(void)
{
int devh;
int rc = 0;
unsigned int parmvalp;
/* Open Board Device */
if ( (devh = dx_open("dxxxB1",NULL))==-1)
{
printf("Error dx_open( )\n");
exit(-1);
} /* End dx_open */
if ( (ATD4_BDTYPE (devh)) == TYP_SX)
{
/* Get the Board Parameter To See if Speakerphone Mode is Enabled */
if ( (rc = d42_getparm(devh, D4BD_SPMODE, (void *)&parmval)) == -1)
{
printf("Error d42_getparm(D4BD_SPMODE)\n");
dx_close(devh);
exit(-1);
} /* End d42_setparm */
/* Check if Speakerphone is enabled */
if (parmval == 1)
{
printf("Speakerphone Mode is ENABLED");
}
else if (parmvalp == 0)
{
printf("Speakerphone Mode is DISABLED");
} /* End Check if Speakerphone is enabled */
} /* end ATD4_BDTYPE */
dx_close(devh);
} /* End main */
If this function returns -1 to indicate a failure, use ATDV_LASTERR( ) and ATDV_ERRMSGP( ) to retrieve one of the following (most common) errors. For a complete list of error codes and definitions, refer to Appendix C.
ED42_FWREQFAILURE |
Firmware error |
ED42_UNKNOWNBOARD |
Unknown D/42 board type |
ED42_BADPARM |
Invalid value for parameter |
ED42_BADDEVICE |
Invalid or wrong device handle |
ED42_INVALARG |
Invalid argument passed to function |
DXLIB_INVNRB |
Internal voice library error |
Click here to contact Dialogic Customer Engineering
Copyright 2000, Dialogic Corporation