1
/* Written to work with Advice Partner/King PR750.
2
See http://www.advice.co.il/product/inter/ups.html for its specifications.
3
This model is based on PowerCom (www.powercom.com) models.
4
Read docs/powercom.txt for other models and manufactures for which
5
I believe this model program might work.
7
Copyright (C) 2000 Shaul Karl <shaulk@israsrv.net.il>
10
ups-trust425+625.c - model specific routines for Trust UPS 425/625
11
Copyright (C) 1999 Peter Bieringer <pb@bieringer.de>
13
A technical description of the interface to the UPS that this program
14
implements is found in docs/\*trust* files.
16
This program is free software; you can redistribute it and/or modify
17
it under the terms of the GNU General Public License as published by
18
the Free Software Foundation; either version 2 of the License, or
19
(at your option) any later version.
21
This program is distributed in the hope that it will be useful,
22
but WITHOUT ANY WARRANTY; without even the implied warranty of
23
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
GNU General Public License for more details.
26
You should have received a copy of the GNU General Public License
27
along with this program; if not, write to the Free Software
28
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34
#include <sys/ioctl.h>
35
#include <sys/types.h>
36
#include <sys/termios.h>
46
#include "upscommon.h"
49
enum general {SHMOK = 1U, SEC_FOR_POWERKILL = 10U,
50
NUM_OF_BYTES_FROM_UPS = 11U, MAINS_VOLTAGE = 230U};
51
enum commands {SEND_DATA = 0x01U, BATTERY_TEST = 0x03U, SHUTDOWN = 0xbcU};
52
enum data {LOAD_LEVEL = 0U, BAT_LEVEL = 1U, IN_AC_VOLT = 2U, OUT_AC_VOLT = 3U,
54
enum status {STATUS_A = 9U,
55
SUMMARY = 0U, MAINS_FAILURE = 1U, LOW_BAT = 2U,
56
AVR_ON = 8U, OVERLOAD = 32U, OFF = 128U,
58
BAD_BAT = 2U, TEST = 4U};
60
/* The following vars must be global because other parts of the NUT package
61
* use them as well. */
63
/* 9 entries in the info array for:
64
* ACFREQ, BATTPCT, LOADPCT, MFR, MODEL,
65
* SERIAL, STATUS, UPSIDENT, UTILITY.
67
* Other 2 are for MEMBERS and MSGID. */