[Nut-upsdev] a patch for apc-hid.h

Alfred Ganz alfred-ganz+nut at agci.com
Thu Aug 4 23:00:14 UTC 2005


Gentlemen,

I have determined that on my UPS (APC Back-UPS ES 650 FW:818.w1.D USB FW:w1),
the variable UPS.PowerSummary.RemainingCapacityLimit is writeable. I am
setting this variable to start shutdown a little earlier. Appended is an 
unconditional patch for apc-hid.h. 

If, as indicated by the original code, there are APC UPS devices that don't
allow setting of this variable, it becomes unfortunately necessary to
complete the following
    /* TODO: verify setability/RW with (hData.Attribute != ATTR_DATA_CST) */
in hid_ups_walk() in newhidups.c in order to use this patch generically 
with apc-hid.h. I would appreciate it if someone with a better understanding
of UPS HID than I would address this task.

Thank you, AG

---------------- patch for apc-hid.h ---------------------------------------
@@ -54,8 +54,8 @@
   
   /* Battery page */
   { "battery.charge", 0, 1, "UPS.PowerSummary.RemainingCapacity", NULL, "%.0f", HU_FLAG_OK, NULL },
-  { "battery.charge.low", ST_FLAG_STRING, 5, "UPS.PowerSummary.RemainingCapacityLimit", NULL,
-    "%.0f", HU_FLAG_OK, NULL }, /* Read only */
+  { "battery.charge.low", ST_FLAG_RW | ST_FLAG_STRING, 5, "UPS.PowerSummary.RemainingCapacityLimit", NULL,
+    "%.0f", HU_FLAG_OK | HU_FLAG_SEMI_STATIC, NULL },
   { "battery.runtime", 0, 0, "UPS.PowerSummary.RunTimeToEmpty", NULL, "%.0f", HU_FLAG_OK, NULL },
   { "battery.voltage",  0, 0, "UPS.PowerSummary.Voltage", NULL, "%.1f", HU_FLAG_OK, NULL },
   { "battery.voltage.nominal", 0, 0, "UPS.Battery.ConfigVoltage", NULL,
----------------------------------------------------------------------------

-- 
 ----------------------------------------------------------------------
   Alfred Ganz					alfred-ganz at agci.com
   AG Consulting, Inc.				(203) 624-9667
   440 Prospect Street # 11
   New Haven, CT 06511
 ----------------------------------------------------------------------



More information about the Nut-upsdev mailing list