[notifier] Notifier class and new OT_CHANGED flags (#2403)

This commit contains the following changes: (a) It adds a new class
`Notifer` which can be used to register callbacks to be notified of
state or configuration changes within OpenThread. This is used both
internally (by other core OpenThread classes) or externally by
registering `otStateChangedCallback` handlers. (b) This commit also
adds a set of new `OT_CHANGED` flag definitions corresponding to
fields in the Thread Operational Dataset (e.g., the Thread network
channel changes map to `OT_CHANGED_THREAD_CHANNEL`). This ensures that
user is notified of changes to Active Operational Dataset. (c) Finally,
this commit adds support in `NcpBase` for the newly added `OT_CHANGED`
flags by emitting asynchronous spinel property updates corresponding
to the changed configuration properties.
This commit is contained in:
Abtin Keshavarzian
2017-12-14 05:50:30 +00:00
committed by Jonathan Hui
parent 78818c3f42
commit 5b25a57db7
34 changed files with 751 additions and 340 deletions
+2
View File
@@ -81,6 +81,7 @@
<ClCompile Include="..\..\src\core\common\locator.cpp" />
<ClCompile Include="..\..\src\core\common\logging.cpp" />
<ClCompile Include="..\..\src\core\common\message.cpp" />
<ClCompile Include="..\..\src\core\common\notifier.cpp" />
<ClCompile Include="..\..\src\core\common\tasklet.cpp" />
<ClCompile Include="..\..\src\core\common\timer.cpp" />
<ClCompile Include="..\..\src\core\common\tlvs.cpp" />
@@ -160,6 +161,7 @@
<ClInclude Include="..\..\src\core\common\locator.hpp" />
<ClInclude Include="..\..\src\core\common\logging.hpp" />
<ClInclude Include="..\..\src\core\common\message.hpp" />
<ClInclude Include="..\..\src\core\common\notifier.hpp" />
<ClInclude Include="..\..\src\core\common\new.hpp" />
<ClInclude Include="..\..\src\core\common\tasklet.hpp" />
<ClInclude Include="..\..\src\core\common\timer.hpp" />
@@ -141,6 +141,9 @@
<ClCompile Include="..\..\src\core\common\message.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\common\notifier.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\common\tasklet.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
@@ -368,6 +371,9 @@
<ClInclude Include="..\..\src\core\common\message.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\common\notifier.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\common\new.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>
@@ -90,6 +90,7 @@
<ClCompile Include="..\..\src\core\common\locator.cpp" />
<ClCompile Include="..\..\src\core\common\logging.cpp" />
<ClCompile Include="..\..\src\core\common\message.cpp" />
<ClCompile Include="..\..\src\core\common\notifier.cpp" />
<ClCompile Include="..\..\src\core\common\tasklet.cpp" />
<ClCompile Include="..\..\src\core\common\timer.cpp" />
<ClCompile Include="..\..\src\core\common\tlvs.cpp" />
@@ -192,6 +193,7 @@
<ClInclude Include="..\..\src\core\common\locator.hpp" />
<ClInclude Include="..\..\src\core\common\logging.hpp" />
<ClInclude Include="..\..\src\core\common\message.hpp" />
<ClInclude Include="..\..\src\core\common\notifier.hpp" />
<ClInclude Include="..\..\src\core\common\new.hpp" />
<ClInclude Include="..\..\src\core\common\tasklet.hpp" />
<ClInclude Include="..\..\src\core\common\timer.hpp" />
@@ -141,6 +141,9 @@
<ClCompile Include="..\..\src\core\common\message.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\common\notifier.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\common\tasklet.cpp">
<Filter>Source Files\common</Filter>
</ClCompile>
@@ -368,6 +371,9 @@
<ClInclude Include="..\..\src\core\common\message.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\common\notifier.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\common\new.hpp">
<Filter>Header Files\common</Filter>
</ClInclude>