(Page 12 of 20 in this chapter)
Version
cdiStartTimer
Description
Starts (or restarts) a timer on this port.
Prototype
DWORD
cdiStartTimer
(
CTAHD
ctahd
,
DWORD
timeout
,
DWORD
count
)
ctahd
CTA context handle.
timeout
Time out value in milliseconds.
count
Number of events.
Return Values
SUCCESS
CTAERR_INVALID_CTAHD
The CTA handle is invalid.
CTAERR_BAD_ARGUMENT
An argument is not in the valid range.
Events
CDIEVN_TIMER_DONE
The timer has stopped. The event
value
field contains one of the following reason codes:
CTA_REASON_FINISHED
The timer ran for the full specified time, and then expired.
CTA_REASON_STOPPED
The timer was halted with
cdiStopTimer
.
CDIEVN_TIMER_START
The timer has started.
CDIEVN_TIMER_TICK
The timer has ticked (see
Details
below).
Details
The CDI service supports one on-board timer per CTA context on a CX board. You can set up this timer to run for a specified amount of time and then expire, returning an event to the application. Alternatively, you can configure the timer to tick, generating a specified number of tick events at a periodic rate before expiring:
To set up the timer to...
Do the following:
Run once and then expire
· Set
timeout
to timeout length (in ms).
· Set
count
to 1.
When the timer is started,
CDIEVN_TIMER_START
is generated. When the timer expires,
CDIEVN_TIMER_DONE
is returned. The
value
field of this event contains
CTA_REASON_FINISHED
.
Tick
· Set
timeout
to tick rate (in ms).
· Set
count
to number of ticks required.
When the timer is started,
CDIEVN_TIMER_START
is generated. As the timer ticks,
CDIEVN_TIMER_TICK
events are generated. On the final tick,
CDIEVN_TIMER_DONE
is returned. The
value
field of this event contains
CTA_REASON_FINISHED
.
The timer has a 2 ms resolution.
You can abort a timer by invoking
cdiStopTimer
.
A running timer may be restarted at any time before normal expiration by a subsequent call to
cdiStartTimer
.
For more information about board timers, refer to
Section 3.8
.
See Also
cdiStopTimer
(Page 12 of 20 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.