[csl] update CSL on role change to router or leader (#7874)

This commit adds a call to `Get<Mac::Mac>().UpdateCsl()` when there
is role change from `SetStateLeader()` or `SetStateRouter()`. This
ensures to disable CSL at `SubMac` and radio platform.
This commit is contained in:
Abtin Keshavarzian
2022-07-07 08:54:14 -07:00
committed by GitHub
parent eb3ca48042
commit 12dfedb28f
+8
View File
@@ -399,6 +399,10 @@ void MleRouter::SetStateRouter(uint16_t aRloc16)
RemoveNeighbor(child);
}
}
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
Get<Mac::Mac>().UpdateCsl();
#endif
}
void MleRouter::SetStateLeader(uint16_t aRloc16, LeaderStartMode aStartMode)
@@ -440,6 +444,10 @@ void MleRouter::SetStateLeader(uint16_t aRloc16, LeaderStartMode aStartMode)
}
}
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
Get<Mac::Mac>().UpdateCsl();
#endif
LogNote("Leader partition id 0x%x", mLeaderData.GetPartitionId());
}