Skip to content

Commit

Permalink
Remove SED related common code as it is deprecated and replaced by ICD (
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartinez-silabs authored and pull[bot] committed Jul 3, 2024
1 parent 86f37c8 commit 4562040
Show file tree
Hide file tree
Showing 22 changed files with 7 additions and 503 deletions.
4 changes: 2 additions & 2 deletions examples/platform/silabs/SiWx917/SiWx917/sl_wifi_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion examples/pump-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion examples/window-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 0 additions & 8 deletions src/app/FailSafeContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
16 changes: 0 additions & 16 deletions src/app/server/CommissioningWindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions src/app/server/CommissioningWindowManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<System::Clock::Seconds16> mMinCommissioningTimeoutOverride;
Expand Down
39 changes: 0 additions & 39 deletions src/include/platform/ConnectivityManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -470,23 +448,6 @@ inline CHIP_ERROR ConnectivityManager::SetThreadDeviceType(ThreadDeviceType devi
return static_cast<ImplClass *>(this)->_SetThreadDeviceType(deviceType);
}

#if CHIP_DEVICE_CONFIG_ENABLE_SED
inline CHIP_ERROR ConnectivityManager::GetSEDIntervalsConfig(SEDIntervalsConfig & intervalsConfig)
{
return static_cast<ImplClass *>(this)->_GetSEDIntervalsConfig(intervalsConfig);
}

inline CHIP_ERROR ConnectivityManager::SetSEDIntervalsConfig(const SEDIntervalsConfig & intervalsConfig)
{
return static_cast<ImplClass *>(this)->_SetSEDIntervalsConfig(intervalsConfig);
}

inline CHIP_ERROR ConnectivityManager::RequestSEDActiveMode(bool onOff, bool delayIdle)
{
return static_cast<ImplClass *>(this)->_RequestSEDActiveMode(onOff, delayIdle);
}
#endif

inline CHIP_ERROR ConnectivityManager::SetPollingInterval(System::Clock::Milliseconds32 pollingInterval)
{
#if CHIP_CONFIG_ENABLE_ICD_SERVER
Expand Down
37 changes: 0 additions & 37 deletions src/include/platform/ThreadStackManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -393,23 +373,6 @@ inline CHIP_ERROR ThreadStackManager::SetThreadDeviceType(ConnectivityManager::T
return static_cast<ImplClass *>(this)->_SetThreadDeviceType(deviceType);
}

#if CHIP_DEVICE_CONFIG_ENABLE_SED
inline CHIP_ERROR ThreadStackManager::GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig)
{
return static_cast<ImplClass *>(this)->_GetSEDIntervalsConfig(intervalsConfig);
}

inline CHIP_ERROR ThreadStackManager::SetSEDIntervalsConfig(const ConnectivityManager::SEDIntervalsConfig & intervalsConfig)
{
return static_cast<ImplClass *>(this)->_SetSEDIntervalsConfig(intervalsConfig);
}

inline CHIP_ERROR ThreadStackManager::RequestSEDActiveMode(bool onOff, bool delayIdle)
{
return static_cast<ImplClass *>(this)->_RequestSEDActiveMode(onOff, delayIdle);
}
#endif

#if CHIP_CONFIG_ENABLE_ICD_SERVER
inline CHIP_ERROR ThreadStackManager::SetPollingInterval(System::Clock::Milliseconds32 pollingInterval)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -144,28 +139,6 @@ GenericConnectivityManagerImpl_Thread<ImplClass>::_SetThreadDeviceType(Connectiv
return ThreadStackMgrImpl().SetThreadDeviceType(deviceType);
}

#if CHIP_DEVICE_CONFIG_ENABLE_SED
template <class ImplClass>
inline CHIP_ERROR
GenericConnectivityManagerImpl_Thread<ImplClass>::_GetSEDIntervalsConfig(ConnectivityManager::SEDIntervalsConfig & intervalsConfig)
{
return ThreadStackMgrImpl().GetSEDIntervalsConfig(intervalsConfig);
}

template <class ImplClass>
inline CHIP_ERROR GenericConnectivityManagerImpl_Thread<ImplClass>::_SetSEDIntervalsConfig(
const ConnectivityManager::SEDIntervalsConfig & intervalsConfig)
{
return ThreadStackMgrImpl().SetSEDIntervalsConfig(intervalsConfig);
}

template <class ImplClass>
inline CHIP_ERROR GenericConnectivityManagerImpl_Thread<ImplClass>::_RequestSEDActiveMode(bool onOff, bool delayIdle)
{
return ThreadStackMgrImpl().RequestSEDActiveMode(onOff, delayIdle);
}
#endif

#if CHIP_CONFIG_ENABLE_ICD_SERVER
template <class ImplClass>
inline CHIP_ERROR
Expand Down
48 changes: 0 additions & 48 deletions src/messaging/ExchangeContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 0 additions & 7 deletions src/messaging/ReliableMessageMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 0 additions & 10 deletions src/messaging/ReliableMessageProtocolConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,6 @@ Optional<ReliableMessageProtocolConfig> 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
Expand Down
26 changes: 0 additions & 26 deletions src/platform/Linux/ThreadStackManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
5 changes: 0 additions & 5 deletions src/platform/Linux/ThreadStackManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
Loading

0 comments on commit 4562040

Please sign in to comment.