
Description | Cautions | Example | Errors | See Also
Name: |
long ATDT_TSSGBIT(devh) | |
Inputs: |
int devh |
|
Returns: |
state of time slot signaling bits | |
Includes: |
srllib.h | |
Category: |
Extended Attribute | |
Mode: |
synchronous | |
The ATDT_TSSGBIT( ) function retrieves the current state of the transmit and receive signaling bits for the time slot specified by devh.
Parameter |
Description |
devh: |
Specifies the valid Digital Network Interface logical time slot device handle returned by a call to dt_open( ) |
The returned bitmask represents the following signaling bits:
To determine the state of the signaling bits for the specified time slot, 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; /* Time slot device handle */
long tsbits; /* Time slot signaling bits */
int arcv, brcv, axmt, bxmt; /* Bit mask values */
/*
* Open board 1 time slot 1 device
*/
if ( ( devh = dt_open( "dtiB1T1", 0 ) ) == -1 ) {
printf( "Cannot open time slot dtiB1T1. errno = %d", errno );
exit( 1 );
}
/*
* Get time slot signaling bits
*/
tsbits = ATDT_TSSGBIT( devh );
if ( tsbits == AT_FAILURE ) {
printf( "Error message = %s.",ATDV_ERRMSGP( devh ) );
exit( 1 );
}
/*
* Display it
*/
arcv = ( tsbits & DTSG_RCVA ) ? 1 : 0;
brcv = ( tsbits & DTSG_RCVB ) ? 1 : 0;
axmt = ( tsbits & DTSG_XMTA ) ? 1 : 0;
bxmt = ( tsbits & DTSG_XMTB ) ? 1 : 0;
printf( "tslot 1 arcv = %d, brcv = %d, axmt = %d, bxmt = %d\n",
arcv, brcv, axmt, bxmt );
.
.
.
}
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