What would be the best way to implement a delay for an SNMP Get operation, when the device needs some time to process a WRITE-only SNMP Set parameter?
Example :
- a 'Load Presets' BUTTON. (write only SNMP action)
- the device needs some time to prepare the presets
In this particular case we cannot immediately retrieve the Presets, because the device needs some time to prepare them.
What is the best practice for delaying the SNMP Get operation after having executed the SNMP set action?
This is my general approach when using time windows.
When the button is pressed you can store the time in a parameter. Then, using a timer-based QAction you can check if a (perhaps user configurable) timespan has been reached since that time and the current time, after which you can either check the trigger to do the get operation, or wait for the next execution of the QAction, and check again.
Depending on how strict you want the time to be you will need a fast or a really fast timer. e.g. if your minimum timespan is 30 seconds, but the timer for the QAction is also 30 seconds, you have a worst case scenario of it taking close to 60 seconds. A 5 second timer would reduce it to maximum of 35 seconds.