forked from HeyuX10Automation/heyu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmessage.c
98 lines (82 loc) · 3.14 KB
/
message.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
* Copyright 1986 by Larry Campbell, 73 Concord Street, Maynard MA 01754 USA
* (maynard!campbell).
*
* John Chmielewski (tesla!jlc until 9/1/86, then rogue!jlc) assisted
* by doing the System V port and adding some nice features. Thanks!
*/
/*
* updated by Daniel Suthers, [email protected] 1996 -- 2000
*/
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include <stdio.h>
#include "x10.h"
char *E_2MANY = EM_2MANY;
char *E_INVCN = EM_INVCN;
char *E_WNA = EM_WNA;
char *E_NMA = EM_NMA;
char *E_NOCMD = EM_NOCMD;
void exit();
int usage(s)
char *s;
{
char RCSID[]= "@(#) $Id: message.c,v 1.12 1999/12/26 20:37:17 dbs Exp dbs $\n";
/*
* Don't combine the two calls to fputs or my compiler will
* gag with "token too long"
*/
display(RCSID);
if( s != NULL )
(void) fprintf(stderr, "Command error: %s\n", s);
(void) fputs("Usage:\n\
heyu help Display new commands in heyu ALPHA\n\
heyu date Return date in date(1) input format\n", stderr);
(void) fputs("\
heyu erase Zero CM11a EEPROM, erasing all events and macros\n\
heyu help Print this message and exit\n\
heyu info Display current CM11a registers and clock\n\
heyu monitor Monitor X10 activity (end with <BREAK>)\n", stderr);
(void) fputs("\
heyu preset ann vv Set unit to level vv for next dim/bright\n\
heyu reset [housecode] Reset interface to 'A' or specified housecode\n\
heyu setclock Set CM11a clock to system clock (per schedule)\n\
heyu status ann[,nn...] Return status of smart modules (rr501...)\n\
heyu stop Stop the current relay daemon\n", stderr);
(void) fputs("\
heyu turn ann[,nn...] on|off|dim|bright [vv]\n\
Change state of housecode a, unit nn by vv\n\
heyu upload [check|croncheck|status|cronstatus]\n\
Upload schedule to CM11a or check schedule file\n\
or display status of uploaded schedule\n\
heyu utility <option> (Enter 'heyu utility' to see options)\n\
heyu version Display the Heyu version and exit\n\
", stderr);
(void) fputs("Verbose mode is enabled if the first parameter is -v\n",
stderr);
exit(1);
}
void error(s)
char *s;
{
extern void quit();
extern int munlock();
extern int port_locked;
(void) fprintf(stderr, "HEYU: %s\n", s);
if( port_locked == 1 )
munlock( "heyu.write" );
quit();
}