# adiStopTimer

Aborts the timer operation.

#### Supported board types

- AG

- CG

#### Prototype

DWORD adiStopTimer ( CTAHD ctahd)

Argument | Description
ctahd | Context handle returned by ctaCreateContext or ctaAttachContext.

#### Return values

Return value | Description
SUCCESS |
CTAERR_FUNCTION_NOT_ACTIVE | Attempt made to stop a function that was not running.
CTAERR_INVALID_CTAHD | Context handle is invalid.
CTAERR_INVALID_SEQUENCE | Attempt made to stop a function that is already being stopped.
CTAERR_SVR_COMM | Server communication error.

#### Events

Event | Description
ADIEVN_TIMER_DONE | After the timer operation stops, the ADI service generates a DONE event with a value field of CTA_REASON_STOPPED.

#### Details

Use adiStopTimer to abort the timer operation started by adiStartTimer. For more information, refer to Using on-board timers.

#### Example

int myStopTimer( CTAHD ctahd )
{
CTA_EVENT event;
if( adiStopTimer( ctahd ) != 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, DTMFs, etc. */
}
}
}