1
/* apcsmart.h - serial commands for APC smart protocol units
3
Copyright (C) 1999 Russell Kroll <rkroll@exploits.org>
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 2 of the License, or
8
(at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
15
You should have received a copy of the GNU General Public License
16
along with this program; if not, write to the Free Software
17
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
#include <sys/ioctl.h>
21
#include <sys/termios.h>
25
#define REQ_MODEL 0x01 /* ^A */
26
#define REQ_SERIAL 'n'
27
#define REQ_UTILITY 'L'
28
#define REQ_BATTPCT 'f'
29
#define REQ_STATUS 'Q'
30
#define REQ_UPSTEMP 'C'
31
#define REQ_ACFREQ 'F'
32
#define REQ_LOADPCT 'P'
33
#define REQ_LOWXFER 'l'
34
#define REQ_HIGHXFER 'u'
35
#define REQ_AMBHUMID 'h'
36
#define REQ_CONTACTS 'i'
37
#define REQ_AMBTEMP 't'
38
#define REQ_UPSIDENT 'c'
39
#define REQ_WAKEDELAY 'r'
40
#define REQ_LINESENS 's'
41
#define REQ_BATTDATE 'x'
42
#define REQ_GRACEDELAY 'p'
43
#define REQ_RTHRESH 'e'
44
#define REQ_ALRMDEL 'k'
45
#define REQ_BATTVOLT 'B'
46
#define REQ_OUTVOLT 'O'
47
#define REQ_CAPABILITIES 26
49
#define REQ_FPTEST 'A'
51
/* #define REQ_SOFTDOWN 'S' not used */
52
#define REQ_SHUTDOWN 'K'
54
#define REQ_ON 0x0E /* ^N */
56
#define ENDCHAR 10 /* APC ends responses with LF */
57
#define IGNCHARS "\015+$|!" /* special characters to ignore */
59
/* dangerous instant commands must be reconfirmed within a 12 second window */
60
#define CONFIRM_DANGEROUS_COMMANDS 1