diff --git a/src/core/mac/wakeup_tx_scheduler.cpp b/src/core/mac/wakeup_tx_scheduler.cpp index 58fd83368..2ae158f16 100644 --- a/src/core/mac/wakeup_tx_scheduler.cpp +++ b/src/core/mac/wakeup_tx_scheduler.cpp @@ -110,7 +110,8 @@ Mac::TxFrame *WakeupTxScheduler::PrepareWakeupFrame(Mac::TxFrames &aTxFrames) // the "free space" between the "n+1"-th and "n+2"-th wake-up frame. rendezvousTimeUs = mIntervalUs; rendezvousTimeUs += (mIntervalUs - (kWakeupFrameLength + kParentRequestLength) * kOctetDuration) / 2; - frame->GetRendezvousTimeIe()->SetRendezvousTime(rendezvousTimeUs / kUsPerTenSymbols); + + frame->GetRendezvousTimeIe()->SetRendezvousTime(ClampToUint16(rendezvousTimeUs / kUsPerTenSymbols)); connectionIe = frame->GetConnectionIe(); connectionIe->SetRetryInterval(kConnectionRetryInterval); diff --git a/src/core/mac/wakeup_tx_scheduler.hpp b/src/core/mac/wakeup_tx_scheduler.hpp index 2ba9edc94..650934a23 100644 --- a/src/core/mac/wakeup_tx_scheduler.hpp +++ b/src/core/mac/wakeup_tx_scheduler.hpp @@ -119,7 +119,7 @@ private: Mac::ExtAddress mWedAddress; TimeMicro mTxTimeUs; // Point in time when the next TX occurs. TimeMicro mTxEndTimeUs; // Point in time when the wake-up sequence is over. - uint16_t mTxRequestAheadTimeUs; // How much ahead the TX MAC operation needs to be requested. + uint32_t mTxRequestAheadTimeUs; // How much ahead the TX MAC operation needs to be requested. uint16_t mIntervalUs; // Interval between consecutive wake-up frames. WakeupTimer mTimer; bool mIsRunning;