[ncp-base] limit the TREL property to FTD/MTD builds (#7111)

This commit is contained in:
Abtin Keshavarzian
2021-10-26 17:26:47 -07:00
committed by GitHub
parent bfd26b988b
commit dbc9cf7ff0
3 changed files with 23 additions and 23 deletions
-21
View File
@@ -43,9 +43,6 @@
#include <openthread/network_time.h>
#include <openthread/platform/misc.h>
#include <openthread/platform/radio.h>
#if OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE
#include <openthread/platform/trel-udp6.h>
#endif
#include "common/code_utils.hpp"
#include "common/debug.hpp"
@@ -2544,24 +2541,6 @@ exit:
}
#endif
#if OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE
template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_DEBUG_TREL_TEST_MODE_ENABLE>(void)
{
return mEncoder.WriteBool(mTrelTestModeEnable);
}
template <> otError NcpBase::HandlePropertySet<SPINEL_PROP_DEBUG_TREL_TEST_MODE_ENABLE>(void)
{
otError error = OT_ERROR_NONE;
SuccessOrExit(error = mDecoder.ReadBool(mTrelTestModeEnable));
error = otPlatTrelUdp6SetTestMode(mInstance, mTrelTestModeEnable);
exit:
return error;
}
#endif
} // namespace Ncp
} // namespace ot
+2 -2
View File
@@ -373,7 +373,7 @@ NcpBase::PropertyHandler NcpBase::FindGetPropertyHandler(spinel_prop_key_t aKey)
OT_NCP_GET_HANDLER_ENTRY(SPINEL_PROP_DEBUG_NCP_LOG_LEVEL),
OT_NCP_GET_HANDLER_ENTRY(SPINEL_PROP_DEBUG_TEST_WATCHDOG),
OT_NCP_GET_HANDLER_ENTRY(SPINEL_PROP_DEBUG_LOG_TIMESTAMP_BASE),
#if OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE
#if OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE && (OPENTHREAD_FTD || OPENTHREAD_MTD)
OT_NCP_GET_HANDLER_ENTRY(SPINEL_PROP_DEBUG_TREL_TEST_MODE_ENABLE),
#endif
};
@@ -625,7 +625,7 @@ NcpBase::PropertyHandler NcpBase::FindSetPropertyHandler(spinel_prop_key_t aKey)
OT_NCP_SET_HANDLER_ENTRY(SPINEL_PROP_DEBUG_NCP_LOG_LEVEL),
#endif
OT_NCP_SET_HANDLER_ENTRY(SPINEL_PROP_DEBUG_LOG_TIMESTAMP_BASE),
#if OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE
#if OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE && (OPENTHREAD_FTD || OPENTHREAD_MTD)
OT_NCP_SET_HANDLER_ENTRY(SPINEL_PROP_DEBUG_TREL_TEST_MODE_ENABLE),
#endif
};
+21
View File
@@ -66,6 +66,9 @@
#if OPENTHREAD_CONFIG_SRP_CLIENT_BUFFERS_ENABLE
#include <openthread/srp_client_buffers.h>
#endif
#if OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE
#include <openthread/platform/trel-udp6.h>
#endif
#include "common/code_utils.hpp"
#include "common/debug.hpp"
@@ -4072,6 +4075,24 @@ exit:
#endif // OPENTHREAD_CONFIG_SRP_CLIENT_ENABLE
#if OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE
template <> otError NcpBase::HandlePropertyGet<SPINEL_PROP_DEBUG_TREL_TEST_MODE_ENABLE>(void)
{
return mEncoder.WriteBool(mTrelTestModeEnable);
}
template <> otError NcpBase::HandlePropertySet<SPINEL_PROP_DEBUG_TREL_TEST_MODE_ENABLE>(void)
{
otError error = OT_ERROR_NONE;
SuccessOrExit(error = mDecoder.ReadBool(mTrelTestModeEnable));
error = otPlatTrelUdp6SetTestMode(mInstance, mTrelTestModeEnable);
exit:
return error;
}
#endif
#if OPENTHREAD_CONFIG_LEGACY_ENABLE
void NcpBase::RegisterLegacyHandlers(const otNcpLegacyHandlers *aHandlers)