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

« back to all changes in this revision

Viewing changes to drivers/bcmxcp.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
/* bcmxcp.h -- header for (BCM/XCP)  protocol module
 
2
 * 
 
3
 * Copyright (c) 2002, Martin Schroeder
 
4
 * emes -at- geomer.de
 
5
 * All rights reserved.
 
6
 *
 
7
 * Redistribution and use in source and binary forms, with or without 
 
8
 * modification, are permitted provided that the following conditions 
 
9
 * are met:
 
10
 *
 
11
 * 1. Redistributions of source code must retain the above copyright 
 
12
 *    notice, this list of conditions and the following disclaimer.
 
13
 * 2. Redistributions in binary form must reproduce the above copyright 
 
14
 *    notice, this list of conditions and the following disclaimer in the 
 
15
 *    documentation and/or other materials provided with the distribution.
 
16
 * 3. Neither the name of Martin Schroeder nor the names of his contributors 
 
17
 *    may be used to endorse or promote products derived from this software 
 
18
 *    without specific prior written permission. 
 
19
 *
 
20
 *
 
21
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
 
22
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
 
23
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
 
24
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
 
25
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
 
26
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
 
27
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
 
28
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
 
29
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
 
30
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
 
31
 * POSSIBILITY OF SUCH DAMAGE.
 
32
 *
 
33
 */    
 
34
 
 
35
#ifndef _POWERWARE_H
 
36
#define _POWERWARE_H
 
37
 
 
38
#include <termios.h>
 
39
 
 
40
 
 
41
char *FreqTol[3]        = {"+/-2%", "+/-5%", "+/-7"};
 
42
char *ABMStatus[4]      = {"Charging", "Discharging", "Floating", "Resting"};
 
43
 
 
44
#define PW_MAX_TRY  3   /* How often we try to get valid data from the ups in */
 
45
                        /* case of a read error                               */
 
46
 
 
47
 
 
48
#define PW_MAX_BAUD 5
 
49
struct pw_baud_rate {
 
50
        int rate;
 
51
        int name;
 
52
} pw_baud_rates[] = {
 
53
        { B1200,  1200 },
 
54
        { B2400,  2400 },
 
55
        { B4800,  4800 },
 
56
        { B9600,  9600 },
 
57
        { B19200, 19200 },
 
58
};
 
59
                            
 
60
 
 
61
#define PW_COMMAND_START_BYTE   0xAB
 
62
 
 
63
 
 
64
#define PW_SYSTEM_INFO1         0x31    /* Model name, ...                        */
 
65
#define PW_SYSTEM_MODE          0x33    /* On Line, On Bypass, ...                */
 
66
#define PW_SYSTEM_STATUS        0x34    /* Current UPS status (Load, utility,...) */
 
67
#define PW_SYSTEM_INFO2         0x36    /* Model serial#, ...                     */
 
68
#define PW_ABM_STATUS           0x3B    /* Charging, floating, ...                */
 
69
#define PW_SYSTEM_SETTINGS      0x3C    /* Configuration (Bypass thresholds,...)  */
 
70
 
 
71
 
 
72
#endif /* _POWERWARE_H */
 
73