Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Sep 2000 23:24:30 -0700 (PDT)
From:      Stephen Beitzel <sbeitzel@mumble.foobie.net>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/21556: Fix to let upsd know about 115VAC SmartUPS systems
Message-ID:  <200009260624.e8Q6OUm18028@mumble.foobie.net>

next in thread | raw e-mail | index | archive | help

>Number:         21556
>Category:       ports
>Synopsis:       Fix to let upsd know about 115VAC SmartUPS systems
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 25 23:30:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Stephen Beitzel
>Release:        FreeBSD 4.1-STABLE i386
>Organization:
foobie.net
>Environment:
	APC SmartUPS 700

>Description:

	The current port of upsd only recognizes 230 and 420 volt
	UPS devices. The included patch adds support for 115 volt
	devices (specifically, the APC SmartUPS 700). I have tested
	this with my system and it seems to be working fine.

>How-To-Repeat:
>Fix:

--- /usr/ports/sysutils/upsd/work/upsd-2.0/apc.h	Mon Sep 25 17:14:37 2000
+++ apc.h	Mon Sep 25 17:15:11 2000
@@ -66,6 +66,7 @@
 extern int apc_poll(struct ups_val *);
 extern int apc_tune(struct ups_val *);
 
+extern struct ups_model apc_SmartUPS_115;
 extern struct ups_model apc_SmartUPS_230;
 extern struct ups_model apc_SmartUPS_vs_420;
 extern char apc_SmartUPS_OK[];

--- /usr/ports/sysutils/upsd/work/upsd-2.0/apc_static.c	Mon Sep 25 11:41:50 2000
+++ apc_static.c	Mon Sep 25 12:17:36 2000
@@ -74,6 +74,59 @@
 	{0, NULL, 0, 0, 0, 0, 0, NULL, 0}
 };
 
+/* Legal values for SmartUPS(R) 115V units. Added by Stephen Beitzel <sbeitzel@pobox.com>
+** and taken from the documentation for the APC SmartUPS 700. */
+static struct ups_val apc_SmartUPS_115_values[] = {
+	{SMART_HTPOINT, {number: 129}},
+	{SMART_HTPOINT, {number: 132}},
+	{SMART_HTPOINT, {number: 135}},
+	{SMART_HTPOINT, {number: 138}},
+
+	{SMART_LTPOINT, {number: 97}},
+	{SMART_LTPOINT, {number: 100}},
+	{SMART_LTPOINT, {number: 103}},
+	{SMART_LTPOINT, {number: 106}},
+
+	{SMART_LOWBATDUR, {number: 2}},
+	{SMART_LOWBATDUR, {number: 5}},
+	{SMART_LOWBATDUR, {number: 7}},
+	{SMART_LOWBATDUR, {number: 10}},
+
+	/* several models accept different values here */
+	{SMART_WAKEUPBCAP, {number: 0}},
+	{SMART_WAKEUPBCAP, {number: 15}},
+	{SMART_WAKEUPBCAP, {number: 50}},
+	{SMART_WAKEUPBCAP, {number: 90}},
+
+	{SMART_WAKEUPDELAY, {number: 0}},
+	{SMART_WAKEUPDELAY, {number: 60}},
+	{SMART_WAKEUPDELAY, {number: 180}},
+	{SMART_WAKEUPDELAY, {number: 300}},
+
+	{SMART_NVOLTAGE, {number: 115}},
+	{SMART_NVOLTAGE, {number: 120}},
+	{SMART_NVOLTAGE, {number: 110}},
+
+	{SMART_SHUTDELAY, {number: 20}},
+	{SMART_SHUTDELAY, {number: 180}},
+	{SMART_SHUTDELAY, {number: 300}},
+
+	{SMART_LINESENS, {binary: "L"}},
+	{SMART_LINESENS, {binary: "M"}},
+	{SMART_LINESENS, {binary: "H"}},
+
+	{SMART_LINEALARM, {binary: "0"}},
+	{SMART_LINEALARM, {binary: "L"}},
+	{SMART_LINEALARM, {binary: "T"}},
+	{SMART_LINEALARM, {binary: "N"}},
+
+	{SMART_LABEL, {binary: NULL}},
+
+	{SMART_BREPL, {binary: NULL}},
+
+	{0, {binary: NULL}}
+};
+
 /* Legal values for SmartUPS(R) 230V units. */
 static struct ups_val apc_SmartUPS_230_values[] = {
 	{SMART_HTPOINT, {number: 253}},
@@ -141,6 +194,18 @@
 	{SMART_TBLOW, "batteries-low", SMART_TBRST, "%", 1},
 	{SMART_TBRST, "batteries-restore", SMART_TBLOW, "+", 1},
 	{0, NULL, 0, NULL, 0}
+};
+
+struct ups_model apc_SmartUPS_115 = {
+	"apc-smart",
+	"smart-ups",
+	115,
+	sizeof(apc_SmartUPS_registers)/sizeof(struct ups_reg),
+	apc_SmartUPS_registers,
+	apc_SmartUPS_triggers,
+	apc_SmartUPS_115_values,
+	apc_poll,
+	apc_tune
 };
 
 struct ups_model apc_SmartUPS_230 = {

--- /usr/ports/sysutils/upsd/work/upsd-2.0/upsd.c	Mon Sep 25 17:10:33 2000
+++ upsd.c	Mon Sep 25 17:11:51 2000
@@ -30,6 +30,7 @@
 
 /* All supported UPS models. */
 struct ups_model *upslist[] = {
+	&apc_SmartUPS_115,
 	&apc_SmartUPS_230,
 	&apc_SmartUPS_vs_420,
 	NULL

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200009260624.e8Q6OUm18028>