
Description | Cautions | Example | Errors | See Also
Name: |
int dcb_getbrdparm(devh,param,valuep) | |
Inputs: |
int devh unsigned char param void * valuep |
|
Returns: |
0 on success -1 on failure | |
Includes: |
srllib.h dtilib.h msilib.h | |
Category: |
Configuration | |
Mode: |
synchronous | |
The dcb_getbrdparm( ) function retrieves a DCB/SC board parameter value. Each parameter has a symbolic name that is defined in dcblib.h. The parameters are explained in the dcb_setbrdparm( ) function description.
Parameter |
Description |
devh: |
The valid board device handle returned by a call to dcb_open( ). |
param: |
The parameter to be examined. |
valuep: |
Pointer to the integer or DCB_VOL structure for storage of the parameter value. |
The valid values for param and valuep are shown below:
Parameter |
Description |
MSG_ACTID |
Indicates Active Talker feature status. Possible values are ACTID_ON or ACTID_OFF. ACTID_OFF is the default. |
MSG_VOLDIG |
Defines the volume control status and volume up/down/reset digits. |
The following structure contains the volume control status and digits:
typedef struct DCB_VOL{
unsigned char vol_control;
unsigned char vol_up;
unsigned char vol_reset;
unsigned char vol_down;
}DCB_VOL;
The digits for volume control are not received by the application. The vol_control field indicates whether the volume control is turned on or off. The vol_up field indicates the digit used for increasing the volume level. vol_down indicates the digit used for decreasing the volume. vol_reset indicates the digit used to set the volume to its default level. By default, vol_control is OFF.
#include <windows.h>
#include <stdio.h>
#include "srllib.h"
#include "dtilib.h"
#include "msilib.h"
#include "dcblib.h"
#include "errno.h"
main()
{
int brddevh; /* Board dev descriptor variables */
int actid_status; /* Active talker status (ON/OFF) */
DCB_VOL volume; /* Volume control structure */
/* Open DCB board 1 */
if ((brddevh = dcb_open("dcbB1",0)) == -1) {
printf( "Cannot open dcbB1: errno = %d\n", errno);
exit(1);
}
/* Retrieve Status (ON/OFF) of the Active Talker Feature */
if (dcb_getbrdparm(brddevh, MSG_ACTID, (void *)&actid_status) == -1) {
printf("Error getting board param:0x%x\n ", ATDV_LASTERR(brddevh));
exit(1);
}
printf("Active talker identification is %s\n", (actid_status ? "ON" : "OFF"));
/* Retrieve Information on Volume Control Feature */
if (dcb_getbrdparm(brddevh, MSG_VOLDIG,(void *)&volume) == -1) {
printf("Error getting volume control parameters : 0x%x\n ",
ATDV_LASTERR(brddevh));
exit(1);
}
printf("Volume Control is %s\n", (volume.vol_control ? "ON" : "OFF"));
printf("The Up Digit is %d\n", volume.vol_up);
printf("The Reset Digit is %d\n", volume.vol_reset);
printf("And the Down Digit is %d\n", volume.vol_down);
/* Continue processing */
if (dcb_close(brddevh)== -1){
printf("Cannot close dcbB1. errno = %d\n", errno);
exit(1);
}
}
If the function does not complete successfully, it will return -1 to indicate an error. Use the Standard Attribute functions ATDV_LASTERR( ) to obtain the applicable error value, or ATDV_ERRMSGP( ) to obtain a more descriptive error message.
Refer to the error type tables found in Chapter 2 of this guide. Error defines can be found in dtilib.h, msilib.h or dcblib.h.
Click here to contact Dialogic Customer Engineering
Copyright 2000, Dialogic Corporation