[child-supervision] relax the check for starting the supervision timeout timer (#2446)

This commit changes the `SupervisionListener` implementation by
relaxing the checks for when to start the supervision listener timeout
timer, in particular relaxing the check for role to be `ROLE_CHILD`.
This addresses an issue where timer may not start during (re-)attach
process after a "Child Id Request" transmission where the device
becomes sleepy but it's not yet fully attached as a child.
This commit is contained in:
Abtin Keshavarzian
2018-01-04 17:38:37 +00:00
committed by Jonathan Hui
parent eeb24229f0
commit c26f5e3bbe
+1 -3
View File
@@ -214,9 +214,7 @@ void SupervisionListener::RestartTimer(void)
{
ThreadNetif &netif = GetNetif();
// Restart the timer, if the timeout value is non-zero and the device is a sleepy child.
if ((mTimeout != 0) && (netif.GetMle().GetRole() == OT_DEVICE_ROLE_CHILD) &&
if ((mTimeout != 0) && (netif.GetMle().GetRole() != OT_DEVICE_ROLE_DISABLED) &&
(netif.GetMeshForwarder().GetRxOnWhenIdle() == false))
{
mTimer.Start(TimerMilli::SecToMsec(mTimeout));