
Description | Cautions | Example | Errors | See Also
|
Name: |
int dcb_open(name,rfu) |
|
|
Inputs: |
char *name |
|
| int rfu | ||
|
Returns: |
device handle on success |
|
| -1 on failure | ||
|
Includes: |
srllib.h |
|
| dcblib.h | ||
| errno.h | ||
| dtilib.h | ||
| msilib.h | ||
|
Category: |
Device Management |
|
|
Mode: |
synchronous |
|
The dcb_open( ) function opens a device and returns a unique handle to identify the device. The device may be a DCB/SC board or a DSP on the board. All subsequent references to the opened device must be made using the device handle.
Parameter |
Description |
name: |
Points to an ASCIIZ string that contains the name of a valid DCB/SC DSP device or board device. |
rfu: |
Reserved for future use. Set this parameter to 0. |
Valid device names are listed below, where x specifies the board number.
Board |
Valid Device Names |
Description |
DCB/320SC |
dcbBxD1 |
DSP1 device handle |
DCB/640SC |
dcbBx |
Board device handle |
DCB/960SC |
dcbBx |
Board device handle |
This function fails when:
#include <windows.h>
#include <stdio.h>
#include "srllib.h"
#include "dtilib.h"
#include "msilib.h"
#include "dcblib.h"
#include "errno.h"
main()
{
int bddevh;
/* open board 1*/
if ((bddevh = dcb_open("dcbB1", 0)) == -1) {
printf("Cannot open device dcbB1. errno = %d\n", errno);
exit(1);
}
else
printf("Board %s is OPEN\n", ATDV_NAMEP(bddevh));
/* Done processing - Close device */
if (dcb_close(bddevh) == -1) {
printf("Cannot close dcbB1 : errno = %d\n", errno);
exit(1);
}
}
The dcb_open( ) function does not return errors in the standard return code format. If an error occurred during the dcb_open( ) call, a -1 will be returned, and the specific error number will be returned in the errno global variable. If a call to dcb_open( ) is successful, the return value will be a handle for the opened device.
Click here to contact Dialogic Customer Engineering
Copyright 2000, Dialogic Corporation