[Nut-upsdev] [PATCH 28/36] Turn on EXTRADATA by default, and fix the code to work with it on!

Greg A. Woods woods at planix.com
Thu Mar 8 23:21:39 UTC 2012


From: "Greg A. Woods" <woods at planix.com>

---
 drivers/metasys.c |   16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/metasys.c b/drivers/metasys.c
index e80217f..aec15e9 100644
--- a/drivers/metasys.c
+++ b/drivers/metasys.c
@@ -17,10 +17,8 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */
 
-/* Uncomment if you want to read additional Meta System UPS data */
-/* 
-#define EXTRADATA 
-*/
+/* Defined to read additional interesting and useful Meta System UPS data */
+#define EXTRADATA 			/* defined */
 
 #include "main.h"
 #include "serial.h"
@@ -269,7 +267,7 @@ void upsdrv_initinfo(void)
 	 dstate_setinfo("output.current", "%d", -1);
 	dstate_setflags("output.current", ST_FLAG_RW);
 #ifdef EXTRADATA
-	 dstate_setinfo("output.current.peak", "%2.2f", -1);	
+	 dstate_setinfo("output.current.peak", "%2.2f", -1.0);
 	dstate_setflags("output.current.peak", ST_FLAG_RW);
 	 dstate_setinfo("input.power", "%d", -1);
 	dstate_setflags("input.power", ST_FLAG_RW);
@@ -277,17 +275,17 @@ void upsdrv_initinfo(void)
 	 dstate_setinfo("input.voltage", "%d", -1);
 	dstate_setflags("input.voltage", ST_FLAG_RW);
 #ifdef EXTRADATA
-	 dstate_setinfo("input.current", "%2.2f", -1);
+	 dstate_setinfo("input.current", "%2.2f", -1.0);
 	dstate_setflags("input.current", ST_FLAG_RW);
-	 dstate_setinfo("input.current.peak", "%2.2f", -1);	
+	 dstate_setinfo("input.current.peak", "%2.2f", -1.0);
 	dstate_setflags("input.current.peak", ST_FLAG_RW);
 #endif
 	 dstate_setinfo("battery.voltage", "%d", -1);
 	dstate_setflags("battery.voltage", ST_FLAG_RW);
 #ifdef EXTRADATA
-	 dstate_setinfo("battery.voltage.low", "%2.2f", -1);
+	 dstate_setinfo("battery.voltage.low", "%2.2f", -1.0);
 	dstate_setflags("battery.voltage.low", ST_FLAG_RW);
-	 dstate_setinfo("battery.voltage.exhaust", "%2.2f", -1);
+	 dstate_setinfo("battery.voltage.exhaust", "%2.2f", -1.0);
 	dstate_setflags("battery.voltage.exhaust", ST_FLAG_RW);
 	 dstate_setinfo("ups.total.runtime", "retrieving...");
 	dstate_setflags("ups.total.runtime", ST_FLAG_STRING | ST_FLAG_RW);
-- 
1.7.9.2




More information about the Nut-upsdev mailing list