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

« back to all changes in this revision

Viewing changes to drivers/hidups.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
/* hidups.h - prototype HID UPS driver for Network UPS Tools
 
2
 
 
3
   Copyright (C) 2001  Russell Kroll <rkroll@exploits.org>
 
4
 
 
5
   Based on evtest.c v1.10 - Copyright (c) 1999-2000 Vojtech Pavlik
 
6
 
 
7
   This program is free software; you can redistribute it and/or modify
 
8
   it under the terms of the GNU General Public License as published by
 
9
   the Free Software Foundation; either version 2 of the License, or 
 
10
   (at your option) any later version.
 
11
  
 
12
   This program is distributed in the hope that it will be useful,
 
13
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
   GNU General Public License for more details.
 
16
   
 
17
   You should have received a copy of the GNU General Public License
 
18
   along with this program; if not, write to the Free Software
 
19
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
20
*/
 
21
 
 
22
#include <ctype.h>
 
23
#include <fcntl.h>
 
24
#include <stdio.h>
 
25
#include <stdlib.h>
 
26
#include <string.h>
 
27
#include <unistd.h>
 
28
#include <asm/types.h>
 
29
#include <sys/ioctl.h>
 
30
#include <sys/types.h>
 
31
#include <sys/time.h>
 
32
 
 
33
#include "config.h"
 
34
#include LINUX_HIDDEV           /* from configure */
 
35
 
 
36
#define DEFAULT_ONDELAY         13      /* delay between return of utility power */
 
37
                                                                /* and powering up of load (10 seconds units for MGE) */
 
38
                                                                /* ondelay > offdelay */
 
39
#define DEFAULT_OFFDELAY        120     /* delay befor power off, in SECONDS*/ 
 
40
 
 
41
/* power device page: x84 */
 
42
 
 
43
#define UPS_USAGE                               0x840004
 
44
#define POWER_USAGE                             0x840020        /* wrong, but needed for MGE */
 
45
#define UPS_BATTVOLT                    0x840030        /* voltage * 100             */
 
46
#define UPS_LOADPCT                             0x840035        /* load percentage           */
 
47
#define UPS_SHUTDOWN_IMMINENT   0x840069        /* 1 = low battery           */
 
48
#define UPS_IMFR                                0x8400FD        /* manufacturer name         */
 
49
#define UPS_IPRODUCT                    0x8400FE        /* model name                */
 
50
#define UPS_ISERIAL                             0x8400FF        /* serial number             */
 
51
#define UPS_WAKEDELAY                   0x840056
 
52
#define UPS_GRACEDELAY                  0x840057
 
53
 
 
54
/* battery system page: x85 */
 
55
 
 
56
#define BATT_BELOW_RCL                  0x850042        /* below remaining cap limit */
 
57
#define BATT_CHARGING                   0x850044        /* 0 = no longer charging    */
 
58
#define BATT_DISCHARGING                0x850045        /* 1 = on battery            */
 
59
#define BATT_REMAINING_CAPACITY 0x850066        /* battery percentage        */
 
60
#define BATT_RUNTIME_TO_EMPTY   0x850068        /* minutes                   */
 
61
#define BATT_MFRDATE                    0x850085        /* manufacturer date         */
 
62
#define BATT_ICHEMISTRY                 0x850089        /* battery type              */
 
63
#define BATT_AC_PRESENT                 0x8500d0        /* 1 = on line               */
 
64
#define BATT_IOEMINFORMATION    0x85008f        /* battery OEM description   */