
Description | Cautions | Example | Errors | See Also
Name: |
int ms_getxmitslot(devh,tsinfop) | |
Inputs: |
int devh |
|
|
SC_TSINFO *tsinfop |
|
Returns: |
0 on success | |
|
-1 on failure | |
Includes: |
srllib.h | |
|
dtilib.h | |
|
msilib.h | |
Category: |
SCbus Routing | |
Mode: |
asynchronous | |
The ms_getxmitslot( ) function returns the SCbus time slot information contained in a SC_TSINFO structure that includes the number of the SCbus time slot connected to the MSI/SC station transmit channel.
Parameter |
Description |
devh: |
The station device handle. |
tsinfop: |
The pointer to the SCbus time slot information structure. |
On return from the function, the SC_TSINFO structure contains the number of SCbus time slots connected to the transmit of the station and points to the array that contains the SCbus time slots (between 0 and 1023). The SC_TSINFO structure is declared as follows:
typedef struct {
unsigned long sc_numts;
long *sc_tsarrayp;
} SC_TSINFO;
For MSI/SC station devices, the sc_numts element of the SC_TSINFO array should be set to 1. The sc_tsarrayp must point to an array of type long and, upon return, its first element will contain the SCbus time slot on which the station is transmitting data.
This function fails when:
Even though the ms_getxmitslot( ) function provides a valid SCbus time slot of where the station transmit channel connects, the actual transmission of data will not occur until the station receive (listen) channel is connected to a valid SCbus time slot.
#include "srllib.h"
#include "dtilib.h"
#include "msilib.h"
#include "errno.h"
int chdev; /* Station dev descriptor */
SC_TSINFO tsinfo; /* Time slot information structure */
long scts; /* SCbus time slot */
/* Open board 1, station 1 device */
if ((chdev1 = ms_open("msiB1C1",0)) == -1) {
printf( "Cannot open MSI B1, C1: errno=%d", errno);
exit(1);
}
/* Set up SC_TSINFO structure */
tsinfo.sc_numts = 1;
tsinfo.sc_tsarray = &scts;
/* Get time slot on which MSI board 1, channel 1 is xmitting */
if (ms_getxmitslot(chdev1,&tsinfo) == -1) {
printf("Error message = %s", ATDV_ERRMSGP(chdev));
exit(1);
}
printf("msiB1C1 is transmitting on SCbus time slot %d",scts);
If the function returns a -1 indicating an error, the error code may be retrieved by calling the SRL standard attribute function ATDV_LASTERR( ). A more descriptive error message may be retrieved by using the function ATDV_ERRMSGP( ).
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation