mirror of
https://github.com/espressif/openthread.git
synced 2026-10-16 20:57:41 +00:00
[posix] radio only host side driver (#2690)
This commit is contained in:
+28
-4
@@ -51,12 +51,24 @@ if OPENTHREAD_BUILD_TESTS
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-DOPENTHREAD_FTD=1 \
|
||||
-I$(top_srcdir)/examples/platforms \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/src \
|
||||
-I$(top_srcdir)/src/core \
|
||||
$(NULL)
|
||||
|
||||
if OPENTHREAD_EXAMPLES_POSIX
|
||||
AM_CPPFLAGS += \
|
||||
-I$(top_srcdir)/examples/platforms \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
if OPENTHREAD_ENABLE_POSIX_APP
|
||||
AM_CPPFLAGS += \
|
||||
-DOPENTHREAD_ENABLE_POSIX_APP=1 \
|
||||
-I$(top_srcdir)/src/posix/platform \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
if OPENTHREAD_ENABLE_NCP
|
||||
|
||||
COMMON_LDADD = \
|
||||
@@ -80,6 +92,12 @@ COMMON_LDADD += \
|
||||
$(NULL)
|
||||
endif # OPENTHREAD_ENABLE_BUILTIN_MBEDTLS
|
||||
|
||||
if OPENTHREAD_ENABLE_POSIX_APP
|
||||
COMMON_LDADD += \
|
||||
-lutil
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
# Test applications that should be run when the 'check' target is run.
|
||||
|
||||
check_PROGRAMS = \
|
||||
@@ -210,10 +228,16 @@ test_toolchain_LDADD = $(COMMON_LDADD)
|
||||
test_toolchain_SOURCES = test_platform.cpp test_toolchain.cpp test_toolchain_c.c
|
||||
|
||||
if OPENTHREAD_ENABLE_DIAG
|
||||
test_diag_LDADD = $(top_builddir)/src/diag/libopenthread-diag.a \
|
||||
$(top_builddir)/examples/platforms/posix/libopenthread-posix.a \
|
||||
$(NULL)
|
||||
test_diag_LDADD = $(top_builddir)/src/diag/libopenthread-diag.a
|
||||
test_diag_SOURCES = test_diag.cpp
|
||||
if OPENTHREAD_ENABLE_POSIX_APP
|
||||
test_diag_LDADD += $(top_builddir)/src/posix/platform/libopenthread-posix.a \
|
||||
-lutil \
|
||||
$(NULL)
|
||||
endif
|
||||
if OPENTHREAD_EXAMPLES_POSIX
|
||||
test_diag_LDADD += $(top_builddir)/examples/platforms/posix/libopenthread-posix.a
|
||||
endif
|
||||
endif
|
||||
|
||||
PRETTY_FILES = \
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
#include <openthread/diag.h>
|
||||
#include <openthread/platform/radio.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "utils/wrap_string.h"
|
||||
|
||||
#include "platform.h"
|
||||
@@ -227,9 +229,12 @@ void TestDiag(void)
|
||||
}};
|
||||
|
||||
// initialize platform layer
|
||||
int argc = 2;
|
||||
char *argv[8] = {(char *)"test_diag", (char *)"1"};
|
||||
PlatformInit(argc, argv);
|
||||
#if OPENTHREAD_ENABLE_POSIX_APP
|
||||
char *argv[] = {(char *)"test_diag", getenv("RADIO_DEVICE"), (char *)"1"};
|
||||
#else
|
||||
char *argv[] = {(char *)"test_diag", (char *)"1"};
|
||||
#endif
|
||||
PlatformInit(sizeof(argv) / sizeof(char *), argv);
|
||||
|
||||
// initialize diagnostics module
|
||||
otDiagInit(NULL);
|
||||
|
||||
Reference in New Issue
Block a user