
Description | Example | Errors | See Also
Name: |
int dx_TxIottData(chdev, iottp, lpTerminations, wType, lpParams, mode) | |
Inputs: |
int chdev |
|
DX_IOTT *iottp |
| |
DV_TPT *lpTerminations |
| |
int wType |
| |
LPVOID lpParams |
| |
USHORT mode |
| |
Returns: |
0 if successful -1 if error | |
Includes: |
dxxxlib.h srllib.h | |
Mode: |
Synchronous/asynchronous | |
The dx_TxIottData( ) function is used to transmit data on a specified channel. The data may come from any combination of data files, memory, or custom devices. The wType parameter specifies the type of data to be transmitted, for example ADSI data. The iottp parameter specifies the messages to be transmitted.
Upon asynchronous completion of dx_TxIottData( ), the TDX_TXDATA event is posted. Use ATDX_TERMMSK( ) to return the reason for the last I/O function termination on the channel chdev. Possible return values are:
|
TM_MAXTIME |
Maximum function time exceeded |
|
|
TM_USRSTOP |
Function stopped by user |
|
|
TM_EOD |
End of FSK data reached on transmit |
|
|
TM_MAXDATA |
Maximum data reached |
|
|
TM_ERROR |
I/O device error |
|
// Synchronous transmit ADSI data
DX_IOTT iott = {0};
char *devnamep = "dxxxB1C1";
char buffer[16];
ADSI_XFERSTRUC adsimode;
int chdev;
.
.
.
sprintf(buffer, "MENU.ADSI");
if ((iott.io_fhandle = dx_fileopen(buffer, _O_RDONLY|O_BINARY)) == -1) {
/* Perform system error processing */
exit(1);
}
if ((chdev = dx_open(devnamep, 0)) == -1) {
fprintf(stderr, "Error opening channel %s\n",devnamep);
dx_fileclose(iott.io_fhandle);
exit(2);
}
// source is a file
iott.io_type = IO_DEV|IO_EOT;
iott.io_bufp = 0;
iott.io_offset = 0;
iott.io_length = -1;
adsimode.cbSize = sizeof(adsimode);
adsimode.dwTxDataMode = ADSI_ALERT; // send out ADSI data with CAS
// Wait for inbound call
if (dx_TxIottData(chdev, &iott, NULL, DT_ADSI, &adsimode, EV_SYNC) < 0) {
fprintf(stderr, "ERROR: dx_TxIottData failed on Channel %s; "
"error: %s\n", ATDV_NAMEP(chdev), ATDV_ERRMSGP(chdev));
}
If the function returns -1 to indicate an error, use the SRL Standard Attribute function ATDV_LASTERR( ) to obtain the error code or you can use ATDV_ERRMSGP( ) to obtain a descriptive error message.
Possible error codes from the dx_TxIottData( ) function include the following:
Error Code |
Description |
EDX_BADPARM |
Invalid data mode |
EDX_BADIOTT |
Invalid DX_IOTT (pointer to I/O transfer table) |
EDX_BUSY |
Channel already executing I/O function |
EDX_SYSTEM |
Error from operating system; use dx_fileerrno( ) to obtain error value |
Click here to contact Dialogic Customer Engineering
Copyright 2002, Intel Corporation