mirror of
https://github.com/espressif/openthread.git
synced 2026-08-12 13:47:47 +00:00
[config] diag (#4020)
This commit is contained in:
+4
-5
@@ -65,13 +65,13 @@ python --version || die
|
||||
-DOPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_COMMISSIONER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1"
|
||||
-DOPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_DIAG_ENABLE=1"
|
||||
|
||||
scan-build ./configure \
|
||||
--enable-builtin-mbedtls=no \
|
||||
--enable-cert-log \
|
||||
--enable-cli \
|
||||
--enable-diag \
|
||||
--enable-dns-client \
|
||||
--enable-ecdsa \
|
||||
--enable-executable=no \
|
||||
@@ -98,7 +98,6 @@ python --version || die
|
||||
--enable-builtin-mbedtls=no \
|
||||
--enable-cert-log \
|
||||
--enable-cli \
|
||||
--enable-diag \
|
||||
--enable-dns-client \
|
||||
--enable-ecdsa \
|
||||
--enable-executable=no \
|
||||
@@ -358,7 +357,8 @@ build_samr21() {
|
||||
-DOPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_CHANNEL_MONITOR_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1"
|
||||
-DOPENTHREAD_CONFIG_CHILD_SUPERVISION_ENABLE=1 \
|
||||
-DOPENTHREAD_CONFIG_DIAG_ENABLE=1"
|
||||
|
||||
git checkout -- . || die
|
||||
git clean -xfd || die
|
||||
@@ -369,7 +369,6 @@ build_samr21() {
|
||||
--enable-mtd \
|
||||
--with-ncp-bus=spi \
|
||||
--with-examples=posix \
|
||||
--enable-diag \
|
||||
--enable-jam-detection \
|
||||
--enable-legacy \
|
||||
--enable-mac-filter \
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ OPENTHREAD_COMMON_FLAGS := \
|
||||
# Enable required features for on-device tests.
|
||||
ifeq ($(TARGET_BUILD_VARIANT),eng)
|
||||
OPENTHREAD_COMMON_FLAGS += \
|
||||
-DOPENTHREAD_ENABLE_DIAG=1 \
|
||||
-DOPENTHREAD_CONFIG_DIAG_ENABLE=1 \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ AM_DISTCHECK_CONFIGURE_FLAGS = \
|
||||
--enable-address-sanitizer \
|
||||
--enable-cert-log \
|
||||
--enable-cli \
|
||||
--enable-diag \
|
||||
--enable-dns-client \
|
||||
--enable-ftd \
|
||||
--enable-joiner \
|
||||
|
||||
@@ -993,38 +993,6 @@ AC_SUBST(OPENTHREAD_ENABLE_MAC_FILTER)
|
||||
AM_CONDITIONAL([OPENTHREAD_ENABLE_MAC_FILTER], [test "${enable_mac_filter}" = "yes"])
|
||||
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_MAC_FILTER],[${OPENTHREAD_ENABLE_MAC_FILTER}],[Define to 1 if you want to use MAC filter feature])
|
||||
|
||||
#
|
||||
# Factory Diagnostics
|
||||
#
|
||||
|
||||
AC_ARG_ENABLE(diag,
|
||||
[AS_HELP_STRING([--enable-diag],[Enable diagnostics support @<:@default=no@:>@.])],
|
||||
[
|
||||
case "${enableval}" in
|
||||
|
||||
no|yes)
|
||||
enable_diag=${enableval}
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_ERROR([Invalid value ${enable_diag} for --enable-diag])
|
||||
;;
|
||||
esac
|
||||
],
|
||||
[enable_diag=no])
|
||||
|
||||
if test "$enable_diag" = "yes"; then
|
||||
OPENTHREAD_ENABLE_DIAG=1
|
||||
else
|
||||
OPENTHREAD_ENABLE_DIAG=0
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING([whether to enable diag])
|
||||
AC_MSG_RESULT(${enable_diag})
|
||||
AC_SUBST(OPENTHREAD_ENABLE_DIAG)
|
||||
AM_CONDITIONAL([OPENTHREAD_ENABLE_DIAG], [test "${enable_diag}" = "yes"])
|
||||
AC_DEFINE_UNQUOTED([OPENTHREAD_ENABLE_DIAG],[${OPENTHREAD_ENABLE_DIAG}],[Define to 1 if you want to enable factory diagnostics feature])
|
||||
|
||||
#
|
||||
# Vendor Extension - Specify a C++ source file which will be built as part of OpenThread core library.
|
||||
#
|
||||
@@ -1725,7 +1693,6 @@ AC_MSG_NOTICE([
|
||||
OpenThread Joiner support : ${enable_joiner}
|
||||
OpenThread Jam Detection support : ${enable_jam_detection}
|
||||
OpenThread MAC Filter support : ${enable_mac_filter}
|
||||
OpenThread Factory Diagnostics support : ${enable_diag}
|
||||
OpenThread Legacy network support : ${enable_legacy}
|
||||
OpenThread DNS Client support : ${enable_dns_client}
|
||||
OpenThread SNTP Client support : ${enable_sntp_client}
|
||||
|
||||
@@ -43,7 +43,6 @@ BuildJobs ?= 10
|
||||
|
||||
configure_OPTIONS = \
|
||||
--enable-cli \
|
||||
--enable-diag \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--enable-ncp \
|
||||
|
||||
@@ -43,7 +43,6 @@ BuildJobs ?= 10
|
||||
|
||||
configure_OPTIONS = \
|
||||
--enable-cli \
|
||||
--enable-diag \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--enable-ncp \
|
||||
|
||||
@@ -43,7 +43,6 @@ BuildJobs ?= 10
|
||||
|
||||
configure_OPTIONS = \
|
||||
--enable-cli \
|
||||
--enable-diag \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--enable-ncp \
|
||||
|
||||
@@ -43,7 +43,6 @@ BuildJobs ?= 10
|
||||
|
||||
configure_OPTIONS = \
|
||||
--enable-cli \
|
||||
--enable-diag \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--enable-ncp \
|
||||
|
||||
@@ -43,7 +43,6 @@ BuildJobs ?= 10
|
||||
|
||||
configure_OPTIONS = \
|
||||
--enable-cli \
|
||||
--enable-diag \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--enable-ncp \
|
||||
|
||||
@@ -47,7 +47,6 @@ BuildJobs ?= 9
|
||||
|
||||
configure_OPTIONS = \
|
||||
--enable-cli \
|
||||
--enable-diag \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--with-examples=$(PPREFIX) \
|
||||
|
||||
@@ -43,7 +43,6 @@ BuildJobs ?= 10
|
||||
|
||||
configure_OPTIONS = \
|
||||
--enable-cli \
|
||||
--enable-diag \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--enable-ncp \
|
||||
|
||||
@@ -44,7 +44,6 @@ GCCVersion = $(shell expr `$(CC) -dumpversion | cut -f1 -d.
|
||||
|
||||
configure_OPTIONS = \
|
||||
--enable-mtd \
|
||||
--enable-diag \
|
||||
--enable-linker-map \
|
||||
--with-examples=nrf52811 \
|
||||
MBEDTLS_CPPFLAGS="$(NRF52811_MBEDTLS_CPPFLAGS)" \
|
||||
|
||||
@@ -45,7 +45,6 @@ GCCVersion = $(shell expr `$(CC) -dumpversion | cut -f1 -d.
|
||||
configure_OPTIONS = \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--enable-diag \
|
||||
--enable-linker-map \
|
||||
--with-examples=nrf52840 \
|
||||
$(NULL)
|
||||
|
||||
@@ -44,7 +44,6 @@ GCCVersion = $(shell expr `$(CC) -dumpversion | cut -f1 -d.
|
||||
|
||||
configure_OPTIONS = \
|
||||
--enable-cli \
|
||||
--enable-diag \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--enable-ncp \
|
||||
|
||||
@@ -58,7 +58,6 @@ endif
|
||||
|
||||
configure_OPTIONS = \
|
||||
--enable-cli \
|
||||
--enable-diag \
|
||||
--enable-ftd \
|
||||
--enable-mtd \
|
||||
--enable-ncp \
|
||||
|
||||
@@ -115,7 +115,7 @@ COMMONCFLAGS += -DOPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE=1
|
||||
endif
|
||||
|
||||
ifeq ($(DIAGNOSTIC),1)
|
||||
configure_OPTIONS += --enable-diag
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_DIAG_ENABLE=1
|
||||
endif
|
||||
|
||||
ifeq ($(DISABLE_DOC),1)
|
||||
|
||||
@@ -114,14 +114,14 @@ void cc1352AlarmProcess(otInstance *aInstance)
|
||||
if (sAlarmTime <= offsetTime)
|
||||
{
|
||||
sIsRunning = false;
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagAlarmFired(aInstance);
|
||||
}
|
||||
else
|
||||
#endif /* OPENTHREAD_ENABLE_DIAG */
|
||||
#endif /* OPENTHREAD_CONFIG_DIAG_ENABLE */
|
||||
{
|
||||
otPlatAlarmMilliFired(aInstance);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
#include "platform-cc1352.h"
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
/**
|
||||
* Diagnostics mode variables.
|
||||
@@ -89,4 +89,4 @@ void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_DIAG
|
||||
#endif // OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
@@ -1835,14 +1835,14 @@ static void cc1352RadioProcessTransmitDone(otInstance * aInstance,
|
||||
otRadioFrame *aAckFrame,
|
||||
otError aTransmitError)
|
||||
{
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioTransmitDone(aInstance, aTransmitFrame, aTransmitError);
|
||||
}
|
||||
else
|
||||
#endif /* OPENTHREAD_ENABLE_DIAG */
|
||||
#endif /* OPENTHREAD_CONFIG_DIAG_ENABLE */
|
||||
{
|
||||
otPlatRadioTxDone(aInstance, aTransmitFrame, aAckFrame, aTransmitError);
|
||||
}
|
||||
@@ -1853,14 +1853,14 @@ static void cc1352RadioProcessReceiveDone(otInstance *aInstance, otRadioFrame *a
|
||||
// TODO Set this flag only when the packet is really acknowledged with frame pending set.
|
||||
// See https://github.com/openthread/openthread/pull/3785
|
||||
aReceiveFrame->mInfo.mRxInfo.mAckedWithFramePending = true;
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioReceiveDone(aInstance, aReceiveFrame, aReceiveError);
|
||||
}
|
||||
else
|
||||
#endif /* OPENTHREAD_ENABLE_DIAG */
|
||||
#endif /* OPENTHREAD_CONFIG_DIAG_ENABLE */
|
||||
{
|
||||
otPlatRadioReceiveDone(aInstance, aReceiveFrame, aReceiveError);
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ void cc2538AlarmProcess(otInstance *aInstance)
|
||||
{
|
||||
sIsRunning = false;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
#include "platform-cc2538.h"
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
/**
|
||||
* Diagnostics mode variables.
|
||||
@@ -86,4 +86,4 @@ void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_DIAG
|
||||
#endif // OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
@@ -718,7 +718,7 @@ void cc2538RadioProcess(otInstance *aInstance)
|
||||
// TODO Set this flag only when the packet is really acknowledged with frame pending set.
|
||||
// See https://github.com/openthread/openthread/pull/3785
|
||||
sReceiveFrame.mInfo.mRxInfo.mAckedWithFramePending = true;
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
@@ -749,7 +749,7 @@ void cc2538RadioProcess(otInstance *aInstance)
|
||||
|
||||
sState = OT_RADIO_STATE_RECEIVE;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
|
||||
@@ -104,14 +104,14 @@ void cc2650AlarmProcess(otInstance *aInstance)
|
||||
if (sAlarmTime <= offsetTime)
|
||||
{
|
||||
sIsRunning = false;
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagAlarmFired(aInstance);
|
||||
}
|
||||
else
|
||||
#endif /* OPENTHREAD_ENABLE_DIAG */
|
||||
#endif /* OPENTHREAD_CONFIG_DIAG_ENABLE */
|
||||
{
|
||||
otPlatAlarmMilliFired(aInstance);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
#include <openthread/platform/diag.h>
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
#include "platform-cc2650.h"
|
||||
/**
|
||||
@@ -86,4 +86,4 @@ void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_DIAG
|
||||
#endif // OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
@@ -1784,14 +1784,14 @@ static void cc2650RadioProcessTransmitDone(otInstance * aInstance,
|
||||
otRadioFrame *aAckFrame,
|
||||
otError aTransmitError)
|
||||
{
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioTransmitDone(aInstance, aTransmitFrame, aTransmitError);
|
||||
}
|
||||
else
|
||||
#endif /* OPENTHREAD_ENABLE_DIAG */
|
||||
#endif /* OPENTHREAD_CONFIG_DIAG_ENABLE */
|
||||
{
|
||||
otPlatRadioTxDone(aInstance, aTransmitFrame, aAckFrame, aTransmitError);
|
||||
}
|
||||
@@ -1802,14 +1802,14 @@ static void cc2650RadioProcessReceiveDone(otInstance *aInstance, otRadioFrame *a
|
||||
// TODO Set this flag only when the packet is really acknowledged with frame pending set.
|
||||
// See https://github.com/openthread/openthread/pull/3785
|
||||
aReceiveFrame->mInfo.mRxInfo.mAckedWithFramePending = true;
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioReceiveDone(aInstance, aReceiveFrame, aReceiveError);
|
||||
}
|
||||
else
|
||||
#endif /* OPENTHREAD_ENABLE_DIAG */
|
||||
#endif /* OPENTHREAD_CONFIG_DIAG_ENABLE */
|
||||
{
|
||||
otPlatRadioReceiveDone(aInstance, aReceiveFrame, aReceiveError);
|
||||
}
|
||||
|
||||
@@ -114,14 +114,14 @@ void cc2652AlarmProcess(otInstance *aInstance)
|
||||
if (sAlarmTime <= offsetTime)
|
||||
{
|
||||
sIsRunning = false;
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagAlarmFired(aInstance);
|
||||
}
|
||||
else
|
||||
#endif /* OPENTHREAD_ENABLE_DIAG */
|
||||
#endif /* OPENTHREAD_CONFIG_DIAG_ENABLE */
|
||||
{
|
||||
otPlatAlarmMilliFired(aInstance);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
#include "platform-cc2652.h"
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
/**
|
||||
* Diagnostics mode variables.
|
||||
@@ -89,4 +89,4 @@ void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_DIAG
|
||||
#endif // OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
@@ -1816,14 +1816,14 @@ static void cc2652RadioProcessTransmitDone(otInstance * aInstance,
|
||||
otRadioFrame *aAckFrame,
|
||||
otError aTransmitError)
|
||||
{
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioTransmitDone(aInstance, aTransmitFrame, aTransmitError);
|
||||
}
|
||||
else
|
||||
#endif /* OPENTHREAD_ENABLE_DIAG */
|
||||
#endif /* OPENTHREAD_CONFIG_DIAG_ENABLE */
|
||||
{
|
||||
otPlatRadioTxDone(aInstance, aTransmitFrame, aAckFrame, aTransmitError);
|
||||
}
|
||||
@@ -1834,14 +1834,14 @@ static void cc2652RadioProcessReceiveDone(otInstance *aInstance, otRadioFrame *a
|
||||
// TODO Set this flag only when the packet is really acknowledged with frame pending set.
|
||||
// See https://github.com/openthread/openthread/pull/3785
|
||||
aReceiveFrame->mInfo.mRxInfo.mAckedWithFramePending = true;
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioReceiveDone(aInstance, aReceiveFrame, aReceiveError);
|
||||
}
|
||||
else
|
||||
#endif /* OPENTHREAD_ENABLE_DIAG */
|
||||
#endif /* OPENTHREAD_CONFIG_DIAG_ENABLE */
|
||||
{
|
||||
otPlatRadioReceiveDone(aInstance, aReceiveFrame, aReceiveError);
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ void efr32AlarmProcess(otInstance *aInstance)
|
||||
}
|
||||
}
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagAlarmFired(aInstance);
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
#include "platform-efr32.h"
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
/**
|
||||
* Diagnostics mode variables.
|
||||
@@ -92,4 +92,4 @@ void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
#endif // #if OPENTHREAD_ENABLE_DIAG
|
||||
#endif // #if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
@@ -685,7 +685,7 @@ static void processNextRxPacket(otInstance *aInstance)
|
||||
// See https://github.com/openthread/openthread/pull/3785
|
||||
sReceiveFrame.mInfo.mRxInfo.mAckedWithFramePending = true;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
@@ -824,7 +824,7 @@ void efr32RadioProcess(otInstance *aInstance)
|
||||
}
|
||||
|
||||
sState = OT_RADIO_STATE_RECEIVE;
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioTransmitDone(aInstance, &sTransmitFrame, sTransmitError);
|
||||
|
||||
@@ -130,7 +130,7 @@ void efr32AlarmProcess(otInstance *aInstance)
|
||||
{
|
||||
sIsRunning = false;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
#include "platform-efr32.h"
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
/**
|
||||
* Diagnostics mode variables.
|
||||
@@ -92,4 +92,4 @@ void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
#endif // #if OPENTHREAD_ENABLE_DIAG
|
||||
#endif // #if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
@@ -663,7 +663,7 @@ static void processNextRxPacket(otInstance *aInstance, RAIL_Handle_t aRailHandle
|
||||
|
||||
sReceiveError = OT_ERROR_NONE;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
@@ -810,7 +810,7 @@ void efr32RadioProcess(otInstance *aInstance)
|
||||
|
||||
sState = OT_RADIO_STATE_RECEIVE;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioTransmitDone(aInstance, &sTransmitFrame, sTransmitError);
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <openthread/platform/alarm-milli.h>
|
||||
#include <openthread/platform/radio.h>
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
/**
|
||||
* Diagnostics mode variables.
|
||||
@@ -84,4 +84,4 @@ void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_DIAG
|
||||
#endif // OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
@@ -63,7 +63,7 @@ void kw41zAlarmProcess(otInstance *aInstance)
|
||||
if ((sAlarmTime != 0) && (sTime >= sAlarmTime))
|
||||
{
|
||||
sAlarmTime = 0;
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#include <openthread/platform/alarm-milli.h>
|
||||
#include <openthread/platform/radio.h>
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
/**
|
||||
* Diagnostics mode variables.
|
||||
@@ -90,4 +90,4 @@ void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_DIAG
|
||||
#endif // OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
@@ -994,7 +994,7 @@ void kw41zRadioProcess(otInstance *aInstance)
|
||||
// See https://github.com/openthread/openthread/pull/3785
|
||||
sRxFrame.mInfo.mRxInfo.mAckedWithFramePending = true;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
|
||||
@@ -496,7 +496,7 @@ void nrf5AlarmProcess(otInstance *aInstance)
|
||||
{
|
||||
sTimerData[kMsTimer].mFireAlarm = false;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
|
||||
@@ -564,7 +564,7 @@ void nrf5RadioProcess(otInstance *aInstance)
|
||||
{
|
||||
if (sReceivedFrames[i].mPsdu != NULL)
|
||||
{
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
@@ -586,7 +586,7 @@ void nrf5RadioProcess(otInstance *aInstance)
|
||||
{
|
||||
resetPendingEvent(kPendingEventFrameTransmitted);
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
@@ -610,7 +610,7 @@ void nrf5RadioProcess(otInstance *aInstance)
|
||||
{
|
||||
resetPendingEvent(kPendingEventChannelAccessFailure);
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
@@ -627,7 +627,7 @@ void nrf5RadioProcess(otInstance *aInstance)
|
||||
{
|
||||
resetPendingEvent(kPendingEventInvalidOrNoAck);
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
@@ -644,7 +644,7 @@ void nrf5RadioProcess(otInstance *aInstance)
|
||||
{
|
||||
resetPendingEvent(kPendingEventReceiveFailed);
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
|
||||
@@ -496,7 +496,7 @@ void nrf5AlarmProcess(otInstance *aInstance)
|
||||
{
|
||||
sTimerData[kMsTimer].mFireAlarm = false;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
|
||||
@@ -564,7 +564,7 @@ void nrf5RadioProcess(otInstance *aInstance)
|
||||
{
|
||||
if (sReceivedFrames[i].mPsdu != NULL)
|
||||
{
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
@@ -586,7 +586,7 @@ void nrf5RadioProcess(otInstance *aInstance)
|
||||
{
|
||||
resetPendingEvent(kPendingEventFrameTransmitted);
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
@@ -610,7 +610,7 @@ void nrf5RadioProcess(otInstance *aInstance)
|
||||
{
|
||||
resetPendingEvent(kPendingEventChannelAccessFailure);
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
@@ -627,7 +627,7 @@ void nrf5RadioProcess(otInstance *aInstance)
|
||||
{
|
||||
resetPendingEvent(kPendingEventInvalidOrNoAck);
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
@@ -644,7 +644,7 @@ void nrf5RadioProcess(otInstance *aInstance)
|
||||
{
|
||||
resetPendingEvent(kPendingEventReceiveFailed);
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
|
||||
@@ -269,7 +269,7 @@ void platformAlarmProcess(otInstance *aInstance)
|
||||
{
|
||||
sIsMsRunning = false;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include <openthread/platform/alarm-milli.h>
|
||||
#include <openthread/platform/radio.h>
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
/**
|
||||
* Diagnostics mode variables.
|
||||
@@ -86,4 +86,4 @@ void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_DIAG
|
||||
#endif // OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
@@ -661,7 +661,7 @@ static void radioReceive(otInstance *aInstance)
|
||||
sState = OT_RADIO_STATE_RECEIVE;
|
||||
sTxWait = false;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
@@ -739,7 +739,7 @@ void radioSendMessage(otInstance *aInstance)
|
||||
{
|
||||
sState = OT_RADIO_STATE_RECEIVE;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
@@ -940,7 +940,7 @@ exit:
|
||||
|
||||
if (error != OT_ERROR_ABORT)
|
||||
{
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioReceiveDone(aInstance, error == OT_ERROR_NONE ? &sReceiveFrame : NULL, error);
|
||||
|
||||
@@ -150,7 +150,7 @@ void platformAlarmProcess(otInstance *aInstance)
|
||||
{
|
||||
sIsMsRunning = false;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
|
||||
@@ -77,7 +77,7 @@ void samr21AlarmProcess(otInstance *aInstance)
|
||||
{
|
||||
sDeltaTime = 0;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include <openthread/config.h>
|
||||
#include <openthread/platform/diag.h>
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
/**
|
||||
* Diagnostics mode variables.
|
||||
@@ -86,4 +86,4 @@ void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_DIAG
|
||||
#endif // OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
@@ -232,7 +232,7 @@ static void handleRx(void)
|
||||
// See https://github.com/openthread/openthread/pull/3785
|
||||
sReceiveFrame.mInfo.mRxInfo.mAckedWithFramePending = true;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
@@ -300,7 +300,7 @@ static void handleTx(void)
|
||||
|
||||
sState = OT_RADIO_STATE_RECEIVE;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioTransmitDone(sInstance, &sTransmitFrame, otStatus);
|
||||
|
||||
+1
-1
@@ -1500,7 +1500,7 @@ Done
|
||||
|
||||
### diag
|
||||
|
||||
Factory Diagnostics module is enabled only when building OpenThread with --enable-diag option.
|
||||
Factory Diagnostics module is enabled only when building OpenThread with `OPENTHREAD_CONFIG_DIAG_ENABLE=1` option.
|
||||
Go [diagnostics module][1] for more information.
|
||||
|
||||
### service
|
||||
|
||||
+3
-3
@@ -117,7 +117,7 @@ const struct Command Interpreter::sCommands[] = {
|
||||
#if OPENTHREAD_FTD
|
||||
{"delaytimermin", &Interpreter::ProcessDelayTimerMin},
|
||||
#endif
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
{"diag", &Interpreter::ProcessDiag},
|
||||
#endif
|
||||
{"discover", &Interpreter::ProcessDiscover},
|
||||
@@ -3406,7 +3406,7 @@ exit:
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_MAC_FILTER
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
void Interpreter::ProcessDiag(int argc, char *argv[])
|
||||
{
|
||||
char output[OPENTHREAD_CONFIG_DIAG_OUTPUT_BUFFER_SIZE];
|
||||
@@ -3434,7 +3434,7 @@ void Interpreter::ProcessLine(char *aBuf, uint16_t aBufLength, Server &aServer)
|
||||
|
||||
cmd = argv[0];
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
VerifyOrExit(
|
||||
(!otDiagIsEnabled(mInstance) || (strcmp(cmd, "diag") == 0)),
|
||||
mServer->OutputFormat("under diagnostics mode, execute 'diag stop' before running any other commands.\r\n"));
|
||||
|
||||
+2
-2
@@ -218,9 +218,9 @@ private:
|
||||
#if OPENTHREAD_FTD
|
||||
void ProcessDelayTimerMin(int argc, char *argv[]);
|
||||
#endif
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
void ProcessDiag(int argc, char *argv[]);
|
||||
#endif // OPENTHREAD_ENABLE_DIAG
|
||||
#endif // OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
void ProcessDiscover(int argc, char *argv[]);
|
||||
#if OPENTHREAD_ENABLE_DNS_CLIENT
|
||||
void ProcessDns(int argc, char *argv[]);
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
|
||||
#endif // OT_CLI_UART_LOCK_HDR_FILE
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
OT_STATIC_ASSERT(OPENTHREAD_CONFIG_DIAG_OUTPUT_BUFFER_SIZE <= OPENTHREAD_CONFIG_CLI_UART_TX_BUFFER_SIZE,
|
||||
"diag output buffer should be smaller than CLI UART tx buffer");
|
||||
OT_STATIC_ASSERT(OPENTHREAD_CONFIG_DIAG_CMD_LINE_BUFFER_SIZE <= OPENTHREAD_CONFIG_CLI_UART_RX_BUFFER_SIZE,
|
||||
|
||||
@@ -327,6 +327,7 @@ HEADERS_COMMON = \
|
||||
config/commissioner.h \
|
||||
config/dhcp6_client.h \
|
||||
config/dhcp6_server.h \
|
||||
config/diag.h \
|
||||
config/openthread-core-config-check.h \
|
||||
config/openthread-core-default-config.h \
|
||||
crypto/aes_ccm.hpp \
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
using namespace ot;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
void otDiagProcessCmdLine(otInstance *aInstance, const char *aString, char *aOutput, size_t aOutputMaxLen)
|
||||
{
|
||||
@@ -63,4 +63,4 @@ bool otDiagIsEnabled(otInstance *aInstance)
|
||||
return instance.Get<FactoryDiags::Diags>().IsEnabled();
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_DIAG
|
||||
#endif // OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
@@ -96,7 +96,7 @@ Instance::Instance(void)
|
||||
#if OPENTHREAD_ENABLE_VENDOR_EXTENSION
|
||||
, mExtension(Extension::ExtensionBase::Init(*this))
|
||||
#endif
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
, mDiags(*this)
|
||||
#endif
|
||||
, mIsInitialized(false)
|
||||
|
||||
@@ -370,7 +370,7 @@ private:
|
||||
#if OPENTHREAD_ENABLE_VENDOR_EXTENSION
|
||||
Extension::ExtensionBase &mExtension;
|
||||
#endif
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
FactoryDiags::Diags mDiags;
|
||||
#endif
|
||||
bool mIsInitialized;
|
||||
@@ -717,7 +717,7 @@ template <> inline Extension::ExtensionBase &Instance::Get(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
template <> inline FactoryDiags::Diags &Instance::Get(void)
|
||||
{
|
||||
return mDiags;
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Copyright (c) 2019, The OpenThread Authors.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the copyright holder nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* This file includes compile-time configurations for the DIAG service.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_DIAG_H_
|
||||
#define CONFIG_DIAG_H_
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
*
|
||||
* Define to 1 to enable Factory Diagnostics support.
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
#define OPENTHREAD_CONFIG_DIAG_ENABLE 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_DIAG_OUTPUT_BUFFER_SIZE
|
||||
*
|
||||
* Define OpenThread diagnostic mode output buffer size in bytes
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_DIAG_OUTPUT_BUFFER_SIZE
|
||||
#define OPENTHREAD_CONFIG_DIAG_OUTPUT_BUFFER_SIZE 256
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_DIAG_CMD_LINE_ARGS_MAX
|
||||
*
|
||||
* Define OpenThread diagnostic mode max command line arguments.
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_DIAG_CMD_LINE_ARGS_MAX
|
||||
#define OPENTHREAD_CONFIG_DIAG_CMD_LINE_ARGS_MAX 32
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_DIAG_CMD_LINE_BUFFER_SIZE
|
||||
*
|
||||
* Define OpenThread diagnostic mode command line buffer size in bytes.
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_DIAG_CMD_LINE_BUFFER_SIZE
|
||||
#define OPENTHREAD_CONFIG_DIAG_CMD_LINE_BUFFER_SIZE 256
|
||||
#endif
|
||||
|
||||
#endif // CONFIG_DIAG_H_
|
||||
@@ -1389,36 +1389,6 @@
|
||||
#define OPENTHREAD_CONFIG_DISABLE_CSMA_CA_ON_LAST_ATTEMPT 0
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_DIAG_OUTPUT_BUFFER_SIZE
|
||||
*
|
||||
* Define OpenThread diagnostic mode output buffer size in bytes
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_DIAG_OUTPUT_BUFFER_SIZE
|
||||
#define OPENTHREAD_CONFIG_DIAG_OUTPUT_BUFFER_SIZE 256
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_DIAG_CMD_LINE_ARGS_MAX
|
||||
*
|
||||
* Define OpenThread diagnostic mode max command line arguments.
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_DIAG_CMD_LINE_ARGS_MAX
|
||||
#define OPENTHREAD_CONFIG_DIAG_CMD_LINE_ARGS_MAX 32
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_DIAG_CMD_LINE_BUFFER_SIZE
|
||||
*
|
||||
* Define OpenThread diagnostic mode command line buffer size in bytes.
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_DIAG_CMD_LINE_BUFFER_SIZE
|
||||
#define OPENTHREAD_CONFIG_DIAG_CMD_LINE_BUFFER_SIZE 256
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_ENABLE_TIME_SYNC
|
||||
*
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
namespace ot {
|
||||
namespace FactoryDiags {
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
#if OPENTHREAD_RADIO
|
||||
|
||||
const struct Diags::Command Diags::sCommands[] = {
|
||||
@@ -557,7 +557,7 @@ bool Diags::IsEnabled(void)
|
||||
return otPlatDiagModeGet();
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_DIAG
|
||||
#endif // OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
} // namespace FactoryDiags
|
||||
} // namespace ot
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
namespace ot {
|
||||
namespace FactoryDiags {
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
class Diags
|
||||
{
|
||||
@@ -162,7 +162,7 @@ private:
|
||||
bool mRepeatActive;
|
||||
};
|
||||
|
||||
#endif // #if OPENTHREAD_ENABLE_DIAG
|
||||
#endif // #if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
} // namespace FactoryDiags
|
||||
} // namespace ot
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
#include "config/commissioner.h"
|
||||
#include "config/dhcp6_client.h"
|
||||
#include "config/dhcp6_server.h"
|
||||
#include "config/diag.h"
|
||||
|
||||
#if OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE || OPENTHREAD_CONFIG_BORDER_AGENT_ENABLE || \
|
||||
OPENTHREAD_CONFIG_COMMISSIONER_ENABLE || OPENTHREAD_ENABLE_JOINER
|
||||
|
||||
@@ -917,7 +917,7 @@ bool NcpBase::HandlePropertySetForSpecialProperties(uint8_t aHeader, spinel_prop
|
||||
case SPINEL_PROP_HOST_POWER_STATE:
|
||||
ExitNow(aError = HandlePropertySet_SPINEL_PROP_HOST_POWER_STATE(aHeader));
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
case SPINEL_PROP_NEST_STREAM_MFG:
|
||||
ExitNow(aError = HandlePropertySet_SPINEL_PROP_NEST_STREAM_MFG(aHeader));
|
||||
#endif
|
||||
@@ -1273,7 +1273,7 @@ exit:
|
||||
// MARK: Individual Property Getters and Setters
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
otError NcpBase::HandlePropertySet_SPINEL_PROP_NEST_STREAM_MFG(uint8_t aHeader)
|
||||
{
|
||||
@@ -1297,7 +1297,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_DIAG
|
||||
#endif // OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_PHY_ENABLED>(void)
|
||||
{
|
||||
|
||||
@@ -405,7 +405,7 @@ protected:
|
||||
|
||||
otError HandlePropertySet_SPINEL_PROP_HOST_POWER_STATE(uint8_t aHeader);
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
OT_STATIC_ASSERT(OPENTHREAD_CONFIG_DIAG_OUTPUT_BUFFER_SIZE <=
|
||||
OPENTHREAD_CONFIG_NCP_TX_BUFFER_SIZE - kSpinelCmdHeaderSize - kSpinelPropIdSize,
|
||||
"diag output buffer should be smaller than NCP UART tx buffer");
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@
|
||||
|
||||
#if OPENTHREAD_ENABLE_NCP_SPI
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
OT_STATIC_ASSERT(OPENTHREAD_CONFIG_DIAG_OUTPUT_BUFFER_SIZE <=
|
||||
OPENTHREAD_CONFIG_NCP_SPI_BUFFER_SIZE - ot::Ncp::NcpBase::kSpinelCmdHeaderSize -
|
||||
ot::Ncp::NcpBase::kSpinelPropIdSize - ot::Ncp::SpiFrame::kHeaderSize,
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
#if OPENTHREAD_ENABLE_NCP_UART
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
OT_STATIC_ASSERT(OPENTHREAD_CONFIG_DIAG_OUTPUT_BUFFER_SIZE <= OPENTHREAD_CONFIG_NCP_UART_RX_BUFFER_SIZE -
|
||||
ot::Ncp::NcpBase::kSpinelCmdHeaderSize -
|
||||
ot::Ncp::NcpBase::kSpinelPropIdSize,
|
||||
|
||||
@@ -177,7 +177,7 @@ void platformAlarmProcess(otInstance *aInstance)
|
||||
{
|
||||
sIsMsRunning = false;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
|
||||
@@ -175,7 +175,7 @@ RadioSpinel::RadioSpinel(void)
|
||||
, mIsPromiscuous(false)
|
||||
, mIsReady(false)
|
||||
, mSupportsLogStream(false)
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
, mDiagMode(false)
|
||||
, mDiagOutput(NULL)
|
||||
, mDiagOutputMaxLen(0)
|
||||
@@ -466,7 +466,7 @@ void RadioSpinel::HandleWaitingResponse(uint32_t aCommand,
|
||||
VerifyOrExit(unpacked > 0, mError = OT_ERROR_PARSE);
|
||||
mError = SpinelStatusToOtError(status);
|
||||
}
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
else if (aKey == SPINEL_PROP_NEST_STREAM_MFG)
|
||||
{
|
||||
spinel_ssize_t unpacked;
|
||||
@@ -685,7 +685,7 @@ void RadioSpinel::RadioReceive(void)
|
||||
}
|
||||
}
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioReceiveDone(mInstance, &mRxRadioFrame, OT_ERROR_NONE);
|
||||
@@ -762,7 +762,7 @@ void RadioSpinel::Process(const fd_set &aReadFdSet, const fd_set &aWriteFdSet)
|
||||
mState = kStateReceive;
|
||||
mTxRadioEndUs = UINT64_MAX;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioTransmitDone(mInstance, mTransmitFrame, mTxError);
|
||||
@@ -1114,7 +1114,7 @@ void RadioSpinel::RadioTransmit(void)
|
||||
{
|
||||
mState = kStateReceive;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
@@ -1377,7 +1377,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
otError RadioSpinel::PlatDiagProcess(const char *aString, char *aOutput, size_t aOutputMaxLen)
|
||||
{
|
||||
otError error;
|
||||
@@ -1650,7 +1650,7 @@ void ot::PosixApp::RadioSpinel::Process(const Event &aEvent)
|
||||
{
|
||||
mState = kStateReceive;
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
if (otPlatDiagModeGet())
|
||||
{
|
||||
otPlatDiagRadioTransmitDone(mInstance, mTransmitFrame, mTxError);
|
||||
@@ -1691,7 +1691,7 @@ void otSimRadioSpinelProcess(otInstance *aInstance, const struct Event *aEvent)
|
||||
}
|
||||
#endif // OPENTHREAD_POSIX_VIRTUAL_TIME
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
void otPlatDiagProcess(otInstance *aInstance, int argc, char *argv[], char *aOutput, size_t aOutputMaxLen)
|
||||
{
|
||||
// deliver the platform specific diags commands to radio only ncp.
|
||||
@@ -1755,7 +1755,7 @@ void otPlatDiagAlarmCallback(otInstance *aInstance)
|
||||
{
|
||||
OT_UNUSED_VARIABLE(aInstance);
|
||||
}
|
||||
#endif // OPENTHREAD_ENABLE_DIAG
|
||||
#endif // OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
|
||||
uint32_t otPlatRadioGetSupportedChannelMask(otInstance *aInstance)
|
||||
{
|
||||
|
||||
@@ -408,7 +408,7 @@ public:
|
||||
void Update(struct timeval &aTimeout);
|
||||
#endif
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
/**
|
||||
* This method enables/disables the factory diagnostics mode.
|
||||
*
|
||||
@@ -618,7 +618,7 @@ private:
|
||||
bool mIsReady : 1; ///< NCP ready.
|
||||
bool mSupportsLogStream : 1; ///< RCP supports `LOG_STREAM` property with OpenThread log meta-data format.
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
#if OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
bool mDiagMode;
|
||||
char * mDiagOutput;
|
||||
size_t mDiagOutputMaxLen;
|
||||
|
||||
@@ -78,7 +78,6 @@ configure_options=" \
|
||||
--disable-docs \
|
||||
--disable-tests \
|
||||
--enable-coverage=$coverage \
|
||||
--enable-diag \
|
||||
--enable-ftd \
|
||||
--enable-jam-detection \
|
||||
--enable-joiner \
|
||||
|
||||
@@ -64,6 +64,14 @@
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_COMMISSIONER_ENABLE 1
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_DIAG_ENABLE
|
||||
*
|
||||
* Define to 1 to enable Factory Diagnostics support.
|
||||
*
|
||||
*/
|
||||
#define OPENTHREAD_CONFIG_DIAG_ENABLE 1
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user