Resets may occur by unplugging the stick or calling a softReset() from
the software side.
Additionally resets the stick when 5 subsequent timeouts happen
as there are firmwares of the CC2652 available which tend to
crash occationally.
The router broadcast address 0xFFFC is not a group addres, but a
"regular" address. Setting the destinationAddressMode to GroupAddress
caused the message to not be broadcastet and permit joining was only
enabled on the coordinator.
This caused mainly the issue that joining a network would not work
if the coordinator is out of reach.
In addition to that, there are quite a bit of end devices out there
which behave badly in finding new parents and will stick to the node
they joined in the first place forever, causing them to have bad
signal if further away from the coordinator, even though there
would be routers with much better LQI.
Additionally it fixes a permit joining issue in the TI backend which would
prevent a call to setPermitJoining(0) to explicitly allow joining
only on the coordinator.
The change of radius from 10 to 30 probably isn't needed for 99% of the
networks, however, it may still help for that one percent that does
indeed have a network depth of > 10. Looking at other implementations
out there, 30 seems to be the common sense.
This may happen on very rare occations after a nymea restart
if the controller is taking too long to initialize but still succeeds
in the end. Also increases the timeout for the procedure.
Starting/stopping the permit joining duration timer is not something
each backend should do on it's own. So making the timer a private
member of ZigbeeNetwork and taking control over it internally.
Also reduce some logic about the remaining duration by merging the
related methods into one and hiding the "remaining" duration from
backend implementations completely.