[notifier] always signal changed state/config for the first time (#2818)

This commit adds new logic in `Notifier` class (and how it is used) to
ensure when state/configuration is changed, each of the OT_CHANGED_*
events (e.g., channel, network name) is signaled for the first time
(even in case new set value is same as before).

This change addresses an issue where if user sets a parameter (using
OpenThread public APIs) before starting Thread operation the event
indicating the change would not be emitted.

This commit also defines `otChangedFlags` and `Notifier::Flags`
types, and updates the logging in `Notifier` to use `String` class.
This commit is contained in:
Abtin Keshavarzian
2018-06-22 15:09:18 -07:00
committed by Jonathan Hui
parent d5797546e1
commit 9ce38e0161
31 changed files with 206 additions and 173 deletions
+3 -3
View File
@@ -3478,7 +3478,7 @@ exit:
return;
}
void OTCALL Interpreter::s_HandleNetifStateChanged(uint32_t aFlags, void *aContext)
void OTCALL Interpreter::s_HandleNetifStateChanged(otChangedFlags aFlags, void *aContext)
{
#ifdef OTDLL
otCliContext *cliContext = static_cast<otCliContext *>(aContext);
@@ -3489,9 +3489,9 @@ void OTCALL Interpreter::s_HandleNetifStateChanged(uint32_t aFlags, void *aConte
}
#ifdef OTDLL
void Interpreter::HandleNetifStateChanged(otInstance *mInstance, uint32_t aFlags)
void Interpreter::HandleNetifStateChanged(otInstance *mInstance, otChangedFlags aFlags)
#else
void Interpreter::HandleNetifStateChanged(uint32_t aFlags)
void Interpreter::HandleNetifStateChanged(otChangedFlags aFlags)
#endif
{
VerifyOrExit((aFlags & OT_CHANGED_THREAD_NETDATA) != 0);