[mle] simplify Start(), Stop(), and SendAnnounce() (#6986)

This commit updates `Start()`, `Stop()` and `SendAnnounce()` in `Mle`
to remove the extra parameters from the `public` versions of these
methods (adding a `private` version with extra parameter for use by
`Mle` class itself). It also adds `StartMode`, `StopMode`, and
`AnnounceMode` enumerations to use as parameter type (instead of
`bool`) in these methods which helps with code readability.
This commit is contained in:
Abtin Keshavarzian
2021-09-09 20:32:03 -07:00
committed by GitHub
parent db3c64410b
commit 9e631d816e
4 changed files with 48 additions and 32 deletions
+2 -2
View File
@@ -481,11 +481,11 @@ otError otThreadSetEnabled(otInstance *aInstance, bool aEnabled)
if (aEnabled)
{
error = instance.Get<Mle::MleRouter>().Start(/* aAnnounceAttach */ false);
error = instance.Get<Mle::MleRouter>().Start();
}
else
{
instance.Get<Mle::MleRouter>().Stop(true);
instance.Get<Mle::MleRouter>().Stop();
}
return error;