
Description | Cautions | Example | Errors | See also
Name: |
int dt_getxmitslot (devh, sc_tsinfop) | |
Inputs: |
int devh |
|
|
SC_TSINFO *sc_tsinfop |
|
Returns: |
0 on success |
|
|
-1 on error |
|
Includes: |
srllib.h |
|
|
dtilib.h | |
Category: |
SCbus Routing | |
Mode: |
Synchronous | |
The dt_getxmitslot( ) function provides SCbus time slot number of the digital transmit channel. The SCbus time slot information is contained in a SC_TSINFO structure that also includes the number of the SCbus time slot connected to the digital network interface device transmit channel (T-1/E-1time slot).
Parameter |
Description |
devh: |
Specifies a digital interface time slot device handle returned by a call to dt_open( ). |
sc_tsinfop: |
Points to the device information structure SC_TSINFO. |
The SC_TSINFO structure is declared as follows:
typedef struct {
unsigned long sc_numts;
long *sc_tsarrayp;
} SC_TSINFO;
The sc_numts field of the SC_TSINFO structure must be initialized with the number of SCbus time slots requested (1 for a digital network interface device time slot). The sc_tsarrayp member of the SC_TSINFO structure must be initialized with a pointer to a valid array of longs. Upon return from the function, the first element of the array will contain the number (between 0 and 1023) of the SCbus time slot on which the digital network interface device transmits.
A D/240SC-T1 or D/300SC-E1 digital network interface device can transmit on only one SCbus time slot at a time.
This function will fail when:
#include <windows.h>
#include <srllib.h>
#include <dtilib.h>
#include <errno.h>
main( )
{
int devh; /* Time slot device handle */
SC_TSINFO sc_tsinfo; /* Time slot information structure */
long scts; /* SCbus time slot */
/* Open board 1 time slot 1 for digital interface device */
if ((devh = dt_open("dtiB1T1", 0)) == -1) {
printf("Cannot open time slot dtiB1T1. errno = %d", errno);
exit(1);
}
/* Fill in the SCbus time slot information */
sc_tsinfo.sc_numts = 1;
sc_tsinfo.sc_tsarrayp = &scts;
/* Get SCbus time slot connected to transmit of time slot (digital channel) 1 on
board 1 */
if (dt_getxmitslot(devh, &sc_tsinfo) == -1) {
printf("Error message = %s", ATDV_ERRMSGP(devh));
exit(1);
}
printf("%s is transmitting on SCbus time slot %d", ATDV_NAMEP(devh), scts);
.
.
.
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. The error codes returned by ATDV_LASTERR( ) are:
Equate |
Returned When |
EDT_BADBRDERR |
Board missing or defective |
EDT_BADCMDERR |
Invalid command parameter to driver |
EDT_FWERR |
Firmware returned an error |
EDT_INVTS |
Invalid time slot device handle |
EDT_INVMSG |
Invalid message |
EDT_SH_BADLCLTS |
Invalid local time slot number |
EDT_SH_BADINDX |
Invalid Switch Handler library index number |
EDT_SH_BADMODE |
Invalid Switch Handler bus configuration |
EDT_SH_BADTYPE |
Invalid local time slot type |
EDT_SH_LCLDSCNCT |
Local time slot is already disconnected from SCbus |
EDT_SH_LIBBSY |
Switch Handler library busy |
EDT_SH_LIBNOTINIT |
Switch Handler library is uninitialized |
EDT_SH_MISSING |
Switch Handler is not present |
EDT_SH_NOCLK |
Switch Handler clock fallback failed |
EDT_SYSTEM |
Windows system error |
EDT_TMOERR |
Timed out waiting for reply from firmware |
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation