diff --git a/config/nrfconnect/chip-module/CMakeLists.txt b/config/nrfconnect/chip-module/CMakeLists.txt index 11642558c3dfb5..0001ff78309a53 100644 --- a/config/nrfconnect/chip-module/CMakeLists.txt +++ b/config/nrfconnect/chip-module/CMakeLists.txt @@ -135,6 +135,7 @@ matter_add_gn_arg_bool ("chip_automation_logging" FALSE) matter_add_gn_arg_bool ("chip_malloc_sys_heap" CONFIG_CHIP_MALLOC_SYS_HEAP) matter_add_gn_arg_bool ("chip_enable_wifi" CONFIG_WIFI_NRF700X) matter_add_gn_arg_bool ("chip_system_config_provide_statistics" CONFIG_CHIP_STATISTICS) +matter_add_gn_arg_bool ("chip_enable_icd_server" CONFIG_CHIP_ENABLE_ICD_SUPPORT) if (CONFIG_CHIP_FACTORY_DATA) matter_add_gn_arg_bool("chip_use_transitional_commissionable_data_provider" FALSE) diff --git a/config/nrfconnect/chip-module/Kconfig.features b/config/nrfconnect/chip-module/Kconfig.features index 84390e38d2029b..6486d19506bab9 100644 --- a/config/nrfconnect/chip-module/Kconfig.features +++ b/config/nrfconnect/chip-module/Kconfig.features @@ -230,27 +230,4 @@ config CHIP_WIFI_CONNECTION_RECOVERY_JITTER a random jitter interval is added to it to avoid periodicity. The random jitter is selected within range [-JITTER; +JITTER]. -config CHIP_ICD_SUBSCRIPTION_HANDLING - bool "Enables platform specific handling of ICD subscriptions" - help - Enables platform specific implementation that handles ICD subscription requests - and selects subscription report interval value considering maximum interval preferred - by the publisher. - -if CHIP_ICD_SUBSCRIPTION_HANDLING - -config CHIP_MAX_PREFERRED_SUBSCRIPTION_REPORT_INTERVAL - int "Maximum preferred interval of sending subscription reports (s)" - default 60 - help - Provides maximum preferred interval to be used by a publisher for negotiation - of the final maximum subscription report interval, after receiving a subscription - request from the initiator. This value should be selected as a compromise between - keeping the power consumption low due to not sending reports too often, and allowing - the initiator device to detect the publisher absence reasonably fast due to not sending - the reports too rarely. The current algorithm is to select bigger value from the one - requested by the initiator and the one preferred by the publisher. - -endif # CHIP_ICD_SUBSCRIPTION_HANDLING - endif # CHIP diff --git a/config/zephyr/Kconfig b/config/zephyr/Kconfig index 12cddf50d1965e..12f8b0af671746 100644 --- a/config/zephyr/Kconfig +++ b/config/zephyr/Kconfig @@ -323,37 +323,66 @@ config CHIP_ENABLE_DNS_CLIENT help Enables using the OpenThread DNS client for the Matter service discovery. -config CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT - bool "Thread Sleepy End Device support" +config CHIP_ENABLE_ICD_SUPPORT + bool "Matter Intermittently Connected Devices support" default n - depends on OPENTHREAD_MTD - imply OPENTHREAD_MTD_SED + imply OPENTHREAD_MTD_SED if NET_L2_OPENTHREAD help - Enables the Thread Sleepy End Device (SED) support in Matter. + Enables the Intermittently Connected Device (ICD) support in Matter. -if CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT +if CHIP_ENABLE_ICD_SUPPORT -config CHIP_SED_IDLE_INTERVAL - int "Sleepy End Device idle interval (ms)" +config CHIP_ICD_SLOW_POLL_INTERVAL + int "Intermittently Connected Device slow polling interval (ms)" default 1000 help - Provides the Sleepy End Device wake interval in milliseconds while the - device is idle (which means that there is no active exchange to or from - the device, and its commissioning window is closed). + Provides the Intermittently Connected Device slow polling interval in milliseconds while the + device is in the idle mode. It determines the fastest frequency at which the device will be able + to receive the messages in the idle mode. -config CHIP_SED_ACTIVE_INTERVAL - int "Sleepy End Device active interval (ms)" +config CHIP_ICD_FAST_POLLING_INTERVAL + int "Intermittently Connected Device fast polling interval (ms)" default 200 help - Provides the Sleepy End Device wake interval in milliseconds while the - device is active (which means that there is an active exchange to or from - the device, or its commissioning window is open). + Provides the Intermittently Connected Device fast polling interval in milliseconds while the + device is in the active mode. It determines the fastest frequency at which the device will be able + to receive the messages in the active mode. The CHIP_ICD_FAST_POLLING_INTERVAL shall be smaller than + CHIP_ICD_ACTIVE_MODE_INTERVAL. -endif # CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT +config CHIP_ICD_IDLE_MODE_INTERVAL + int "Intermittently Connected Device idle mode interval (s)" + default 120 + help + Provides the Intermittently Connected Device idle mode interval is seconds. + It determines the maximum amount of time the device can stay in the idle mode, which means the + device may be unreachable and not able to receive messages. + +config CHIP_ICD_ACTIVE_MODE_INTERVAL + int "Intermittently Connected Device active mode interval (ms)" + default 300 + help + Provides the Intermittently Connected Device active mode interval is milliseconds. + It determines the minimum amount of time the device shall stay in the active mode. + +config CHIP_ICD_ACTIVE_MODE_THRESHOLD + int "Intermittently Connected Device active mode threshold (ms)" + default 300 + help + Provides the Intermittently Connected Device active mode threshold is milliseconds. + It determines the minimum amount of time the device shall stay in the active mode after the network activity. + +config CHIP_ICD_CLIENTS_PER_FABRIC + int "Intermittently Connected Device number of clients per fabric" + default 2 + help + Provides the Intermittently Connected Device number of clients per fabric. It determines the maximum number + of clients per fabric that can be registered to receive notification from a device if their subscription is lost. + +endif # CHIP_ENABLE_ICD_SUPPORT config CHIP_THREAD_SSED bool "Enable Thread Synchronized Sleepy End Device support" - depends on OPENTHREAD_CSL_RECEIVER && CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT + depends on OPENTHREAD_CSL_RECEIVER && CHIP_ENABLE_ICD_SUPPORT help Enables the Thread Synchronized Sleepy End Device support in Matter. diff --git a/docs/guides/nrfconnect_examples_configuration.md b/docs/guides/nrfconnect_examples_configuration.md index 14170f46d480d0..1e74d2f4e097ea 100644 --- a/docs/guides/nrfconnect_examples_configuration.md +++ b/docs/guides/nrfconnect_examples_configuration.md @@ -186,13 +186,13 @@ You can enable the support for Thread Sleepy End Device in Matter by setting the following Kconfig options: - `CONFIG_OPENTHREAD_MTD` -- `CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT` +- `CONFIG_CHIP_ENABLE_ICD_SUPPORT` The following Kconfig options can be used to tune Thread Sleepy End Device wake intervals: -- `CONFIG_CHIP_SED_IDLE_INTERVAL` -- `CONFIG_CHIP_SED_ACTIVE_INTERVAL` +- `CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL` +- `CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL` #### Commissioning with NFC support diff --git a/examples/all-clusters-app/telink/prj.conf b/examples/all-clusters-app/telink/prj.conf index 549cf67ea46cdf..1ae6d5b5cec6a3 100644 --- a/examples/all-clusters-app/telink/prj.conf +++ b/examples/all-clusters-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=n +CONFIG_CHIP_ENABLE_ICD_SUPPORT=n CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/all-clusters-minimal-app/telink/prj.conf b/examples/all-clusters-minimal-app/telink/prj.conf index 90d531fa2b1087..c7e50cd1c89afc 100644 --- a/examples/all-clusters-minimal-app/telink/prj.conf +++ b/examples/all-clusters-minimal-app/telink/prj.conf @@ -23,7 +23,7 @@ CONFIG_GPIO=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=n +CONFIG_CHIP_ENABLE_ICD_SUPPORT=n CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/bridge-app/telink/prj.conf b/examples/bridge-app/telink/prj.conf index 72b6dce7e2866c..83001627e4307c 100644 --- a/examples/bridge-app/telink/prj.conf +++ b/examples/bridge-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=n -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=n +CONFIG_CHIP_ENABLE_ICD_SUPPORT=n CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/chef/telink/prj.conf b/examples/chef/telink/prj.conf index d83c730a8f61e2..9e90758301a410 100755 --- a/examples/chef/telink/prj.conf +++ b/examples/chef/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/common/m5stack-tft/repo b/examples/common/m5stack-tft/repo index a6299b6c7c0b2e..3344a8105f8dfe 160000 --- a/examples/common/m5stack-tft/repo +++ b/examples/common/m5stack-tft/repo @@ -1 +1 @@ -Subproject commit a6299b6c7c0b2e3eb62fa08ee4bf7155c39bad1f +Subproject commit 3344a8105f8dfecb95832f369733cf6f863a1662 diff --git a/examples/contact-sensor-app/telink/prj.conf b/examples/contact-sensor-app/telink/prj.conf index 63794047c764a2..f5695b45866f39 100755 --- a/examples/contact-sensor-app/telink/prj.conf +++ b/examples/contact-sensor-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/light-switch-app/nrfconnect/CMakeLists.txt b/examples/light-switch-app/nrfconnect/CMakeLists.txt index 2e719072f23fb4..12d4454c91bcd5 100644 --- a/examples/light-switch-app/nrfconnect/CMakeLists.txt +++ b/examples/light-switch-app/nrfconnect/CMakeLists.txt @@ -70,10 +70,6 @@ if(CONFIG_MCUMGR_TRANSPORT_BT) target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/DFUOverSMP.cpp) endif() -if(CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING) - target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/ICDUtil.cpp) -endif() - chip_configure_data_model(app INCLUDE_SERVER ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../light-switch-common/light-switch-app.zap diff --git a/examples/light-switch-app/nrfconnect/Kconfig b/examples/light-switch-app/nrfconnect/Kconfig index 73f8d8cf318a65..18fe9b4a7914df 100644 --- a/examples/light-switch-app/nrfconnect/Kconfig +++ b/examples/light-switch-app/nrfconnect/Kconfig @@ -34,7 +34,7 @@ choice OPENTHREAD_DEVICE_TYPE default OPENTHREAD_MTD endchoice -config CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT +config CHIP_ENABLE_ICD_SUPPORT bool default y @@ -47,9 +47,6 @@ config NRF_WIFI_LOW_POWER endif # CHIP_WIFI -config CHIP_ICD_SUBSCRIPTION_HANDLING - default y - rsource "../../../config/nrfconnect/chip-module/Kconfig.features" rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults" source "Kconfig.zephyr" diff --git a/examples/light-switch-app/nrfconnect/main/AppTask.cpp b/examples/light-switch-app/nrfconnect/main/AppTask.cpp index b64f70472558c4..2716458175b20c 100644 --- a/examples/light-switch-app/nrfconnect/main/AppTask.cpp +++ b/examples/light-switch-app/nrfconnect/main/AppTask.cpp @@ -44,10 +44,6 @@ #include "OTAUtil.h" #endif -#ifdef CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING -#include -#endif - #include #include #include @@ -229,10 +225,6 @@ CHIP_ERROR AppTask::Init() ConfigurationMgr().LogDeviceConfig(); PrintOnboardingCodes(RendezvousInformationFlags(RendezvousInformationFlag::kBLE)); -#ifdef CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING - chip::app::InteractionModelEngine::GetInstance()->RegisterReadHandlerAppCallback(&GetICDUtil()); -#endif - // Add CHIP event handler and start CHIP thread. // Note that all the initialization code should happen prior to this point // to avoid data races between the main and the CHIP threads. diff --git a/examples/light-switch-app/nrfconnect/main/include/AppTask.h b/examples/light-switch-app/nrfconnect/main/include/AppTask.h index 240ac589040164..c4018152e23da5 100644 --- a/examples/light-switch-app/nrfconnect/main/include/AppTask.h +++ b/examples/light-switch-app/nrfconnect/main/include/AppTask.h @@ -33,10 +33,6 @@ #include "DFUOverSMP.h" #endif -#ifdef CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING -#include "ICDUtil.h" -#endif - #include struct k_timer; diff --git a/examples/light-switch-app/telink/prj.conf b/examples/light-switch-app/telink/prj.conf index baba7213300e00..7d97baca2ee0cd 100755 --- a/examples/light-switch-app/telink/prj.conf +++ b/examples/light-switch-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/lighting-app/telink/prj.conf b/examples/lighting-app/telink/prj.conf index 71a134523d33c8..50ee05660e1e9c 100644 --- a/examples/lighting-app/telink/prj.conf +++ b/examples/lighting-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=n -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=n +CONFIG_CHIP_ENABLE_ICD_SUPPORT=n CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/lock-app/nrfconnect/CMakeLists.txt b/examples/lock-app/nrfconnect/CMakeLists.txt index e1b3e8f2f0e489..daa594239e89b7 100644 --- a/examples/lock-app/nrfconnect/CMakeLists.txt +++ b/examples/lock-app/nrfconnect/CMakeLists.txt @@ -71,7 +71,3 @@ endif() if(CONFIG_MCUMGR_TRANSPORT_BT) target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/DFUOverSMP.cpp) endif() - -if(CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING) - target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/ICDUtil.cpp) -endif() diff --git a/examples/lock-app/nrfconnect/Kconfig b/examples/lock-app/nrfconnect/Kconfig index 384993c130f77d..061349e92502ea 100644 --- a/examples/lock-app/nrfconnect/Kconfig +++ b/examples/lock-app/nrfconnect/Kconfig @@ -46,7 +46,7 @@ choice OPENTHREAD_DEVICE_TYPE default OPENTHREAD_MTD endchoice -config CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT +config CHIP_ENABLE_ICD_SUPPORT bool default y @@ -59,9 +59,6 @@ config NRF_WIFI_LOW_POWER endif # CHIP_WIFI -config CHIP_ICD_SUBSCRIPTION_HANDLING - default y - rsource "../../../config/nrfconnect/chip-module/Kconfig.features" rsource "../../../config/nrfconnect/chip-module/Kconfig.defaults" source "Kconfig.zephyr" diff --git a/examples/lock-app/nrfconnect/main/AppTask.cpp b/examples/lock-app/nrfconnect/main/AppTask.cpp index 17fa9e31412123..3ef85657363043 100644 --- a/examples/lock-app/nrfconnect/main/AppTask.cpp +++ b/examples/lock-app/nrfconnect/main/AppTask.cpp @@ -45,10 +45,6 @@ #include "OTAUtil.h" #endif -#ifdef CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING -#include -#endif - #include #include #include @@ -222,10 +218,6 @@ CHIP_ERROR AppTask::Init() ConfigurationMgr().LogDeviceConfig(); PrintOnboardingCodes(chip::RendezvousInformationFlags(chip::RendezvousInformationFlag::kBLE)); -#ifdef CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING - chip::app::InteractionModelEngine::GetInstance()->RegisterReadHandlerAppCallback(&GetICDUtil()); -#endif - // Add CHIP event handler and start CHIP thread. // Note that all the initialization code should happen prior to this point to avoid data races // between the main and the CHIP threads. diff --git a/examples/lock-app/nrfconnect/main/include/AppTask.h b/examples/lock-app/nrfconnect/main/include/AppTask.h index 01d1536bc2545e..a0a50da9ed23db 100644 --- a/examples/lock-app/nrfconnect/main/include/AppTask.h +++ b/examples/lock-app/nrfconnect/main/include/AppTask.h @@ -35,10 +35,6 @@ #include "DFUOverSMP.h" #endif -#ifdef CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING -#include "ICDUtil.h" -#endif - struct k_timer; struct Identify; diff --git a/examples/lock-app/telink/prj.conf b/examples/lock-app/telink/prj.conf index 5de8f1a8f352c1..58aaca9b95d593 100755 --- a/examples/lock-app/telink/prj.conf +++ b/examples/lock-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/ota-requestor-app/telink/prj.conf b/examples/ota-requestor-app/telink/prj.conf index c117dd823f3e85..50796f3077aab1 100755 --- a/examples/ota-requestor-app/telink/prj.conf +++ b/examples/ota-requestor-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=n +CONFIG_CHIP_ENABLE_ICD_SUPPORT=n CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/platform/nrfconnect/util/ICDUtil.cpp b/examples/platform/nrfconnect/util/ICDUtil.cpp deleted file mode 100644 index b3dc9c80bbc9dd..00000000000000 --- a/examples/platform/nrfconnect/util/ICDUtil.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * Copyright (c) 2023 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "ICDUtil.h" - -ICDUtil ICDUtil::sICDUtil; - -CHIP_ERROR ICDUtil::OnSubscriptionRequested(chip::app::ReadHandler & aReadHandler, chip::Transport::SecureSession & aSecureSession) -{ - uint16_t agreedMaxInterval = CONFIG_CHIP_MAX_PREFERRED_SUBSCRIPTION_REPORT_INTERVAL; - uint16_t requestedMinInterval = 0; - uint16_t requestedMaxInterval = 0; - aReadHandler.GetReportingIntervals(requestedMinInterval, requestedMaxInterval); - - if (requestedMaxInterval > agreedMaxInterval) - { - agreedMaxInterval = requestedMaxInterval; - } - else if (agreedMaxInterval > kSubscriptionMaxIntervalPublisherLimit) - { - agreedMaxInterval = kSubscriptionMaxIntervalPublisherLimit; - } - - return aReadHandler.SetMaxReportingInterval(agreedMaxInterval); -} diff --git a/examples/platform/nrfconnect/util/include/ICDUtil.h b/examples/platform/nrfconnect/util/include/ICDUtil.h deleted file mode 100644 index 33db1e97a051ac..00000000000000 --- a/examples/platform/nrfconnect/util/include/ICDUtil.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * - * Copyright (c) 2023 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include - -class ICDUtil : public chip::app::ReadHandler::ApplicationCallback -{ - CHIP_ERROR OnSubscriptionRequested(chip::app::ReadHandler & aReadHandler, - chip::Transport::SecureSession & aSecureSession) override; - friend ICDUtil & GetICDUtil(); - static ICDUtil sICDUtil; -}; - -inline ICDUtil & GetICDUtil() -{ - return ICDUtil::sICDUtil; -} diff --git a/examples/pump-app/telink/prj.conf b/examples/pump-app/telink/prj.conf index de5cf119a6a831..c105c33dccfe3d 100755 --- a/examples/pump-app/telink/prj.conf +++ b/examples/pump-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/pump-controller-app/telink/prj.conf b/examples/pump-controller-app/telink/prj.conf index 66074d03470303..964b7dca1951f3 100755 --- a/examples/pump-controller-app/telink/prj.conf +++ b/examples/pump-controller-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/shell/telink/prj.conf b/examples/shell/telink/prj.conf index 3abb915e850fcd..4213bd6ee833f9 100755 --- a/examples/shell/telink/prj.conf +++ b/examples/shell/telink/prj.conf @@ -27,7 +27,7 @@ CONFIG_PWM=y # OpenThread configs #CONFIG_OPENTHREAD_MTD=n CONFIG_OPENTHREAD_FTD=y -# CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +# CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/smoke-co-alarm-app/telink/prj.conf b/examples/smoke-co-alarm-app/telink/prj.conf index 637c9bf1d752e1..be2d095edeb1ab 100755 --- a/examples/smoke-co-alarm-app/telink/prj.conf +++ b/examples/smoke-co-alarm-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/temperature-measurement-app/telink/prj.conf b/examples/temperature-measurement-app/telink/prj.conf index 63deb05cbddfcb..90182edc255273 100644 --- a/examples/temperature-measurement-app/telink/prj.conf +++ b/examples/temperature-measurement-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/thermostat/telink/prj.conf b/examples/thermostat/telink/prj.conf index 827b3e7cbd32ff..fdf42e9c76466f 100755 --- a/examples/thermostat/telink/prj.conf +++ b/examples/thermostat/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/examples/window-app/nrfconnect/CMakeLists.txt b/examples/window-app/nrfconnect/CMakeLists.txt index 441adc79b3ef95..74b2b9e13a0c6f 100644 --- a/examples/window-app/nrfconnect/CMakeLists.txt +++ b/examples/window-app/nrfconnect/CMakeLists.txt @@ -73,7 +73,3 @@ endif() if(CONFIG_MCUMGR_TRANSPORT_BT) target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/DFUOverSMP.cpp) endif() - -if(CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING) - target_sources(app PRIVATE ${NRFCONNECT_COMMON}/util/ICDUtil.cpp) -endif() diff --git a/examples/window-app/nrfconnect/main/AppTask.cpp b/examples/window-app/nrfconnect/main/AppTask.cpp index ed16dc1311dff8..cda4c0c9e318b8 100644 --- a/examples/window-app/nrfconnect/main/AppTask.cpp +++ b/examples/window-app/nrfconnect/main/AppTask.cpp @@ -35,10 +35,6 @@ #include "OTAUtil.h" #endif -#ifdef CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING -#include -#endif - #include #include #include @@ -202,10 +198,6 @@ CHIP_ERROR AppTask::Init() ConfigurationMgr().LogDeviceConfig(); PrintOnboardingCodes(chip::RendezvousInformationFlag(chip::RendezvousInformationFlag::kBLE)); -#ifdef CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING - chip::app::InteractionModelEngine::GetInstance()->RegisterReadHandlerAppCallback(&GetICDUtil()); -#endif - // Add CHIP event handler and start CHIP thread. // Note that all the initialization code should happen prior to this point to avoid data races // between the main and the CHIP threads diff --git a/examples/window-app/nrfconnect/main/include/AppTask.h b/examples/window-app/nrfconnect/main/include/AppTask.h index 64410f910547a2..fdd94d0c61e416 100644 --- a/examples/window-app/nrfconnect/main/include/AppTask.h +++ b/examples/window-app/nrfconnect/main/include/AppTask.h @@ -32,10 +32,6 @@ #include "DFUOverSMP.h" #endif -#ifdef CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING -#include "ICDUtil.h" -#endif - struct k_timer; struct Identify; diff --git a/examples/window-app/nrfconnect/prj.conf b/examples/window-app/nrfconnect/prj.conf index 052d3fbe841572..48bc61f67d5a47 100644 --- a/examples/window-app/nrfconnect/prj.conf +++ b/examples/window-app/nrfconnect/prj.conf @@ -31,13 +31,10 @@ CONFIG_PWM=y CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y CONFIG_OPENTHREAD_MTD=y CONFIG_OPENTHREAD_FTD=n -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=y -CONFIG_CHIP_SED_IDLE_INTERVAL=500 -CONFIG_CHIP_SED_ACTIVE_INTERVAL=500 - -# Enable ICD subscription platform specific handling -CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING=y +CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL=500 +CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL=500 # Bluetooth Low Energy configuration CONFIG_BT_DEVICE_NAME="MatterWinCov" diff --git a/examples/window-app/nrfconnect/prj_no_dfu.conf b/examples/window-app/nrfconnect/prj_no_dfu.conf index 3183a0e518ac47..570011cc9ef6da 100644 --- a/examples/window-app/nrfconnect/prj_no_dfu.conf +++ b/examples/window-app/nrfconnect/prj_no_dfu.conf @@ -36,13 +36,10 @@ CONFIG_PWM=y CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y CONFIG_OPENTHREAD_MTD=y CONFIG_OPENTHREAD_FTD=n -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=y -CONFIG_CHIP_SED_IDLE_INTERVAL=500 -CONFIG_CHIP_SED_ACTIVE_INTERVAL=500 - -# Enable ICD subscription platform specific handling -CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING=y +CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL=500 +CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL=500 # Bluetooth Low Energy configuration CONFIG_BT_DEVICE_NAME="MatterWinCov" diff --git a/examples/window-app/nrfconnect/prj_release.conf b/examples/window-app/nrfconnect/prj_release.conf index f2393649c1fe0c..8143a5d60ad7e8 100644 --- a/examples/window-app/nrfconnect/prj_release.conf +++ b/examples/window-app/nrfconnect/prj_release.conf @@ -36,13 +36,10 @@ CONFIG_PWM=y CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y CONFIG_OPENTHREAD_MTD=y CONFIG_OPENTHREAD_FTD=n -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=y -CONFIG_CHIP_SED_IDLE_INTERVAL=500 -CONFIG_CHIP_SED_ACTIVE_INTERVAL=500 - -# Enable ICD subscription platform specific handling -CONFIG_CHIP_ICD_SUBSCRIPTION_HANDLING=y +CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL=500 +CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL=500 # Bluetooth Low Energy configuration CONFIG_BT_DEVICE_NAME="MatterWinCov" diff --git a/examples/window-app/telink/prj.conf b/examples/window-app/telink/prj.conf index 753040f73c6086..960d523ca172bc 100644 --- a/examples/window-app/telink/prj.conf +++ b/examples/window-app/telink/prj.conf @@ -26,7 +26,7 @@ CONFIG_PWM=y # OpenThread configs CONFIG_OPENTHREAD_MTD=y -CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_THREAD_SSED=n # Default OpenThread network settings diff --git a/src/lib/core/CHIPConfig.h b/src/lib/core/CHIPConfig.h index b59f3b0ef3bf6f..14453c98a02d73 100644 --- a/src/lib/core/CHIPConfig.h +++ b/src/lib/core/CHIPConfig.h @@ -1503,7 +1503,7 @@ extern const char CHIP_NON_PRODUCTION_MARKER[]; /** * @def CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC * - * @brief Default value for the ICD Management cluster ClientsSupportedPerFabric attribute, in milliseconds + * @brief Default value for the ICD Management cluster ClientsSupportedPerFabric attribute */ #ifndef CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC #define CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC 2 diff --git a/src/platform/Zephyr/CHIPDevicePlatformConfig.h b/src/platform/Zephyr/CHIPDevicePlatformConfig.h index 18df25c480ac6f..3296f3aa8f1c55 100644 --- a/src/platform/Zephyr/CHIPDevicePlatformConfig.h +++ b/src/platform/Zephyr/CHIPDevicePlatformConfig.h @@ -114,10 +114,10 @@ #endif // CONFIG_CHIP_ENABLE_DNS_CLIENT #endif // CONFIG_CHIP_ENABLE_DNSSD_SRP -#ifdef CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT +#ifdef CONFIG_CHIP_ENABLE_ICD_SUPPORT #define CHIP_DEVICE_CONFIG_ENABLE_SED 1 #define CHIP_DEVICE_CONFIG_THREAD_SSED CONFIG_CHIP_THREAD_SSED -#endif // CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT +#endif // CONFIG_CHIP_ENABLE_ICD_SUPPORT #ifdef CONFIG_CHIP_COMMISSIONABLE_DEVICE_TYPE #define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE 1 diff --git a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h index 837b963b7a31fc..c260dbe4ac4f58 100644 --- a/src/platform/nrfconnect/CHIPDevicePlatformConfig.h +++ b/src/platform/nrfconnect/CHIPDevicePlatformConfig.h @@ -217,25 +217,20 @@ #endif // CONFIG_CHIP_ENABLE_DNS_CLIENT #endif // CONFIG_CHIP_ENABLE_DNSSD_SRP -#ifdef CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT -#define CHIP_DEVICE_CONFIG_ENABLE_SED 1 +#ifdef CONFIG_CHIP_ENABLE_ICD_SUPPORT #define CHIP_DEVICE_CONFIG_THREAD_SSED CONFIG_CHIP_THREAD_SSED -#endif // CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT - -#ifdef CONFIG_NRF_WIFI_LOW_POWER -#define CHIP_DEVICE_CONFIG_ENABLE_SED 1 -#endif // CONFIG_NRF_WIFI_LOW_POWER +#endif // CONFIG_CHIP_ENABLE_ICD_SUPPORT #ifndef CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL -#ifdef CONFIG_CHIP_SED_IDLE_INTERVAL -#define CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_CHIP_SED_IDLE_INTERVAL) -#endif // CONFIG_CHIP_SED_IDLE_INTERVAL +#ifdef CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL +#define CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL) +#endif // CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL #endif // CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL #ifndef CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL -#ifdef CONFIG_CHIP_SED_ACTIVE_INTERVAL -#define CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_CHIP_SED_ACTIVE_INTERVAL) -#endif // CONFIG_CHIP_SED_ACTIVE_INTERVAL +#ifdef CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL +#define CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL) +#endif // CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL #endif // CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL #ifdef CONFIG_CHIP_COMMISSIONABLE_DEVICE_TYPE diff --git a/src/platform/nrfconnect/CHIPPlatformConfig.h b/src/platform/nrfconnect/CHIPPlatformConfig.h index c2d34bea2ac4c9..d3c7b965217f04 100644 --- a/src/platform/nrfconnect/CHIPPlatformConfig.h +++ b/src/platform/nrfconnect/CHIPPlatformConfig.h @@ -111,3 +111,27 @@ #define CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL (1000_ms32) #endif // CHIP_ENABLE_OPENTHREAD #endif // CHIP_CONFIG_MRP_LOCAL_IDLE_RETRY_INTERVAL + +#ifndef CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL +#ifdef CONFIG_CHIP_ICD_IDLE_MODE_INTERVAL +#define CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL CONFIG_CHIP_ICD_IDLE_MODE_INTERVAL +#endif // CONFIG_CHIP_ICD_IDLE_MODE_INTERVAL +#endif // CHIP_CONFIG_ICD_IDLE_MODE_INTERVAL + +#ifndef CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL +#ifdef CONFIG_CHIP_ICD_ACTIVE_MODE_INTERVAL +#define CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL CONFIG_CHIP_ICD_ACTIVE_MODE_INTERVAL +#endif // CONFIG_CHIP_ICD_ACTIVE_MODE_INTERVAL +#endif // CHIP_CONFIG_ICD_ACTIVE_MODE_INTERVAL + +#ifndef CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD +#ifdef CONFIG_CHIP_ICD_ACTIVE_MODE_THRESHOLD +#define CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD CONFIG_CHIP_ICD_ACTIVE_MODE_THRESHOLD +#endif // CONFIG_CHIP_ICD_ACTIVE_MODE_THRESHOLD +#endif // CHIP_CONFIG_ICD_ACTIVE_MODE_THRESHOLD + +#ifndef CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC +#ifdef CONFIG_CHIP_ICD_CLIENTS_PER_FABRIC +#define CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC CONFIG_CHIP_ICD_CLIENTS_PER_FABRIC +#endif // CONFIG_CHIP_ICD_CLIENTS_PER_FABRIC +#endif // CHIP_CONFIG_ICD_CLIENTS_SUPPORTED_PER_FABRIC diff --git a/src/platform/telink/CHIPDevicePlatformConfig.h b/src/platform/telink/CHIPDevicePlatformConfig.h index 2527a3e8fc785a..8670ac640ff62e 100644 --- a/src/platform/telink/CHIPDevicePlatformConfig.h +++ b/src/platform/telink/CHIPDevicePlatformConfig.h @@ -222,19 +222,19 @@ #define CHIP_DEVICE_CONFIG_ENABLE_EXTENDED_DISCOVERY 1 #endif // CONFIG_CHIP_EXTENDED_DISCOVERY -#ifdef CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT +#ifdef CONFIG_CHIP_ENABLE_ICD_SUPPORT #define CHIP_DEVICE_CONFIG_ENABLE_SED 1 #define CHIP_DEVICE_CONFIG_THREAD_SSED CONFIG_CHIP_THREAD_SSED -#endif // CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT +#endif // CONFIG_CHIP_ENABLE_ICD_SUPPORT #ifndef CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL -#ifdef CONFIG_CHIP_SED_IDLE_INTERVAL -#define CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_CHIP_SED_IDLE_INTERVAL) -#endif // CONFIG_CHIP_SED_IDLE_INTERVAL +#ifdef CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL +#define CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL) +#endif // CONFIG_CHIP_ICD_SLOW_POLL_INTERVAL #endif // CHIP_DEVICE_CONFIG_ICD_SLOW_POLL_INTERVAL #ifndef CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL -#ifdef CONFIG_CHIP_SED_ACTIVE_INTERVAL -#define CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_CHIP_SED_ACTIVE_INTERVAL) -#endif // CONFIG_CHIP_SED_ACTIVE_INTERVAL +#ifdef CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL +#define CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL chip::System::Clock::Milliseconds32(CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL) +#endif // CONFIG_CHIP_ICD_FAST_POLLING_INTERVAL #endif // CHIP_DEVICE_CONFIG_ICD_FAST_POLL_INTERVAL