[Nut-upsdev] Flushing the report buffer

Arjen de Korte nut+devel at de-korte.org
Wed Aug 15 09:33:00 UTC 2007

Hi Peter,

The explanation on why I want to flush the report buffer after running
instcmd() or setvar() was incorrect. It is not the variable thats get
written, that needs to be read fresh from the UPS. That is already handled
by HIDSetItemValue(), which reads back the value and thereby refreshes the
report buffer. I goofed up here, I looked at the wrong parameters. :-(

However, when I change the "output.voltage.nominal" on my Evolution 650,
it also adjusts the settings for "input.transfer.*" (automatically). There
is an odd chance that you might miss changes in the UPS if you change two
parameters in quick succession otherwise. Since you can never know what
values change after writing a variable to the UPS, I think the safest
option is to flush whatever is in the report buffer.

Maybe flushing the report buffer should be the default behaviour of
HIDSetItemValue(), so that it invalidates all timestamps in the report
buffer before reading back the parameter just set. Or would this be too
inflexible? What's your opinion on that?

Best regards, Arjen
Eindhoven - The Netherlands
Key fingerprint - 66 4E 03 2C 9D B5 CB 9B  7A FE 7E C1 EE 88 BC 57

More information about the Nut-upsdev mailing list