
Description | Cautions | Example | Errors | See Also
Name: |
long ATDT_BDMODE(devh) | |
Inputs: |
int devh |
|
Returns: |
signaling mode of all Digital Network Interface time slots | |
Includes: |
srllib.h | |
Category: |
Extended Attribute | |
Mode: |
synchronous | |
The ATDT_BDMODE( ) function returns the current mode of every time slot on the specified Digital Network Interface device.
Parameter |
Description |
devh: |
Specifies the valid Digital Network Interface logical board device handle returned by a call to dt_open( ) |
For T-1 applications, the mode is returned as a long integer where bits 0 to 23 represent the mode of Digital Network Interface time slots 1 to 24.
For E-1 applications, the mode is returned as a long integer where bits 0 to 29 represent the mode of Digital Network Interface time slots 1 to 30.
The following signaling mode defines are provided in dtilib.h:
To determine the mode of a time slot, compare the returned value with the provided defines.
#include <windows.h> /* For Windows applications only */
#include <srllib.h>
#include <dtilib.h>
#include <errno.h>
main()
{
int devh; /* Board device handle */
long modebits; /* Mode of all time slots */
int i; /* Loop counter */
/*
* Open board 1 device
*/
if ( ( devh = dt_open( "dtiB1", 0 ) ) == -1 ) {
printf( "Cannot open board dtiB1. errno = %d", errno );
exit( 1 );
}
/*
* Get the signaling mode of all E-1 time slots (1 to 30)
*/
if ( ( modebits = ATDT_BDMODE( devh ) ) == AT_FAILURE ) {
printf( "Error message = %s.",ATDV_ERRMSGP( devh ) );
exit( 1 );
}
/*
* Display it
*/
for ( i = 0; i < 30; i++ ) {
switch( ( modebits >> i ) & 1 ) {
case DTM_TRANSP:
printf( "Time slot %d on board 1 is in transparent mode\n", i + 1 );
break;
case DTM_SIGINS:
printf( "Time slot %d on board 1 is in insertion mode\n", i + 1 );
break;
}
}
.
.
}
If the function returns AT_FAILURE, use the SRL Standard Attribute function ATDV_LASTERR( ) to obtain the error code or use ATDV_ERRMSGP( ) to obtain a descriptive error message. See Appendix A - Standard Runtime Library for more information on SRL functions. The error codes returned by ATDV_LASTERR( ) are:
Error defines can be found in the file dtilib.h.
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation