Carlos Rodrigues
2005-Oct-10 00:02 UTC
[Nut-upsdev] Re: About blazer, powermust and mustek
Arnaud Quette wrote:> Anyhow, I would more see this as a merge of all these drivers, with > some autodetection or flag/param to switch the mfr/model and maybe > capabilities... Whatever the driver name is, a good thing would be the > name of the protocol or something generic enough, though powermust is > fine.Ok, I made some minor changes to powermust, to make it less "mustek" and more "megatec protocol", which can be seen in the attached patch. If this is ok, I can rebuild the patch with the other changes necessary for this (rename powermust and change the docs and manpage). Carlos Rodrigues -------------- next part -------------- diff -ruN nut.orig/drivers/powermust.c nut/drivers/powermust.c --- nut.orig/drivers/powermust.c 2005-09-12 13:38:35.000000000 +0100 +++ nut/drivers/powermust.c 2005-10-10 00:58:50.000000000 +0100 @@ -1,8 +1,8 @@ /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: t; -*- * - * powermust.c: support for Mustek (and others) models + * powermust.c: support for Megatec protocol based UPSes * - * Copyright (C) 2003, 2004 Carlos Rodrigues <carlos.efr@mail.telepac.pt> + * Copyright (C) 2003-2005 Carlos Rodrigues <carlos.efr@mail.telepac.pt> * * powermust.c created on 4/10/2003 * @@ -99,7 +99,7 @@ } QueryValues; -/* Defined in upsdrv_initups */ +/* Defined in upsdrv_initinfo */ static float battvolt_min; static float battvolt_max; @@ -206,13 +206,13 @@ } if (success < IDENT_MINSUCCESS) { - fatalx("Mustek PowerMust UPS, or compatible, not detected."); + fatalx("Megatec protocol UPS not detected."); } - upslogx(LOG_INFO, "Mustek PowerMust UPS, or compatible, detected."); + upslogx(LOG_INFO, "Megatec protocol UPS detected."); dstate_setinfo("driver.version.internal", "%s", DRV_VERSION); - dstate_setinfo("ups.mfr", "Mustek"); - dstate_setinfo("ups.model", "PowerMust"); + dstate_setinfo("ups.mfr", "unknown"); + dstate_setinfo("ups.model", "unknown (Megatec protocol based)"); dstate_setinfo("ups.serial", "unknown"); if (get_firmware_values(&values) < 0) { @@ -427,7 +427,7 @@ if (strcasecmp(varname, "ups.delay.start") == 0) { delay = CLAMP(delay, 0, MAX_START_DELAY); start_delay = delay; - dstate_setinfo( "ups.delay.start", "%d", delay); + dstate_setinfo("ups.delay.start", "%d", delay); dstate_dataok(); @@ -437,7 +437,7 @@ if (strcasecmp(varname, "ups.delay.shutdown") == 0) { delay = CLAMP(delay, 0, MAX_SHUTDOWN_DELAY); shutdown_delay = delay; - dstate_setinfo( "ups.delay.shutdown", "%d", delay); + dstate_setinfo("ups.delay.shutdown", "%d", delay); dstate_dataok(); @@ -460,8 +460,8 @@ void upsdrv_banner(void) { - printf("Network UPS Tools - Mustek PowerMust UPS driver %s (%s)\n", DRV_VERSION, UPS_VERSION); - printf("Carlos Rodrigues (c) 2003, 2004\n\n"); + printf("Network UPS Tools - Megatec protocol driver %s (%s)\n", DRV_VERSION, UPS_VERSION); + printf("Carlos Rodrigues (c) 2003-2005\n\n"); } diff -ruN nut.orig/drivers/powermust.h nut/drivers/powermust.h --- nut.orig/drivers/powermust.h 2005-09-12 13:38:35.000000000 +0100 +++ nut/drivers/powermust.h 2005-10-10 00:57:59.000000000 +0100 @@ -1,8 +1,8 @@ /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: t; -*- * - * powermust.h: support for Mustek (and others) models + * powermust.h: support for Megatec protocol based UPSes * - * Copyright (C) 2003, 2004 Carlos Rodrigues <carlos.efr@mail.telepac.pt> + * Copyright (C) 2003-2005 Carlos Rodrigues <carlos.efr@mail.telepac.pt> * * powermust.c created on 4/10/2003 * @@ -21,4 +21,4 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#define DRV_VERSION "1.1" +#define DRV_VERSION "1.2"
Hi, Following the previous mails, I've: - removed Martin from the list, - added Michel for his fentonups knowledges. Michel, your help would be welcomed ;-) 2005/10/10, Carlos Rodrigues <carlos.efr@mail.telepac.pt>:> > Arnaud Quette wrote: > > > Anyhow, I would more see this as a merge of all these drivers, with > > some autodetection or flag/param to switch the mfr/model and maybe > > capabilities... Whatever the driver name is, a good thing would be the > > name of the protocol or something generic enough, though powermust is > > fine. > > Ok, I made some minor changes to powermust, to make it less "mustek" and > more "megatec protocol", which can be seen in the attached patch.uhm, megatec you say! You should also have a look at fentonups. I remember that it's stated to be a Megatec protocol driver (look at driver.list too)... If this is ok, I can rebuild the patch with the other changes necessary> for this (rename powermust and change the docs and manpage).maybe megatec would be a good name! considering my above remark, things might be huger than I (we) have thought at first... I like the starting of your patch (more generic...), although the unknown values in mfr/model aren't the best. Some switch (ie -mode={mustek,blazer,fenton} should be fine to handle this. Anyway, we'll postpon things until the situation gets more clear. Can you please have a look at all these Carlos and Michel? thanks, Arnaud -- Linux / Unix Expert - MGE UPS SYSTEMS - R&D Dpt Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/ Debian Developer - http://people.debian.org/~aquette/<http://people.debian.org/%7Eaquette/> OpenSource Developer - http://arnaud.quette.free.fr/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20051010/c4520377/attachment.htm