(Page 48 of 69 in this chapter) Version
adiStartTimer
Description
- Starts (or re-starts) a timer on the board.
Prototype
- DWORD adiStartTimer ( CTAHD ctahd,
unsigned timeout,
unsigned count )
- ctahd CTA context handle returned by ctaCreateContext.
- timeout Timeout value (in milliseconds).
- count Number of events.
Return Values
Events
Details
- The ADI service supports one application timer per port. This on-board timer has 10 ms resolution. The timer can be used when the application is controlling the protocol from application space. The timer generates periodic events. The programmer specifies both the period (timeout) and number of events (count).
- The application can stop the timer by calling adiStopTimer. The timer may be reset or restarted with another call to adiStartTimer. When the timer is restarted, previous timer definitions are discarded and the timer begins with the new parameters.
Note: Unlike most other ADI service asynchronous functions, the timer function is not stopped automatically when a call is released.
See Also
- adiStopTimer
Example
int myTimer( CTAHD ctahd, unsigned ms )
{
CTA_EVENT event;
if( adiStartTimer( ctahd, ms, 1 /*count*/ ) != SUCCESS )
return MYFAILURE;
while( 1 )
{
myGetEvent( &event ); /* see ctaWaitEvent example */
switch( event.id )
{
case ADIEVN_TIMER_DONE:
if( CTA_IS_ERROR( event.value ) )
return MYFAILURE; /* API error */
else
return SUCCESS; /* stopped normally */
break;
/* might include cases to handle disconnect event, DTMFs, etc. */
}
}
}
(Page 48 of 69 in this chapter) Version
Want to send us feedback on our documentation? Email: Tech_Pubs@nmss.com
Copyright © 2000, Natural MicroSystems, Inc. All rights
reserved.