-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
samples: matter: added thermostat sample application
Created example application for thermostat device, able to read temperature from external temperature sensor or use mocked temperature values. Signed-off-by: Patryk Lipinski <patryk.lipinski@nordicsemi.no>
- Loading branch information
1 parent
93e7fcc
commit 8104c0e
Showing
63 changed files
with
14,465 additions
and
31 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
74 changes: 43 additions & 31 deletions
74
doc/nrf/protocols/matter/getting_started/hw_requirements.rst
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# | ||
# Copyright (c) 2023 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
cmake_minimum_required(VERSION 3.20.0) | ||
|
||
# Set Kconfig root files that will be processed as a first Kconfig for used child images. | ||
set(mcuboot_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.mcuboot.root") | ||
set(multiprotocol_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.root") | ||
set(hci_rpmsg_KCONFIG_ROOT "\\\${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/chip-module/Kconfig.hci_rpmsg.root") | ||
|
||
# For prj.conf the CONF_FILE is empty. In other case extract the exact file name from the path string. | ||
if(CONF_FILE) | ||
get_filename_component(CONFIG_FILE_NAME ${CONF_FILE} NAME) | ||
endif() | ||
|
||
if(NOT CONFIG_FILE_NAME STREQUAL "prj_no_dfu.conf") | ||
set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}/pm_static_dfu.yml) | ||
endif() | ||
|
||
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE}) | ||
|
||
project(matter-template) | ||
|
||
set(COMMON_ROOT ${ZEPHYR_NRF_MODULE_DIR}/samples/matter/common) | ||
set(NLIO_ROOT ${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/third_party/nlio/repo) | ||
include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/config/nrfconnect/app/enable-gnu-std.cmake) | ||
include(${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/src/app/chip_data_model.cmake) | ||
|
||
# NORDIC SDK APP START | ||
target_include_directories(app PRIVATE | ||
src | ||
${COMMON_ROOT}/src | ||
${NLIO_ROOT}/include | ||
${ZEPHYR_CONNECTEDHOMEIP_MODULE_DIR}/zzz_generated/app-common | ||
) | ||
|
||
target_sources(app PRIVATE | ||
src/app_task.cpp | ||
src/main.cpp | ||
src/temp_sensor_manager.cpp | ||
src/temperature_manager.cpp | ||
src/zcl_callbacks.cpp | ||
src/zap-generated/IMClusterCommandHandler.cpp | ||
src/zap-generated/callback-stub.cpp | ||
src/binding_handler.cpp | ||
${COMMON_ROOT}/src/led_widget.cpp | ||
) | ||
|
||
|
||
if(CONFIG_CHIP_OTA_REQUESTOR OR CONFIG_MCUMGR_TRANSPORT_BT) | ||
target_sources(app PRIVATE ${COMMON_ROOT}/src/ota_util.cpp) | ||
endif() | ||
|
||
if(CONFIG_MCUMGR_TRANSPORT_BT) | ||
target_sources(app PRIVATE ${COMMON_ROOT}/src/dfu_over_smp.cpp) | ||
endif() | ||
|
||
if(CONFIG_THERMOSTAT_EXTERNAL_SENSOR) | ||
target_sources(app PRIVATE src/temperature_measurement/real_temp.cpp) | ||
else() | ||
target_sources(app PRIVATE src/temperature_measurement/simulated_temp.cpp) | ||
endif() | ||
|
||
|
||
chip_configure_data_model(app | ||
INCLUDE_SERVER | ||
BYPASS_IDL | ||
GEN_DIR src/zap-generated | ||
ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/src/thermostat.zap | ||
) | ||
# NORDIC SDK APP END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# | ||
# Copyright (c) 2023 Nordic Semiconductor | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
mainmenu "Matter Thermostat sample application" | ||
|
||
config THERMOSTAT_EXTERNAL_SENSOR | ||
bool "Select if the temperature measurement is provided directly from an external sensor." | ||
help | ||
Set to true to enable the temperature measurement from a physical external sensor. Set to false to simulate the temperature measurement. | ||
|
||
config THERMOSTAT_TEMPERATURE_STEP | ||
int "Defines a simulated temperature step. Use 0 for random." | ||
default 0 | ||
help | ||
A temperature step that defines differences between consecutive simulated temperature measurements. If set to 0, then the step is random. | ||
|
||
config THERMOSTAT_SIMULATED_TEMPERATURE_MAX | ||
int "Maximum simulated temperature value." | ||
default 3000 | ||
|
||
config THERMOSTAT_SIMULATED_TEMPERATURE_MIN | ||
int "Minimum simulated temperature value." | ||
default 1500 | ||
|
||
config THERMOSTAT_SIMULATED_TEMPERATURE_CHANGE | ||
bool "Select to set the temperature to rise or fall." | ||
default y | ||
help | ||
If set to true, the simulated temperature is rising. If set to false, the simulated temperature is falling. | ||
|
||
|
||
# Sample configuration used for Thread networking | ||
if NET_L2_OPENTHREAD | ||
|
||
choice OPENTHREAD_NORDIC_LIBRARY_CONFIGURATION | ||
default OPENTHREAD_NORDIC_LIBRARY_MTD | ||
endchoice | ||
|
||
choice OPENTHREAD_DEVICE_TYPE | ||
default OPENTHREAD_MTD | ||
endchoice | ||
|
||
endif # NET_L2_OPENTHREAD | ||
|
||
source "${ZEPHYR_BASE}/../modules/lib/matter/config/nrfconnect/chip-module/Kconfig.features" | ||
source "${ZEPHYR_BASE}/../modules/lib/matter/config/nrfconnect/chip-module/Kconfig.defaults" | ||
source "Kconfig.zephyr" |
Oops, something went wrong.