<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Feb 14, 2012, at 5:02 PM, William R. Elliot wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<div>
<font size="3">I am trying to make ups.delay.shutdown writable so the user
can use upsrw to change it.<br><br>
In the driver, after setting the variable to 0, I am using: 
dstate_setflags("ups.delay.shutdown", ST_FLAG_RW);<br></font></div></blockquote><div><font size="3"><br></font></div><div>As in the other thread, this is not something I am terribly familiar with, but I'll give it a shot.</div><div><font size="3"><br></font></div><div><font size="3">I think the only two types of R/W variables in NUT are strings and enumerations. If it is an enumeration, you would need to provide a list of all possible values:</font></div><div><font size="3"><br></font></div><div><font size="3">   <a href="http://www.networkupstools.org/docs/developer-guide.chunked/ar01s04.html#_enumerated_types">http://www.networkupstools.org/docs/developer-guide.chunked/ar01s04.html#_enumerated_types</a></font></div><div><font size="3"><br></font></div><div><font size="3">It sounds like you are looking for an integer variable, which I have handled in the past by using ST_FLAG_STRING and parsing the string with sscanf().</font></div><div><font size="3"><br></font></div><div><font size="3">The "OK" return code is only a confirmation of receipt of the command - there was some discussion about how to handle return values, but often this would result in a round-trip to the device-- and the simplest way to handle this without blocking is to re-read the variable after setting it.</font></div></div><br><div apple-content-edited="true">
<div>-- </div><div>Charles Lepple</div><div>clepple@gmail</div><div><br></div><br class="Apple-interchange-newline">
</div>
<br></body></html>