Phonetics 5100 Home Security System User Manual


 
93
Chapter 8: C Programming
ENABLE
Summary:
int enable(n1,n2);
int n1; Input number
int n2; Command, 0=disable, 1=enable, 2=return status
Description:
The enable function enables, disables, or reads the dialout ability for an input specified
by n1.
Return value:
The enable function returns 0 if the input is disabled, or a 1 if the input is enabled for
dialout.
Example:
This program will disable dialout for input 4 from 12 noon to 12:59, and enable dialout
for all other hours. This program will also turn on output 1 when input 1 dialout is
enabled.
main()
{
if (hours == 12)
{
enable(4,0);
}
else
{
enable(4,1);
}
if (enable(1,2) == 1)
{
output(1,1);
}
else
{
output(1,0);
}
}