~ubuntu-branches/ubuntu/saucy/nut/saucy

« back to all changes in this revision

Viewing changes to drivers/apcsmart.h

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Quette
  • Date: 2004-05-28 13:10:01 UTC
  • mto: (16.1.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20040528131001-yj2m9qcez4ya2w14
Tags: upstream-1.4.2
ImportĀ upstreamĀ versionĀ 1.4.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* apcsmart.h - serial commands for APC smart protocol units
 
2
 
 
3
   Copyright (C) 1999  Russell Kroll <rkroll@exploits.org>
 
4
 
 
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.
 
9
 
 
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.
 
14
 
 
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
 
18
*/
 
19
 
 
20
#include <sys/ioctl.h>
 
21
#include <sys/termios.h>
 
22
#include "timehead.h"
 
23
 
 
24
#define GO_SMART        'Y'
 
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
 
48
#define NEXT_VAL        '-'
 
49
#define REQ_FPTEST      'A'
 
50
#define REQ_BTEST       'U'
 
51
/* #define REQ_SOFTDOWN 'S'     not used */
 
52
#define REQ_SHUTDOWN    'K'
 
53
#define REQ_OFF         'Z'
 
54
#define REQ_ON          0x0E    /* ^N */
 
55
#define REQ_CAL         'D'
 
56
#define ENDCHAR 10              /* APC ends responses with LF */
 
57
#define IGNCHARS "\015+$|!"     /* special characters to ignore */
 
58
 
 
59
/* dangerous instant commands must be reconfirmed within a 12 second window */
 
60
#define CONFIRM_DANGEROUS_COMMANDS 1
 
61
#define MINCMDTIME      3
 
62
#define MAXCMDTIME      15