Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 429
start a transmit-initiated reception of data — dx_TxRxIottData( )
!
!!
! Example
// Synchronous transmit initiated receive ADSI data
#include "srllib.h"
#include "dxxxlib.h"
main()
{
DX_IOTT TxIott = {0};
DX_IOTT RxIott = {0};
DV_TPT tpt;
char *devnamep = "dxxxB1C1";
char buffer[16];
ADSI_XFERSTRUC adsimode;
int chdev;
.
.
.
sprintf(buffer, "MENU.ADSI");
if ((TxIott.io_fhandle = dx_fileopen(buffer, _O_RDONLY|O_BINARY)) == -1) {
/* Perform system error processing */
exit(1);
}
sprintf(buffer, "RECEIVE.ADSI");
if ((RxIott.io_fhandle = dx_fileopen(buffer, O_BINARY)) == -1) {
/* Perform system error processing */
dx_fileclose(TxIott.io_fhandle);
exit(2);
}
if ((chdev = dx_open(devnamep, 0)) == -1) {
fprintf(stderr, "Error opening channel %s\n",devnamep);
dx_fileclose(TxIott.io_fhandle);
dx_fileclose(RxIott.io_fhandle);
exit(1);
}
.
.
.
// source is a file
TxIott.io_type = IO_DEV|IO_EOT;
TxIott.io_bufp = 0;
TxIott.io_offset = 0;
TxIott.io_length = -1;
// destination is a file
RxIott.io_type = IO_DEV|IO_EOT;
RxIott.io_bufp = 0;
RxIott.io_offset = 0;
RxIott.io_length = -1;
adsimode.cbSize = sizeof(adsimode);
adsimode.dwTxDataMode = ADSI_ALERT;
adsimode.dwRxDataMode = ADSI_NOALERT;
// Specify maximum time termination condition in the TPT for the
// receive portion of the function. Application specific value is
// used to terminate dx_TxRxIottData( ) if end of data is not
// detected over a specified duration.
tpt.tp_type = IO_EOT;