weekTimeInRange — checking if the present time hits the specified interval of time and day of week.

 

Description:

u8 weekTimeInRange(000000000000000000000000000000000000000000000000000000000000000000000000000000000000);

Checking if the present time hits the specified interval of time of the week.

List of parameters:

Parameter in the format of 7 consecutive repeating successions of hexadecimal notations like XXXXXXXXXXXX The length of each succession is 12 characters for each day of week starting from Sunday. They represent bit-to-bit half-hour intervals (every character equals to 2 hours, every character bit equals to 30 minutes). For example:

0001FFC00000 – from 7:30 till 13:00,

000000FE0380 – from 12:00 till 15:30 and from 19:00 till 20:30.

Return values:

· Returns 0 if the present time doesn’t hit the interval .

· Returns value not 0 if the present time hits the interval .

Example:

<item addr="524:248" name="Test for weekTimeInRange function" type="script">

V-ID/V-ADDR
{
	if(opt0())
	{
		u8 res = weekTimeInRange(000000000000000000000000FFFFFFFFFFFF000000000000FFFFFFFFFFFF000000000000FFFFFFFFFFFF);
		
		if(res != 0)
			setStatus(@exciterId():32, {1, "Today is TU or TH or SA"});

		res =weekTimeInRange(000000000000FFFFFF000000000000000000000000FFFFFF000000000000FFFFFF000000000000000000);

		if(res != 0)
			setStatus(@exciterId():32, {1, "Today is MO or WE up to 12:00 or FR after 12:00!"});

		res=weekTimeInRange(000000000000000000FFFFFF000000000000FFFFFF000000000000000000000000FFFFFF000000000000);

		if(res != 0) 
			setStatus(@exciterId():32, {1, "Today is MO or WE after 12:00 or FR up to 12:00!"});
	}
}

</item>

The result of performing the example:

Depending on the day of week and time of day when clicking the element script the following messages will be displayed in the interface: ” Today is TU or TH or SA!”, “Today is MO or WE up to 12:00 or FR after 12:00!” or ” Today is MO or WE after 12:00 or FR up to 12:00!”.