Intel 05-1832-002 IP Phone User Manual


 
Voice API for Windows Operating Systems Library Reference — November 2003 321
play the cadenced tone defined by TN_GENCAD — dx_playtoneEx( )
If a TN_GEN tone generation template contains an invalid tg_dflag, or the specified amplitude
or frequency is outside the valid range, dx_playtoneEx( ) will generate a TDX_ERROR event
if asynchronous, or -1 if synchronous.
On DM3 boards, the DX_MAXTIME termination condition is not supported by tone
generation functions, which include dx_playtoneEx( ).
!
!!
! Errors
If the function returns -1, use the Standard Runtime Library (SRL) Standard Attribute function
ATDV_LASTERR( ) to obtain the error code or use ATDV_ERRMSGP( ) to obtain a descriptive
error message. One of the following error codes may be returned:
EDX_AMPLGEN
Invalid amplitude value in TN_GEN structure
EDX_BADPARM
Invalid parameter
EDX_BADPROD
Function not supported on this board
EDX_BADTPT
Invalid DV_TPT entry
EDX_BUSY
Busy executing I/O function
EDX_FLAGGEN
Invalid tg_dflag field in TN_GEN structure
EDX_FREQGEN
Invalid frequency component in TN_GEN structure
EDX_SYSTEM
Error from operating system; use dx_fileerrno( ) to obtain error value
!
!!
! Example
/*$ dx_playtoneEx( ) example $*/
#include <stdio.h>
#include <windows.h>
#include <srllib.h>
#include <dxxxlib.h>
main()
{
TN_GEN tngen;
TN_GENCAD tngencad;
DV_TPT tpt[ 2 ];
int dxxxdev;
long term;
/*
* Open the Voice Channel Device and Enable a Handler
*/
if ( ( dxxxdev = dx_open( "dxxxB1C1", 0 ) ) == -1 ) {
perror( "dxxxB1C1" );
exit( 1 );
}