
Description | Cautions | Example | Errors | See Also
Name: |
int dt_getxmitslot(devh,sc_tsinfop) | |
Inputs: |
int devh |
|
SC_TSINFO *sc_tsinfop |
| |
Returns: |
0 on success | |
Includes: |
srllib.h | |
Category: |
SCbus Routing | |
Mode: |
||
The dt_getxmitslot( ) function returns the SCbus time slot connected to the transmit of a Digital Network Interface device time slot.
Parameter |
Description |
devh: |
Specifies the valid Digital Network Interface time slot device handle returned by a call to dt_open( ) |
sc_tsinfop: |
Specifies the pointer to the data structure SC_TSINFO |
The sc_numts member 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. Upon return from the function, the array will contain the number (between 0 and 1023) of the SCbus time slot on which the Digital Network Interface device time slot transmits. The SC_TSINFO structure is declared as follows:
typedef struct {
unsigned long sc_numts;
long *sc_tsarrayp;
} SC_TSINFO;
A Digital Network Interface device time slot can transmit on only one SCbus time slot.
This function will fail when an invalid time slot device handle is specified.
#include <windows.h> /* For Windows applications only */
#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 network 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:
In the SCbus Routing Function Reference:
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation