From ec7e02d13f493fa19307c488fbbcbd253f1868a2 Mon Sep 17 00:00:00 2001 From: Eduardo Montoya Date: Thu, 14 Nov 2024 15:43:29 +0100 Subject: [PATCH] [wed] support WED for MTD only Do not support Wake-up End Device for non-MTD configurations for now. --- src/cli/cli.cpp | 10 +++++----- src/core/api/link_api.cpp | 8 ++++---- src/core/config/mac.h | 2 +- src/core/mac/mac.cpp | 18 +++++++++--------- src/core/mac/mac.hpp | 12 ++++++------ src/core/mac/mac_frame.cpp | 8 ++++---- src/core/mac/mac_frame.hpp | 4 ++-- src/core/mac/mac_header_ie.hpp | 4 ++-- src/core/mac/mac_links.hpp | 2 +- src/core/mac/sub_mac.cpp | 6 +++--- src/core/mac/sub_mac.hpp | 8 ++++---- src/core/mac/sub_mac_wed.cpp | 4 ++-- src/core/meshcop/dataset_manager.cpp | 2 +- src/core/radio/radio.hpp | 2 +- src/core/thread/key_manager.cpp | 2 +- src/core/thread/key_manager.hpp | 2 +- src/ncp/ncp_base_dispatcher.cpp | 4 ++-- src/ncp/ncp_base_mtd.cpp | 2 +- 18 files changed, 50 insertions(+), 50 deletions(-) diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp index 5ecd2247d9c..2070bacbca4 100644 --- a/src/cli/cli.cpp +++ b/src/cli/cli.cpp @@ -8228,7 +8228,7 @@ template <> otError Interpreter::Process(Arg aArgs[]) #endif // OPENTHREAD_CONFIG_VERHOEFF_CHECKSUM_ENABLE -#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || (OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE) template <> otError Interpreter::Process(Arg aArgs[]) { otError error = OT_ERROR_NONE; @@ -8255,7 +8255,7 @@ template <> otError Interpreter::Process(Arg aArgs[]) { error = ProcessGetSet(aArgs + 1, otLinkGetWakeupChannel, otLinkSetWakeupChannel); } -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE /** * @cli wakeup parameters (get,set) * @code @@ -8318,7 +8318,7 @@ template <> otError Interpreter::Process(Arg aArgs[]) { error = ProcessEnableDisable(aArgs + 1, otLinkIsWakeupListenEnabled, otLinkSetWakeUpListenEnabled); } -#endif // OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#endif // OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE else { ExitNow(error = OT_ERROR_INVALID_ARGS); @@ -8327,7 +8327,7 @@ template <> otError Interpreter::Process(Arg aArgs[]) exit: return error; } -#endif // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#endif // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || (OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE) #endif // OPENTHREAD_FTD || OPENTHREAD_MTD @@ -8639,7 +8639,7 @@ otError Interpreter::ProcessCommand(Arg aArgs[]) #endif // OPENTHREAD_FTD || OPENTHREAD_MTD CmdEntry("version"), #if OPENTHREAD_FTD || OPENTHREAD_MTD -#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || (OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE) CmdEntry("wakeup"), #endif #endif diff --git a/src/core/api/link_api.cpp b/src/core/api/link_api.cpp index 1a46d51aaf0..775a508d462 100644 --- a/src/core/api/link_api.cpp +++ b/src/core/api/link_api.cpp @@ -79,7 +79,7 @@ otError otLinkSetChannel(otInstance *aInstance, uint8_t aChannel) return error; } -#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || (OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE) uint8_t otLinkGetWakeupChannel(otInstance *aInstance) { return AsCoreType(aInstance).Get().GetWakeupChannel(); @@ -100,7 +100,7 @@ otError otLinkSetWakeupChannel(otInstance *aInstance, uint8_t aChannel) exit: return error; } -#endif // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#endif // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || (OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE) uint32_t otLinkGetSupportedChannelMask(otInstance *aInstance) { @@ -510,7 +510,7 @@ otError otLinkGetRegion(otInstance *aInstance, uint16_t *aRegionCode) return error; } -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE otError otLinkSetWakeUpListenEnabled(otInstance *aInstance, bool aEnable) { return AsCoreType(aInstance).Get().SetWakeupListenEnabled(aEnable); @@ -530,4 +530,4 @@ otError otLinkSetWakeupListenParameters(otInstance *aInstance, uint32_t aInterva { return AsCoreType(aInstance).Get().SetWakeupListenParameters(aInterval, aDuration); } -#endif // OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#endif // OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE diff --git a/src/core/config/mac.h b/src/core/config/mac.h index d2359a91db2..32add946dae 100644 --- a/src/core/config/mac.h +++ b/src/core/config/mac.h @@ -407,7 +407,7 @@ */ #ifndef OPENTHREAD_CONFIG_MAC_MULTIPURPOSE_FRAME #define OPENTHREAD_CONFIG_MAC_MULTIPURPOSE_FRAME \ - (OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE) + (OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || (OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE)) #endif /** diff --git a/src/core/mac/mac.cpp b/src/core/mac/mac.cpp index 820e37e4741..906740c6cb9 100644 --- a/src/core/mac/mac.cpp +++ b/src/core/mac/mac.cpp @@ -61,7 +61,7 @@ Mac::Mac(Instance &aInstance) , mShouldDelaySleep(false) , mDelayingSleep(false) #endif -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE , mWakeupListenEnabled(false) #endif , mOperation(kOperationIdle) @@ -87,7 +87,7 @@ Mac::Mac(Instance &aInstance) , mCslPeriod(0) #endif , mWakeupChannel(OPENTHREAD_CONFIG_DEFAULT_WAKEUP_CHANNEL) -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE , mWakeupListenInterval(kDefaultWedListenInterval) , mWakeupListenDuration(kDefaultWedListenDuration) #endif @@ -1601,7 +1601,7 @@ Error Mac::ProcessReceiveSecurity(RxFrame &aFrame, const Address &aSrcAddr, Neig break; case Frame::kKeyIdMode2: -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE if (aFrame.IsWakeupFrame()) { uint32_t sequence; @@ -2029,7 +2029,7 @@ void Mac::HandleReceivedFrame(RxFrame *aFrame, Error aError) mCounters.mRxData++; break; -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE case Frame::kTypeMultipurpose: SuccessOrExit(error = HandleWakeupFrame(*aFrame)); OT_FALL_THROUGH; @@ -2384,7 +2384,7 @@ void Mac::SetCslChannel(uint8_t aChannel) void Mac::SetCslPeriod(uint16_t aPeriod) { -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE if (IsWakeupListenEnabled() && aPeriod != 0) { IgnoreError(SetWakeupListenEnabled(false)); @@ -2478,7 +2478,7 @@ void Mac::SetRadioFilterEnabled(bool aFilterEnabled) } #endif -#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || (OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE) Error Mac::SetWakeupChannel(uint8_t aChannel) { Error error = kErrorNone; @@ -2492,7 +2492,7 @@ Error Mac::SetWakeupChannel(uint8_t aChannel) VerifyOrExit(mSupportedChannelMask.ContainsChannel(aChannel), error = kErrorInvalidArgs); mWakeupChannel = aChannel; -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE UpdateWakeupListening(); #endif @@ -2501,7 +2501,7 @@ Error Mac::SetWakeupChannel(uint8_t aChannel) } #endif -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE void Mac::GetWakeupListenParameters(uint32_t &aInterval, uint32_t &aDuration) const { aInterval = mWakeupListenInterval; @@ -2607,7 +2607,7 @@ Error Mac::HandleWakeupFrame(const RxFrame &aFrame) exit: return error; } -#endif // OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#endif // OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE } // namespace Mac } // namespace ot diff --git a/src/core/mac/mac.hpp b/src/core/mac/mac.hpp index 8a5e78ec268..e7c5cf7d2c1 100644 --- a/src/core/mac/mac.hpp +++ b/src/core/mac/mac.hpp @@ -704,7 +704,7 @@ class Mac : public InstanceLocator, private NonCopyable */ uint8_t GetWakeupChannel(void) const { return mWakeupChannel; } -#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || (OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE) /** * Sets the wake-up channel. * @@ -716,7 +716,7 @@ class Mac : public InstanceLocator, private NonCopyable Error SetWakeupChannel(uint8_t aChannel); #endif -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE /** * Gets the wake-up listen parameters. * @@ -757,7 +757,7 @@ class Mac : public InstanceLocator, private NonCopyable * @retval FALSE If listening for wake-up frames is not enabled. */ bool IsWakeupListenEnabled(void) const { return mWakeupListenEnabled; } -#endif // OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#endif // OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE private: static constexpr uint16_t kMaxCcaSampleCount = OPENTHREAD_CONFIG_CCA_FAILURE_RATE_AVERAGING_WINDOW; @@ -848,7 +848,7 @@ class Mac : public InstanceLocator, private NonCopyable #if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE void ProcessEnhAckProbing(const RxFrame &aFrame, const Neighbor &aNeighbor); #endif -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE Error HandleWakeupFrame(const RxFrame &aFrame); void UpdateWakeupListening(void); #endif @@ -869,7 +869,7 @@ class Mac : public InstanceLocator, private NonCopyable bool mShouldDelaySleep : 1; bool mDelayingSleep : 1; #endif -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE bool mWakeupListenEnabled : 1; #endif Operation mOperation; @@ -897,7 +897,7 @@ class Mac : public InstanceLocator, private NonCopyable uint16_t mCslPeriod; #endif uint8_t mWakeupChannel; -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE uint32_t mWakeupListenInterval; uint32_t mWakeupListenDuration; #endif diff --git a/src/core/mac/mac_frame.cpp b/src/core/mac/mac_frame.cpp index 5630e7ceff4..ae1aa831735 100644 --- a/src/core/mac/mac_frame.cpp +++ b/src/core/mac/mac_frame.cpp @@ -279,7 +279,7 @@ Error Frame::ValidatePsdu(void) const return error; } -#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || (OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE) bool Frame::IsWakeupFrame(void) const { const uint16_t fcf = GetFrameControlField(); @@ -315,7 +315,7 @@ bool Frame::IsWakeupFrame(void) const exit: return result; } -#endif // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#endif // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || (OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE) void Frame::SetAckRequest(bool aAckRequest) { @@ -1142,7 +1142,7 @@ const uint8_t *Frame::GetHeaderIe(uint8_t aIeId) const } #if OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE || \ - OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE + OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || (OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE) const uint8_t *Frame::GetThreadIe(uint8_t aSubType) const { uint8_t index = FindHeaderIeIndex(); @@ -1175,7 +1175,7 @@ const uint8_t *Frame::GetThreadIe(uint8_t aSubType) const return header; } #endif // OPENTHREAD_CONFIG_MLE_LINK_METRICS_INITIATOR_ENABLE || OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE || - // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE + // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || (OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE) #endif // OPENTHREAD_CONFIG_MAC_HEADER_IE_SUPPORT diff --git a/src/core/mac/mac_frame.hpp b/src/core/mac/mac_frame.hpp index 7b47d2df429..76bac81c0db 100644 --- a/src/core/mac/mac_frame.hpp +++ b/src/core/mac/mac_frame.hpp @@ -178,7 +178,7 @@ class Frame : public otRadioFrame */ bool IsAck(void) const { return GetType() == kTypeAck; } -#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || (OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE) /** * This method returns whether the frame is an IEEE 802.15.4 Wake-up frame. * @@ -224,7 +224,7 @@ class Frame : public otRadioFrame return (ie != nullptr) ? reinterpret_cast(ie + sizeof(HeaderIe)) : nullptr; } -#endif // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#endif // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || (OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE) /** * Returns the IEEE 802.15.4 Frame Version. diff --git a/src/core/mac/mac_header_ie.hpp b/src/core/mac/mac_header_ie.hpp index 7948429a67d..57901d3724e 100644 --- a/src/core/mac/mac_header_ie.hpp +++ b/src/core/mac/mac_header_ie.hpp @@ -289,7 +289,7 @@ class ThreadIe static constexpr uint8_t kEnhAckProbingIe = 0x00; }; -#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || (OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE) /** * This class implements Rendezvous Time IE data structure. * @@ -390,7 +390,7 @@ class ConnectionIe : public VendorIeHeader uint8_t mConnectionWindow; } OT_TOOL_PACKED_END; -#endif // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#endif // OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || (OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE) /** * @} diff --git a/src/core/mac/mac_links.hpp b/src/core/mac/mac_links.hpp index 13b89a22916..45284d7801a 100644 --- a/src/core/mac/mac_links.hpp +++ b/src/core/mac/mac_links.hpp @@ -502,7 +502,7 @@ class Links : public InstanceLocator } #endif // OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE /** * Configures wake-up listening parameters in all radios. * diff --git a/src/core/mac/sub_mac.cpp b/src/core/mac/sub_mac.cpp index c718e6fe0a3..7e9375ab030 100644 --- a/src/core/mac/sub_mac.cpp +++ b/src/core/mac/sub_mac.cpp @@ -55,7 +55,7 @@ SubMac::SubMac(Instance &aInstance) #if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE , mCslTimer(aInstance, SubMac::HandleCslTimer) #endif -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE , mWedTimer(aInstance, SubMac::HandleWedTimer) #endif { @@ -96,7 +96,7 @@ void SubMac::Init(void) #if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE CslInit(); #endif -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE WedInit(); #endif } @@ -223,7 +223,7 @@ Error SubMac::Disable(void) #if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE mCslTimer.Stop(); #endif -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE mWedTimer.Stop(); #endif diff --git a/src/core/mac/sub_mac.hpp b/src/core/mac/sub_mac.hpp index 4bef9381881..c2b6bc96024 100644 --- a/src/core/mac/sub_mac.hpp +++ b/src/core/mac/sub_mac.hpp @@ -494,7 +494,7 @@ class SubMac : public InstanceLocator, private NonCopyable bool IsRadioFilterEnabled(void) const { return mRadioFilterEnabled; } #endif -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE /** * Configures wake-up listening parameters in all radios. * @@ -519,7 +519,7 @@ class SubMac : public InstanceLocator, private NonCopyable void LogReceived(RxFrame *aFrame); #endif #endif -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE void WedInit(void); static void HandleWedTimer(Timer &aTimer); void HandleWedTimer(void); @@ -571,7 +571,7 @@ class SubMac : public InstanceLocator, private NonCopyable static constexpr uint32_t kCslReceiveTimeAhead = OPENTHREAD_CONFIG_CSL_RECEIVE_TIME_AHEAD; #endif -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE // Margin to be applied after the end of a wake-up listen duration to schedule the next listen interval. // The value is in usec. static constexpr uint32_t kWedReceiveTimeAfter = OPENTHREAD_CONFIG_WED_RECEIVE_TIME_AFTER; @@ -674,7 +674,7 @@ class SubMac : public InstanceLocator, private NonCopyable TimerMicro mCslTimer; #endif -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE uint32_t mWakeupListenInterval; // The wake-up listen interval, in microseconds. uint32_t mWakeupListenDuration; // The wake-up listen duration, in microseconds. uint8_t mWakeupChannel; // The wake-up sample channel. diff --git a/src/core/mac/sub_mac_wed.cpp b/src/core/mac/sub_mac_wed.cpp index 741be27708d..c0489282fac 100644 --- a/src/core/mac/sub_mac_wed.cpp +++ b/src/core/mac/sub_mac_wed.cpp @@ -33,7 +33,7 @@ #include "sub_mac.hpp" -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE #include "instance/instance.hpp" @@ -87,4 +87,4 @@ void SubMac::HandleWedTimer(void) } // namespace Mac } // namespace ot -#endif // OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#endif // OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE diff --git a/src/core/meshcop/dataset_manager.cpp b/src/core/meshcop/dataset_manager.cpp index c3dca49eab6..fb571b25a18 100644 --- a/src/core/meshcop/dataset_manager.cpp +++ b/src/core/meshcop/dataset_manager.cpp @@ -194,7 +194,7 @@ Error DatasetManager::ApplyConfiguration(const Dataset &aDataset) const case Tlv::kWakeupChannel: { -#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || (OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE) uint8_t channel = static_cast(cur->ReadValueAs().GetChannel()); error = Get().SetWakeupChannel(channel); diff --git a/src/core/radio/radio.hpp b/src/core/radio/radio.hpp index 9943c74c499..4f28648b70d 100644 --- a/src/core/radio/radio.hpp +++ b/src/core/radio/radio.hpp @@ -63,7 +63,7 @@ static constexpr uint64_t kMinCslPeriod = OPENTHREAD_CONFIG_MAC_CSL_MIN_PERIOD static constexpr uint64_t kMaxCslTimeout = OPENTHREAD_CONFIG_MAC_CSL_MAX_TIMEOUT; #endif -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE /** * Minimum wake-up listen duration supported in microseconds. */ diff --git a/src/core/thread/key_manager.cpp b/src/core/thread/key_manager.cpp index 8b8eb9073af..65a6932d84f 100644 --- a/src/core/thread/key_manager.cpp +++ b/src/core/thread/key_manager.cpp @@ -400,7 +400,7 @@ const Mle::KeyMaterial &KeyManager::GetTemporaryMleKey(uint32_t aKeySequence) return mTemporaryMleKey; } -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE const Mle::KeyMaterial &KeyManager::GetTemporaryMacKey(uint32_t aKeySequence) { HashKeys hashKeys; diff --git a/src/core/thread/key_manager.hpp b/src/core/thread/key_manager.hpp index 2aafa365824..cbdeb3b5b52 100644 --- a/src/core/thread/key_manager.hpp +++ b/src/core/thread/key_manager.hpp @@ -607,7 +607,7 @@ class KeyManager : public InstanceLocator, private NonCopyable Mle::KeyMaterial mMleKey; Mle::KeyMaterial mTemporaryMleKey; -#if OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE Mle::KeyMaterial mTemporaryMacKey; #endif diff --git a/src/ncp/ncp_base_dispatcher.cpp b/src/ncp/ncp_base_dispatcher.cpp index 60db0e65f5b..4c531308468 100644 --- a/src/ncp/ncp_base_dispatcher.cpp +++ b/src/ncp/ncp_base_dispatcher.cpp @@ -343,7 +343,7 @@ NcpBase::PropertyHandler NcpBase::FindGetPropertyHandler(spinel_prop_key_t aKey) OT_NCP_GET_HANDLER_ENTRY(SPINEL_PROP_THREAD_ACTIVE_DATASET_TLVS), OT_NCP_GET_HANDLER_ENTRY(SPINEL_PROP_THREAD_PENDING_DATASET_TLVS), OT_NCP_GET_HANDLER_ENTRY(SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET_TLVS), -#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || (OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE) OT_NCP_GET_HANDLER_ENTRY(SPINEL_PROP_THREAD_WAKEUP_CHANNEL), #endif #if OPENTHREAD_CONFIG_CHANNEL_MANAGER_ENABLE @@ -637,7 +637,7 @@ NcpBase::PropertyHandler NcpBase::FindSetPropertyHandler(spinel_prop_key_t aKey) OT_NCP_SET_HANDLER_ENTRY(SPINEL_PROP_THREAD_ACTIVE_DATASET_TLVS), OT_NCP_SET_HANDLER_ENTRY(SPINEL_PROP_THREAD_PENDING_DATASET_TLVS), OT_NCP_SET_HANDLER_ENTRY(SPINEL_PROP_THREAD_MGMT_SET_PENDING_DATASET_TLVS), -#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || (OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE) OT_NCP_SET_HANDLER_ENTRY(SPINEL_PROP_THREAD_WAKEUP_CHANNEL), #endif #if OPENTHREAD_CONFIG_COMMISSIONER_ENABLE diff --git a/src/ncp/ncp_base_mtd.cpp b/src/ncp/ncp_base_mtd.cpp index 0fbaf757466..b07aaf5795d 100644 --- a/src/ncp/ncp_base_mtd.cpp +++ b/src/ncp/ncp_base_mtd.cpp @@ -4791,7 +4791,7 @@ void NcpBase::ProcessThreadChangedFlags(void) return; } -#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE +#if OPENTHREAD_CONFIG_WAKEUP_COORDINATOR_ENABLE || (OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE) template <> otError NcpBase::HandlePropertySet(void) { uint8_t wakeupChannel;