
Description | Cautions | Example | Errors | See Also
Name: |
int dt_open(name,oflags) | |
Inputs: |
char *name |
|
int oflags |
| |
Returns: |
device handle if successful | |
Includes: |
srllib.h | |
Category: |
Resource Management | |
Mode: |
synchronous | |
The dt_open( ) function opens a Digital Network Interface device and returns a unique handle to identify the device. All subsequent references to the opened device must use the returned device handle.
All Digital Network Interface logical boards and time slot devices can be opened with this function. Opening a Digital Network Interface device does not alter the state of the device. Opening or closing a Digital Network Interface device does not affect other processes using the device but a command can only be issued while the device is idle.
Parameter |
Description |
name: |
Points to an ASCIIZ string that contains the name of a valid Digital Network Interface logical board or time slot device. The Digital Network Interface logical board device names are defined in the configuration file when the System Release Development Package is installed. Valid Digital Network Interface logical board and time slot device names are usually found in the /dev directory. |
To avoid conflict between the DTI/ driver and the generic driver, follow the guidelines below when defining devices in the configuration files: | |
The name of the D/xxxSC device defined in /usr/dialogic/cfg/.voxcfg may be in the form dtiBx, dtiBx, dtiBxTy, or dtiBxTy where: | |
| |
| |
| |
oflags: |
Reserved for future use. Set this parameter to 0. |
#include <windows.h> /* For Windows applications only */
#include <srllib.h>
#include <dtilib.h>
#include <errno.h>
main()
{
int devh; /* Board device handle */
/*
* Open board 1 device
*/
if ( ( devh = dt_open( "dtiB1", 0 ) ) == -1 ) {
printf( "Cannot open board dtiB1. errno = %d", errno );
exit( 1 );
}
.
.
.
}
The dt_open( ) function does not return errors in the standard Digital Network Interface return code format because it is a system error. If an error occurs during the dt_open( ) call, a -1 will be returned and the specific error message will be returned in the errno global variable. If a call to dt_open( ) is successful, the return value is a valid handle for the open device.
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation