diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp index 7b42c24e3840f8..3f0410c0cd0b40 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.cpp @@ -1896,6 +1896,10 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_RequestSEDActiv if (!onOff && delayIdle && CHIP_DEVICE_CONFIG_SED_ACTIVE_THRESHOLD.count() != 0) { + // StartTimer will cancel a timer if the same callback & context is used. + // This will have the effect of canceling the previous one (if any) and starting + // a new timer of the same duration. This effectively prolongs the active threshold + // without consuming additional resources. err = DeviceLayer::SystemLayer().StartTimer(CHIP_DEVICE_CONFIG_SED_ACTIVE_THRESHOLD, RequestSEDModeUpdate, this); if (CHIP_NO_ERROR == err) { diff --git a/src/system/SystemLayer.h b/src/system/SystemLayer.h index d312d67a8a29cc..632037f45a328f 100644 --- a/src/system/SystemLayer.h +++ b/src/system/SystemLayer.h @@ -118,12 +118,8 @@ class DLL_EXPORT Layer * This method cancels a one-shot timer, started earlier through @p StartTimer(). * * @note - * The cancellation could fail silently in two different ways. If the timer specified by the combination of the callback - * function and application state object couldn't be found, cancellation could fail. If the timer has fired, then - * an event is queued and will be processed later. - * - * WARNING: Timer handlers MUST assume that they may be hit even after CancelTimer due to cancelling an - * already fired timer that is queued in the event loop already. + * The cancellation could fail silently if the timer specified by the combination of the callback + * function and application state object couldn't be found. * * @param[in] aOnComplete A pointer to the callback function used in calling @p StartTimer(). * @param[in] aAppState A pointer to the application state object used in calling @p StartTimer().