delayedCallR —delayed function call for each specified number of seconds.

Description:

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

Delayed func function call every time seconds.

List of parameters:

func

Pointer to the function.

time

Time in seconds. Max number of seconds which is possible to specify is 0хFFFF.

Example:

<item id="524" LAMP="524:19" name="Test for function delayedCallR" type="script">

void onOffLamp() 
{
	setStatus(LAMP, ![LAMP]);
}

V-ID/V-ADDR 
{
	if(opt0())
	{
		delayedCallR(onOffLamp, 2);
	}

	if(!opt0())
	{
		cancelDelayedCall(onOffLamp);
	}
}

</item>

The result of performing this example:

Every 2 seconds the element LAMP will change its status to the opposite one (if it is activated – it will be disactivated and vice a versa)

Note:

· 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.

· Use cancelDelayedCall for suspending the delayed function call.