
Description | Cautions | Example | Errors | See also
Name: |
int fx_getxmitslot(dev,sc_tsinfop) | |
Inputs: |
int dev |
|
|
SC_TSINFO *sc_tsinfop |
|
Returns: |
0 on success |
|
|
-1 on failure |
|
Includes: |
srllib.h |
|
|
dxxxlib.h |
|
|
faxlib.h |
|
Category: |
SCbus Routing |
|
Mode: |
synchronous |
|
The fx_getxmitslot( ) function provides SCbus time slot number of the FAX transmit channel. It returns the SCbus time slot information contained in a SC_TSINFO structure that includes the number of the SCbus time slot connected to the FAX transmit channel.
Parameter |
Description |
dev: |
Specifies the channel device handle obtained when the FAX device was opened using fx_open( ). |
sc_tsinfop: |
Specifies a pointer to the data 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 member of the SC_TSINFO structure must be initialized with the number of SCbus time slots requested (1 for a FAX channel). 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 first element of the array will contain the number (between 0 and 1023) of the SCbus time slot on which the FAX channel transmits.
A FAX channel on a VFX/40ESC board can transmit on only one SCbus time slot.
This function will fail when:
#include <windows.h>
#include <srllib.h>
#include <dxxxlib.h>
#include <faxlib.h>
#include <errno.h>
main( )
{
int dev; /* Fax channel device handle. */
SC_TSINFO sc_tsinfo; /* Timeslot information structure. */
long scts; /* SCbus time slots. */
.
.
/* Open the FAX channel resource device. */
if ((dev = fx_open("dxxxB7C1", NULL)) == -1) {
/* Error opening device. */
printf("Error opening channel, errno = %d\n", errno);
exit(1);
}
/* Fill in the SC_TSINFO structure time slot information. */
sc_tsinfo.sc_numts = 1;
sc_tsinfo.sc_tsarray = &scts;
/* Get FAX device channel SCbus transmit time slot. */
if (fx_getxmitslot(dev, &sc_tsinfo) == -1) {
printf("Error message = %s", ATDV_ERRMSGP(dev));
exit(1);
}
printf("Fax channel is transmitting on SCbus time slot %d\n", scts);
.
.
If this function returns -1, use ATDV_LASTERR( ) and ATDV_ERRMSGP( ) to retrieve one of the following error reasons (see the Voice Software Reference - Features Guide for error message information):
Equate |
Returned When |
EDX_BADPARM |
Parameter error |
EDX_SH_BADCMD |
Command is not supported in current bus configuration |
EDX_SH_BADINDX |
Invalid Switch Handler index number |
EDX_SH_BADLCLTS |
Invalid channel number |
EDX_SH_BADMODE |
Function not supported in current bus configuration |
EDX_SH_BADTYPE |
Invalid channel type (voice, analog, etc.) |
EDX_SH_CMDBLOCK |
Blocking command is in progress |
EDX_SH_LCLDSCNCT |
Channel is already disconnected from SCbus |
EDX_SH_LIBBSY |
Switch Handler library busy |
EDX_SH_LIBNOTINIT |
Switch Handler library uninitialized |
EDX_SH_MISSING |
Switch Handler is not present |
EDX_SH_NOCLK |
Switch Handler clock fallback failed |
EDX_SYSTEM |
Windows System Error |
Click here to contact Dialogic Customer Engineering
Copyright 2001, Dialogic Corporation