OpenBSD 4.2 apcupsd 3.14.3 (bsd-usb.c patched)

View: New views
1 Messages — Rating Filter:   Alert me  

OpenBSD 4.2 apcupsd 3.14.3 (bsd-usb.c patched)

by Dick Blonov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Installed the 3.14.3 source and patched bsd-usb.c (patch attached). I
guess 3.14.4 should behave the same since it has that patch applied.

Works perfectly (ugen picked up the UPS (generic kernel) without having
to disable other USB drivers).

Here's my apcaccess output.

APC      : 001,036,0910
DATE     : Wed Jul 02 23:11:54 EDT 2008
HOSTNAME : dembo.my.domain
RELEASE  : 3.14.3
VERSION  : 3.14.3 (20 January 2008) openbsd
UPSNAME  : dembo.my.domain
CABLE    : USB Cable
MODEL    : Back-UPS ES 500
UPSMODE  : Stand Alone
STARTTIME: Wed Jul 02 22:23:49 EDT 2008
STATUS   : ONLINE
LINEV    : 121.0 Volts
LOADPCT  :  16.0 Percent Load Capacity
BCHARGE  : 100.0 Percent
TIMELEFT :  37.4 Minutes
MBATTCHG : 50 Percent
MINTIMEL : 10 Minutes
MAXTIME  : 0 Seconds
SENSE    : High
LOTRANS  : 088.0 Volts
HITRANS  : 138.0 Volts
ALARMDEL : Always
BATTV    : 13.6 Volts
LASTXFER : Low line voltage
NUMXFERS : 0
TONBATT  : 0 seconds
CUMONBATT: 0 seconds
XOFFBATT : N/A
STATFLAG : 0x07000008 Status Flag
MANDATE  : 2005-07-18
SERIALNO : BB0530002058  
BATTDATE : 2000-00-00
NOMINV   : 120 Volts
NOMBATTV :  12.0 Volts
FIRMWARE : 801.e6.D USB FW:e6
APCMODEL : Back-UPS ES 500
END APC  : Wed Jul 02 23:12:36 EDT 2008
#


apcupsd FTW !

Phil


[bsd-patch]

--- src/drivers/usb/bsd/bsd-usb.c.orig  2007-10-27 20:15:14.000000000 +0300
+++ src/drivers/usb/bsd/bsd-usb.c       2008-03-18 01:10:26.000000000 +0200
@@ -351,9 +351,9 @@
 
 int pusb_ups_get_capabilities(UPSINFO *ups, const struct s_known_info *known_info)
 {
-   int i, rc, ci, phys;
+   int i, ci, phys, input, feature;
    USB_DATA *my_data = (USB_DATA *)ups->driver_internal_data;
-   hid_item_t item;
+   hid_item_t item, witem;
    USB_INFO *info;
 
    write_lock(ups);
@@ -506,7 +506,7 @@
 
       // Store a (possibly truncated) copy of the floating point value in the
       // integer field as well.
-      val.iValue = val.dValue;
+      val.iValue = (int) val.dValue;
 
       Dmsg4(200, "Def val=%d exp=%d dVal=%f ci=%d\n", info->value,
          exponent, val.dValue, info->ci);
@@ -775,7 +775,7 @@
    return true;
 }
 
-int pusb_write_int_to_ups(UPSINFO *ups, int ci, int value, char *name)
+int pusb_write_int_to_ups(UPSINFO *ups, int ci, int value, const char *name)
 {
    USB_DATA *my_data = (USB_DATA *)ups->driver_internal_data;
    USB_INFO *info;


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Apcupsd-users mailing list
Apcupsd-users@...
https://lists.sourceforge.net/lists/listinfo/apcupsd-users