diff --git a/src/messaging/ReliableMessageMgr.cpp b/src/messaging/ReliableMessageMgr.cpp index 753c95871e4335..96a8563b1a4464 100644 --- a/src/messaging/ReliableMessageMgr.cpp +++ b/src/messaging/ReliableMessageMgr.cpp @@ -34,6 +34,7 @@ #include #include #include +#include using namespace chip::System::Clock::Literals; @@ -248,6 +249,18 @@ System::Clock::Timestamp ReliableMessageMgr::GetBackoff(System::Clock::Timestamp uint32_t jitter = MRP_BACKOFF_JITTER_BASE + Crypto::GetRandU8(); mrpBackoffTime = mrpBackoffTime * jitter / MRP_BACKOFF_JITTER_BASE; +#if CHIP_DEVICE_CONFIG_ENABLE_SED + // Implement: + // "A sleepy sender SHOULD increase t to also account for its own sleepy interval + // required to receive the acknowledgment" + DeviceLayer::ConnectivityManager::SEDIntervalsConfig sedIntervals; + + if (DeviceLayer::ConnectivityMgr().GetSEDIntervalsConfig(sedIntervals) == CHIP_NO_ERROR) + { + mrpBackoffTime += System::Clock::Timestamp(sedIntervals.ActiveIntervalMS); + } +#endif + return mrpBackoffTime; }