Open plinioseniore opened 9 years ago
This is not trivial, since it has to be integrated with actual time-out detection mechanism. In the app the channel for sending commands is decoupled, so every activity has to manage the timeout consistently
Sure, I don't know how actually this is done in SoulissApp. But you should go concurrently with the actual time-out, you need a sending queue that tracks each send packet with an its own timed-out state.
So that you can track multiple packet at same time, just checking if the states changed accordingly. This should be in a short time-frame (lets say 3 or 5 seconds timeout) in order to avoid confusion with commands sent from other sources.
The openHAB binding by @fazioa has a nice feature that allow the binding to re-transmit a command if this has been lost.
If works in a very easy way, for each command there is an associated feedback value, once a command has been issued the binding monitor the relevant slot and waits for a state update. If the state doesn't update with the expected value it issue the command again, no more than three times.
Not all commands are suitable, so there is a NULL feddback value that disable this mechanism, examples are toggles commands.