OpenZWave / open-zwave

a C++ library to control Z-Wave Networks via a USB Z-Wave Controller.
http://www.openzwave.net/
GNU Lesser General Public License v3.0
1.05k stars 918 forks source link

Reduce retransmit timeout after a CAN collision #2566

Open MarkGodwin opened 3 years ago

MarkGodwin commented 3 years ago

I noticed that the side effect to PR #2049 is that it introduces an at least 1 second delay before the message is re-transmitted, and could potentially be much worse if there is more activity on the network, as each unsolicited message resets the timer again.

This is a simple change to use a much shorter timeout after a CAN or NAK message from the controller, so we can get on with clearing the message queue sooner, while still allowing any queued incoming messages to be processed first, in the spirit of the original PR.

This makes a big difference for me when setting scenes with multiple Z-Wave devices. I have been seeing delays of 2-3 seconds appearing due to the chatty devices responding to requests with multiple unsolicited updates on the lifeline association group.