I was running Fedora Core 7 on my machine until this weekend when I upgraded to Fedora 11.<br>This meant upgrading from nut 2.0.5 to nut 2.4.1. I have a Powercom Black Knight 600AP UPS,<br>and this was always driven by the powercom driver, type KIN1500AP. Now I had to use type "BNT" <br>
to connect to the UPS.<br><br>My rather long-winded question: the powercom driver now does some kind of "battery test" when<br>it connects to the UPS. Is this correct?<br><br>I did some checking in the svn repo, and this change was added in revision:<br>
<a href="http://svn.debian.org/wsvn/nut/trunk/drivers/powercom.c?rev=1236&sc=0">http://svn.debian.org/wsvn/nut/trunk/drivers/powercom.c?rev=1236&sc=0</a><br><br>In method "upsdrv_initups" there is now an extra section that does the <br>
"ser_send_char(upsfd, BATTERY_TEST)" for some reason:<br>---------- code ----------<br>if (!strncasecmp(types[type].name, "BNT",3) || !strncasecmp(types[type].name, "KIN",3) || !strncasecmp(types[type].name, "IMP",3)){<br>
if (!ups_getinfo()) return;<br> if (raw_data[UPSVERSION]==0xFF){<br> types[type].name="IMP";<br> model=raw_data[MODELNUMBER]/16;<br> }<br> if (raw_data[MODELNAME]==0x42){<br>
types[type].name="BNT";<br> model=BNTmodels[raw_data[MODELNUMBER]/16];<br> }<br> if (raw_data[MODELNAME]==0x4B){<br> types[type].name="KIN";<br> model=KINmodels[raw_data[MODELNUMBER]/16];<br>
}<br> linevoltage=voltages[raw_data[MODELNUMBER]%16];<br> sprintf(buf,"%s-%dAP",types[type].name,model);<br> modelname=buf;<br> upsdebugx(1,"Detected: %s , %dV",modelname,linevoltage);<br>
if (ser_send_char (upsfd, BATTERY_TEST) != 1) {<br> upslogx(LOG_NOTICE, "writing error");<br> dstate_datastale();<br> return;<br> }<br> }<br>---------- code ----------<br>
The outer "if" (with the string comparisons to BNT, KIN and IMP) does not make a lot of sense to me?<br><br>So my questions are:<br> . why the battery test?<br> . the if looks a bit strange - is it supposed to look like that?<br>
<br>Thanks!<br>Albert<br>