From 00b59b0def06fcadee80517c3e5ed44cbfcc862b Mon Sep 17 00:00:00 2001 From: Mathieu Kardous Date: Fri, 4 Aug 2023 08:43:02 -0400 Subject: [PATCH 1/6] Add CSL support for Silabs platform --- .../light-switch-app/silabs/openthread.gni | 3 ++- .../light-switch-app/silabs/src/AppTask.cpp | 10 +++++++++ examples/lock-app/silabs/openthread.gni | 3 ++- examples/platform/silabs/MatterConfig.cpp | 22 +++++++++++++++++++ .../efr32/project_include/OpenThreadConfig.h | 7 ++++++ scripts/examples/gn_silabs_example.sh | 6 +++++ ...nericThreadStackManagerImpl_OpenThread.hpp | 5 +---- .../silabs/CHIPDevicePlatformConfig.h | 16 -------------- third_party/silabs/efr32_sdk.gni | 19 +++++++++++++++- 9 files changed, 68 insertions(+), 23 deletions(-) diff --git a/examples/light-switch-app/silabs/openthread.gni b/examples/light-switch-app/silabs/openthread.gni index 19b09c05a8f4b6..9079c66b80818f 100644 --- a/examples/light-switch-app/silabs/openthread.gni +++ b/examples/light-switch-app/silabs/openthread.gni @@ -27,11 +27,12 @@ openthread_external_platform = # ICD Default configurations chip_enable_icd_server = true +enable_synchronized_sed = true chip_subscription_timeout_resumption = false sl_use_subscription_synching = true # Openthread Configuration flags -sl_ot_idle_interval_ms = 30000 # 30s Idle Intervals +sl_ot_idle_interval_ms = 500 # 30s Idle Intervals sl_ot_active_interval_ms = 500 # 500ms Active Intervals # ICD Matter Configuration flags diff --git a/examples/light-switch-app/silabs/src/AppTask.cpp b/examples/light-switch-app/silabs/src/AppTask.cpp index 2f8d01275863be..2083a6a885c577 100644 --- a/examples/light-switch-app/silabs/src/AppTask.cpp +++ b/examples/light-switch-app/silabs/src/AppTask.cpp @@ -26,6 +26,10 @@ #include "AppEvent.h" #include "BindingHandler.h" +#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) +#include "sl_power_manager.h" +#endif + #include "LEDWidget.h" #include "LightSwitchMgr.h" @@ -124,6 +128,12 @@ void AppTask::AppTaskMain(void * pvParameter) #endif SILABS_LOG("App Task started"); + +#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) + SILABS_LOG("----------------------------------------------- ADING EM1 requirement ---------------------------------"); + sl_power_manager_add_em_requirement(SL_POWER_MANAGER_EM1); +#endif + while (true) { BaseType_t eventReceived = xQueueReceive(sAppEventQueue, &event, portMAX_DELAY); diff --git a/examples/lock-app/silabs/openthread.gni b/examples/lock-app/silabs/openthread.gni index cde56f8029f6da..729440aa5d9ffa 100644 --- a/examples/lock-app/silabs/openthread.gni +++ b/examples/lock-app/silabs/openthread.gni @@ -27,11 +27,12 @@ openthread_external_platform = # ICD Default configurations chip_enable_icd_server = true +enable_synchronized_sed = true chip_subscription_timeout_resumption = false sl_use_subscription_synching = true # Openthread Configuration flags -sl_ot_idle_interval_ms = 5000 # 5s Idle Intervals +sl_ot_idle_interval_ms = 500 # 5s Idle Intervals sl_ot_active_interval_ms = 500 # 500ms Active Intervals # ICD Matter Configuration flags diff --git a/examples/platform/silabs/MatterConfig.cpp b/examples/platform/silabs/MatterConfig.cpp index 3a78cf774c8c5a..3356e5b8f2f262 100644 --- a/examples/platform/silabs/MatterConfig.cpp +++ b/examples/platform/silabs/MatterConfig.cpp @@ -87,6 +87,10 @@ static chip::DeviceLayer::Internal::Efr32PsaOperationalKeystore gOperationalKeys #include #include +#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) +#include "sl_power_manager.h" +#endif + // ================================================================================ // Matter Networking Callbacks // ================================================================================ @@ -113,7 +117,11 @@ CHIP_ERROR SilabsMatterConfig::InitOpenThread(void) ReturnErrorOnFailure(ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router)); #else // CHIP_DEVICE_CONFIG_THREAD_FTD #if CHIP_CONFIG_ENABLE_ICD_SERVER +#if CHIP_DEVICE_CONFIG_THREAD_SSED + ReturnErrorOnFailure(ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SynchronizedSleepyEndDevice)); +#else ReturnErrorOnFailure(ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice)); +#endif #else // CHIP_CONFIG_ENABLE_ICD_SERVER ReturnErrorOnFailure(ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice)); #endif // CHIP_CONFIG_ENABLE_ICD_SERVER @@ -144,6 +152,20 @@ void SilabsMatterConfig::ConnectivityEventCallback(const ChipDeviceEvent * event chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds32(OTAConfig::kInitOTARequestorDelaySec), InitOTARequestorHandler, nullptr); #endif + + SILABS_LOG("------------------------------------ Send Data Request -------------------------------------") + otLinkSendDataRequest(chip::DeviceLayer::ThreadStackMgrImpl().OTInstance()); + + } + + if (event->Type == DeviceLayer::DeviceEventType::kCommissioningComplete) + { +#if CHIP_ENABLE_OPENTHREAD +#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) + SILABS_LOG("------------------------------------ REMOVE EM 1 REQUIREMENT -------------------------------------") + sl_power_manager_remove_em_requirement(SL_POWER_MANAGER_EM1); +#endif +#endif // CHIP_ENABLE_OPENTHREAD } } diff --git a/examples/platform/silabs/efr32/project_include/OpenThreadConfig.h b/examples/platform/silabs/efr32/project_include/OpenThreadConfig.h index e906e48ab02684..56fc6ea87d8be8 100644 --- a/examples/platform/silabs/efr32/project_include/OpenThreadConfig.h +++ b/examples/platform/silabs/efr32/project_include/OpenThreadConfig.h @@ -45,6 +45,13 @@ // Timeout after 2 missed checkin or 4 mins if sleep interval is too short. #define OPENTHREAD_CONFIG_MLE_CHILD_TIMEOUT_DEFAULT ((SL_MLE_TIMEOUT_s < 120) ? 240 : ((SL_MLE_TIMEOUT_s * 2) + 1)) + +#define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 1 +#define OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE 1 +#define OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE 1 +#define OPENTHREAD_CONFIG_CHILD_SUPERVISION_CHECK_TIMEOUT 0 +#define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 200 + #endif // SL_ICD_ENABLED /****Uncomment below section for OpenThread Debug logs*/ diff --git a/scripts/examples/gn_silabs_example.sh b/scripts/examples/gn_silabs_example.sh index fc8fcfd387f8fa..2042dc11876db7 100755 --- a/scripts/examples/gn_silabs_example.sh +++ b/scripts/examples/gn_silabs_example.sh @@ -86,6 +86,9 @@ if [ "$#" == "0" ]; then chip_enable_icd_server Configure has a Intermitently connected device. (Default false) Must also set chip_openthread_ftd=false + enable_synchronized_sed + Enable Synchronized Sleepy end device. (Default false) + Must also set chip_enable_icd_server=true chip_openthread_ftd=false use_rs9116 Build wifi example with extension board rs9116. (Default false) use_SiWx917 @@ -121,6 +124,9 @@ if [ "$#" == "0" ]; then --icd enable ICD features, set thread mtd For minimum consumption, add --low-power + --ssed + enable synchronized sleepy end device, with csl + For minimum consumption, add --low-power --low-power disables all power consuming features for the most power efficient build This flag is to be used with --icd diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp index acc0c78d0c8eb7..7aa9c48f613f69 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp @@ -535,9 +535,7 @@ GenericThreadStackManagerImpl_OpenThread::_SetThreadDeviceType(Connec #endif case ConnectivityManager::kThreadDeviceType_MinimalEndDevice: case ConnectivityManager::kThreadDeviceType_SleepyEndDevice: -#if CHIP_DEVICE_CONFIG_THREAD_SSED case ConnectivityManager::kThreadDeviceType_SynchronizedSleepyEndDevice: -#endif break; default: ExitNow(err = CHIP_ERROR_INVALID_ARGUMENT); @@ -560,11 +558,9 @@ GenericThreadStackManagerImpl_OpenThread::_SetThreadDeviceType(Connec case ConnectivityManager::kThreadDeviceType_SleepyEndDevice: deviceTypeStr = "SLEEPY END DEVICE"; break; -#if CHIP_DEVICE_CONFIG_THREAD_SSED case ConnectivityManager::kThreadDeviceType_SynchronizedSleepyEndDevice: deviceTypeStr = "SYNCHRONIZED SLEEPY END DEVICE"; break; -#endif default: deviceTypeStr = "(unknown)"; break; @@ -596,6 +592,7 @@ GenericThreadStackManagerImpl_OpenThread::_SetThreadDeviceType(Connec case ConnectivityManager::kThreadDeviceType_SynchronizedSleepyEndDevice: linkMode.mDeviceType = false; linkMode.mRxOnWhenIdle = false; + linkMode.mNetworkData = true; break; default: break; diff --git a/src/platform/silabs/CHIPDevicePlatformConfig.h b/src/platform/silabs/CHIPDevicePlatformConfig.h index 12aadb24400691..fa3a50974f6a50 100644 --- a/src/platform/silabs/CHIPDevicePlatformConfig.h +++ b/src/platform/silabs/CHIPDevicePlatformConfig.h @@ -118,22 +118,6 @@ // ========== Platform-specific Configuration Overrides ========= -#ifndef CHIP_DEVICE_CONFIG_BLE_LL_TASK_PRIORITY -#define CHIP_DEVICE_CONFIG_BLE_LL_TASK_PRIORITY (configTIMER_TASK_PRIORITY - 1) -#endif // CHIP_DEVICE_CONFIG_BLE_LL_TASK_PRIORITY - -#ifndef CHIP_DEVICE_CONFIG_BLE_STACK_TASK_PRIORITY -#define CHIP_DEVICE_CONFIG_BLE_STACK_TASK_PRIORITY (CHIP_DEVICE_CONFIG_BLE_LL_TASK_PRIORITY - 1) -#endif // CHIP_DEVICE_CONFIG_BLE_STACK_TASK_PRIORITY - -#ifndef CHIP_DEVICE_CONFIG_BLE_APP_TASK_PRIORITY -#define CHIP_DEVICE_CONFIG_BLE_APP_TASK_PRIORITY (CHIP_DEVICE_CONFIG_BLE_STACK_TASK_PRIORITY - 1) -#endif // CHIP_DEVICE_CONFIG_BLE_STACK_TASK_PRIORITY - -#ifndef CHIP_DEVICE_CONFIG_BLE_APP_TASK_STACK_SIZE -#define CHIP_DEVICE_CONFIG_BLE_APP_TASK_STACK_SIZE 1536 -#endif // CHIP_DEVICE_CONFIG_BLE_APP_TASK_STACK_SIZE - #ifndef CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE #define CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE (6 * 1024) #endif // CHIP_DEVICE_CONFIG_CHIP_TASK_STACK_SIZE diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index 3a80deb7f99e33..a81760b8239f43 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -49,6 +49,9 @@ declare_args() { # ICD Openthread Configuration flags sl_ot_idle_interval_ms = 15000 # 15s Idle Intervals sl_ot_active_interval_ms = 200 # 200ms Active Intervals + + # SSED Specific configurations + sl_ot_csl_timeout_sec = 30 # 30s CSL timeout # ICD Matter Configuration flags sl_idle_mode_interval_s = 600 # 10min Idle Mode Interval @@ -59,6 +62,9 @@ declare_args() { silabs_log_enabled = true + # Enable Synchronized Sleepy End Device + enable_synchronized_sed = false + # Argument to enable IPv4 for wifi # aligning to match chip_inet_config_enable_ipv4 default configuration chip_enable_wifi_ipv4 = false @@ -160,7 +166,6 @@ template("efr32_sdk") { "${efr32_sdk_root}/platform/radio/rail_lib/protocol/ieee802154", "${efr32_sdk_root}/platform/radio/rail_lib/protocol/ble", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/pa-conversions", - "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_power_manager_init", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_pti", "${efr32_sdk_root}/platform/radio/rail_lib/plugin/rail_util_power_manager_init", "${efr32_sdk_root}/platform/service/device_init/inc", @@ -433,6 +438,18 @@ template("efr32_sdk") { "SL_OT_IDLE_INTERVAL=${sl_ot_idle_interval_ms}", "SL_OT_ACTIVE_INTERVAL=${sl_ot_active_interval_ms}", ] + + if (enable_synchronized_sed) { + defines += [ + "CHIP_DEVICE_CONFIG_THREAD_SSED=1", + "OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE=1", + "OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE=1", + "OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE=1", + "OPENTHREAD_CONFIG_CHILD_SUPERVISION_CHECK_TIMEOUT=0", + "SL_OPENTHREAD_CSL_TX_UNCERTAINTY=200", + "OPENTHREAD_CONFIG_CSL_TIMEOUT=${sl_ot_csl_timeout_sec}", + ] + } } if (defined(invoker.chip_enable_wifi) && invoker.chip_enable_wifi) { From 6f9483be2b3acc9017d4994c0f0aacc4b4056b67 Mon Sep 17 00:00:00 2001 From: Mathieu Kardous Date: Thu, 1 Feb 2024 14:59:30 -0500 Subject: [PATCH 2/6] Clean up CSL support --- .../light-switch-app/silabs/openthread.gni | 3 +-- .../light-switch-app/silabs/src/AppTask.cpp | 17 +-------------- examples/lock-app/silabs/openthread.gni | 3 +-- examples/platform/silabs/MatterConfig.cpp | 18 ---------------- .../efr32/project_include/OpenThreadConfig.h | 21 ++++++++----------- scripts/examples/gn_silabs_example.sh | 4 ++++ ...nericThreadStackManagerImpl_OpenThread.hpp | 5 ++++- third_party/silabs/efr32_sdk.gni | 17 +++------------ 8 files changed, 23 insertions(+), 65 deletions(-) diff --git a/examples/light-switch-app/silabs/openthread.gni b/examples/light-switch-app/silabs/openthread.gni index 9079c66b80818f..2ea7cd471c2b8a 100644 --- a/examples/light-switch-app/silabs/openthread.gni +++ b/examples/light-switch-app/silabs/openthread.gni @@ -27,12 +27,11 @@ openthread_external_platform = # ICD Default configurations chip_enable_icd_server = true -enable_synchronized_sed = true chip_subscription_timeout_resumption = false sl_use_subscription_synching = true # Openthread Configuration flags -sl_ot_idle_interval_ms = 500 # 30s Idle Intervals +sl_ot_idle_interval_ms = 15000 # 15s Idle Intervals sl_ot_active_interval_ms = 500 # 500ms Active Intervals # ICD Matter Configuration flags diff --git a/examples/light-switch-app/silabs/src/AppTask.cpp b/examples/light-switch-app/silabs/src/AppTask.cpp index 2083a6a885c577..c9759d24118fdd 100644 --- a/examples/light-switch-app/silabs/src/AppTask.cpp +++ b/examples/light-switch-app/silabs/src/AppTask.cpp @@ -25,33 +25,24 @@ #include "AppConfig.h" #include "AppEvent.h" #include "BindingHandler.h" - -#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) -#include "sl_power_manager.h" -#endif - #include "LEDWidget.h" - #include "LightSwitchMgr.h" - #ifdef DISPLAY_ENABLED #include "lcd.h" #ifdef QR_CODE_ENABLED #include "qrcodegen.h" #endif // QR_CODE_ENABLED #endif // DISPLAY_ENABLED - #include #include #include #include #include #include +#include #include #include -#include - /********************************************************** * Defines and Constants *********************************************************/ @@ -128,12 +119,6 @@ void AppTask::AppTaskMain(void * pvParameter) #endif SILABS_LOG("App Task started"); - -#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) - SILABS_LOG("----------------------------------------------- ADING EM1 requirement ---------------------------------"); - sl_power_manager_add_em_requirement(SL_POWER_MANAGER_EM1); -#endif - while (true) { BaseType_t eventReceived = xQueueReceive(sAppEventQueue, &event, portMAX_DELAY); diff --git a/examples/lock-app/silabs/openthread.gni b/examples/lock-app/silabs/openthread.gni index 729440aa5d9ffa..cde56f8029f6da 100644 --- a/examples/lock-app/silabs/openthread.gni +++ b/examples/lock-app/silabs/openthread.gni @@ -27,12 +27,11 @@ openthread_external_platform = # ICD Default configurations chip_enable_icd_server = true -enable_synchronized_sed = true chip_subscription_timeout_resumption = false sl_use_subscription_synching = true # Openthread Configuration flags -sl_ot_idle_interval_ms = 500 # 5s Idle Intervals +sl_ot_idle_interval_ms = 5000 # 5s Idle Intervals sl_ot_active_interval_ms = 500 # 500ms Active Intervals # ICD Matter Configuration flags diff --git a/examples/platform/silabs/MatterConfig.cpp b/examples/platform/silabs/MatterConfig.cpp index 3356e5b8f2f262..e9fed8d924c3e0 100644 --- a/examples/platform/silabs/MatterConfig.cpp +++ b/examples/platform/silabs/MatterConfig.cpp @@ -87,10 +87,6 @@ static chip::DeviceLayer::Internal::Efr32PsaOperationalKeystore gOperationalKeys #include #include -#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) -#include "sl_power_manager.h" -#endif - // ================================================================================ // Matter Networking Callbacks // ================================================================================ @@ -152,20 +148,6 @@ void SilabsMatterConfig::ConnectivityEventCallback(const ChipDeviceEvent * event chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds32(OTAConfig::kInitOTARequestorDelaySec), InitOTARequestorHandler, nullptr); #endif - - SILABS_LOG("------------------------------------ Send Data Request -------------------------------------") - otLinkSendDataRequest(chip::DeviceLayer::ThreadStackMgrImpl().OTInstance()); - - } - - if (event->Type == DeviceLayer::DeviceEventType::kCommissioningComplete) - { -#if CHIP_ENABLE_OPENTHREAD -#if defined(SL_CATALOG_POWER_MANAGER_PRESENT) - SILABS_LOG("------------------------------------ REMOVE EM 1 REQUIREMENT -------------------------------------") - sl_power_manager_remove_em_requirement(SL_POWER_MANAGER_EM1); -#endif -#endif // CHIP_ENABLE_OPENTHREAD } } diff --git a/examples/platform/silabs/efr32/project_include/OpenThreadConfig.h b/examples/platform/silabs/efr32/project_include/OpenThreadConfig.h index 56fc6ea87d8be8..d7492f4044f3fa 100644 --- a/examples/platform/silabs/efr32/project_include/OpenThreadConfig.h +++ b/examples/platform/silabs/efr32/project_include/OpenThreadConfig.h @@ -45,42 +45,39 @@ // Timeout after 2 missed checkin or 4 mins if sleep interval is too short. #define OPENTHREAD_CONFIG_MLE_CHILD_TIMEOUT_DEFAULT ((SL_MLE_TIMEOUT_s < 120) ? 240 : ((SL_MLE_TIMEOUT_s * 2) + 1)) +#if defined(SL_CSL_ENABLE) && SL_CSL_ENABLE #define OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE 1 #define OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE 1 #define OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE 1 #define OPENTHREAD_CONFIG_CHILD_SUPERVISION_CHECK_TIMEOUT 0 +#define OPENTHREAD_CONFIG_CSL_RECEIVE_TIME_AHEAD 750 +#define OPENTHREAD_CONFIG_CSL_TIMEOUT SL_CSL_TIMEOUT #define SL_OPENTHREAD_CSL_TX_UNCERTAINTY 200 +#endif // SL_CSL_ENABLE + #endif // SL_ICD_ENABLED /****Uncomment below section for OpenThread Debug logs*/ // #define OPENTHREAD_CONFIG_LOG_LEVEL OT_LOG_LEVEL_DEBG // #ifndef OPENTHREAD_CONFIG_LOG_CLI -// #define OPENTHREAD_CONFIG_LOG_CLI 1 +// #define OPENTHREAD_CONFIG_LOG_CLI 1 // #endif // #ifndef OPENTHREAD_CONFIG_LOG_PKT_DUMP -// #define OPENTHREAD_CONFIG_LOG_PKT_DUMP 1 +// #define OPENTHREAD_CONFIG_LOG_PKT_DUMP 1 // #endif // #ifndef OPENTHREAD_CONFIG_LOG_PLATFORM -// #define OPENTHREAD_CONFIG_LOG_PLATFORM 1 +// #define OPENTHREAD_CONFIG_LOG_PLATFORM 1 // #endif // #ifndef OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL -// #define OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 1 +// #define OPENTHREAD_CONFIG_LOG_PREPEND_LEVEL 1 // #endif -// EFR32MG21A020F1024IM32 has 96k of RAM. Reduce the number of buffers to -// conserve RAM for this Series 2 part. -#if defined(EFR32MG21) -#define OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS 22 -#define OPENTHREAD_CONFIG_CLI_UART_TX_BUFFER_SIZE 512 -#define OPENTHREAD_CONFIG_CLI_UART_RX_BUFFER_SIZE 512 -#endif - #define OPENTHREAD_CONFIG_NCP_HDLC_ENABLE 1 #define OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE 1 diff --git a/scripts/examples/gn_silabs_example.sh b/scripts/examples/gn_silabs_example.sh index 2042dc11876db7..54a2d614f13eb7 100755 --- a/scripts/examples/gn_silabs_example.sh +++ b/scripts/examples/gn_silabs_example.sh @@ -198,6 +198,10 @@ else optArgs+="chip_enable_icd_server=true chip_openthread_ftd=false " shift ;; + --ssed) + optArgs+="enable_synchronized_sed=true " + shift + ;; --low-power) optArgs+="chip_build_libshell=false enable_openthread_cli=false show_qr_code=false disable_lcd=true " shift diff --git a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp index 7aa9c48f613f69..acc0c78d0c8eb7 100644 --- a/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp +++ b/src/platform/OpenThread/GenericThreadStackManagerImpl_OpenThread.hpp @@ -535,7 +535,9 @@ GenericThreadStackManagerImpl_OpenThread::_SetThreadDeviceType(Connec #endif case ConnectivityManager::kThreadDeviceType_MinimalEndDevice: case ConnectivityManager::kThreadDeviceType_SleepyEndDevice: +#if CHIP_DEVICE_CONFIG_THREAD_SSED case ConnectivityManager::kThreadDeviceType_SynchronizedSleepyEndDevice: +#endif break; default: ExitNow(err = CHIP_ERROR_INVALID_ARGUMENT); @@ -558,9 +560,11 @@ GenericThreadStackManagerImpl_OpenThread::_SetThreadDeviceType(Connec case ConnectivityManager::kThreadDeviceType_SleepyEndDevice: deviceTypeStr = "SLEEPY END DEVICE"; break; +#if CHIP_DEVICE_CONFIG_THREAD_SSED case ConnectivityManager::kThreadDeviceType_SynchronizedSleepyEndDevice: deviceTypeStr = "SYNCHRONIZED SLEEPY END DEVICE"; break; +#endif default: deviceTypeStr = "(unknown)"; break; @@ -592,7 +596,6 @@ GenericThreadStackManagerImpl_OpenThread::_SetThreadDeviceType(Connec case ConnectivityManager::kThreadDeviceType_SynchronizedSleepyEndDevice: linkMode.mDeviceType = false; linkMode.mRxOnWhenIdle = false; - linkMode.mNetworkData = true; break; default: break; diff --git a/third_party/silabs/efr32_sdk.gni b/third_party/silabs/efr32_sdk.gni index a81760b8239f43..415f89b4db04fb 100644 --- a/third_party/silabs/efr32_sdk.gni +++ b/third_party/silabs/efr32_sdk.gni @@ -49,7 +49,7 @@ declare_args() { # ICD Openthread Configuration flags sl_ot_idle_interval_ms = 15000 # 15s Idle Intervals sl_ot_active_interval_ms = 200 # 200ms Active Intervals - + # SSED Specific configurations sl_ot_csl_timeout_sec = 30 # 30s CSL timeout @@ -301,13 +301,6 @@ template("efr32_sdk") { #"__STACK_SIZE=0", ] - if (!(use_silabs_thread_lib || use_silabs_thread_lib)) { - #Enabling this config temporarly to fix a build issue until - #official fix is pushed - - defines += [ "OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE=1" ] - } - # Temporary configuration to enable COAP specific configurations if (use_thread_coap_lib) { defines += [ "SL_USE_COAP_CONFIG=1" ] @@ -442,12 +435,8 @@ template("efr32_sdk") { if (enable_synchronized_sed) { defines += [ "CHIP_DEVICE_CONFIG_THREAD_SSED=1", - "OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE=1", - "OPENTHREAD_CONFIG_MAC_CSL_AUTO_SYNC_ENABLE=1", - "OPENTHREAD_CONFIG_PLATFORM_USEC_TIMER_ENABLE=1", - "OPENTHREAD_CONFIG_CHILD_SUPERVISION_CHECK_TIMEOUT=0", - "SL_OPENTHREAD_CSL_TX_UNCERTAINTY=200", - "OPENTHREAD_CONFIG_CSL_TIMEOUT=${sl_ot_csl_timeout_sec}", + "SL_CSL_ENABLE=1", + "SL_CSL_TIMEOUT=${sl_ot_csl_timeout_sec}", ] } } From 15823dc5356243ccaac222677a3e1891325c4620 Mon Sep 17 00:00:00 2001 From: Mathieu Kardous Date: Thu, 1 Feb 2024 16:25:56 -0500 Subject: [PATCH 3/6] enable ssed ICD on window-app by default --- examples/window-app/silabs/openthread.gni | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/examples/window-app/silabs/openthread.gni b/examples/window-app/silabs/openthread.gni index ffe5dc7c278205..cdd7f8c0f1f42e 100644 --- a/examples/window-app/silabs/openthread.gni +++ b/examples/window-app/silabs/openthread.gni @@ -24,3 +24,18 @@ chip_enable_openthread = true openthread_external_platform = "${chip_root}/third_party/openthread/platforms/efr32:libopenthread-efr32" + +# ICD Default configurations +chip_enable_icd_server = true +enable_synchronized_sed = true +chip_subscription_timeout_resumption = false +sl_use_subscription_synching = true + +# Openthread Configuration flags +sl_ot_idle_interval_ms = 1000 # 1s Idle Intervals +sl_ot_active_interval_ms = 500 # 500ms Active Intervals + +# ICD Matter Configuration flags +sl_idle_mode_interval_s = 600 # 10min Idle Mode Interval +sl_active_mode_interval_ms = 0 # 0s Active Mode Interval +sl_active_mode_threshold_ms = 0 # 1s Active Mode Threshold From 4175115b01de5872636361ae63d67381d4092e5e Mon Sep 17 00:00:00 2001 From: Mathieu Kardous Date: Thu, 1 Feb 2024 16:27:20 -0500 Subject: [PATCH 4/6] remove --ssed build flag --- scripts/examples/gn_silabs_example.sh | 238 +++++++++++++------------- 1 file changed, 116 insertions(+), 122 deletions(-) diff --git a/scripts/examples/gn_silabs_example.sh b/scripts/examples/gn_silabs_example.sh index 54a2d614f13eb7..cbd7952d90c72b 100755 --- a/scripts/examples/gn_silabs_example.sh +++ b/scripts/examples/gn_silabs_example.sh @@ -88,7 +88,8 @@ if [ "$#" == "0" ]; then Must also set chip_openthread_ftd=false enable_synchronized_sed Enable Synchronized Sleepy end device. (Default false) - Must also set chip_enable_icd_server=true chip_openthread_ftd=false + Must also set chip_enable_icd_server=true chip_openthread_ftd=false + --icd can be used to configure both arguments use_rs9116 Build wifi example with extension board rs9116. (Default false) use_SiWx917 @@ -124,9 +125,6 @@ if [ "$#" == "0" ]; then --icd enable ICD features, set thread mtd For minimum consumption, add --low-power - --ssed - enable synchronized sleepy end device, with csl - For minimum consumption, add --low-power --low-power disables all power consuming features for the most power efficient build This flag is to be used with --icd @@ -170,126 +168,122 @@ else shift while [ $# -gt 0 ]; do case $1 in - --clean) - DIR_CLEAN=true - shift - ;; - --wifi) - if [ -z "$2" ]; then - echo "--wifi requires rs9116 or SiWx917 or wf200" - exit 1 - fi - if [ "$2" = "rs9116" ]; then - optArgs+="use_rs9116=true " - elif [ "$2" = "SiWx917" ]; then - optArgs+="use_SiWx917=true " - elif [ "$2" = "wf200" ]; then - optArgs+="use_wf200=true " - else - echo "Wifi usage: --wifi rs9116|SiWx917|wf200" - exit 1 - fi + --clean) + DIR_CLEAN=true + shift + ;; + --wifi) + if [ -z "$2" ]; then + echo "--wifi requires rs9116 or SiWx917 or wf200" + exit 1 + fi + if [ "$2" = "rs9116" ]; then + optArgs+="use_rs9116=true " + elif [ "$2" = "SiWx917" ]; then + optArgs+="use_SiWx917=true " + elif [ "$2" = "wf200" ]; then + optArgs+="use_wf200=true " + else + echo "Wifi usage: --wifi rs9116|SiWx917|wf200" + exit 1 + fi + USE_WIFI=true + optArgs+="chip_device_platform =\"efr32\" " + shift + shift + ;; + --icd) + optArgs+="chip_enable_icd_server=true chip_openthread_ftd=false " + shift + ;; + --low-power) + optArgs+="chip_build_libshell=false enable_openthread_cli=false show_qr_code=false disable_lcd=true " + shift + ;; + --chip_enable_wifi_ipv4) + optArgs="chip_enable_wifi_ipv4=true chip_inet_config_enable_ipv4=true " + shift + ;; + --additional_data_advertising) + optArgs+="chip_enable_additional_data_advertising=true chip_enable_rotating_device_id=true " + shift + ;; + --use_ot_lib) + optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" " + shift + ;; + --use_ot_coap_lib) + optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" use_thread_coap_lib=true " + shift + ;; + --use_chip_lwip_lib) + optArgs+="lwip_root=\""//third_party/connectedhomeip/third_party/lwip"\" " + shift + ;; + # Option not to be used until ot-efr32 github is updated + # --use_ot_github_sources) + # optArgs+="openthread_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/openthread\" openthread_efr32_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/src/src\"" + # shift + # ;; + --release) + optArgs+="is_debug=false disable_lcd=true chip_build_libshell=false enable_openthread_cli=false use_external_flash=false chip_logging=false silabs_log_enabled=false " + shift + ;; + --bootloader) + USE_BOOTLOADER=true + shift + ;; + --docker) + optArgs+="efr32_sdk_root=\"$GSDK_ROOT\" " + optArgs+="wiseconnect_sdk_root=\"$WISECONNECT_SDK_ROOT\" " + optArgs+="wifi_sdk_root=\"$WIFI_SDK_ROOT\" " + USE_DOCKER=true + shift + ;; + --uart_log) + optArgs+="sl_uart_log_output=true " + shift + ;; + + --slc_generate) + optArgs+="slc_generate=true " + USE_SLC=true + shift + ;; + --use_pw_rpc) + optArgs+="import(\"//with_pw_rpc.gni\") " + shift + ;; + --slc_reuse_files) + optArgs+="slc_reuse_files=true " + USE_SLC=true + shift + ;; + --gn_path) + if [ -z "$2" ]; then + echo "--gn_path requires a path to GN" + exit 1 + else + GN_PATH="$2" + fi + GN_PATH_PROVIDED=true + shift + shift + ;; + *"sl_matter_version_str="*) + optArgs+="$1 " + USE_GIT_SHA_FOR_VERSION=false + shift + ;; + *) + if [ "$1" =~ *"use_rs9116=true"* ] || [ "$1" =~ *"use_SiWx917=true"* ] || [ "$1" =~ *"use_wf200=true"* ]; then USE_WIFI=true + # NCP Mode so base MCU is an EFR32 optArgs+="chip_device_platform =\"efr32\" " - shift - shift - ;; - --icd) - optArgs+="chip_enable_icd_server=true chip_openthread_ftd=false " - shift - ;; - --ssed) - optArgs+="enable_synchronized_sed=true " - shift - ;; - --low-power) - optArgs+="chip_build_libshell=false enable_openthread_cli=false show_qr_code=false disable_lcd=true " - shift - ;; - --chip_enable_wifi_ipv4) - optArgs="chip_enable_wifi_ipv4=true chip_inet_config_enable_ipv4=true " - shift - ;; - --additional_data_advertising) - optArgs+="chip_enable_additional_data_advertising=true chip_enable_rotating_device_id=true " - shift - ;; - --use_ot_lib) - optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" " - shift - ;; - --use_ot_coap_lib) - optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" use_thread_coap_lib=true " - shift - ;; - --use_chip_lwip_lib) - optArgs+="lwip_root=\""//third_party/connectedhomeip/third_party/lwip"\" " - shift - ;; - # Option not to be used until ot-efr32 github is updated - # --use_ot_github_sources) - # optArgs+="openthread_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/openthread\" openthread_efr32_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/src/src\"" - # shift - # ;; - --release) - optArgs+="is_debug=false disable_lcd=true chip_build_libshell=false enable_openthread_cli=false use_external_flash=false chip_logging=false silabs_log_enabled=false " - shift - ;; - --bootloader) - USE_BOOTLOADER=true - shift - ;; - --docker) - optArgs+="efr32_sdk_root=\"$GSDK_ROOT\" " - optArgs+="wiseconnect_sdk_root=\"$WISECONNECT_SDK_ROOT\" " - optArgs+="wifi_sdk_root=\"$WIFI_SDK_ROOT\" " - USE_DOCKER=true - shift - ;; - --uart_log) - optArgs+="sl_uart_log_output=true " - shift - ;; - - --slc_generate) - optArgs+="slc_generate=true " - USE_SLC=true - shift - ;; - --use_pw_rpc) - optArgs+="import(\"//with_pw_rpc.gni\") " - shift - ;; - --slc_reuse_files) - optArgs+="slc_reuse_files=true " - USE_SLC=true - shift - ;; - --gn_path) - if [ -z "$2" ]; then - echo "--gn_path requires a path to GN" - exit 1 - else - GN_PATH="$2" - fi - GN_PATH_PROVIDED=true - shift - shift - ;; - *"sl_matter_version_str="*) - optArgs+="$1 " - USE_GIT_SHA_FOR_VERSION=false - shift - ;; - *) - if [ "$1" =~ *"use_rs9116=true"* ] || [ "$1" =~ *"use_SiWx917=true"* ] || [ "$1" =~ *"use_wf200=true"* ]; then - USE_WIFI=true - # NCP Mode so base MCU is an EFR32 - optArgs+="chip_device_platform =\"efr32\" " - fi - optArgs+=$1" " - shift - ;; + fi + optArgs+=$1" " + shift + ;; esac done From e821d4f9b20616896302204338f64f4ec59eb444 Mon Sep 17 00:00:00 2001 From: Mathieu Kardous Date: Thu, 1 Feb 2024 16:29:33 -0500 Subject: [PATCH 5/6] restyle --- scripts/examples/gn_silabs_example.sh | 230 +++++++++++++------------- 1 file changed, 115 insertions(+), 115 deletions(-) diff --git a/scripts/examples/gn_silabs_example.sh b/scripts/examples/gn_silabs_example.sh index cbd7952d90c72b..c69f9d495fa975 100755 --- a/scripts/examples/gn_silabs_example.sh +++ b/scripts/examples/gn_silabs_example.sh @@ -88,7 +88,7 @@ if [ "$#" == "0" ]; then Must also set chip_openthread_ftd=false enable_synchronized_sed Enable Synchronized Sleepy end device. (Default false) - Must also set chip_enable_icd_server=true chip_openthread_ftd=false + Must also set chip_enable_icd_server=true chip_openthread_ftd=false --icd can be used to configure both arguments use_rs9116 Build wifi example with extension board rs9116. (Default false) @@ -168,122 +168,122 @@ else shift while [ $# -gt 0 ]; do case $1 in - --clean) - DIR_CLEAN=true - shift - ;; - --wifi) - if [ -z "$2" ]; then - echo "--wifi requires rs9116 or SiWx917 or wf200" - exit 1 - fi - if [ "$2" = "rs9116" ]; then - optArgs+="use_rs9116=true " - elif [ "$2" = "SiWx917" ]; then - optArgs+="use_SiWx917=true " - elif [ "$2" = "wf200" ]; then - optArgs+="use_wf200=true " - else - echo "Wifi usage: --wifi rs9116|SiWx917|wf200" - exit 1 - fi - USE_WIFI=true - optArgs+="chip_device_platform =\"efr32\" " - shift - shift - ;; - --icd) - optArgs+="chip_enable_icd_server=true chip_openthread_ftd=false " - shift - ;; - --low-power) - optArgs+="chip_build_libshell=false enable_openthread_cli=false show_qr_code=false disable_lcd=true " - shift - ;; - --chip_enable_wifi_ipv4) - optArgs="chip_enable_wifi_ipv4=true chip_inet_config_enable_ipv4=true " - shift - ;; - --additional_data_advertising) - optArgs+="chip_enable_additional_data_advertising=true chip_enable_rotating_device_id=true " - shift - ;; - --use_ot_lib) - optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" " - shift - ;; - --use_ot_coap_lib) - optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" use_thread_coap_lib=true " - shift - ;; - --use_chip_lwip_lib) - optArgs+="lwip_root=\""//third_party/connectedhomeip/third_party/lwip"\" " - shift - ;; - # Option not to be used until ot-efr32 github is updated - # --use_ot_github_sources) - # optArgs+="openthread_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/openthread\" openthread_efr32_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/src/src\"" - # shift - # ;; - --release) - optArgs+="is_debug=false disable_lcd=true chip_build_libshell=false enable_openthread_cli=false use_external_flash=false chip_logging=false silabs_log_enabled=false " - shift - ;; - --bootloader) - USE_BOOTLOADER=true - shift - ;; - --docker) - optArgs+="efr32_sdk_root=\"$GSDK_ROOT\" " - optArgs+="wiseconnect_sdk_root=\"$WISECONNECT_SDK_ROOT\" " - optArgs+="wifi_sdk_root=\"$WIFI_SDK_ROOT\" " - USE_DOCKER=true - shift - ;; - --uart_log) - optArgs+="sl_uart_log_output=true " - shift - ;; - - --slc_generate) - optArgs+="slc_generate=true " - USE_SLC=true - shift - ;; - --use_pw_rpc) - optArgs+="import(\"//with_pw_rpc.gni\") " - shift - ;; - --slc_reuse_files) - optArgs+="slc_reuse_files=true " - USE_SLC=true - shift - ;; - --gn_path) - if [ -z "$2" ]; then - echo "--gn_path requires a path to GN" - exit 1 - else - GN_PATH="$2" - fi - GN_PATH_PROVIDED=true - shift - shift - ;; - *"sl_matter_version_str="*) - optArgs+="$1 " - USE_GIT_SHA_FOR_VERSION=false - shift - ;; - *) - if [ "$1" =~ *"use_rs9116=true"* ] || [ "$1" =~ *"use_SiWx917=true"* ] || [ "$1" =~ *"use_wf200=true"* ]; then + --clean) + DIR_CLEAN=true + shift + ;; + --wifi) + if [ -z "$2" ]; then + echo "--wifi requires rs9116 or SiWx917 or wf200" + exit 1 + fi + if [ "$2" = "rs9116" ]; then + optArgs+="use_rs9116=true " + elif [ "$2" = "SiWx917" ]; then + optArgs+="use_SiWx917=true " + elif [ "$2" = "wf200" ]; then + optArgs+="use_wf200=true " + else + echo "Wifi usage: --wifi rs9116|SiWx917|wf200" + exit 1 + fi USE_WIFI=true - # NCP Mode so base MCU is an EFR32 optArgs+="chip_device_platform =\"efr32\" " - fi - optArgs+=$1" " - shift - ;; + shift + shift + ;; + --icd) + optArgs+="chip_enable_icd_server=true chip_openthread_ftd=false " + shift + ;; + --low-power) + optArgs+="chip_build_libshell=false enable_openthread_cli=false show_qr_code=false disable_lcd=true " + shift + ;; + --chip_enable_wifi_ipv4) + optArgs="chip_enable_wifi_ipv4=true chip_inet_config_enable_ipv4=true " + shift + ;; + --additional_data_advertising) + optArgs+="chip_enable_additional_data_advertising=true chip_enable_rotating_device_id=true " + shift + ;; + --use_ot_lib) + optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" " + shift + ;; + --use_ot_coap_lib) + optArgs+="use_silabs_thread_lib=true chip_openthread_target=$SILABS_THREAD_TARGET openthread_external_platform=\"""\" use_thread_coap_lib=true " + shift + ;; + --use_chip_lwip_lib) + optArgs+="lwip_root=\""//third_party/connectedhomeip/third_party/lwip"\" " + shift + ;; + # Option not to be used until ot-efr32 github is updated + # --use_ot_github_sources) + # optArgs+="openthread_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/openthread\" openthread_efr32_root=\"//third_party/connectedhomeip/third_party/openthread/ot-efr32/src/src\"" + # shift + # ;; + --release) + optArgs+="is_debug=false disable_lcd=true chip_build_libshell=false enable_openthread_cli=false use_external_flash=false chip_logging=false silabs_log_enabled=false " + shift + ;; + --bootloader) + USE_BOOTLOADER=true + shift + ;; + --docker) + optArgs+="efr32_sdk_root=\"$GSDK_ROOT\" " + optArgs+="wiseconnect_sdk_root=\"$WISECONNECT_SDK_ROOT\" " + optArgs+="wifi_sdk_root=\"$WIFI_SDK_ROOT\" " + USE_DOCKER=true + shift + ;; + --uart_log) + optArgs+="sl_uart_log_output=true " + shift + ;; + + --slc_generate) + optArgs+="slc_generate=true " + USE_SLC=true + shift + ;; + --use_pw_rpc) + optArgs+="import(\"//with_pw_rpc.gni\") " + shift + ;; + --slc_reuse_files) + optArgs+="slc_reuse_files=true " + USE_SLC=true + shift + ;; + --gn_path) + if [ -z "$2" ]; then + echo "--gn_path requires a path to GN" + exit 1 + else + GN_PATH="$2" + fi + GN_PATH_PROVIDED=true + shift + shift + ;; + *"sl_matter_version_str="*) + optArgs+="$1 " + USE_GIT_SHA_FOR_VERSION=false + shift + ;; + *) + if [ "$1" =~ *"use_rs9116=true"* ] || [ "$1" =~ *"use_SiWx917=true"* ] || [ "$1" =~ *"use_wf200=true"* ]; then + USE_WIFI=true + # NCP Mode so base MCU is an EFR32 + optArgs+="chip_device_platform =\"efr32\" " + fi + optArgs+=$1" " + shift + ;; esac done From be42af44224ef96482035844de3ba024d192113f Mon Sep 17 00:00:00 2001 From: Mathieu Kardous Date: Thu, 1 Feb 2024 16:37:50 -0500 Subject: [PATCH 6/6] Enable ICDM cluster --- examples/window-app/common/window-app.matter | 97 ++++++++++++ examples/window-app/common/window-app.zap | 157 ++++++++++++++++++- 2 files changed, 253 insertions(+), 1 deletion(-) diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index c8308305b71a9e..feb7bc3d2adb38 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -1810,6 +1810,91 @@ cluster UserLabel = 65 { readonly attribute int16u clusterRevision = 65533; } +/** Allows servers to ensure that listed clients are notified when a server is available for communication. */ +cluster IcdManagement = 70 { + revision 2; + + enum OperatingModeEnum : enum8 { + kSIT = 0; + kLIT = 1; + } + + bitmap Feature : bitmap32 { + kCheckInProtocolSupport = 0x1; + kUserActiveModeTrigger = 0x2; + kLongIdleTimeSupport = 0x4; + } + + bitmap UserActiveModeTriggerBitmap : bitmap32 { + kPowerCycle = 0x1; + kSettingsMenu = 0x2; + kCustomInstruction = 0x4; + kDeviceManual = 0x8; + kActuateSensor = 0x10; + kActuateSensorSeconds = 0x20; + kActuateSensorTimes = 0x40; + kActuateSensorLightsBlink = 0x80; + kResetButton = 0x100; + kResetButtonLightsBlink = 0x200; + kResetButtonSeconds = 0x400; + kResetButtonTimes = 0x800; + kSetupButton = 0x1000; + kSetupButtonSeconds = 0x2000; + kSetupButtonLightsBlink = 0x4000; + kSetupButtonTimes = 0x8000; + kAppDefinedButton = 0x10000; + } + + fabric_scoped struct MonitoringRegistrationStruct { + fabric_sensitive node_id checkInNodeID = 1; + fabric_sensitive int64u monitoredSubject = 2; + fabric_idx fabricIndex = 254; + } + + readonly attribute int32u idleModeDuration = 0; + readonly attribute int32u activeModeDuration = 1; + readonly attribute int16u activeModeThreshold = 2; + readonly attribute access(read: administer) optional MonitoringRegistrationStruct registeredClients[] = 3; + readonly attribute access(read: administer) optional int32u ICDCounter = 4; + readonly attribute optional int16u clientsSupportedPerFabric = 5; + readonly attribute optional UserActiveModeTriggerBitmap userActiveModeTriggerHint = 6; + readonly attribute optional char_string<128> userActiveModeTriggerInstruction = 7; + readonly attribute optional OperatingModeEnum operatingMode = 8; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct RegisterClientRequest { + node_id checkInNodeID = 0; + int64u monitoredSubject = 1; + octet_string<16> key = 2; + optional octet_string<16> verificationKey = 3; + } + + response struct RegisterClientResponse = 1 { + int32u ICDCounter = 0; + } + + request struct UnregisterClientRequest { + node_id checkInNodeID = 0; + optional octet_string<16> verificationKey = 1; + } + + response struct StayActiveResponse = 4 { + int32u promisedActiveDuration = 0; + } + + /** Register a client to the end device */ + fabric command access(invoke: manage) RegisterClient(RegisterClientRequest): RegisterClientResponse = 0; + /** Unregister a client from an end device */ + fabric command access(invoke: manage) UnregisterClient(UnregisterClientRequest): DefaultSuccess = 2; + /** Request the end device to stay in Active Mode for an additional ActiveModeThreshold */ + command access(invoke: manage) StayActiveRequest(): StayActiveResponse = 3; +} + /** Provides an interface for controlling and adjusting automatic window coverings. */ cluster WindowCovering = 258 { revision 5; @@ -2360,6 +2445,18 @@ endpoint 0 { ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; } + + server cluster IcdManagement { + callback attribute idleModeDuration; + callback attribute activeModeDuration; + callback attribute activeModeThreshold; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0x0000; + ram attribute clusterRevision default = 2; + } } endpoint 1 { device type ma_windowcovering = 514, version 2; diff --git a/examples/window-app/common/window-app.zap b/examples/window-app/common/window-app.zap index 46ca5f520c42eb..801757e7561042 100644 --- a/examples/window-app/common/window-app.zap +++ b/examples/window-app/common/window-app.zap @@ -5065,6 +5065,160 @@ "reportableChange": 0 } ] + }, + { + "name": "ICD Management", + "code": 70, + "mfgCode": null, + "define": "ICD_MANAGEMENT_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "IdleModeDuration", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveModeDuration", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int32u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ActiveModeThreshold", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x0000", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] } ] }, @@ -7105,5 +7259,6 @@ "endpointId": 2, "networkId": 0 } - ] + ], + "log": [] } \ No newline at end of file