mirror of
https://github.com/espressif/openthread.git
synced 2026-09-05 00:30:07 +00:00
Add diagnostics module in OpenThread (#343)
* Add diagnostics module in OpenThread - provide the same diagnostics interface for both CLI and NCP usage - implement common diagnostics features based on existing platform interface defined in 'include/platform/' - other more platform specific diagnostics features will be processed under platform layer - update CLI interface to support diagnostics feature - update both Posix and CC2538 platform to support diagnostics feature * Add diagnostics module unit test - move platform.h from "examples/platform" to "include/platform" - add test_diag.cpp to test diagnostics module * Add a configuration option that would enable/disable diagnostics module Add --enable-diag configuration option to enable/disable diagnostics module when building OpenThread.
This commit is contained in:
@@ -46,6 +46,12 @@ ot_cli_LDADD = \
|
||||
ot_cli_LDFLAGS = \
|
||||
$(NULL)
|
||||
|
||||
if OPENTHREAD_ENABLE_DIAG
|
||||
ot_cli_LDADD += \
|
||||
$(top_builddir)/src/diag/libopenthread-diag.a \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_POSIX
|
||||
ot_cli_LDADD += \
|
||||
$(top_builddir)/examples/platforms/posix/libopenthread-posix.a \
|
||||
|
||||
@@ -27,8 +27,10 @@
|
||||
*/
|
||||
|
||||
#include <openthread.h>
|
||||
#include <openthread-config.h>
|
||||
#include <openthread-diag.h>
|
||||
#include <cli/cli-uart.h>
|
||||
#include <platform.h>
|
||||
#include <platform/platform.h>
|
||||
|
||||
void otSignalTaskletPending(void)
|
||||
{
|
||||
@@ -40,6 +42,10 @@ int main(int argc, char *argv[])
|
||||
otEnable();
|
||||
otCliUartInit();
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
diagInit();
|
||||
#endif
|
||||
|
||||
while (1)
|
||||
{
|
||||
otProcessNextTasklet();
|
||||
|
||||
@@ -46,6 +46,12 @@ ot_ncp_LDADD = \
|
||||
ot_ncp_LDFLAGS = \
|
||||
$(NULL)
|
||||
|
||||
if OPENTHREAD_ENABLE_DIAG
|
||||
ot_ncp_LDADD += \
|
||||
$(top_builddir)/src/diag/libopenthread-diag.a \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
if OPENTHREAD_EXAMPLES_POSIX
|
||||
ot_ncp_LDADD += \
|
||||
$(top_builddir)/examples/platforms/posix/libopenthread-posix.a \
|
||||
|
||||
@@ -27,8 +27,10 @@
|
||||
*/
|
||||
|
||||
#include <openthread.h>
|
||||
#include <openthread-config.h>
|
||||
#include <openthread-diag.h>
|
||||
#include <ncp/ncp.h>
|
||||
#include <platform.h>
|
||||
#include <platform/platform.h>
|
||||
|
||||
void otSignalTaskletPending(void)
|
||||
{
|
||||
@@ -40,6 +42,10 @@ int main(int argc, char *argv[])
|
||||
otEnable();
|
||||
otNcpInit();
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
diagInit();
|
||||
#endif
|
||||
|
||||
while (1)
|
||||
{
|
||||
otProcessNextTasklet();
|
||||
|
||||
Reference in New Issue
Block a user