
Description | Cautions | Example | Errors | See Also
Name: |
char * ATDT_BDSGBIT(devh) | |
Inputs: |
int devh |
|
Returns: |
pointer to signaling bit states of all device time slots | |
Includes: |
srllib.h | |
Category: |
Extended Attribute | |
Mode: |
synchronous | |
The ATDT_BDSGBIT( ) function returns the current state of the transmit and receive bits for all time slots on the Digital Network Interface device specified in devh.
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 returned value is a pointer to a 24-byte buffer. Bytes 0 to 23 represent T-1 time slots 1 to 24.
For E-1 applications, the returned value is a pointer to a 30-byte buffer. Bytes 0 to 29 represent E-1 time slots 1 to 30.
The following symbols represent each signaling bit and are defined in dtilib.h:
To determine the state of the signaling bits, perform a logical AND operation on the byte buffer and the defines, as demonstrated in the example below.
#include <windows.h> /* For Windows applications only */
#include <srllib.h>
#include <dtilib.h>
#include <errno.h>
main()
{
int devh; /* Board device handle */
char *sigbits; /* Pointer to signaling bits array */
int i; /* Loop counter */
int arcv, brcv, axmt, bxmt; /* Bit mask values */
/*
* Open board 1 device
*/
if ( ( devh = dt_open( "dtiB1", 0 ) ) == -1 ) {
printf( "Cannot open board dtiB1. errno = %d", errno );
exit( 1 );
}
/*
* Get current transmit and receive signaling bits of all time slots
*/
if ( ( sigbits = ATDT_BDSGBIT( devh ) ) == AT_FAILUREP ) {
printf( "Error message = %s.",ATDV_ERRMSGP( devh ) );
exit( 1 );
}
/*
* Display it
*/
for ( i = 0; i < 24; i++ ) {
arcv = ( sigbits[ i ] & DTSG_RCVA ) ? 1 : 0;
brcv = ( sigbits[ i ] & DTSG_RCVB ) ? 1 : 0;
axmt = ( sigbits[ i ] & DTSG_XMTA ) ? 1 : 0;
bxmt = ( sigbits[ i ] & DTSG_XMTB ) ? 1 : 0;
printf( "tslot #%d arcv = %d, brcv = %d, axmt = %d, bxmt = %d\n",
i + 1, arcv, brcv, axmt, bxmt );
}
.
.
.
}
If the function returns AT_FAILUREP, 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