
Description | Cautions | Example | Errors | See Also
Name: |
int dt_xmitwink(devh, tmo) | |
Inputs: |
int devh |
|
unsigned int tmo |
| |
Returns: |
0 on success | |
Includes: |
srllib.h | |
Category: |
Time Slot Signaling | |
Mode: |
synchronous/asynchronous | |
The dt_xmitwink( ) function transmits wink signaling to the T-1 or E-1 network span on any of the available signaling bits. The bit to be used and the polarity or beginning state of the wink are configurable through the download parameter file (see the Installation Reference (for Linux or Windows for details). A wink starts by transmitting signaling state 0, then transmits signaling state 1, and returns to signaling state 0. The signaling bit selected must be in the proper state (state 0) when the dt_xmitwink( ) function is called. Also, the time slot must be in signaling insertion mode to transmit a wink.
Board parameters may be set through dt_setparm( ) to control pre-wink delay and transmit wink duration for all time slots simultaneously.
Parameter |
Description |
devh: |
Specifies the valid Digital Network Interface logical time slot device handle returned by a call to dt_open( ) |
tmo: |
Specifies the maximum amount of time in seconds that the function will block while awaiting a response from the Digital Network Interface |
Asynchronous Mode
To operate this function in asynchronous (non-blocking) mode, specify 0 for tmo. This allows the application to continue processing while awaiting a completion event from the device. If event handling is set up properly for your application, DTEV_WINKCPLT is returned by the SRL sr_getevttype( ) function when the wink is successfully completed. See Appendix A - Standard Runtime Library for information on event handling.
Synchronous Mode
To run this function in synchronous (blocking) mode, set tmo to the length of time, in seconds, to await a return. If a response is not returned within tmo seconds, an error is returned. A suggested tmo setting for this function is 2.
#include <windows.h> /* For Windows applications only */
#include <srllib.h>
#include <dtilib.h>
#include <errno.h>
main()
{
int devh; /* Time slot device handle */
/*
* Open time slot 1 on board 1
*/
if ( ( devh = dt_open( "dtiB1T1", 0 ) ) == -1 ) {
printf( "Failed to open device dtiB1T1. errno = %d\n", errno );
exit( 1 );
}
/*
* Set signaling bits to a known state
*/
if ( dt_settsig ( devh, DTB_ABIT | DTB_BBIT, DTA_SUBMSK ) == -1 ) {
printf( "Error message = %s \n", ATDV_ERRMSGP( devh ) );
exit( 1 );
}
/*
* Set signaling mode to signaling insertion
*/
if ( dt_setsigmod( devh, DTM_SIGINS ) == -1 ) {
printf( "Error message = %s.",ATDV_ERRMSGP( devh ) );
exit( 1 );
}
*
* Disable silence transmission
*/
if ( dt_setidle( devh, DTIS_DISABLE) == -1 ) {
printf( "Error message = %s.",ATDV_ERRMSGP( devh ) );
exit( 1 );
}
/*
* Go offhook assuming that wink set to negative polarity on A bit
*/
if ( dt_settssig( devh, DTB_ABIT, DTA_SETMSK ) == -1 ) {
printf( "Error message = %s.",ATDV_ERRMSGP( devh ) );
exit( 1 );
}
/*
* Transmit wink with 2 second timeout. Note that this is the blocking
* (synchronous) mode
*/
if ( dt_xmitwink( devh, 2 ) == -1 ) {
printf( "Error message = %s.",ATDV_ERRMSGP( devh ) );
exit( 1 );
}
.
.
.
}
If the function returns -1, 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). 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