delayedCall — delayed function call.


void delayedCall(void *func, u16 time[,u32 data]);

Delayed func function call in time seconds. Data parameter is supported in the versions of modules and server firmware after 05.07.2016.

List of parameters
Pointer to the function.
Time in seconds. Only literal (number) can be as the parameter in the firmwares of CM9 before 20.07.2015. Max number of seconds which is possible to specify 0хFFFF.


<import-script id="524" LAMP="543:45" name="Test for delayedCall function">
void offLamp() {
        	setStatus(LAMP, 0);
        	if(opt0()) {
        	        	delayedCall(offLamp, 5);

<!--With the use of additional parameter:-->
<item type="script" addr="524:250" name="Test for delayedCall function">
void fn(u32 param)
     srvMessage("fn param = %d", param);
     delayedCall(fn, 1, opt(0));

The result of performing the first example:
On expiry of 5 seconds after switching on the element LAMP will be turned off.
The result of performing the second example:
In a second after clicking the script the message with script status will be displayed in the server log.

Before the previous call is triggered the 2nd delayed call will be generated but not recorded over the previous one when assigning the delayed recall to one and the same function.