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

Arnaud Quette aquette.dev at gmail.com
Tue May 15 12:17:48 UTC 2012


2012/3/9 Greg A. Woods <woods at planix.com>:
> 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);

I've postponed this one, until we fix the situation with the various
non standard variables that are enabled by defining "EXTRADATA".

For the time being, there is a bug to track this:
https://alioth.debian.org/tracker/index.php?func=detail&aid=313633&group_id=30602&atid=411542

cheers,
Arnaud
-- 
Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.free.fr/



More information about the Nut-upsdev mailing list