Skip to content

Commit

Permalink
[nrfconnect] Use [S]SED mode by default in a few examples (#19463)
Browse files Browse the repository at this point in the history
* [nrfconnect] Use [S]SED mode by default in a few examples

Reduce the number of build types in some Matter samples by:
1. Removing Low Power builds.
2. Enabling SED in Lock and Light Switch and SSED in Window
   Covering by default.
3. Enabling PM_DEVICE in release builds.

Signed-off-by: Damian Krolik <[email protected]>

* Restyled by prettier-markdown

* Expose SED intervals via Kconfig

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Jul 13, 2022
1 parent 52e3175 commit 1647924
Show file tree
Hide file tree
Showing 34 changed files with 87 additions and 268 deletions.
20 changes: 20 additions & 0 deletions config/zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,26 @@ config CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT
help
Enables Thread Sleepy End Device support in Matter.

if CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT

config CHIP_SED_IDLE_INTERVAL
int "Sleepy End Device idle interval (ms)"
default 1000
help
SED wake interval in milliseconds while the device is idle, meaning that
there is no active exchange to or from the device, and its commissioning
window is closed.

config CHIP_SED_ACTIVE_INTERVAL
int "Sleepy End Device active interval (ms)"
default 200
help
SED wake interval in milliseconds while the device is active, meaning that
there is an active exchange to or from the device, or its commissioning
window is open.

endif # CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT

config CHIP_THREAD_SSED
bool "Enable Thread Synchronized Sleepy End Device support"
depends on OPENTHREAD_CSL_RECEIVER && CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT
Expand Down
6 changes: 6 additions & 0 deletions docs/guides/nrfconnect_examples_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ following Kconfig options:
- `CONFIG_OPENTHREAD_MTD`
- `CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_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`

**Commissioning with NFC support**

You can configure the Matter protocol to use an NFC tag for commissioning,
Expand Down
19 changes: 2 additions & 17 deletions examples/all-clusters-app/nrfconnect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ certification of a Matter device communicating over a low-power, 802.15.4 Thread
network.

The example behaves as a Matter accessory, that is a device that can be paired
into an existing Matter network and can be controlled by this network.
into an existing Matter network and can be controlled by this network. The
device works as a Thread Minimal End Device.

<hr>

Expand Down Expand Up @@ -294,22 +295,6 @@ features like logs and command-line interface, run the following command:
Remember to replace _build-target_ with the build target name of the Nordic
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.

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
kit you own (for example `nrf52840dk_nrf52840`):

$ west build -b build-target -- -DOVERLAY_CONFIG=overlay-low_power.conf

For example, use the following command for `nrf52840dk_nrf52840`:

$ west build -b nrf52840dk_nrf52840 -- -DOVERLAY_CONFIG=overlay-low_power.conf

### Building with Device Firmware Upgrade support

Support for DFU using Matter OTA is disabled by default.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,3 @@
// Use a default pairing code if one hasn't been provisioned in flash.
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00

#define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL 2000_ms32
30 changes: 0 additions & 30 deletions examples/all-clusters-app/nrfconnect/overlay-low_power.conf

This file was deleted.

19 changes: 2 additions & 17 deletions examples/all-clusters-minimal-app/nrfconnect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ certification of a Matter device communicating over a low-power, 802.15.4 Thread
network.

The example behaves as a Matter accessory, that is a device that can be paired
into an existing Matter network and can be controlled by this network.
into an existing Matter network and can be controlled by this network. The
device works as a Thread Minimal End Device.

<hr>

Expand Down Expand Up @@ -294,22 +295,6 @@ features like logs and command-line interface, run the following command:
Remember to replace _build-target_ with the build target name of the Nordic
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.

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
kit you own (for example `nrf52840dk_nrf52840`):

$ west build -b build-target -- -DOVERLAY_CONFIG=overlay-low_power.conf

For example, use the following command for `nrf52840dk_nrf52840`:

$ west build -b nrf52840dk_nrf52840 -- -DOVERLAY_CONFIG=overlay-low_power.conf

### Building with Device Firmware Upgrade support

Support for DFU using Matter OTA is disabled by default.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,3 @@
// Use a default pairing code if one hasn't been provisioned in flash.
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00

#define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL 2000_ms32

This file was deleted.

19 changes: 2 additions & 17 deletions examples/light-switch-app/nrfconnect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ Semiconductor's nRF Connect SDK, and supports remote access and control of a
lighting examples over a low-power, 802.15.4 Thread network.

The example behaves as a Matter accessory, that is a device that can be paired
into an existing Matter network and can be controlled by this network.
into an existing Matter network and can be controlled by this network. The
device works as a Thread Sleepy End Device.

<hr>

Expand Down Expand Up @@ -452,22 +453,6 @@ features like logs and command-line interface, run the following command:
Remember to replace _build-target_ with the build target name of the Nordic
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.

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
kit you own (for example `nrf52840dk_nrf52840`):

$ west build -b build-target -- -DOVERLAY_CONFIG=overlay-low_power.conf

For example, use the following command for `nrf52840dk_nrf52840`:

$ west build -b nrf52840dk_nrf52840 -- -DOVERLAY_CONFIG=overlay-low_power.conf

### Building with Device Firmware Upgrade support

Support for DFU using Matter OTA is enabled by default.
Expand Down
4 changes: 1 addition & 3 deletions examples/light-switch-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,8 @@ CHIP_ERROR AppTask::Init()

#ifdef CONFIG_OPENTHREAD_MTD_SED
err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice);
#elif CONFIG_OPENTHREAD_MTD
err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
#else
err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
#endif
if (err != CHIP_NO_ERROR)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@
/* Use a default pairing code if one hasn't been provisioned in flash. */
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00
#define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL 2000_ms32
30 changes: 0 additions & 30 deletions examples/light-switch-app/nrfconnect/overlay-low_power.conf

This file was deleted.

1 change: 1 addition & 0 deletions examples/light-switch-app/nrfconnect/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y
CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y
CONFIG_OPENTHREAD_MTD=y
CONFIG_OPENTHREAD_FTD=n
CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y

# Bluetooth overrides
CONFIG_BT_DEVICE_NAME="MatterSwitch"
Expand Down
1 change: 1 addition & 0 deletions examples/light-switch-app/nrfconnect/prj_no_dfu.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y
CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y
CONFIG_OPENTHREAD_MTD=y
CONFIG_OPENTHREAD_FTD=n
CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y

# Bluetooth overrides
CONFIG_BT_DEVICE_NAME="MatterSwitch"
Expand Down
4 changes: 4 additions & 0 deletions examples/light-switch-app/nrfconnect/prj_release.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y
CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y
CONFIG_OPENTHREAD_MTD=y
CONFIG_OPENTHREAD_FTD=n
CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y

# Bluetooth overrides
CONFIG_BT_DEVICE_NAME="MatterSwitch"
Expand All @@ -41,6 +42,9 @@ CONFIG_CHIP_PROJECT_CONFIG="main/include/CHIPProjectConfig.h"
# 32772 == 0x8004 (example light-switch-app)
CONFIG_CHIP_DEVICE_PRODUCT_ID=32772

# Suspend devices when the CPU goes into sleep
CONFIG_PM_DEVICE=y

# Disable all debug features
CONFIG_SHELL=n
CONFIG_OPENTHREAD_SHELL=n
Expand Down
3 changes: 2 additions & 1 deletion examples/lighting-app/nrfconnect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Semiconductor's nRF Connect SDK, and supports remote access and control of a
lighting over a low-power, 802.15.4 Thread network.

The example behaves as a Matter accessory, that is a device that can be paired
into an existing Matter network and can be controlled by this network.
into an existing Matter network and can be controlled by this network. The
device works as a Thread Router.

<hr>

Expand Down
5 changes: 1 addition & 4 deletions examples/lighting-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,8 @@ CHIP_ERROR AppTask::Init()
return err;
}

#ifdef CONFIG_OPENTHREAD_MTD
err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
#else
err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
#endif

if (err != CHIP_NO_ERROR)
{
LOG_ERR("ConnectivityMgr().SetThreadDeviceType() failed");
Expand Down
19 changes: 2 additions & 17 deletions examples/lock-app/nrfconnect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ Semiconductor's nRF Connect SDK, and supports remote access and control of a
simulated door lock over a low-power, 802.15.4 Thread network.

The example behaves as a Matter accessory, that is a device that can be paired
into an existing Matter network and can be controlled by this network.
into an existing Matter network and can be controlled by this network. The
device works as a Thread Sleepy End Device.

<hr>

Expand Down Expand Up @@ -381,22 +382,6 @@ features like logs and command-line interface, run the following command:
Remember to replace _build-target_ with the build target name of the Nordic
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.

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
kit you own (for example `nrf52840dk_nrf52840`):

$ west build -b build-target -- -DOVERLAY_CONFIG=overlay-low_power.conf

For example, use the following command for `nrf52840dk_nrf52840`:

$ west build -b nrf52840dk_nrf52840 -- -DOVERLAY_CONFIG=overlay-low_power.conf

### Building with Device Firmware Upgrade support

Support for DFU using Matter OTA is enabled by default.
Expand Down
4 changes: 1 addition & 3 deletions examples/lock-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,8 @@ CHIP_ERROR AppTask::Init()

#ifdef CONFIG_OPENTHREAD_MTD_SED
err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice);
#elif CONFIG_OPENTHREAD_MTD
err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
#else
err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
#endif
if (err != CHIP_NO_ERROR)
{
Expand Down
2 changes: 0 additions & 2 deletions examples/lock-app/nrfconnect/main/include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,3 @@
// Use a default pairing code if one hasn't been provisioned in flash.
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_PIN_CODE 20202021
#define CHIP_DEVICE_CONFIG_USE_TEST_SETUP_DISCRIMINATOR 0xF00

#define CHIP_DEVICE_CONFIG_SED_IDLE_INTERVAL 20000_ms32
30 changes: 0 additions & 30 deletions examples/lock-app/nrfconnect/overlay-low_power.conf

This file was deleted.

Loading

0 comments on commit 1647924

Please sign in to comment.