DitsUfaceTimer - Set up Uface Context timer message.

Function

Set up Uface Context timer message.

Description

Routines running in Uface Context cannot setup timer based reschedules using DitsPutRequest/DitsPutDelay as they are not running in the context of an action. This routine allows uface routines to explictly setup timers which result in a call to the specified response routine.

Additionally, application routines can invoke this routine to setup timers which will be triggered in Uface context.

This routine works by creating a message which looks like a message from another task.

Note that the response routine is invoked in uface context, but you should call DitsUfaceCtxEnable to install a new response routine before initiating messages to other tasks. Alternately, you can signal an action using DitsSignal().

In the ResponseRoutine, DitsGetReason will return a type of DITS_REA_RESCHED and DitsGetEntInfo will return the transaction id returned by this routine.

Before the timer has gone off, the transation id can be supplied to DitsUfaceTimerCancel to cancel the timer.

Language

C

Call

(Void) = DitsUfaceTimer(delay, ResponseRoutine, code, transid, status)

Parameters

(">" input, "!" modified, "W" workspace, "<" output)

>delayDitsDeltaTimeType *The delay before the timeout occurs. If a null pointer is supplied, a zero second timer is used.
>ResponseRoutineDitsActionRoutineTypeThe routine to be called. See Dits documentation for details. If zero, the this value and the code are taken from the current Uface Context Response Routine as set by DitsUfaceCtxEnable. If not in Uface context, then this routine Must be supplied.
>codelong intWill be returned by DitsGetCode in the response routine. Only used if Response Routine is supplied, otherwise the current value supplied to DitsUfaceCtxEnable is used.
<transidDitsTransIdType *Transaction id for the transaction started. If a null pointer is supplied, no transaction id is returned.
!statusStatusType *Modified status.

Function Prototypes Used

typedef DVOID (*DitsActionRoutineType)(StatusType *status);

Parameters

(">" input, "!" modified, "W" workspace, "<" output)

!statusStatusType *Modified status. The handler function should set status bad when it fails

Include files

DitsSys.h

External functions used

Dits___TransIdCreateDits Internal Create a transaction id
Dits___TransIdDeleteDits Internal Delete a transaction id
ImpQueueReminderImp Queue a reminder message

External values used

DitsTask - Details of the current task

Prior requirements

DitsAppInit must have been called.

See Also

The Dits Specification Document, DitsUfaceCtxEnable(3), DitsUfaceTimerCancel(3), DulExecuteCmd(3).

Support

Tony Farrell, AAO

Click here for the DRAMA home page and here for the AAO home page.

 For more information, contact tony.farrell@mq.edu.au