diff --git a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c index f54175ae9733da..22032e33f4a928 100644 --- a/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c +++ b/examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c @@ -191,7 +191,7 @@ sl_status_t join_callback_handler(sl_wifi_event_t event, char * result, uint32_t return SL_STATUS_OK; } -#if CHIP_DEVICE_CONFIG_ENABLE_SED +#if SL_ICD_ENABLED /****************************************************************** * @fn wfx_rsi_power_save() * @brief @@ -221,7 +221,7 @@ int32_t wfx_rsi_power_save() SILABS_LOG("Powersave Config Success"); return status; } -#endif /* CHIP_DEVICE_CONFIG_ENABLE_SED */ +#endif /* SL_ICD_ENABLED */ /************************************************************************************* * @fn static int32_t wfx_wifi_rsi_init(void) diff --git a/examples/pump-app/silabs/src/AppTask.cpp b/examples/pump-app/silabs/src/AppTask.cpp index d870092d6527a4..b37d10852d0bd9 100644 --- a/examples/pump-app/silabs/src/AppTask.cpp +++ b/examples/pump-app/silabs/src/AppTask.cpp @@ -135,7 +135,7 @@ void AppTask::AppTaskMain(void * pvParameter) appError(err); } -#if !(defined(CHIP_DEVICE_CONFIG_ENABLE_SED) && CHIP_DEVICE_CONFIG_ENABLE_SED) +#if !(defined(CHIP_CONFIG_ENABLE_ICD_SERVER) && CHIP_CONFIG_ENABLE_ICD_SERVER) sAppTask.StartStatusLEDTimer(); #endif diff --git a/examples/window-app/silabs/src/AppTask.cpp b/examples/window-app/silabs/src/AppTask.cpp index 9adf137a5ccc04..4765c48fa4d987 100644 --- a/examples/window-app/silabs/src/AppTask.cpp +++ b/examples/window-app/silabs/src/AppTask.cpp @@ -120,7 +120,7 @@ void AppTask::AppTaskMain(void * pvParameter) appError(err); } -#if !(defined(CHIP_DEVICE_CONFIG_ENABLE_SED) && CHIP_DEVICE_CONFIG_ENABLE_SED) +#if !(defined(CHIP_CONFIG_ENABLE_ICD_SERVER) && CHIP_CONFIG_ENABLE_ICD_SERVER) sAppTask.StartStatusLEDTimer(); #endif diff --git a/src/app/FailSafeContext.cpp b/src/app/FailSafeContext.cpp index d79a36f14f045b..b11ad8775c84df 100644 --- a/src/app/FailSafeContext.cpp +++ b/src/app/FailSafeContext.cpp @@ -52,14 +52,6 @@ void FailSafeContext::HandleDisarmFailSafe(intptr_t arg) void FailSafeContext::SetFailSafeArmed(bool armed) { -#if CHIP_DEVICE_CONFIG_ENABLE_SED - if (IsFailSafeArmed() != armed) - { - // Per spec, we should be staying in active mode while a fail-safe is - // armed. - DeviceLayer::ConnectivityMgr().RequestSEDActiveMode(armed); - } -#endif // CHIP_DEVICE_CONFIG_ENABLE_SED #if CHIP_CONFIG_ENABLE_ICD_SERVER if (IsFailSafeArmed() != armed) { diff --git a/src/app/server/CommissioningWindowManager.cpp b/src/app/server/CommissioningWindowManager.cpp index cbc7c44e7fb6f8..270f4dad57cb39 100644 --- a/src/app/server/CommissioningWindowManager.cpp +++ b/src/app/server/CommissioningWindowManager.cpp @@ -98,14 +98,6 @@ void CommissioningWindowManager::ResetState() mECMIterations = 0; mECMSaltLength = 0; -#if CHIP_DEVICE_CONFIG_ENABLE_SED - if (mSEDActiveModeEnabled) - { - DeviceLayer::ConnectivityMgr().RequestSEDActiveMode(false); - mSEDActiveModeEnabled = false; - } -#endif - UpdateWindowStatus(CommissioningWindowStatusEnum::kWindowNotOpen); UpdateOpenerFabricIndex(NullNullable); @@ -245,14 +237,6 @@ CHIP_ERROR CommissioningWindowManager::AdvertiseAndListenForPASE() mPairingSession.Clear(); -#if CHIP_DEVICE_CONFIG_ENABLE_SED - if (!mSEDActiveModeEnabled) - { - mSEDActiveModeEnabled = true; - DeviceLayer::ConnectivityMgr().RequestSEDActiveMode(true); - } -#endif - ReturnErrorOnFailure(mServer->GetExchangeManager().RegisterUnsolicitedMessageHandlerForType( Protocols::SecureChannel::MsgType::PBKDFParamRequest, this)); mListeningForPASE = true; diff --git a/src/app/server/CommissioningWindowManager.h b/src/app/server/CommissioningWindowManager.h index fae3c075f5b518..df9b1dcd5e36c6 100644 --- a/src/app/server/CommissioningWindowManager.h +++ b/src/app/server/CommissioningWindowManager.h @@ -211,10 +211,6 @@ class CommissioningWindowManager : public Messaging::UnsolicitedMessageHandler, uint32_t mECMSaltLength = 0; uint8_t mECMSalt[kSpake2p_Max_PBKDF_Salt_Length]; -#if CHIP_DEVICE_CONFIG_ENABLE_SED - bool mSEDActiveModeEnabled = false; -#endif - // For tests only, so that we can test the commissioning window timeout // without having to wait 3 minutes. Optional mMinCommissioningTimeoutOverride; diff --git a/src/include/platform/ConnectivityManager.h b/src/include/platform/ConnectivityManager.h index 79eaa37423542a..cdacf50b663979 100755 --- a/src/include/platform/ConnectivityManager.h +++ b/src/include/platform/ConnectivityManager.h @@ -204,28 +204,6 @@ class ConnectivityManager void ResetThreadNetworkDiagnosticsCounts(); CHIP_ERROR WriteThreadNetworkDiagnosticAttributeToTlv(AttributeId attributeId, app::AttributeValueEncoder & encoder); -// Sleepy end device methods -#if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR GetSEDIntervalsConfig(SEDIntervalsConfig & intervalsConfig); - - /** - * Sets Sleepy End Device intervals configuration and posts kSEDIntervalChange event to inform other software - * modules about the change. - * - * @param[in] intervalsConfig intervals configuration to be set - */ - CHIP_ERROR SetSEDIntervalsConfig(const SEDIntervalsConfig & intervalsConfig); - - /** - * Requests setting Sleepy End Device active interval on or off. - * Every method call with onOff parameter set to true or false results in incrementing or decrementing the active mode - * consumers counter. Active mode is set if the consumers counter is bigger than 0. - * - * @param[in] onOff true if active mode should be enabled and false otherwise. - */ - CHIP_ERROR RequestSEDActiveMode(bool onOff, bool delayIdle = false); -#endif - CHIP_ERROR SetPollingInterval(System::Clock::Milliseconds32 pollingInterval); // CHIPoBLE service methods @@ -470,23 +448,6 @@ inline CHIP_ERROR ConnectivityManager::SetThreadDeviceType(ThreadDeviceType devi return static_cast(this)->_SetThreadDeviceType(deviceType); } -#if CHIP_DEVICE_CONFIG_ENABLE_SED -inline CHIP_ERROR ConnectivityManager::GetSEDIntervalsConfig(SEDIntervalsConfig & intervalsConfig) -{ - return static_cast(this)->_GetSEDIntervalsConfig(intervalsConfig); -} - -inline CHIP_ERROR ConnectivityManager::SetSEDIntervalsConfig(const SEDIntervalsConfig & intervalsConfig) -{ - return static_cast(this)->_SetSEDIntervalsConfig(intervalsConfig); -} - -inline CHIP_ERROR ConnectivityManager::RequestSEDActiveMode(bool onOff, bool delayIdle) -{ - return static_cast(this)->_RequestSEDActiveMode(onOff, delayIdle); -} -#endif - inline CHIP_ERROR ConnectivityManager::SetPollingInterval(System::Clock::Milliseconds32 pollingInterval) { #if CHIP_CONFIG_ENABLE_ICD_SERVER diff --git a/src/include/platform/ThreadStackManager.h b/src/include/platform/ThreadStackManager.h index 589d138ba77773..bfd8875551a84b 100755 --- a/src/include/platform/ThreadStackManager.h +++ b/src/include/platform/ThreadStackManager.h @@ -163,26 +163,6 @@ class ThreadStackManager ConnectivityManager::ThreadDeviceType GetThreadDeviceType(); CHIP_ERROR SetThreadDeviceType(ConnectivityManager::ThreadDeviceType threadRole); -#if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig); - - /** - * Sets Sleepy End Device intervals configuration and posts kICDPollingIntervalChange event to inform other software - * modules about the change. - * - * @param[in] intervalsConfig intervals configuration to be set - */ - CHIP_ERROR SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig); - - /** - * Requests setting Sleepy End Device active interval on or off. - * Every method call with onOff parameter set to true or false results in incrementing or decrementing the active mode - * consumers counter. Active mode is set if the consumers counter is bigger than 0. - * - * @param[in] onOff true if active mode should be enabled and false otherwise. - */ - CHIP_ERROR RequestSEDActiveMode(bool onOff, bool delayIdle = false); -#endif #if CHIP_CONFIG_ENABLE_ICD_SERVER CHIP_ERROR SetPollingInterval(System::Clock::Milliseconds32 pollingInterval); #endif @@ -393,23 +373,6 @@ inline CHIP_ERROR ThreadStackManager::SetThreadDeviceType(ConnectivityManager::T return static_cast(this)->_SetThreadDeviceType(deviceType); } -#if CHIP_DEVICE_CONFIG_ENABLE_SED -inline CHIP_ERROR ThreadStackManager::GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig) -{ - return static_cast(this)->_GetSEDIntervalsConfig(intervalsConfig); -} - -inline CHIP_ERROR ThreadStackManager::SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig) -{ - return static_cast(this)->_SetSEDIntervalsConfig(intervalsConfig); -} - -inline CHIP_ERROR ThreadStackManager::RequestSEDActiveMode(bool onOff, bool delayIdle) -{ - return static_cast(this)->_RequestSEDActiveMode(onOff, delayIdle); -} -#endif - #if CHIP_CONFIG_ENABLE_ICD_SERVER inline CHIP_ERROR ThreadStackManager::SetPollingInterval(System::Clock::Milliseconds32 pollingInterval) { diff --git a/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.h b/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.h index 0f8b568d0393dd..a1d24c2e1c80d4 100755 --- a/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.h +++ b/src/include/platform/internal/GenericConnectivityManagerImpl_Thread.h @@ -63,11 +63,6 @@ class GenericConnectivityManagerImpl_Thread bool _IsThreadApplicationControlled(); ConnectivityManager::ThreadDeviceType _GetThreadDeviceType(); CHIP_ERROR _SetThreadDeviceType(ConnectivityManager::ThreadDeviceType deviceType); -#if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR _GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig); - CHIP_ERROR _SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig); - CHIP_ERROR _RequestSEDActiveMode(bool onOff, bool delayIdle = false); -#endif #if CHIP_CONFIG_ENABLE_ICD_SERVER CHIP_ERROR _SetPollingInterval(System::Clock::Milliseconds32 pollingInterval); #endif /* CHIP_CONFIG_ENABLE_ICD_SERVER */ @@ -144,28 +139,6 @@ GenericConnectivityManagerImpl_Thread::_SetThreadDeviceType(Connectiv return ThreadStackMgrImpl().SetThreadDeviceType(deviceType); } -#if CHIP_DEVICE_CONFIG_ENABLE_SED -template -inline CHIP_ERROR -GenericConnectivityManagerImpl_Thread::_GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig) -{ - return ThreadStackMgrImpl().GetSEDIntervalsConfig(intervalsConfig); -} - -template -inline CHIP_ERROR GenericConnectivityManagerImpl_Thread::_SetSEDIntervalsConfig( - const ConnectivityManager::SEDIntervalsConfig & intervalsConfig) -{ - return ThreadStackMgrImpl().SetSEDIntervalsConfig(intervalsConfig); -} - -template -inline CHIP_ERROR GenericConnectivityManagerImpl_Thread::_RequestSEDActiveMode(bool onOff, bool delayIdle) -{ - return ThreadStackMgrImpl().RequestSEDActiveMode(onOff, delayIdle); -} -#endif - #if CHIP_CONFIG_ENABLE_ICD_SERVER template inline CHIP_ERROR diff --git a/src/messaging/ExchangeContext.cpp b/src/messaging/ExchangeContext.cpp index bb8fe2d993da32..9d1e7ca06fce23 100644 --- a/src/messaging/ExchangeContext.cpp +++ b/src/messaging/ExchangeContext.cpp @@ -91,45 +91,6 @@ void ExchangeContext::SetResponseTimeout(Timeout timeout) mResponseTimeout = timeout; } -#if CONFIG_DEVICE_LAYER && CHIP_DEVICE_CONFIG_ENABLE_SED -void ExchangeContext::UpdateSEDIntervalMode() -{ - if (!HasSessionHandle()) - { - // After the session has been deleted, no further communication can occur on the exchange, - // so withdraw a SED active mode request. - UpdateSEDIntervalMode(false); - return; - } - - Transport::PeerAddress address; - - switch (GetSessionHandle()->GetSessionType()) - { - case Transport::Session::SessionType::kSecure: - address = GetSessionHandle()->AsSecureSession()->GetPeerAddress(); - break; - case Transport::Session::SessionType::kUnauthenticated: - address = GetSessionHandle()->AsUnauthenticatedSession()->GetPeerAddress(); - break; - default: - return; - } - - VerifyOrReturn(address.GetTransportType() != Transport::Type::kBle); - UpdateSEDIntervalMode(IsResponseExpected() || IsSendExpected() || IsMessageNotAcked()); -} - -void ExchangeContext::UpdateSEDIntervalMode(bool activeMode) -{ - if (activeMode != IsRequestingActiveMode()) - { - SetRequestingActiveMode(activeMode); - DeviceLayer::ConnectivityMgr().RequestSEDActiveMode(activeMode, true); - } -} -#endif - CHIP_ERROR ExchangeContext::SendMessage(Protocols::Id protocolId, uint8_t msgType, PacketBufferHandle && msgBuf, const SendFlags & sendFlags) { @@ -400,11 +361,6 @@ ExchangeContext::~ExchangeContext() // VerifyOrDie(mFlags.Has(Flags::kFlagClosed)); -#if CONFIG_DEVICE_LAYER && CHIP_DEVICE_CONFIG_ENABLE_SED - // Make sure that the exchange withdraws the request for Sleepy End Device active mode. - UpdateSEDIntervalMode(false); -#endif - // Ideally, in this scenario, the retransmit table should // be clear of any outstanding messages for this context and // the boolean parameter passed to DoClose() should not matter. @@ -681,10 +637,6 @@ CHIP_ERROR ExchangeContext::HandleMessage(uint32_t messageCounter, const Payload void ExchangeContext::MessageHandled() { -#if CONFIG_DEVICE_LAYER && CHIP_DEVICE_CONFIG_ENABLE_SED - UpdateSEDIntervalMode(); -#endif - if (mFlags.Has(Flags::kFlagClosed) || IsResponseExpected() || IsSendExpected()) { return; diff --git a/src/messaging/ReliableMessageMgr.cpp b/src/messaging/ReliableMessageMgr.cpp index b2aaacf633b9af..5dc397a39b9ad8 100644 --- a/src/messaging/ReliableMessageMgr.cpp +++ b/src/messaging/ReliableMessageMgr.cpp @@ -258,13 +258,6 @@ System::Clock::Timestamp ReliableMessageMgr::GetBackoff(System::Clock::Timestamp // "An ICD sender SHOULD increase t to also account for its own sleepy interval // required to receive the acknowledgment" mrpBackoffTime += app::ICDManager::GetFastPollingInterval(); -#elif CHIP_DEVICE_CONFIG_ENABLE_SED - DeviceLayer::ConnectivityManager::SEDIntervalsConfig sedIntervals; - - if (DeviceLayer::ConnectivityMgr().GetSEDIntervalsConfig(sedIntervals) == CHIP_NO_ERROR) - { - mrpBackoffTime += System::Clock::Timestamp(sedIntervals.ActiveIntervalMS); - } #endif mrpBackoffTime += CHIP_CONFIG_MRP_RETRY_INTERVAL_SENDER_BOOST; diff --git a/src/messaging/ReliableMessageProtocolConfig.cpp b/src/messaging/ReliableMessageProtocolConfig.cpp index 795e02c3ce3679..9dfd0719293774 100644 --- a/src/messaging/ReliableMessageProtocolConfig.cpp +++ b/src/messaging/ReliableMessageProtocolConfig.cpp @@ -76,16 +76,6 @@ Optional GetLocalMRPConfig() config.mIdleRetransTimeout += app::ICDManager::GetSlowPollingInterval(); config.mActiveRetransTimeout += app::ICDManager::GetFastPollingInterval(); config.mActiveThresholdTime = System::Clock::Milliseconds16(IcdManagementServer::GetInstance().GetActiveModeThreshold()); -#elif CHIP_DEVICE_CONFIG_ENABLE_SED - DeviceLayer::ConnectivityManager::SEDIntervalsConfig sedIntervalsConfig; - - if (DeviceLayer::ConnectivityMgr().GetSEDIntervalsConfig(sedIntervalsConfig) == CHIP_NO_ERROR) - { - // Increase local MRP retry intervals by SED intervals. That is, intervals for - // which the device can be at sleep and not be able to receive any messages). - config.mIdleRetransTimeout += sedIntervalsConfig.IdleIntervalMS; - config.mActiveRetransTimeout += sedIntervalsConfig.ActiveIntervalMS; - } #endif #if CONFIG_BUILD_FOR_HOST_UNIT_TEST diff --git a/src/platform/Linux/ThreadStackManagerImpl.cpp b/src/platform/Linux/ThreadStackManagerImpl.cpp index f8cdcb2f453e44..a880490d85fb00 100644 --- a/src/platform/Linux/ThreadStackManagerImpl.cpp +++ b/src/platform/Linux/ThreadStackManagerImpl.cpp @@ -518,32 +518,6 @@ CHIP_ERROR ThreadStackManagerImpl::_SetThreadDeviceType(ConnectivityManager::Thr return CHIP_NO_ERROR; } -#if CHIP_DEVICE_CONFIG_ENABLE_SED -CHIP_ERROR ThreadStackManagerImpl::_GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig) -{ - (void) intervalsConfig; - - ChipLogError(DeviceLayer, "SED intervals config is not supported on linux"); - return CHIP_ERROR_NOT_IMPLEMENTED; -} - -CHIP_ERROR ThreadStackManagerImpl::_SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig) -{ - (void) intervalsConfig; - - ChipLogError(DeviceLayer, "SED intervals config is not supported on linux"); - return CHIP_ERROR_NOT_IMPLEMENTED; -} - -CHIP_ERROR ThreadStackManagerImpl::_RequestSEDActiveMode(bool onOff, bool delayIdle) -{ - (void) onOff; - (void) delayIdle; - - ChipLogError(DeviceLayer, "SED intervals config is not supported on linux"); - return CHIP_ERROR_NOT_IMPLEMENTED; -} -#endif #if CHIP_CONFIG_ENABLE_ICD_SERVER CHIP_ERROR ThreadStackManagerImpl::_SetPollingInterval(System::Clock::Milliseconds32 pollingInterval) { diff --git a/src/platform/Linux/ThreadStackManagerImpl.h b/src/platform/Linux/ThreadStackManagerImpl.h index b91d210f7c5028..5e077cba3bd1fe 100755 --- a/src/platform/Linux/ThreadStackManagerImpl.h +++ b/src/platform/Linux/ThreadStackManagerImpl.h @@ -93,11 +93,6 @@ class ThreadStackManagerImpl : public ThreadStackManager CHIP_ERROR _SetThreadDeviceType(ConnectivityManager::ThreadDeviceType deviceType); -#if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR _GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig); - CHIP_ERROR _SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig); - CHIP_ERROR _RequestSEDActiveMode(bool onOff, bool delayIdle = false); -#endif #if CHIP_CONFIG_ENABLE_ICD_SERVER CHIP_ERROR _SetPollingInterval(System::Clock::Milliseconds32 pollingInterval); #endif /* CHIP_CONFIG_ENABLE_ICD_SERVER */ diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h index b28058b5946d72..d8bf1b2b76a4a0 100755 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.h @@ -100,13 +100,6 @@ class GenericThreadStackManagerImpl_OpenThread void _OnNetworkScanFinished(otActiveScanResult * aResult); void _UpdateNetworkStatus(); -#if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR _GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig); - CHIP_ERROR _SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig); - CHIP_ERROR _RequestSEDActiveMode(bool onOff, bool delayIdle); - CHIP_ERROR SEDUpdateMode(); - static void RequestSEDModeUpdate(chip::System::Layer * apSystemLayer, void * apAppState); -#endif #if CHIP_CONFIG_ENABLE_ICD_SERVER CHIP_ERROR _SetPollingInterval(System::Clock::Milliseconds32 pollingInterval); #endif // CHIP_CONFIG_ENABLE_ICD_SERVER @@ -166,13 +159,6 @@ class GenericThreadStackManagerImpl_OpenThread NetworkCommissioning::Internal::WirelessDriver::ConnectCallback * mpConnectCallback; NetworkCommissioning::Internal::BaseDriver::NetworkStatusChangeCallback * mpStatusChangeCallback = nullptr; -#if CHIP_DEVICE_CONFIG_ENABLE_SED - ConnectivityManager::SEDIntervalsConfig mIntervalsConfig; - ConnectivityManager::SEDIntervalMode mIntervalsMode = ConnectivityManager::SEDIntervalMode::Idle; - uint32_t mActiveModeConsumers = 0; - bool mDelayIdleTimerRunning = false; -#endif - #if CHIP_DEVICE_CONFIG_ENABLE_THREAD_SRP_CLIENT struct SrpClient @@ -279,10 +265,6 @@ class GenericThreadStackManagerImpl_OpenThread static void OnJoinerComplete(otError aError, void * aContext); void OnJoinerComplete(otError aError); -#if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR SetSEDIntervalMode(ConnectivityManager::SEDIntervalMode intervalType); -#endif - inline ImplClass * Impl() { return static_cast(this); } }; diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp index 4d2f461e61dd7f..4e89e6938520b4 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp @@ -376,7 +376,7 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_StartThreadScan(NetworkCommissioning::ThreadDriver::ScanCallback * callback) { CHIP_ERROR error = CHIP_NO_ERROR; -#if CHIP_DEVICE_CONFIG_ENABLE_SED || CHIP_CONFIG_ENABLE_ICD_SERVER +#if CHIP_CONFIG_ENABLE_ICD_SERVER otLinkModeConfig linkMode; #endif // If there is another ongoing scan request, reject the new one. @@ -392,7 +392,7 @@ GenericThreadStackManagerImpl_OpenThread::_StartThreadScan(NetworkCom SuccessOrExit(error = MapOpenThreadError(otIp6SetEnabled(mOTInst, true))); } -#if CHIP_DEVICE_CONFIG_ENABLE_SED || CHIP_CONFIG_ENABLE_ICD_SERVER +#if CHIP_CONFIG_ENABLE_ICD_SERVER // Thread network discovery makes Sleepy End Devices detach from a network, so temporarily disable the SED mode. linkMode = otThreadGetLinkMode(mOTInst); @@ -430,7 +430,7 @@ void GenericThreadStackManagerImpl_OpenThread::_OnNetworkScanFinished { if (aResult == nullptr) // scan completed { -#if CHIP_DEVICE_CONFIG_ENABLE_SED || CHIP_CONFIG_ENABLE_ICD_SERVER +#if CHIP_CONFIG_ENABLE_ICD_SERVER if (mTemporaryRxOnWhenIdle) { otLinkModeConfig linkMode = otThreadGetLinkMode(mOTInst); @@ -1702,19 +1702,6 @@ CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::DoInit(otInstanc mOTInst = otInst; -#if CHIP_DEVICE_CONFIG_ENABLE_SED - ConnectivityManager::SEDIntervalsConfig sedIntervalsConfig; - using namespace System::Clock::Literals; - sedIntervalsConfig.ActiveIntervalMS = CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL; - sedIntervalsConfig.IdleIntervalMS = CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL; - err = _SetSEDIntervalsConfig(sedIntervalsConfig); - if (err != CHIP_NO_ERROR) - { - ChipLogError(DeviceLayer, "Failed to set sleepy end device intervals: %s", ErrorStr(err)); - } - SuccessOrExit(err); -#endif - // Arrange for OpenThread to call the OnOpenThreadStateChange method whenever a // state change occurs. Note that we reference the OnOpenThreadStateChange method // on the concrete implementation class so that that class can override the default @@ -1767,172 +1754,6 @@ bool GenericThreadStackManagerImpl_OpenThread::IsThreadInterfaceUpNoL return otIp6IsEnabled(mOTInst); } -#if CHIP_DEVICE_CONFIG_ENABLE_SED -template -CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_GetSEDIntervalsConfig( - ConnectivityManager::SEDIntervalsConfig & intervalsConfig) -{ - intervalsConfig = mIntervalsConfig; - return CHIP_NO_ERROR; -} - -template -CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_SetSEDIntervalsConfig( - const ConnectivityManager::SEDIntervalsConfig & intervalsConfig) -{ - using namespace System::Clock::Literals; - if ((intervalsConfig.IdleIntervalMS < intervalsConfig.ActiveIntervalMS) || (intervalsConfig.IdleIntervalMS == 0_ms32) || - (intervalsConfig.ActiveIntervalMS == 0_ms32)) - { - return CHIP_ERROR_INVALID_ARGUMENT; - } - mIntervalsConfig = intervalsConfig; - - CHIP_ERROR err = SetSEDIntervalMode(mIntervalsMode); - - if (err == CHIP_NO_ERROR) - { - ChipDeviceEvent event; - event.Type = DeviceEventType::kICDPollingIntervalChange; - err = chip::DeviceLayer::PlatformMgr().PostEvent(&event); - } - - return err; -} - -template -CHIP_ERROR -GenericThreadStackManagerImpl_OpenThread::SetSEDIntervalMode(ConnectivityManager::SEDIntervalMode intervalType) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - System::Clock::Milliseconds32 interval; - - if (intervalType == ConnectivityManager::SEDIntervalMode::Idle) - { - interval = mIntervalsConfig.IdleIntervalMS; - } - else if (intervalType == ConnectivityManager::SEDIntervalMode::Active) - { - interval = mIntervalsConfig.ActiveIntervalMS; - } - else - { - return CHIP_ERROR_INVALID_ARGUMENT; - } - - Impl()->LockThreadStack(); - - mIntervalsMode = intervalType; - -// For Thread devices, the intervals are defined as: -// * poll period for SED devices that poll the parent for data -// * CSL period for SSED devices that listen for messages in scheduled time slots. -#if CHIP_DEVICE_CONFIG_THREAD_SSED - // Get CSL period in units of 10 symbols, convert it to microseconds and divide by 1000 to get milliseconds. - uint32_t curIntervalMS = otLinkCslGetPeriod(mOTInst) * OT_US_PER_TEN_SYMBOLS / 1000; -#else - uint32_t curIntervalMS = otLinkGetPollPeriod(mOTInst); -#endif - otError otErr = OT_ERROR_NONE; - if (interval.count() != curIntervalMS) - { -#if CHIP_DEVICE_CONFIG_THREAD_SSED - // Set CSL period in units of 10 symbols, convert it to microseconds and divide by 1000 to get milliseconds. - otErr = otLinkCslSetPeriod(mOTInst, interval.count() * 1000 / OT_US_PER_TEN_SYMBOLS); - curIntervalMS = otLinkCslGetPeriod(mOTInst) * OT_US_PER_TEN_SYMBOLS / 1000; -#else - otErr = otLinkSetPollPeriod(mOTInst, interval.count()); - curIntervalMS = otLinkGetPollPeriod(mOTInst); -#endif - err = MapOpenThreadError(otErr); - } - - Impl()->UnlockThreadStack(); - - if (otErr != OT_ERROR_NONE) - { - ChipLogError(DeviceLayer, "Failed to set SED interval to %" PRId32 "ms. Defaulting to %" PRId32 "ms", interval.count(), - curIntervalMS); - } - else - { - ChipLogProgress(DeviceLayer, "OpenThread SED interval is %" PRId32 "ms", curIntervalMS); - } - - return err; -} - -template -CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_RequestSEDActiveMode(bool onOff, bool delayIdle) -{ - CHIP_ERROR err = CHIP_NO_ERROR; - - if (onOff) - { - mActiveModeConsumers++; - } - else - { - if (mActiveModeConsumers > 0) - mActiveModeConsumers--; - } - - 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) - { - if (!mDelayIdleTimerRunning) - { - mDelayIdleTimerRunning = true; - mActiveModeConsumers++; - } - return err; - } - - ChipLogError(DeviceLayer, "Failed to postpone Idle Mode with error %" CHIP_ERROR_FORMAT, err.Format()); - } - - return SEDUpdateMode(); -} - -template -CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::SEDUpdateMode() -{ - CHIP_ERROR err = CHIP_NO_ERROR; - ConnectivityManager::SEDIntervalMode mode; - - mode = mActiveModeConsumers > 0 ? ConnectivityManager::SEDIntervalMode::Active : ConnectivityManager::SEDIntervalMode::Idle; - - if (mIntervalsMode != mode) - err = SetSEDIntervalMode(mode); - - return err; -} - -template -void GenericThreadStackManagerImpl_OpenThread::RequestSEDModeUpdate(chip::System::Layer * apSystemLayer, - void * apAppState) -{ - if (apAppState != nullptr) - { - GenericThreadStackManagerImpl_OpenThread * obj = static_cast(apAppState); - if (obj->mActiveModeConsumers > 0) - { - obj->mActiveModeConsumers--; - } - - obj->mDelayIdleTimerRunning = false; - - obj->SEDUpdateMode(); - } -} -#endif - #if CHIP_CONFIG_ENABLE_ICD_SERVER template CHIP_ERROR GenericThreadStackManagerImpl_OpenThread::_SetPollingInterval(System::Clock::Milliseconds32 pollingInterval) diff --git a/src/platform/nrfconnect/wifi/ConnectivityManagerImplWiFi.cpp b/src/platform/nrfconnect/wifi/ConnectivityManagerImplWiFi.cpp index 93559822ef6d82..b3bdede0f2f852 100644 --- a/src/platform/nrfconnect/wifi/ConnectivityManagerImplWiFi.cpp +++ b/src/platform/nrfconnect/wifi/ConnectivityManagerImplWiFi.cpp @@ -123,26 +123,6 @@ CHIP_ERROR ConnectivityManagerImplWiFi::_GetAndLogWiFiStatsCounters(void) return CHIP_NO_ERROR; } -#if CHIP_DEVICE_CONFIG_ENABLE_SED -CHIP_ERROR ConnectivityManagerImplWiFi::_GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & SEDIntervalsConfig) -{ - // For now Wi-Fi uses legacy power save mode that has fixed inactivity interval - SEDIntervalsConfig.ActiveIntervalMS = - chip::System::Clock::Milliseconds32(WiFiManager::kDefaultDTIMInterval * WiFiManager::kBeaconIntervalMs); - SEDIntervalsConfig.IdleIntervalMS = - chip::System::Clock::Milliseconds32(WiFiManager::kDefaultDTIMInterval * WiFiManager::kBeaconIntervalMs); - return CHIP_NO_ERROR; -} -CHIP_ERROR ConnectivityManagerImplWiFi::_SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig) -{ - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -} -CHIP_ERROR ConnectivityManagerImplWiFi::_RequestSEDActiveMode(bool onOff, bool delayIdle) -{ - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; -} -#endif - ConnectivityManager::WiFiAPMode ConnectivityManagerImplWiFi::_GetWiFiAPMode(void) { /* AP mode is unsupported */ diff --git a/src/platform/nrfconnect/wifi/ConnectivityManagerImplWiFi.h b/src/platform/nrfconnect/wifi/ConnectivityManagerImplWiFi.h index 407bb2044ed77c..dfa6a05f0b7ae4 100644 --- a/src/platform/nrfconnect/wifi/ConnectivityManagerImplWiFi.h +++ b/src/platform/nrfconnect/wifi/ConnectivityManagerImplWiFi.h @@ -55,12 +55,6 @@ class ConnectivityManagerImplWiFi void _OnWiFiScanDone(); void _OnWiFiStationProvisionChange(); -#if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR _GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig); - CHIP_ERROR _SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig); - CHIP_ERROR _RequestSEDActiveMode(bool onOff, bool delayIdle = false); -#endif - // Wi-Fi access point - not supported ConnectivityManager::WiFiAPMode _GetWiFiAPMode(void); CHIP_ERROR _SetWiFiAPMode(ConnectivityManager::WiFiAPMode val); diff --git a/src/platform/qpg/ThreadStackManagerImpl.cpp b/src/platform/qpg/ThreadStackManagerImpl.cpp index cb6fd0e2ec1289..01abdc679f970c 100644 --- a/src/platform/qpg/ThreadStackManagerImpl.cpp +++ b/src/platform/qpg/ThreadStackManagerImpl.cpp @@ -113,13 +113,3 @@ extern "C" void otPlatFree(void * aPtr) { CHIPPlatformMemoryFree(aPtr); } - -#if CHIP_DEVICE_CONFIG_ENABLE_SED -CHIP_ERROR ThreadStackManagerImpl::_RequestSEDFastPollingMode(bool onOff) -{ - (void) onOff; - - ChipLogError(DeviceLayer, "Polling config is not supported on this platform"); - return CHIP_ERROR_NOT_IMPLEMENTED; -} -#endif diff --git a/src/platform/qpg/ThreadStackManagerImpl.h b/src/platform/qpg/ThreadStackManagerImpl.h index fe39291e77edb3..9896ea6e57128e 100644 --- a/src/platform/qpg/ThreadStackManagerImpl.h +++ b/src/platform/qpg/ThreadStackManagerImpl.h @@ -74,10 +74,6 @@ class ThreadStackManagerImpl final : public ThreadStackManager, using ThreadStackManager::InitThreadStack; CHIP_ERROR InitThreadStack(otInstance * otInst); -#if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR _RequestSEDFastPollingMode(bool onOff); -#endif - private: // ===== Methods that implement the ThreadStackManager abstract interface. diff --git a/src/platform/webos/ThreadStackManagerImpl.cpp b/src/platform/webos/ThreadStackManagerImpl.cpp index b6e4bd9e9a853e..6acb542d78a3c1 100644 --- a/src/platform/webos/ThreadStackManagerImpl.cpp +++ b/src/platform/webos/ThreadStackManagerImpl.cpp @@ -481,32 +481,6 @@ CHIP_ERROR ThreadStackManagerImpl::_SetThreadDeviceType(ConnectivityManager::Thr return CHIP_NO_ERROR; } -#if CHIP_DEVICE_CONFIG_ENABLE_SED -CHIP_ERROR ThreadStackManagerImpl::_GetSEDPollingConfig(ConnectivityManager::SEDPollingConfig & pollingConfig) -{ - (void) pollingConfig; - - ChipLogError(DeviceLayer, "Polling config is not supported on linux"); - return CHIP_ERROR_NOT_IMPLEMENTED; -} - -CHIP_ERROR ThreadStackManagerImpl::_SetSEDPollingConfig(const ConnectivityManager::SEDPollingConfig & pollingConfig) -{ - (void) pollingConfig; - - ChipLogError(DeviceLayer, "Polling config is not supported on linux"); - return CHIP_ERROR_NOT_IMPLEMENTED; -} - -CHIP_ERROR ThreadStackManagerImpl::_RequestSEDFastPollingMode(bool onOff) -{ - (void) onOff; - - ChipLogError(DeviceLayer, "Polling config is not supported on linux"); - return CHIP_ERROR_NOT_IMPLEMENTED; -} -#endif - bool ThreadStackManagerImpl::_HaveMeshConnectivity() { // TODO: Remove Weave legacy APIs diff --git a/src/platform/webos/ThreadStackManagerImpl.h b/src/platform/webos/ThreadStackManagerImpl.h index b70910878c08d0..330e601f75a7fd 100644 --- a/src/platform/webos/ThreadStackManagerImpl.h +++ b/src/platform/webos/ThreadStackManagerImpl.h @@ -86,12 +86,6 @@ class ThreadStackManagerImpl : public ThreadStackManager CHIP_ERROR _SetThreadDeviceType(ConnectivityManager::ThreadDeviceType deviceType); -#if CHIP_DEVICE_CONFIG_ENABLE_SED - CHIP_ERROR _GetSEDPollingConfig(ConnectivityManager::SEDPollingConfig & pollingConfig); - CHIP_ERROR _SetSEDPollingConfig(const ConnectivityManager::SEDPollingConfig & pollingConfig); - CHIP_ERROR _RequestSEDFastPollingMode(bool onOff); -#endif - bool _HaveMeshConnectivity(); CHIP_ERROR _GetAndLogThreadStatsCounters();