rsmp-nordic / rsmp_sxl_traffic_lights

RSMP Signal Exchange List (SXL) for Traffic Controllers
MIT License
12 stars 4 forks source link

repeated M0001 commands and timeout? #149

Open emiltin opened 2 years ago

emiltin commented 2 years ago

What happens if you send an M0001 with a timeout, and send another one before the first timeout is reached?

  1. are previous timeouts cancelled when a new one is set?
  2. when the timeout is reached, what position should be reverted to?

Example:

the tlc is in normal control switch to dark, with timeout of 2min right after, switch to yellow flash, with timeout of 1min

.. after 1m the tlc switches to dark? .. does it ever switch back to normal control?

otterdahl commented 2 years ago

I think that any new command clears any old command. The last received command overrides the timeout value.

emiltin commented 2 years ago

ok. so in the example above, it switches to dark after 1min, and never back to normal control?

emiltin commented 2 years ago

if you try to switch to the position that you're already in, should it abort, or clear the previous timeout?

otterdahl commented 2 years ago

so in the example above, it switches to dark after 1min, and never back to normal control?

Yes, I think so. At least, that's how I interpret how it's written in the SXL.

if you try to switch to the position that you're already in, should it abort, or clear the previous timeout?

I don't see how the command would have any effect. Unless there is some edge case.

emiltin commented 2 years ago

say you're in dark mode. and a timeout is active, e.g one that would switch it back to normal control. if you send the same command again, that timeout gets cleared, and it will never switch back to normal control.

otterdahl commented 2 years ago

say you're in dark mode. and a timeout is active, e.g one that would switch it back to normal control. if you send the same command again, that timeout gets cleared, and it will never switch back to normal control.

Right. That is how it is is currently stated in the SXL. And yes, it might not be the best solution. We can consider changing this so that it should always revert to NormalControl instead.