forked from networkupstools/nut
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbelkin.h
60 lines (49 loc) · 1.92 KB
/
belkin.h
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
/* belkin.h - serial commands for Belkin smart protocol units
Copyright (C) 2000 Marcus Müller <[email protected]>
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 2 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, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <sys/ioctl.h>
#include "serial.h"
#include "timehead.h"
#define STATUS 'P'
#define CONTROL 'S'
#define MANUFACTURER "MNU"
#define MODEL "MOD"
#define VERSION_CMD "VER"
#define RATING "RAT"
#define STAT_INPUT "STI"
#define STAT_OUTPUT "STO"
#define STAT_BATTERY "STB"
#define STAT_STATUS "STA"
#define TEST_RESULT "TSR"
#define POWER_ON "RON"
#define POWER_OFF "ROF"
#define POWER_SDTYPE "SDT" /* shutdown type? */
#define POWER_CYCLE "SDA" /* shutdown, then restore */
#define BUZZER "BUZ"
#define BUZZER_ON "1"
#define BUZZER_OFF0 "0" /* Switching the buzzer off can be either 0 or 2 */
#define BUZZER_OFF2 "2" /* Seems to be used for F6c1400 */
#define TEST "TST"
#define TEST_10SEC "3"
#define TEST_DEEP "4"
#define TEST_CANCEL "0"
/* The UPS Status "low battery" comes up 10s before the UPS actually stops.
Therefore a shutdown is done at this battery % */
#define LOW_BAT 20
/* the maximum allowed number of missed replies */
#define MAXTRIES 3
/* dangerous instant commands must be reconfirmed within a 12 second window */
#define CONFIRM_DANGEROUS_COMMANDS 1
#define MINCMDTIME 3
#define MAXCMDTIME 15