
Description | Cautions | Example | Errors | See Also
Name: |
int dcb_setbrdparm(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_setbrdparm( ) function sets DCB/SC board device parameters.
Parameter |
Description |
devh: |
The valid board device handle returned by a call to dcb_open( ). |
param: |
The parameter whose value is to be altered. |
valuep: |
The address of the integer or DCB_VOL structure containing the values to be assigned to the parameter. |
Parameters are specified in the param field and may have the IDs and descriptions as shown below:
Active Talker Feature |
Active talker feature can be enabled or disabled by setting to ACTID_ON or ACTID_OFF. |
Volume Control Digits |
Defines the volume control status and volume digits. Possible values are UP, DOWN, and RESET digits. |
The parameters are disabled by default and must be enabled using the dcb_setbrdparm( ) function.
For MSG_ACTID, valuep points to an integer value. For MSG_VOLDIG, valuep points to an DCB_VOL structure defined as follows:
typedef struct dcb_vol{
unsigned char vol_control; /* Feature status ON/OFF */
unsigned char vol_up; /* Digit to increase volume */
unsigned char vol_reset; /* Digit to reset volume to default level */
unsigned char vol_down; /* Digit to decrease volume */
}DCB_VOL;
vol_control indicates whether the volume control is turned ON or OFF. vol_up indicates the digit used for increasing the volume level. vol_down indicates the digit used for decreasing the volume, and vol_reset indicates the digit used to reset the volume level to the default.
#include <windows.h>
#include <stdio.h>
#include "srllib.h"
#include "dtilib.h"
#include "msilib.h"
#include "dcblib.h"
#include "errno.h"
main()
{
int bddevh; /* Board dev descriptor variables */
int valuep = ACTID_ON;
DCB_VOL volume; /* Volume control */
/* open DCB board 1 */
if ( (bddevh = dcb_open("dcbB1", 0)) == -1) {
printf("Cannot open device dcbB1. errno = %d\n", errno);
exit(1);
}
/* Enable Active talker feature */
if (dcb_setbrdparm(devh, MSG_ACTID, &valuep) == -1) {
printf("Error setting board param:0x%x\n ",ATDV_LASTERR(devh));
exit(1);
}
volume.vol_control = ON;
volume.vol_up = 2;
volume.vol_reset= 5;
volume.vol_down = 8;
if (dcb_setbrdparm(devh, MSG_VOLDIG,(void *)&volume) == -1) {
printf("Error getting board param:0x%x\n ", ATDV_LASTERR(devh));
exit(1);
}
/*
* Continue processing
*/
/* Done processing - Close device */
if ( dcb_close(bddevh) == -1) {
printf("Cannot close device 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