
Description | Example | Error
Name: |
int gl_listen (int chan, SC_TSINFOP *tsinfop) | |
Inputs: |
int chan |
|
|
SC_TSINFO * tsinfop |
|
Outputs: |
GFQRECORD *qrec |
|
Returns: |
0 |
|
|
-1 |
|
Includes: |
gfsc.h |
|
The gl_listen( ) function connects the fax channel to receive timeslot on SCbus
This function connects the receive data stream of a fax channel to a timeslot on the external SCbus. The SC_TSINFO structure contains two fields. The first field specifies the total number of SCbus timeslots to connect. The second field is a pointer to an array that contains the SCbus timeslots (from 1 and 1024) necessary to connect the receive data stream of the channel. If gl_listen( ) is called to establish a connection for a CP Fax SC fax channel that is already connected, the existing connection will be broken before the specified connection is established.
The SC_TSINFO structure is declared as follows:
typedef struct {
unsigned longnumts;
long*tsarray;
} SC_TSINFO;
Multiple fax channels may listen to a single SCbus timeslot, although the transmit data stream of a single SC channel can be connected to only one SCbus timeslot. The SC_TSINFO structure is used to provide uniformity among SCbus timeslot access functions for all SCSA devices.
#include "gfsc.h"
SC_TSINFO sc_tsinfo; /* SCbus timeslot info structure */
long scts; /* SCbus timeslot */
int devh1, devh2, status;
devh1 = 1;
devh2 = 2;
sc_tsinfo.sc_numts = 1; /* always one timeslot */
sc_tsinfo.sc_tsarrayp = &scts;
status = gl_getxmitslot( devh1, &sc_tsinfo );
if (status)
{
fprintf(stderr, "gl_getxmitslot( ) error %d\n", status);
return (status);
}
else
fprintf(stdout, "chan %d is transmitting on timeslot %d\n",
devh1, scts);
/* connect devh2 rxslot to devh1 txslot */
status = gl_listen( devh2, &sc_tsinfo );
if (status)
{
fprintf(stderr, "gl_listen( ) error %d\n", status);
return (status);
}
else
fprintf(stdout, "chan %d is receiving on timeslot %d\n",
devh2, scts);
/* devh2 is connected half-duplex with devh1. For a full-duplex connection, repeat the above steps to connect devh1 rxslot to devh2 txslot */
Click here to contact Dialogic Customer Engineering
Copyright 2000, Dialogic Corporation