Fellows,<br><br>I've had this stagging for too long:<br>For some writable (RW) variables, that support ranges of values, ENUM and STRING are too limited and not adapted.<br>So it's worth adding a new RANGE type, with the needed driver function (dstate_addrange()) and server / client support.<br>
<br>Thus, I'm intending to do the following network protocol addition:<br>    * new RANGE type, for the "GET  TYPE" command. This needs the "RW" flag, and completes existing ENUM and STRING types<br>
   
* new "LIST RANGE" command:<br><br>RANGE<br>~~~~~<br><br>Form:<br><br>    LIST RANGE <upsname> <varname><br>    LIST RANGE su700 input.transfer.low<br><br>Response:<br><br>    BEGIN LIST RANGE <upsname> <varname><br>
    RANGE <upsname> <varname> "<min>" "<max>"<br>    ...<br>    END LIST RANGE <upsname> <varname><br><br>    BEGIN LIST RANGE su700 input.transfer.low<br>    RANGE su700 input.transfer.low "90" "100"<br>
    RANGE su700 input.transfer.low "102" "105"<br>    ...<br>    END LIST RANGE su700 input.transfer.low<br><br><br>A branch is available for review:<br>$ svn co svn://<a href="http://anonscm.debian.org/nut/branches/var-range">anonscm.debian.org/nut/branches/var-range</a><br>
<a href="http://trac.networkupstools.org/projects/nut/changeset/3527">http://trac.networkupstools.org/projects/nut/changeset/3527</a><br><br>It includes the core implementation ({d,s,}state, Ie drivers,server,core support), upsrw and the documentation updates.<br>
Python / Perl / Java implementations, plus a bit of polishing, are the only thing missing.<br><br>Note that this implementation supports multiple ranges specifications, as shown above.<br>I'm still not sure if this is (or will be) useful, since I personally have no example!<br>
<br>Here is a sample upsrw output:<br>[test.range.low]<br>Description unavailable<br>Type: RANGE<br>Option: "90-100" SELECTED<br>Option: "102-105"<br>
<br>As usual, feedback and comments welcome...<br><br>cheers,<br>Arnaud<br>