<html>
<body>
Returned to office right now... :-( <br>
Now I will take a look to your corrections.<br><br>
. best regards<br>
_ Elio Corbolante.<br><br>
At 23:54 2009/02/05 +0100, Kjell Claesson wrote:<br>
<blockquote type=cite class=cite cite="">onsdag 04 februari 2009 23:24:11
skrev Arjen de Korte:<br>
Hi Arjen,<br><br>
(Sorry for the bottom quote of original mail)<br><br>
As I put it in the trunk I feel that I have to fix some of the code.<br>
Send a copy of the mail to Elio. I have made some changes to the
code,<br>
as you suggested. But I leave it up to Elio to check it out.<br><br>
I don't want to make to may changes. But it is in the trunk now.<br><br>
regards<br>
/Kjell<br><br>
P.S. Made some comments in the rest of the mail.<br>
> Citeren Arnaud Quette <aquette.dev@gmail.com>:<br>
> > Author: keyson-guest<br>
> > Date: Wed Feb 4 15:03:36 2009<br>
> > New Revision: 1765<br>
> ><br>
> > Log:<br>
> > - Added mocrodowell.c/h into drivers/. add man/microdowell.8.
Adjusted<br>
> > drivers/Makefile.am and man/makefile.am. Adjusted the code for
2.4.0 in<br>
> > the microdowell.c.<br>
><br>
> Besides the things already mentioned by others and the obvious<br>
><br>
> formatting issue, just a couple of nits to pick:<br>
> > 93 <x-tab> </x-tab>static char *ErrMessages[] = {<br>
><br>
> [...]<br>
><br>
> > 187
<x-tab> </x-tab>}<br>
Not done anything about this as....<br><br>
><br>
> Consider returning the error message through something like<br>
><br>
> > 124
<x-tab> </x-tab>case
ERR_NO_ERROR:<br>
> > 125
<x-tab> </x-tab><x-tab>
</x-tab>return
"OK";<br>
><br>
> instead of doing this indirectly through an index in an array of
error<br>
> strings. This makes sure these don't get out of sync.<br>
><br>
..it depends on how this is handled.<br>
Leave this to Elio</blockquote><br>
I will check it out<br><br>
<br>
<blockquote type=cite class=cite cite="">> > 547
<x-tab> </x-tab>
dstate_setinfo("ups.StatusUPS", "%08lX",<br>
> > ups.StatusUPS) ;<br>
> > 548
<x-tab> </x-tab>
dstate_setinfo("ups.ShortStatus", "%04X",<br>
> > ups.ShortStatus) ;<br>
><br>
> Don't 'invent' new variables without discussing this on the<br>
> development mailinglist. Since these are probably useful only
for<br>
> debugging purposes, they shouldn't be exposed to the
server/clients<br>
> anyway.<br><br>
Changed this to debug statements.</blockquote><br>
OK<br><br>
<br><br>
<blockquote type=cite class=cite cite="">><br>
> > 629
<x-tab> </x-tab>
dstate_setinfo("ups.realpower", "%d",<br>
> > (int)((float)(p[4]*256 + p[5]) * 0.6)) ;<br>
><br>
> This suggests a fixed relationship between apparent and active
power.<br>
> This might be the case for the nominal values, but this is not true
in<br>
> the general case. So don't export 'ups.realpower' unless it is
truly<br>
> measured (which is not the case here).<br><br>
Made a comment that it is calculated. Can this be
measured?</blockquote><br>
Yes, the relation between the VA and W is fixed as in the most UPS sold
on the market:<br>
Very few UPS have a cos phi of 1.0. <br>
This particular line of UPSs has a cos phi of 0.6 and the calculation of
the VA value is made integrating the current measurement (10 samples for
a half sine) so the result is very near to an RMS value.<br>
The output in W is 0.6 * VA<br><br>
<br><br>
<blockquote type=cite class=cite cite="">><br>
> > 645
<x-tab> </x-tab>
poll_interval = 2;<br>
><br>
> Any particular reason to hardcode this? This might surprise
people<br>
> that attempt to override this value, so unless there is a real
good<br>
> reason to do this, it will be confusing.<br><br>
I leave it in. Have you any good reason to have it hardcoded
Elio?</blockquote><br>
No, there were no particular reason.<br>
It can be any value but I thought that 2 seconds was reasonable.<br><br>
<br><br>
<blockquote type=cite class=cite cite="">><br>
> > 899
<x-tab> </x-tab>
dstate_setinfo("ups.StatusUPS", "%08lX",<br>
> > ups.StatusUPS) ;<br>
> > 900
<x-tab> </x-tab>
dstate_setinfo("ups.ShortStatus", "%04X",<br>
> > ups.ShortStatus) ;<br>
> > 905
<x-tab> </x-tab>
dstate_setinfo("ups.time", "%02d:%02d:%02d",<br>
> > p[6], p[7], p[8]) ;<br>
><br>
> The above is a waste of effort. By the time upsdrv_shutdown()
runs,<br>
> the server won't be listening anymore.<br>
><br>
Changed the status to debug messages. And removed the ups.time her,<br>
as the daemon would not get it anyway.</blockquote><br>
The UPS timer countinue to work by itself even if the computer is turned
off: if you need, you can program/enable up to 6 weekly schedules in the
UPS and it will turn ON/OFF without requiring any attached computer to
it!!!<br><br>
<br><br>
<blockquote type=cite class=cite cite="">> > 958
<x-tab> </x-tab>
addvar(VAR_VALUE,
"ups.delay.shutdown", "Override<br>
> > shutdown delay (120s)");<br>
> > 959
<x-tab> </x-tab>
addvar(VAR_VALUE,
"ups.delay.start", "Override restart<br>
> > delay (10s)");<br>
><br>
> This doesn't work without using getval() somewhere in the
driver.<br>
Fixed this and moved some code. This can now be set from ups.conf.<br>
And as before changed during runtime.</blockquote><br>
OK<br><br>
<br><br>
<blockquote type=cite class=cite cite="">> > 971
<x-tab> </x-tab>
ioctl(upsfd, TIOCMBIC,
&rts_bit);<br>
> > 972
<x-tab> </x-tab>
ioctl(upsfd, TIOCMBIC,
&dtr_bit);<br>
><br>
> We have library functions in serial.c to handle this. Use
them.</blockquote><br>
Unfortunately (even for the debugging functions) when I wrote the driver
(if I remember correctly) there were NO official documentation on the
OFFICIAL functions to be used in the developement of the drivers.
<br><br>
<br><br>
. best regards<br>
_ Elio Corbolante.<br><br>
<br>
<x-sigsep><p></x-sigsep>
<font face="Arial, Helvetica">Elio Corbolante<br>
e-mail:
<x-tab> </x-tab>
eliocor@microdowell.com <br>
<x-tab> </x-tab>
research@microdowell.com <br>
</font><font face="Arial, Helvetica" size=5 color="#808080"><b>Micro<i>
dowell</i> S.p.A.<br>
</b></font><font face="Arial, Helvetica" size=2>Via dei Boschi, 2<br>
33040 - Pradamano (UD) - Italia<br>
Tel. +39-0432-671758<br>
Tel. +39-0432-640142 (Assistenza Tecnica)<br>
Fax. +39-0432-671760<br>
<a href="http://www.microdowell.com/">http://www.microdowell.com</a>
</font> <br>
</body>
</html>