/*
   ups.h --- UpsInfo definitions for shutdown.library

   (c) Copyright 1995 SHW Wabnitz
   Written by Bernhard Fastenrath (fasten@shw.com)

   This file may be distributed under the terms
   of the GNU General Public License.
*/

#ifndef UPS_H
#define UPS_H

#define UPS_EV_NAMES { \
  "Okay", "Line Fail", "Recovery", \
  "Bypass", "No Bypass", "Low Battery", \
  "Recharged", "Shutdown Recommended", \
  "Short Power Fail", "", \
  "Fault",      "No Fault", \
  "Inverter",   "No Inverter", \
  "Special On", "Special Off", "", \
  "Connection Lost", "Connection Restored" \
}

#define UPS_EV_OKAY         0x00
#define UPS_EV_LINE_FAIL    0x01
#define UPS_EV_RECOVERY     0x02
#define UPS_EV_BYPASS       0x03
#define UPS_EV_NO_BYPASS    0x04
#define UPS_EV_LOW_BATTERY  0x05
#define UPS_EV_RECHARGED    0x06
#define UPS_EV_SHUTDOWN_RECOMMENDED 0x07
#define UPS_EV_SHORT_POWER_FAIL     0x08
#define UPS_EV_FAULT        0x0a
#define UPS_EV_NO_FAULT     0x0b
#define UPS_EV_INVERTER     0x0c
#define UPS_EV_NO_INVERTER  0x0d
#define UPS_EV_SPECIAL_ON   0x0e
#define UPS_EV_SPECIAL_OFF  0x0f
#define UPS_EV_CONNECTION_LOST 0x11
#define UPS_EV_CONNECTION_OKAY 0x12
#define UPS_EV_MAX 0x12

typedef struct UpsInfo {
  ULONG ui_Event;
  ULONG ui_Charge; /* Charge in percent */
  ULONG ui_Time;   /* Remaining time    */
} UpsInfo;

#endif /* UPS_H */
