From 7111fd55b5262a28f92bb749d5ba34abfb71fb96 Mon Sep 17 00:00:00 2001 From: markaj-nordic <98948394+markaj-nordic@users.noreply.github.com> Date: Tue, 10 May 2022 10:12:32 +0200 Subject: [PATCH] [nrfconnect] add support for SSED in window-app. (#18198) Signed-off-by: Marcin Kajor --- examples/window-app/nrfconnect/README.md | 4 ++-- examples/window-app/nrfconnect/main/AppTask.cpp | 3 +++ .../window-app/nrfconnect/main/include/CHIPProjectConfig.h | 7 ++++++- examples/window-app/nrfconnect/overlay-low_power.conf | 3 +++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/examples/window-app/nrfconnect/README.md b/examples/window-app/nrfconnect/README.md index 8cf7548a42f8fb..526a19004bf8bd 100644 --- a/examples/window-app/nrfconnect/README.md +++ b/examples/window-app/nrfconnect/README.md @@ -377,8 +377,8 @@ Semiconductor's kit you own. ### Building with low-power configuration You can build the example using the low-power configuration, which enables -Thread's Sleepy End Device mode and disables debug features, such as the UART -console or the **LED 1** usage. +Thread's Synchronized Sleepy End Device mode and disables debug features, such +as the UART console or the **LED 1** usage. To build for the low-power configuration, run the following command with _build-target_ replaced with the build target name of the Nordic Semiconductor's diff --git a/examples/window-app/nrfconnect/main/AppTask.cpp b/examples/window-app/nrfconnect/main/AppTask.cpp index a03f5e28401a56..7f186f635bf315 100644 --- a/examples/window-app/nrfconnect/main/AppTask.cpp +++ b/examples/window-app/nrfconnect/main/AppTask.cpp @@ -100,9 +100,12 @@ CHIP_ERROR AppTask::Init() #ifdef CONFIG_OPENTHREAD_MTD_SED err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice); +#elif CONFIG_CHIP_THREAD_SSED + err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SynchronizedSleepyEndDevice); #else err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice); #endif + if (err != CHIP_NO_ERROR) { LOG_ERR("ConnectivityMgr().SetThreadDeviceType() failed"); diff --git a/examples/window-app/nrfconnect/main/include/CHIPProjectConfig.h b/examples/window-app/nrfconnect/main/include/CHIPProjectConfig.h index 49000724fc6c47..df571c7319dd07 100644 --- a/examples/window-app/nrfconnect/main/include/CHIPProjectConfig.h +++ b/examples/window-app/nrfconnect/main/include/CHIPProjectConfig.h @@ -30,4 +30,9 @@ #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021 #define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00 -#define CHIP_DEVICE_CONFIG_SED_SLOW_POLLING_INTERVAL 2000_ms32 +#ifdef CONFIG_CHIP_THREAD_SSED +#define CHIP_DEVICE_CONFIG_SED_ACTIVE_INTERVAL 1000_ms32 +#define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL 1000_ms32 +#else +#define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL 2000_ms32 +#endif diff --git a/examples/window-app/nrfconnect/overlay-low_power.conf b/examples/window-app/nrfconnect/overlay-low_power.conf index c962425f6ef937..602eb4f76784e2 100644 --- a/examples/window-app/nrfconnect/overlay-low_power.conf +++ b/examples/window-app/nrfconnect/overlay-low_power.conf @@ -17,6 +17,9 @@ # Enable MTD Sleepy End Device CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y +# Enable Thread CSL to support Synchronized SED +CONFIG_CHIP_THREAD_SSED=y + # Disable UART console CONFIG_SHELL=n CONFIG_LOG=n