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 &quot;BNT&quot; <br>
to connect to the UPS.<br><br>My rather long-winded question:  the powercom driver now does some kind of &quot;battery test&quot; 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&amp;sc=0">http://svn.debian.org/wsvn/nut/trunk/drivers/powercom.c?rev=1236&amp;sc=0</a><br><br>In method &quot;upsdrv_initups&quot; there is now an extra section that does the <br>
&quot;ser_send_char(upsfd, BATTERY_TEST)&quot;  for some reason:<br>---------- code ----------<br>if (!strncasecmp(types[type].name, &quot;BNT&quot;,3) || !strncasecmp(types[type].name, &quot;KIN&quot;,3) || !strncasecmp(types[type].name, &quot;IMP&quot;,3)){<br>
        if (!ups_getinfo()) return;<br>        if (raw_data[UPSVERSION]==0xFF){<br>            types[type].name=&quot;IMP&quot;;<br>            model=raw_data[MODELNUMBER]/16;<br>        }<br>        if (raw_data[MODELNAME]==0x42){<br>
            types[type].name=&quot;BNT&quot;;<br>            model=BNTmodels[raw_data[MODELNUMBER]/16];<br>        }<br>        if (raw_data[MODELNAME]==0x4B){<br>            types[type].name=&quot;KIN&quot;;<br>            model=KINmodels[raw_data[MODELNUMBER]/16];<br>
        }<br>        linevoltage=voltages[raw_data[MODELNUMBER]%16];<br>        sprintf(buf,&quot;%s-%dAP&quot;,types[type].name,model);<br>        modelname=buf;<br>        upsdebugx(1,&quot;Detected: %s , %dV&quot;,modelname,linevoltage);<br>
        if (ser_send_char (upsfd, BATTERY_TEST) != 1) {<br>            upslogx(LOG_NOTICE, &quot;writing error&quot;);<br>            dstate_datastale();<br>            return;<br>        }<br>    }<br>---------- code ----------<br>
The outer &quot;if&quot; (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>