Example
The following example is for Linux applications.
#include <fcntl.h> #include <stdio.h> #include <stdlib.h> #include <srllib.h> #include <dxxxlib.h>
#define MAXLEN 10000
main()
{
int devh1, devh2, devh3; short fd;
DV_TPT tpt;
DX_IOTT iott[2]; DX_XPB xpb; SC_TSINFO tsinfo; long scts;
long tslots[32];
char basebufp[MAXLEN];
/* open two voice channels */
if ((devh1 = dx_open("dxxxB1C1", NULL)) ==
exit (1);
}
if ((devh2 = dx_open("dxxxB1C2", NULL)) ==
exit (1);
}
if ((devh3 = dx_open("dxxxB1C3", NULL)) ==
exit (1);
}
if ((fd = open("file.vox", O_CREAT O_RDWR, 0666)) ==
exit (1);
}
/*
*Get channels' external time slots
*and fill in tslots[] array
*/
tsinfo.sc_numts = 1; tsinfo.sc_tsarrayp = &scts;
if (dx_getxmitslot (devh1, &tsinfo) ==
{/* Handle error */ } tslots[0] = scts;
if (dx_getxmitslot (devh2, &tsinfo) ==
{/* Handle error */ }
tslots[1] = scts;
/* Set up SC_TSINFO structure */ tsinfo.sc_numts = 2; tsinfo.sc_tsarrayp = &tslots[0];
HMP Linux 1.2 Release Update, Rev 05 — September 2006September 2006 | 37 |