Skip to content

Commit

Permalink
[wed] support WED for MTD only
Browse files Browse the repository at this point in the history
Do not support Wake-up End Device for non-MTD configurations for now.
  • Loading branch information
edmont committed Nov 14, 2024
1 parent cc8f078 commit ec7e02d
Show file tree
Hide file tree
Showing 18 changed files with 50 additions and 50 deletions.
10 changes: 5 additions & 5 deletions src/cli/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8228,7 +8228,7 @@ template <> otError Interpreter::Process<Cmd("verhoeff")>(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<Cmd("wakeup")>(Arg aArgs[])
{
otError error = OT_ERROR_NONE;
Expand All @@ -8255,7 +8255,7 @@ template <> otError Interpreter::Process<Cmd("wakeup")>(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
Expand Down Expand Up @@ -8318,7 +8318,7 @@ template <> otError Interpreter::Process<Cmd("wakeup")>(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);
Expand All @@ -8327,7 +8327,7 @@ template <> otError Interpreter::Process<Cmd("wakeup")>(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

Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/core/api/link_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Mac::Mac>().GetWakeupChannel();
Expand All @@ -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)
{
Expand Down Expand Up @@ -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<Mac::Mac>().SetWakeupListenEnabled(aEnable);
Expand All @@ -530,4 +530,4 @@ otError otLinkSetWakeupListenParameters(otInstance *aInstance, uint32_t aInterva
{
return AsCoreType(aInstance).Get<Mac::Mac>().SetWakeupListenParameters(aInterval, aDuration);
}
#endif // OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
#endif // OPENTHREAD_MTD && OPENTHREAD_CONFIG_WAKEUP_END_DEVICE_ENABLE
2 changes: 1 addition & 1 deletion src/core/config/mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

/**
Expand Down
18 changes: 9 additions & 9 deletions src/core/mac/mac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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;
Expand All @@ -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

Expand All @@ -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;
Expand Down Expand Up @@ -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
12 changes: 6 additions & 6 deletions src/core/mac/mac.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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.
*
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions src/core/mac/mac_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/core/mac/mac_frame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -224,7 +224,7 @@ class Frame : public otRadioFrame

return (ie != nullptr) ? reinterpret_cast<const ConnectionIe *>(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.
Expand Down
4 changes: 2 additions & 2 deletions src/core/mac/mac_header_ie.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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)

/**
* @}
Expand Down
2 changes: 1 addition & 1 deletion src/core/mac/mac_links.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
6 changes: 3 additions & 3 deletions src/core/mac/sub_mac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions src/core/mac/sub_mac.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/core/mac/sub_mac_wed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/core/meshcop/dataset_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint8_t>(cur->ReadValueAs<WakeupChannelTlv>().GetChannel());
error = Get<Mac::Mac>().SetWakeupChannel(channel);

Expand Down
2 changes: 1 addition & 1 deletion src/core/radio/radio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
Loading

0 comments on commit ec7e02d

Please sign in to comment.