Dialogic 05-0867-005 Table Top Game User Manual


 
forces the termination of a tone cc_StopTone( )
273
/*
* Play a Tone with its
* Frequency1 = 330, Frequency2 = 460
* Amplitude at -10dB for both
* Duration of infinity
* This is a Panasonic Local Dial Tone.
*
*/
if (cc_PlayTone( devHdl, &ToneParm, &tpt, EV_SYNC ) == -1 ){
printf( "Unable to Play the Tone\n" );
printf( "Lasterror = %d Err Msg = %s\n",
cc_CauseValue( devHdl ), cc_ResultMsg( devHdl ) );
cc_Close( devHdl);
exit( 1 );
}
.
.
.
.
/* Force the channel idle. The I/O function that the channel is
* executing will be terminated.
* In the asynchronous mode, cc_StopTone() returns immediately,
* without waiting for the channel to go idle.
*/
if ( cc_StopTone(devHdl, EV_ASYNC) == -1) {
/* process error */
}
}
!
! !
!
Errors
If the function returns < 0 to indicate failure, use the cc_CauseValue( ) function
to retrieve the reason code for the failure. The cc_ResultMsg( ) function can be
used to interpret the reason code. Error codes are defined in the files ccerr.h,
isdnerr.h, and isdncmd.h.
Error codes from the cc_StopTone( ) function include the following:
Error Code Description
ERR_TONEINVALIDMSG Invalid message type
ERR_TONEBUSY Busy executing previous command
ERR_TONECP System error with CP
ERR_TONEDSP System error with DSP
ERR_TONECHANNELID Invalid channel ID
ERR_TONESTOP Tone has already stopped playing on this
channel