
Description | Cautions | Example | Errors | See Also
Name: |
||
Inputs: |
int devh |
|
int parmnum |
| |
void *parmvalp |
| |
Returns: |
0 |
|
Includes: |
D42LIB.H | |
Mode: |
synchronous | |
The d42_setparm( ) function sets a board or channel parameter. Depending on the parameter to be set, the value can be either a character string or an integer. The input board and channel parameter values for parmnum are listed in Table 2.
Parameter |
Description |
devh: |
specifies the valid board device or channel device descriptor obtained by a call to dx_open( ) |
parmnum: |
contains the parameter name to update |
parmvalp: |
application buffer containing the parameter value |
To set board parameters the following requirements must be met:
To set channel parameters the following requirements must be met:
This function returns a failure if:
When setting a parameter, the user passes a pointer to a variable containing the new parameter value. This variable should be treated as an unsigned integer for all parameters. The application should cast the parmvalp parameter to a (void *) to avoid compiler warnings.
Table 2. Board and Channel Parameters for d42_setparm( )
Board Parameters |
Description |
Enable Caller ID Values: 0 - disable (default) 1 - enable | |
Enable report reset Values: 0 - disable (default) 1 - enable | |
Channel Parameters |
Description |
Receive asynchronous channel Values: 0 - disable (default) 1 - enable |
void main(void)
{
int devh;
int rc = 0;
unsigned int parmvalp = 1;
/* 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_D/82M1)
{
/* Set the Board Parameter To Enable Calling/Caller Id */
if ( (rc = d42_setparm(devh, D4BD_CALLID, (void *)&parmvalp)) == -1)
{
printf("Error d42_setparm(D4BD_CALLID)\n");
dx_close(devh);
exit(-1);
} /* End d42_setparm */
} /* end ATD4_BDTYPE */
dx_close(devh);
} /* End main */
If this function returns -1 to indicate a failure, one of the following (most common) codes will be contained in dx_errno. For a complete list of error codes and definitions, refer to Appendix C.
ED42_BADDEVICE |
Invalid or wrong device handle |
ED42_UNSUPPORTED |
Function not supported on this board |
ED42_SYSTEM |
System level error |
ED42_INVALARG |
Invalid argument passed to function |
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation