diff --git a/.github/workflows/examples-tv-app.yaml b/.github/workflows/examples-tv-app.yaml
new file mode 100644
index 00000000000000..fff6cbb39d1acb
--- /dev/null
+++ b/.github/workflows/examples-tv-app.yaml
@@ -0,0 +1,72 @@
+# 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.
+
+name: Build example - TV App and TV Casting App
+
+on:
+ push:
+ pull_request:
+ merge_group:
+
+concurrency:
+ group: ${{ github.ref }}-${{ github.workflow }}-${{ (github.event_name == 'pull_request' && github.event.number) || (github.event_name == 'workflow_dispatch' && github.run_number) || github.sha }}
+ cancel-in-progress: true
+
+env:
+ CHIP_NO_LOG_TIMESTAMPS: true
+
+jobs:
+ tv-app:
+ name: TV App
+
+ env:
+ BUILD_TYPE: tv_app
+
+ runs-on: ubuntu-latest
+ if: github.actor != 'restyled-io[bot]'
+
+ container:
+ image: ghcr.io/project-chip/chip-build-android:35
+ volumes:
+ - "/tmp/bloat_reports:/tmp/bloat_reports"
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ - name: Checkout submodules & Bootstrap
+ uses: ./.github/actions/checkout-submodules-and-bootstrap
+ with:
+ platform: android
+ - name: Set up environment for size reports
+ uses: ./.github/actions/setup-size-reports
+ if: ${{ !env.ACT }}
+ with:
+ gh-context: ${{ toJson(github) }}
+ - name: Build Android arm64-tv-casting-app
+ run: |
+ ./scripts/run_in_build_env.sh \
+ "./scripts/build/build_examples.py --target android-arm64-tv-casting-app build"
+ - name: Clean out build output
+ run: rm -rf ./out examples/tv-casting-app/android/App/app/libs/jniLibs/* examples/tv-casting-app/android/App/app/libs/*.jar
+ - name: Build Android arm64-tv-server
+ run: |
+ ./scripts/run_in_build_env.sh \
+ "./scripts/build/build_examples.py --target android-arm64-tv-server build"
+ - name: Clean out build output
+ run: rm -rf ./out examples/tv-app/android/App/app/libs/jniLibs/* examples/tv-app/android/App/app/libs/*.jar
+ - name: Uploading Size Reports
+ uses: ./.github/actions/upload-size-reports
+ if: ${{ !env.ACT }}
+ with:
+ platform-name: TVApp
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 92d5ca3598c6b4..189f63837c841e 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -119,7 +119,6 @@ jobs:
--known-failure app/reporting/tests/MockReportScheduler.h \
--known-failure app/server/AppDelegate.h \
--known-failure app/TestEventTriggerDelegate.h \
- --known-failure app/util/af-enums.h \
--known-failure app/util/af.h \
--known-failure app/util/af-types.h \
--known-failure app/util/attribute-metadata.h \
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
index af9ee570102fac..05d2670edd665e 100644
--- a/.github/workflows/tests.yaml
+++ b/.github/workflows/tests.yaml
@@ -526,6 +526,18 @@ jobs:
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TestMatterTestingSupport.py" --script-args "--trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --script "src/python_testing/TestSpecParsingSupport.py" --script-args "--trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py'
+ scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OPSTATE_1_1.py" --script-args "--endpoint 1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
+ scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OPSTATE_2_1.py" --script-args "--endpoint 1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
+ scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OPSTATE_2_2.py" --script-args "--endpoint 1 --int-arg PIXIT.WAITTIME.COUNTDOWN:5 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
+ scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OPSTATE_2_3.py" --script-args "--endpoint 1 --int-arg PIXIT.WAITTIME.COUNTDOWN:5 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
+ scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OPSTATE_2_4.py" --script-args "--endpoint 1 --int-arg PIXIT.OPSTATE.ErrorEventGen:1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
+ scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OPSTATE_2_5.py" --script-args "--endpoint 1 --int-arg PIXIT.WAITTIME.REBOOT:5 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
+ scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OVENOPSTATE_1_1.py" --script-args "--endpoint 1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
+ scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OVENOPSTATE_2_1.py" --script-args "--endpoint 1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
+ scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OVENOPSTATE_2_2.py" --script-args "--endpoint 1 --int-arg PIXIT.WAITTIME.COUNTDOWN:5 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
+ scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OVENOPSTATE_2_3.py" --script-args "--endpoint 1 --int-arg PIXIT.WAITTIME.COUNTDOWN:5 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
+ scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OVENOPSTATE_2_4.py" --script-args "--endpoint 1 --int-arg PIXIT.OVENOPSTATE.ErrorEventGen:1 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
+ scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace-to json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_OVENOPSTATE_2_5.py" --script-args "--endpoint 1 --int-arg PIXIT.WAITTIME.REBOOT:5 --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-microwave-oven-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-microwave-oven-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_file json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_MWOCTRL_2_2.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-microwave-oven-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-microwave-oven-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_file json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_MWOCTRL_2_3.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --app out/linux-x64-microwave-oven-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-microwave-oven-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_file json:out/trace_data/app-{SCRIPT_BASE_NAME}.json" --script "src/python_testing/TC_MWOCTRL_2_4.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:out/trace_data/test-{SCRIPT_BASE_NAME}.json --trace-to perfetto:out/trace_data/test-{SCRIPT_BASE_NAME}.perfetto"'
diff --git a/.github/workflows/unit_integration_test.yaml b/.github/workflows/unit_integration_test.yaml
index f1be1a194a1b46..62231116bb92c1 100644
--- a/.github/workflows/unit_integration_test.yaml
+++ b/.github/workflows/unit_integration_test.yaml
@@ -65,7 +65,7 @@ jobs:
"clang") GN_ARGS='is_clang=true';;
"mbedtls") GN_ARGS='chip_crypto="mbedtls"';;
"rotating_device_id") GN_ARGS='chip_crypto="boringssl" chip_enable_rotating_device_id=true';;
- "icd") GN_ARGS='chip_enable_icd_server=true';;
+ "icd") GN_ARGS='chip_enable_icd_server=true chip_enable_icd_lit=true';;
*) ;;
esac
diff --git a/BUILD.gn b/BUILD.gn
index e201b56ceac00d..838ea743f348c8 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -626,8 +626,10 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") {
if (enable_linux_lit_icd_app_build) {
group("linux_lit_icd_app") {
- deps =
- [ "${chip_root}/examples/lit-icd-app/linux(${standalone_toolchain})" ]
+ lit_icd_standalone_toolchain =
+ "${chip_root}/config/standalone/toolchain:lit_icd"
+
+ deps = [ "${chip_root}/examples/lit-icd-app/linux(${lit_icd_standalone_toolchain})" ]
}
extra_build_deps += [ ":linux_lit_icd_app" ]
diff --git a/config/nrfconnect/chip-module/CMakeLists.txt b/config/nrfconnect/chip-module/CMakeLists.txt
index 672bf5834da196..9b81d7cf30282e 100644
--- a/config/nrfconnect/chip-module/CMakeLists.txt
+++ b/config/nrfconnect/chip-module/CMakeLists.txt
@@ -139,6 +139,12 @@ matter_add_gn_arg_bool ("chip_enable_icd_server" CONFIG_CHIP_EN
matter_add_gn_arg_bool ("chip_enable_factory_data" CONFIG_CHIP_FACTORY_DATA)
matter_add_gn_arg_bool ("chip_enable_read_client" CONFIG_CHIP_ENABLE_READ_CLIENT)
+if (CONFIG_CHIP_ENABLE_ICD_SUPPORT)
+ matter_add_gn_arg_bool ("chip_enable_icd_lit" CONFIG_CHIP_ICD_LIT_SUPPORT)
+ matter_add_gn_arg_bool ("chip_enable_icd_checkin" CONFIG_CHIP_ICD_CHECK_IN_SUPPORT)
+ matter_add_gn_arg_bool ("chip_enable_icd_user_active_mode_trigger" CONFIG_CHIP_ICD_UAT_SUPPORT)
+endif()
+
if (CONFIG_CHIP_FACTORY_DATA OR CONFIG_CHIP_FACTORY_DATA_CUSTOM_BACKEND)
matter_add_gn_arg_bool("chip_use_transitional_commissionable_data_provider" FALSE)
matter_add_gn_arg_bool("chip_use_transitional_device_instance_info_provider" FALSE)
diff --git a/config/nxp/chip-module/Kconfig b/config/nxp/chip-module/Kconfig
index 88918a67450ad3..7ee0917ebec555 100644
--- a/config/nxp/chip-module/Kconfig
+++ b/config/nxp/chip-module/Kconfig
@@ -208,7 +208,7 @@ endif #CHIP_FACTORY_DATA_BUILD
# See config/zephyr/Kconfig for full definition
config CHIP_FACTORY_RESET_ERASE_NVS
bool
- default y if CHIP_FACTORY_DATA || CHIP_FACTORY_DATA_CUSTOM_BACKEND
+ default y
endif
diff --git a/config/nxp/chip-module/Kconfig.defaults b/config/nxp/chip-module/Kconfig.defaults
index 56c82e3752900c..531a3f38245aad 100644
--- a/config/nxp/chip-module/Kconfig.defaults
+++ b/config/nxp/chip-module/Kconfig.defaults
@@ -87,7 +87,7 @@ config PTHREAD_IPC
config POSIX_MAX_FDS
int
- default 16
+ default 8
# Application stack size
config MAIN_STACK_SIZE
@@ -99,12 +99,21 @@ config INIT_STACKS
config NET_MGMT_EVENT_STACK_SIZE
default 2048
+config NET_MGMT_EVENT_QUEUE_SIZE
+ default 20
+
config NET_IPV6_MLD
default y
config NET_IF_MCAST_IPV6_ADDR_COUNT
default 14
+config NET_IF_MAX_IPV4_COUNT
+ default 2
+
+config NET_IF_MAX_IPV6_COUNT
+ default 2
+
config NET_TC_TX_COUNT
default 1
@@ -129,10 +138,10 @@ config NET_TC_RX_THREAD_BASE_PRIO
# Network buffers
config NET_PKT_RX_COUNT
- default 16
+ default 60
config NET_PKT_TX_COUNT
- default 16
+ default 40
config NET_BUF_RX_COUNT
default 60
@@ -141,7 +150,7 @@ config NET_BUF_TX_COUNT
default 80
config NET_BUF_DATA_SIZE
- default 1700
+ default 1744
# Bluetooth Low Energy configs
@@ -233,11 +242,14 @@ choice WPA_SUPP_LOG_LEVEL_CHOICE
endchoice
config WPA_SUPP_THREAD_STACK_SIZE
- default 6144
+ default 12288
config SYSTEM_WORKQUEUE_STACK_SIZE
default 2048
+config NET_TCP_WORKQ_STACK_SIZE
+ default 2048
+
# align these numbers to match the OpenThread config
config NET_IF_UNICAST_IPV6_ADDR_COUNT
default 6
@@ -246,7 +258,25 @@ config NET_IF_MCAST_IPV6_ADDR_COUNT
default 8
config NET_SOCKETS_POLL_MAX
- default 4
+ default 8
+
+config NET_IPV4_FRAGMENT_MAX_COUNT
+ default 3
+
+config NET_IPV4_FRAGMENT_MAX_PKT
+ default 7
+
+config NET_IPV4_FRAGMENT_TIMEOUT
+ default 3
+
+config NET_IPV6_FRAGMENT_MAX_COUNT
+ default 3
+
+config NET_IPV6_FRAGMENT_MAX_PKT
+ default 7
+
+config NET_IPV6_FRAGMENT_TIMEOUT
+ default 3
# options managed by IP4/IP6 simultaneous support
# aligned here to match OpenThread config
@@ -260,7 +290,7 @@ config SHELL_STACK_SIZE
default 2616
config HEAP_MEM_POOL_SIZE
- default 65536
+ default 122880
config CHIP_MALLOC_SYS_HEAP_SIZE
default 28672 # 28 kB
diff --git a/config/standalone/toolchain/BUILD.gn b/config/standalone/toolchain/BUILD.gn
index 8e9160fe097216..58e284cdc38a77 100644
--- a/config/standalone/toolchain/BUILD.gn
+++ b/config/standalone/toolchain/BUILD.gn
@@ -25,3 +25,12 @@ gcc_toolchain("standalone") {
import("${chip_root}/config/standalone/args.gni")
}
}
+
+gcc_toolchain("lit_icd") {
+ toolchain_args = {
+ current_os = host_os
+ current_cpu = host_cpu
+ is_clang = false
+ import("${chip_root}/examples/lit-icd-app/linux/args.gni")
+ }
+}
diff --git a/config/telink/chip-module/CMakeLists.txt b/config/telink/chip-module/CMakeLists.txt
index 418dbc07e0ba0b..7862d5f8b95d8e 100644
--- a/config/telink/chip-module/CMakeLists.txt
+++ b/config/telink/chip-module/CMakeLists.txt
@@ -104,6 +104,12 @@ matter_add_gn_arg_bool ("chip_detail_logging" CONFIG_MATTER_
matter_add_gn_arg_bool ("chip_automation_logging" FALSE)
matter_add_gn_arg_bool ("chip_enable_icd_server" CONFIG_CHIP_ENABLE_ICD_SUPPORT)
+if (CONFIG_CHIP_ENABLE_ICD_SUPPORT)
+ matter_add_gn_arg_bool ("chip_enable_icd_lit" CONFIG_CHIP_ICD_LIT_SUPPORT)
+ matter_add_gn_arg_bool ("chip_enable_icd_checkin" CONFIG_CHIP_ICD_CHECK_IN_SUPPORT)
+ matter_add_gn_arg_bool ("chip_enable_icd_user_active_mode_trigger" CONFIG_CHIP_ICD_UAT_SUPPORT)
+endif()
+
if (CONFIG_CHIP_FACTORY_DATA)
matter_add_gn_arg_bool ("chip_use_transitional_commissionable_data_provider" "false")
matter_add_gn_arg_bool ("chip_enable_factory_data" "true")
diff --git a/config/zephyr/Kconfig b/config/zephyr/Kconfig
index 8df6c418aa42e3..ad36a663b5fd1f 100644
--- a/config/zephyr/Kconfig
+++ b/config/zephyr/Kconfig
@@ -334,6 +334,7 @@ if CHIP_ENABLE_ICD_SUPPORT
config CHIP_ICD_SLOW_POLL_INTERVAL
int "Intermittently Connected Device slow polling interval (ms)"
+ default 30000 if CHIP_ICD_LIT_SUPPORT
default 1000
help
Provides the Intermittently Connected Device slow polling interval in milliseconds while the
@@ -347,33 +348,57 @@ config CHIP_ICD_FAST_POLLING_INTERVAL
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.
+ CHIP_ICD_ACTIVE_MODE_DURATION.
-config CHIP_ICD_IDLE_MODE_INTERVAL
- int "Intermittently Connected Device idle mode interval (s)"
+config CHIP_ICD_IDLE_MODE_DURATION
+ int "Intermittently Connected Device idle mode duration (s)"
+ default 300 if CHIP_ICD_LIT_SUPPORT
default 120
help
- Provides the Intermittently Connected Device idle mode interval in seconds.
+ Provides the Intermittently Connected Device idle mode duration in 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)"
+config CHIP_ICD_ACTIVE_MODE_DURATION
+ int "Intermittently Connected Device active mode duration (ms)"
default 300
help
- Provides the Intermittently Connected Device active mode interval in milliseconds.
+ Provides the Intermittently Connected Device active mode duration in 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 5000 if CHIP_ICD_LIT_SUPPORT
default 300
help
Provides the Intermittently Connected Device active mode threshold in milliseconds.
It determines the minimum amount of time the device shall stay in the active mode after the network activity.
+ For LIT devices it cannot be set to a value smaller than 5000 ms.
+
+config CHIP_ICD_LIT_SUPPORT
+ bool "Intermittenly Connected Device Long Idle Time support"
+ imply CHIP_ICD_CHECK_IN_SUPPORT
+ imply CHIP_ICD_UAT_SUPPORT
+ help
+ Enables the Intermittently Connected Device Long Idle Time support in Matter.
+ It also implies the ICD Check-In and UAT features support that are mandatory for LIT device.
+
+config CHIP_ICD_CHECK_IN_SUPPORT
+ bool "Intermittenly Connected Device Check-In protocol support"
+ help
+ Enables the Check-In protocol support in Matter. It allows an ICD device to notify the registered
+ ICD clients that it is available for communication.
+
+config CHIP_ICD_UAT_SUPPORT
+ bool "Intermittenly Connected Device User Active Mode Trigger support"
+ help
+ Enables the User Active Mode Trigger (UAT) support in Matter. It allows the User to use application specific
+ means (e.g. button press) to trigger an ICD device to enter the active mode and become responsive.
config CHIP_ICD_CLIENTS_PER_FABRIC
int "Intermittently Connected Device number of clients per fabric"
default 2
+ depends on CHIP_ICD_CHECK_IN_SUPPORT
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.
diff --git a/data_model/clusters/Mode_Laundry.xml b/data_model/clusters/Mode_Laundry.xml
deleted file mode 100644
index 63108a01aa876b..00000000000000
--- a/data_model/clusters/Mode_Laundry.xml
+++ /dev/null
@@ -1,92 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
index 64d3a8f6283dba..ebb9b3da83929b 100644
--- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
+++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter
@@ -7831,8 +7831,11 @@ endpoint 1 {
}
server cluster OvenCavityOperationalState {
+ emits event OperationalError;
+ emits event OperationCompletion;
callback attribute phaseList;
callback attribute currentPhase;
+ callback attribute countdownTime;
callback attribute operationalStateList;
callback attribute operationalState;
callback attribute operationalError;
@@ -7842,6 +7845,12 @@ endpoint 1 {
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;
+
+ handle command Pause;
+ handle command Stop;
+ handle command Start;
+ handle command Resume;
+ handle command OperationalCommandResponse;
}
server cluster OvenMode {
@@ -8076,7 +8085,7 @@ endpoint 1 {
callback attribute acceptedCommandList;
callback attribute attributeList;
ram attribute featureMap default = 0;
- ram attribute clusterRevision default = 1;
+ ram attribute clusterRevision default = 2;
handle command Pause;
handle command Stop;
@@ -8301,11 +8310,9 @@ endpoint 1 {
callback attribute supplyState;
callback attribute faultState;
callback attribute chargingEnabledUntil;
- callback attribute dischargingEnabledUntil;
callback attribute circuitCapacity;
callback attribute minimumChargeCurrent;
callback attribute maximumChargeCurrent;
- callback attribute maximumDischargeCurrent;
callback attribute userMaximumChargeCurrent;
callback attribute randomizationDelayWindow;
callback attribute nextChargeStartTime;
@@ -8313,13 +8320,9 @@ endpoint 1 {
callback attribute nextChargeRequiredEnergy;
callback attribute nextChargeTargetSoC;
callback attribute approximateEVEfficiency;
- callback attribute stateOfCharge;
- callback attribute batteryCapacity;
- callback attribute vehicleID;
callback attribute sessionID;
callback attribute sessionDuration;
callback attribute sessionEnergyCharged;
- callback attribute sessionEnergyDischarged;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
index cb3e8ec2930b5e..1666cef4adc1b8 100644
--- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
+++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
@@ -17,6 +17,12 @@
}
],
"package": [
+ {
+ "pathRelativity": "relativeToZap",
+ "path": "../../../src/app/zap-templates/app-templates.json",
+ "type": "gen-templates-json",
+ "version": "chip-v1"
+ },
{
"pathRelativity": "relativeToZap",
"path": "../../../src/app/zap-templates/zcl/zcl-with-test-extensions.json",
@@ -24,12 +30,6 @@
"category": "matter",
"version": 1,
"description": "Matter SDK ZCL data with some extensions"
- },
- {
- "pathRelativity": "relativeToZap",
- "path": "../../../src/app/zap-templates/app-templates.json",
- "type": "gen-templates-json",
- "version": "chip-v1"
}
],
"endpointTypes": [
@@ -3097,10 +3097,10 @@
"side": "server",
"type": "bitmap32",
"included": 1,
- "storageOption": "RAM",
+ "storageOption": "External",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0",
+ "defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -3113,10 +3113,10 @@
"side": "server",
"type": "int16u",
"included": 1,
- "storageOption": "RAM",
+ "storageOption": "External",
"singleton": 0,
"bounded": 0,
- "defaultValue": "0x0002",
+ "defaultValue": null,
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
@@ -8227,6 +8227,48 @@
"side": "server",
"enabled": 1,
"apiMaturity": "provisional",
+ "commands": [
+ {
+ "name": "Pause",
+ "code": 0,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "Stop",
+ "code": 1,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "Start",
+ "code": 2,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "Resume",
+ "code": 3,
+ "mfgCode": null,
+ "source": "client",
+ "isIncoming": 1,
+ "isEnabled": 1
+ },
+ {
+ "name": "OperationalCommandResponse",
+ "code": 4,
+ "mfgCode": null,
+ "source": "server",
+ "isIncoming": 0,
+ "isEnabled": 1
+ }
+ ],
"attributes": [
{
"name": "PhaseList",
@@ -8260,6 +8302,22 @@
"maxInterval": 65534,
"reportableChange": 0
},
+ {
+ "name": "CountdownTime",
+ "code": 2,
+ "mfgCode": null,
+ "side": "server",
+ "type": "elapsed_s",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": "",
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
{
"name": "OperationalStateList",
"code": 3,
@@ -8404,6 +8462,22 @@
"maxInterval": 65534,
"reportableChange": 0
}
+ ],
+ "events": [
+ {
+ "name": "OperationalError",
+ "code": 0,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ },
+ {
+ "name": "OperationCompletion",
+ "code": 1,
+ "mfgCode": null,
+ "side": "server",
+ "included": 1
+ }
]
},
{
@@ -8570,6 +8644,7 @@
"define": "LAUNDRY_DRYER_CONTROLS_CLUSTER",
"side": "server",
"enabled": 1,
+ "apiMaturity": "provisional",
"attributes": [
{
"name": "SupportedDrynessLevels",
@@ -11175,7 +11250,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
- "defaultValue": "1",
+ "defaultValue": "2",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -13815,22 +13890,6 @@
"maxInterval": 65534,
"reportableChange": 0
},
- {
- "name": "DischargingEnabledUntil",
- "code": 4,
- "mfgCode": null,
- "side": "server",
- "type": "epoch_s",
- "included": 1,
- "storageOption": "External",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": null,
- "reportable": 1,
- "minInterval": 1,
- "maxInterval": 65534,
- "reportableChange": 0
- },
{
"name": "CircuitCapacity",
"code": 5,
@@ -13879,22 +13938,6 @@
"maxInterval": 65534,
"reportableChange": 0
},
- {
- "name": "MaximumDischargeCurrent",
- "code": 8,
- "mfgCode": null,
- "side": "server",
- "type": "amperage_ma",
- "included": 1,
- "storageOption": "External",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": null,
- "reportable": 1,
- "minInterval": 1,
- "maxInterval": 65534,
- "reportableChange": 0
- },
{
"name": "UserMaximumChargeCurrent",
"code": 9,
@@ -14007,54 +14050,6 @@
"maxInterval": 65534,
"reportableChange": 0
},
- {
- "name": "StateOfCharge",
- "code": 48,
- "mfgCode": null,
- "side": "server",
- "type": "percent",
- "included": 1,
- "storageOption": "External",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": null,
- "reportable": 1,
- "minInterval": 1,
- "maxInterval": 65534,
- "reportableChange": 0
- },
- {
- "name": "BatteryCapacity",
- "code": 49,
- "mfgCode": null,
- "side": "server",
- "type": "energy_mwh",
- "included": 1,
- "storageOption": "External",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": null,
- "reportable": 1,
- "minInterval": 1,
- "maxInterval": 65534,
- "reportableChange": 0
- },
- {
- "name": "VehicleID",
- "code": 50,
- "mfgCode": null,
- "side": "server",
- "type": "char_string",
- "included": 1,
- "storageOption": "External",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": null,
- "reportable": 1,
- "minInterval": 1,
- "maxInterval": 65534,
- "reportableChange": 0
- },
{
"name": "SessionID",
"code": 64,
@@ -14103,22 +14098,6 @@
"maxInterval": 65534,
"reportableChange": 0
},
- {
- "name": "SessionEnergyDischarged",
- "code": 67,
- "mfgCode": null,
- "side": "server",
- "type": "energy_mwh",
- "included": 1,
- "storageOption": "External",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": null,
- "reportable": 1,
- "minInterval": 1,
- "maxInterval": 65534,
- "reportableChange": 0
- },
{
"name": "GeneratedCommandList",
"code": 65528,
diff --git a/examples/all-clusters-app/all-clusters-common/include/operational-state-delegate-impl.h b/examples/all-clusters-app/all-clusters-common/include/operational-state-delegate-impl.h
index 0bcb76f324a1da..60b6b09e9b6511 100644
--- a/examples/all-clusters-app/all-clusters-common/include/operational-state-delegate-impl.h
+++ b/examples/all-clusters-app/all-clusters-common/include/operational-state-delegate-impl.h
@@ -20,7 +20,7 @@
#include
#include
-#include
+
#include
namespace chip {
@@ -33,11 +33,15 @@ namespace OperationalState {
class GenericOperationalStateDelegateImpl : public Delegate
{
public:
+ uint32_t mRunningTime = 0;
+ uint32_t mPausedTime = 0;
+ app::DataModel::Nullable mCountDownTime;
+
/**
* Get the countdown time. This attribute is not used in this application.
* @return The current countdown time.
*/
- app::DataModel::Nullable GetCountdownTime() override { return {}; };
+ app::DataModel::Nullable GetCountdownTime() override;
/**
* Fills in the provided GenericOperationalState with the state at index `index` if there is one,
@@ -104,11 +108,33 @@ class OperationalStateDelegate : public GenericOperationalStateDelegateImpl
GenericOperationalState(to_underlying(OperationalStateEnum::kError)),
};
+ const uint32_t kExampleCountDown = 30;
+
public:
OperationalStateDelegate()
{
GenericOperationalStateDelegateImpl::mOperationalStateList = Span(opStateList);
}
+
+ /**
+ * Handle Command Callback in application: Start
+ * @param[out] get operational error after callback.
+ */
+ void HandleStartStateCallback(GenericOperationalError & err) override
+ {
+ mCountDownTime.SetNonNull(static_cast(kExampleCountDown));
+ GenericOperationalStateDelegateImpl::HandleStartStateCallback(err);
+ }
+
+ /**
+ * Handle Command Callback in application: Stop
+ * @param[out] get operational error after callback.
+ */
+ void HandleStopStateCallback(GenericOperationalError & err) override
+ {
+ GenericOperationalStateDelegateImpl::HandleStopStateCallback(err);
+ mCountDownTime.SetNull();
+ }
};
Instance * GetOperationalStateInstance();
diff --git a/examples/all-clusters-app/all-clusters-common/include/oven-operational-state-delegate.h b/examples/all-clusters-app/all-clusters-common/include/oven-operational-state-delegate.h
index 6d7338214f77ae..89f9969ffb86a7 100644
--- a/examples/all-clusters-app/all-clusters-common/include/oven-operational-state-delegate.h
+++ b/examples/all-clusters-app/all-clusters-common/include/oven-operational-state-delegate.h
@@ -20,7 +20,7 @@
#include
#include
-#include
+
#include
namespace chip {
@@ -33,13 +33,17 @@ namespace OvenCavityOperationalState {
class OvenCavityOperationalStateDelegate : public OperationalState::Delegate
{
private:
- inline static const Clusters::OperationalState::GenericOperationalState mOperationalStateList[] = {
+ inline static const Clusters::OperationalState::GenericOperationalState opStateList[] = {
OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped)),
OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning)),
OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused)),
OperationalState::GenericOperationalState(to_underlying(OperationalState::OperationalStateEnum::kError))
};
+ Span mOperationalStateList =
+ Span(opStateList);
+ Span mOperationalPhaseList;
+
public:
/**
* Get the countdown time. This attribute is not supported in our example app.
@@ -73,43 +77,29 @@ class OvenCavityOperationalStateDelegate : public OperationalState::Delegate
* Handle Command Callback in application: Pause
* @param[out] get operational error after callback.
*/
- void HandlePauseStateCallback(Clusters::OperationalState::GenericOperationalError & err) override
- {
- // This command in not supported.
- err.Set(to_underlying(ErrorStateEnum::kCommandInvalidInState));
- };
+ void HandlePauseStateCallback(Clusters::OperationalState::GenericOperationalError & err) override;
/**
* Handle Command Callback in application: Resume
* @param[out] get operational error after callback.
*/
- void HandleResumeStateCallback(Clusters::OperationalState::GenericOperationalError & err) override
- {
- // This command in not supported.
- err.Set(to_underlying(ErrorStateEnum::kCommandInvalidInState));
- };
+ void HandleResumeStateCallback(Clusters::OperationalState::GenericOperationalError & err) override;
/**
* Handle Command Callback in application: Start
* @param[out] get operational error after callback.
*/
- void HandleStartStateCallback(Clusters::OperationalState::GenericOperationalError & err) override
- {
- // This command in not supported.
- err.Set(to_underlying(ErrorStateEnum::kCommandInvalidInState));
- };
+ void HandleStartStateCallback(Clusters::OperationalState::GenericOperationalError & err) override;
/**
* Handle Command Callback in application: Stop
* @param[out] get operational error after callback.
*/
- void HandleStopStateCallback(Clusters::OperationalState::GenericOperationalError & err) override
- {
- // This command in not supported.
- err.Set(to_underlying(ErrorStateEnum::kCommandInvalidInState));
- };
+ void HandleStopStateCallback(Clusters::OperationalState::GenericOperationalError & err) override;
};
+Instance * GetOperationalStateInstance();
+
void Shutdown();
} // namespace OvenCavityOperationalState
diff --git a/examples/all-clusters-app/all-clusters-common/include/rvc-operational-state-delegate-impl.h b/examples/all-clusters-app/all-clusters-common/include/rvc-operational-state-delegate-impl.h
index 4417f9f5a3ab4a..60a2f5d530f9b9 100644
--- a/examples/all-clusters-app/all-clusters-common/include/rvc-operational-state-delegate-impl.h
+++ b/examples/all-clusters-app/all-clusters-common/include/rvc-operational-state-delegate-impl.h
@@ -20,7 +20,7 @@
#include
#include
-#include
+
#include
namespace chip {
diff --git a/examples/all-clusters-app/all-clusters-common/src/dishwasher-alarm-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/dishwasher-alarm-stub.cpp
index 58d393752c8bfd..f700df068b529f 100644
--- a/examples/all-clusters-app/all-clusters-common/src/dishwasher-alarm-stub.cpp
+++ b/examples/all-clusters-app/all-clusters-common/src/dishwasher-alarm-stub.cpp
@@ -17,7 +17,6 @@
*/
#include
#include
-#include
using namespace chip;
diff --git a/examples/all-clusters-app/all-clusters-common/src/electrical-power-measurement-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/electrical-power-measurement-stub.cpp
index 4bcea0e8ed9895..2a4c422d581e55 100644
--- a/examples/all-clusters-app/all-clusters-common/src/electrical-power-measurement-stub.cpp
+++ b/examples/all-clusters-app/all-clusters-common/src/electrical-power-measurement-stub.cpp
@@ -47,5 +47,7 @@ void emberAfElectricalPowerMeasurementClusterInitCallback(chip::EndpointId endpo
OptionalAttributes::kOptionalAttributeNeutralCurrent));
gEPMInstance->Init();
+
+ gEPMDelegate->SetPowerMode(PowerModeEnum::kAc);
}
}
diff --git a/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp
index f9983d47883852..72fe588995784e 100644
--- a/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp
+++ b/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp
@@ -35,9 +35,7 @@ void emberAfEnergyEvseClusterInitCallback(chip::EndpointId endpointId)
{
gInstance = std::make_unique(
endpointId, *gDelegate,
- BitMask(EnergyEvse::Feature::kChargingPreferences, EnergyEvse::Feature::kPlugAndCharge,
- EnergyEvse::Feature::kRfid, EnergyEvse::Feature::kSoCReporting,
- EnergyEvse::Feature::kV2x),
+ BitMask(EnergyEvse::Feature::kChargingPreferences, EnergyEvse::Feature::kRfid),
BitMask(OptionalAttributes::kSupportsUserMaximumChargingCurrent,
OptionalAttributes::kSupportsRandomizationWindow,
OptionalAttributes::kSupportsApproximateEvEfficiency),
diff --git a/examples/all-clusters-app/all-clusters-common/src/operational-state-delegate-impl.cpp b/examples/all-clusters-app/all-clusters-common/src/operational-state-delegate-impl.cpp
index 3370d75bd65f35..2070e1b86754fe 100644
--- a/examples/all-clusters-app/all-clusters-common/src/operational-state-delegate-impl.cpp
+++ b/examples/all-clusters-app/all-clusters-common/src/operational-state-delegate-impl.cpp
@@ -16,6 +16,7 @@
* limitations under the License.
*/
#include
+#include
using namespace chip;
using namespace chip::app;
@@ -23,6 +24,16 @@ using namespace chip::app::Clusters;
using namespace chip::app::Clusters::OperationalState;
using namespace chip::app::Clusters::RvcOperationalState;
+static void onOperationalStateTimerTick(System::Layer * systemLayer, void * data);
+
+DataModel::Nullable GenericOperationalStateDelegateImpl::GetCountdownTime()
+{
+ if (mCountDownTime.IsNull())
+ return DataModel::NullNullable;
+
+ return DataModel::MakeNullable((uint32_t) (mCountDownTime.Value() - mRunningTime));
+}
+
CHIP_ERROR GenericOperationalStateDelegateImpl::GetOperationalStateAtIndex(size_t index, GenericOperationalState & operationalState)
{
if (index >= mOperationalStateList.size())
@@ -44,6 +55,15 @@ CHIP_ERROR GenericOperationalStateDelegateImpl::GetOperationalPhaseAtIndex(size_
void GenericOperationalStateDelegateImpl::HandlePauseStateCallback(GenericOperationalError & err)
{
+ OperationalState::OperationalStateEnum state =
+ static_cast(GetInstance()->GetCurrentOperationalState());
+
+ if (state == OperationalState::OperationalStateEnum::kStopped || state == OperationalState::OperationalStateEnum::kError)
+ {
+ err.Set(to_underlying(OperationalState::ErrorStateEnum::kCommandInvalidInState));
+ return;
+ }
+
// placeholder implementation
auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused));
if (error == CHIP_NO_ERROR)
@@ -58,6 +78,15 @@ void GenericOperationalStateDelegateImpl::HandlePauseStateCallback(GenericOperat
void GenericOperationalStateDelegateImpl::HandleResumeStateCallback(GenericOperationalError & err)
{
+ OperationalState::OperationalStateEnum state =
+ static_cast(GetInstance()->GetCurrentOperationalState());
+
+ if (state == OperationalState::OperationalStateEnum::kStopped || state == OperationalState::OperationalStateEnum::kError)
+ {
+ err.Set(to_underlying(OperationalState::ErrorStateEnum::kCommandInvalidInState));
+ return;
+ }
+
// placeholder implementation
auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kRunning));
if (error == CHIP_NO_ERROR)
@@ -72,10 +101,20 @@ void GenericOperationalStateDelegateImpl::HandleResumeStateCallback(GenericOpera
void GenericOperationalStateDelegateImpl::HandleStartStateCallback(GenericOperationalError & err)
{
+ OperationalState::GenericOperationalError current_err(to_underlying(OperationalState::ErrorStateEnum::kNoError));
+ GetInstance()->GetCurrentOperationalError(current_err);
+
+ if (current_err.errorStateID != to_underlying(OperationalState::ErrorStateEnum::kNoError))
+ {
+ err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnableToStartOrResume));
+ return;
+ }
+
// placeholder implementation
auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kRunning));
if (error == CHIP_NO_ERROR)
{
+ (void) DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds16(1), onOperationalStateTimerTick, this);
err.Set(to_underlying(ErrorStateEnum::kNoError));
}
else
@@ -90,6 +129,18 @@ void GenericOperationalStateDelegateImpl::HandleStopStateCallback(GenericOperati
auto error = GetInstance()->SetOperationalState(to_underlying(OperationalStateEnum::kStopped));
if (error == CHIP_NO_ERROR)
{
+ (void) DeviceLayer::SystemLayer().CancelTimer(onOperationalStateTimerTick, this);
+
+ OperationalState::GenericOperationalError current_err(to_underlying(OperationalState::ErrorStateEnum::kNoError));
+ GetInstance()->GetCurrentOperationalError(current_err);
+
+ Optional> totalTime((DataModel::Nullable(mRunningTime + mPausedTime)));
+ Optional> pausedTime((DataModel::Nullable(mPausedTime)));
+
+ GetInstance()->OnOperationCompletionDetected(static_cast(current_err.errorStateID), totalTime, pausedTime);
+
+ mRunningTime = 0;
+ mPausedTime = 0;
err.Set(to_underlying(ErrorStateEnum::kNoError));
}
else
@@ -98,6 +149,38 @@ void GenericOperationalStateDelegateImpl::HandleStopStateCallback(GenericOperati
}
}
+static void onOperationalStateTimerTick(System::Layer * systemLayer, void * data)
+{
+ GenericOperationalStateDelegateImpl * delegate = reinterpret_cast(data);
+
+ OperationalState::Instance * instance = OperationalState::GetOperationalStateInstance();
+ OperationalState::OperationalStateEnum state =
+ static_cast(instance->GetCurrentOperationalState());
+
+ auto countdown_time = delegate->GetCountdownTime();
+
+ if (countdown_time.IsNull() || (!countdown_time.IsNull() && countdown_time.Value() > 0))
+ {
+ if (state == OperationalState::OperationalStateEnum::kRunning)
+ {
+ delegate->mRunningTime++;
+ }
+ else if (state == OperationalState::OperationalStateEnum::kPaused)
+ {
+ delegate->mPausedTime++;
+ }
+ }
+
+ if (state == OperationalState::OperationalStateEnum::kRunning || state == OperationalState::OperationalStateEnum::kPaused)
+ {
+ (void) DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds16(1), onOperationalStateTimerTick, delegate);
+ }
+ else
+ {
+ (void) DeviceLayer::SystemLayer().CancelTimer(onOperationalStateTimerTick, delegate);
+ }
+}
+
// Init Operational State cluster
static OperationalState::Instance * gOperationalStateInstance = nullptr;
diff --git a/examples/all-clusters-app/all-clusters-common/src/oven-operational-state-delegate.cpp b/examples/all-clusters-app/all-clusters-common/src/oven-operational-state-delegate.cpp
index ecae5c88006ef4..726f326afbb6f8 100644
--- a/examples/all-clusters-app/all-clusters-common/src/oven-operational-state-delegate.cpp
+++ b/examples/all-clusters-app/all-clusters-common/src/oven-operational-state-delegate.cpp
@@ -22,8 +22,13 @@ using namespace chip::app;
using namespace chip::app::Clusters;
using namespace chip::app::Clusters::OvenCavityOperationalState;
-static OperationalState::Instance * gOvenCavityOperationalStateInstance = nullptr;
-static OvenCavityOperationalStateDelegate * gOvenCavityOperationalStateDelegate = nullptr;
+static OvenCavityOperationalState::Instance * gOvenCavityOperationalStateInstance = nullptr;
+static OvenCavityOperationalStateDelegate * gOvenCavityOperationalStateDelegate = nullptr;
+
+OvenCavityOperationalState::Instance * OvenCavityOperationalState::GetOperationalStateInstance()
+{
+ return gOvenCavityOperationalStateInstance;
+}
void OvenCavityOperationalState::Shutdown()
{
@@ -58,7 +63,7 @@ CHIP_ERROR
OvenCavityOperationalStateDelegate::GetOperationalStateAtIndex(size_t index,
OperationalState::GenericOperationalState & operationalState)
{
- if (index >= ArraySize(mOperationalStateList))
+ if (index >= mOperationalStateList.size())
{
return CHIP_ERROR_NOT_FOUND;
}
@@ -69,5 +74,89 @@ OvenCavityOperationalStateDelegate::GetOperationalStateAtIndex(size_t index,
CHIP_ERROR
OvenCavityOperationalStateDelegate::GetOperationalPhaseAtIndex(size_t index, MutableCharSpan & operationalPhase)
{
- return CHIP_ERROR_NOT_FOUND;
+ if (index >= mOperationalPhaseList.size())
+ {
+ return CHIP_ERROR_NOT_FOUND;
+ }
+ return CopyCharSpanToMutableCharSpan(mOperationalPhaseList[index], operationalPhase);
+}
+
+void OvenCavityOperationalStateDelegate::HandlePauseStateCallback(OperationalState::GenericOperationalError & err)
+{
+ OperationalState::OperationalStateEnum state =
+ static_cast(GetInstance()->GetCurrentOperationalState());
+
+ if (state == OperationalState::OperationalStateEnum::kStopped || state == OperationalState::OperationalStateEnum::kError)
+ {
+ err.Set(to_underlying(OperationalState::ErrorStateEnum::kCommandInvalidInState));
+ return;
+ }
+
+ auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused));
+ if (error == CHIP_NO_ERROR)
+ {
+ err.Set(to_underlying(OperationalState::ErrorStateEnum::kNoError));
+ }
+ else
+ {
+ err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation));
+ }
+}
+
+void OvenCavityOperationalStateDelegate::HandleResumeStateCallback(OperationalState::GenericOperationalError & err)
+{
+
+ OperationalState::OperationalStateEnum state =
+ static_cast(GetInstance()->GetCurrentOperationalState());
+
+ if (state == OperationalState::OperationalStateEnum::kStopped || state == OperationalState::OperationalStateEnum::kError)
+ {
+ err.Set(to_underlying(OperationalState::ErrorStateEnum::kCommandInvalidInState));
+ return;
+ }
+
+ auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning));
+ if (error == CHIP_NO_ERROR)
+ {
+ err.Set(to_underlying(OperationalState::ErrorStateEnum::kNoError));
+ }
+ else
+ {
+ err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation));
+ }
+}
+
+void OvenCavityOperationalStateDelegate::HandleStartStateCallback(OperationalState::GenericOperationalError & err)
+{
+ OperationalState::GenericOperationalError current_err(to_underlying(OperationalState::ErrorStateEnum::kNoError));
+ GetInstance()->GetCurrentOperationalError(current_err);
+
+ if (current_err.errorStateID != to_underlying(OperationalState::ErrorStateEnum::kNoError))
+ {
+ err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnableToStartOrResume));
+ return;
+ }
+
+ auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning));
+ if (error == CHIP_NO_ERROR)
+ {
+ err.Set(to_underlying(OperationalState::ErrorStateEnum::kNoError));
+ }
+ else
+ {
+ err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation));
+ }
+}
+
+void OvenCavityOperationalStateDelegate::HandleStopStateCallback(OperationalState::GenericOperationalError & err)
+{
+ auto error = GetInstance()->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped));
+ if (error == CHIP_NO_ERROR)
+ {
+ err.Set(to_underlying(OperationalState::ErrorStateEnum::kNoError));
+ }
+ else
+ {
+ err.Set(to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation));
+ }
}
diff --git a/examples/all-clusters-app/asr/src/AppTask.cpp b/examples/all-clusters-app/asr/src/AppTask.cpp
index 069954f7adf70d..92b6aaef3dba49 100644
--- a/examples/all-clusters-app/asr/src/AppTask.cpp
+++ b/examples/all-clusters-app/asr/src/AppTask.cpp
@@ -272,7 +272,7 @@ void AppTask::OnOffUpdateClusterState(void)
if (status != Status::Success)
{
- ASR_LOG("ERR: updating on/off %x", status);
+ ASR_LOG("ERR: updating on/off %x", to_underlying(status));
}
}
diff --git a/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp b/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp
index e14bf5ac6278ba..b75b5abfc74294 100644
--- a/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp
+++ b/examples/all-clusters-app/infineon/psoc6/src/AppTask.cpp
@@ -413,7 +413,7 @@ void AppTask::OnOffUpdateClusterState(intptr_t context)
if (status != Protocols::InteractionModel::Status::Success)
{
- P6_LOG("ERR: updating on/off %x", status);
+ P6_LOG("ERR: updating on/off %x", to_underlying(status));
}
}
diff --git a/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp b/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp
index 3145bd605b518c..b2fe3a90b59f3f 100644
--- a/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp
+++ b/examples/all-clusters-app/linux/AllClustersCommandDelegate.cpp
@@ -30,7 +30,9 @@
#include
#include
#include
+#include
#include
+#include
#include
using namespace chip;
@@ -179,6 +181,12 @@ void AllClustersAppCommandHandler::HandleCommand(intptr_t context)
self->OnAirQualityChange(static_cast(jsonAirQualityEnum.asUInt()));
}
}
+ else if (name == "OperationalStateChange")
+ {
+ std::string device = self->mJsonValue["Device"].asString();
+ std::string operation = self->mJsonValue["Operation"].asString();
+ self->OnOperationalStateChange(device, operation, self->mJsonValue["Param"]);
+ }
else
{
ChipLogError(NotSpecified, "Unhandled command: Should never happens");
@@ -436,6 +444,54 @@ void AllClustersAppCommandHandler::OnModeChangeHandler(std::string device, std::
}
}
+void AllClustersAppCommandHandler::OnOperationalStateChange(std::string device, std::string operation, Json::Value param)
+{
+ OperationalState::Instance * operationalStateInstance = nullptr;
+ if (device == "Generic")
+ {
+ operationalStateInstance = OperationalState::GetOperationalStateInstance();
+ }
+ else if (device == "Oven")
+ {
+ operationalStateInstance = OvenCavityOperationalState::GetOperationalStateInstance();
+ }
+ else
+ {
+ ChipLogDetail(NotSpecified, "Invalid device type : %s", device.c_str());
+ return;
+ }
+
+ if (operation == "Start" || operation == "Resume")
+ {
+ operationalStateInstance->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kRunning));
+ }
+ else if (operation == "Pause")
+ {
+ operationalStateInstance->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kPaused));
+ }
+ else if (operation == "Stop")
+ {
+ operationalStateInstance->SetOperationalState(to_underlying(OperationalState::OperationalStateEnum::kStopped));
+ }
+ else if (operation == "OnFault")
+ {
+
+ uint8_t event_id = to_underlying(OperationalState::ErrorStateEnum::kUnableToCompleteOperation);
+ if (!param.isNull())
+ {
+ event_id = to_underlying(static_cast(param.asUInt()));
+ }
+
+ OperationalState::GenericOperationalError err(event_id);
+ operationalStateInstance->OnOperationalErrorDetected(err);
+ }
+ else
+ {
+ ChipLogDetail(NotSpecified, "Invalid operation : %s", operation.c_str());
+ return;
+ }
+}
+
void AllClustersAppCommandHandler::OnAirQualityChange(uint32_t aNewValue)
{
AirQuality::Instance * airQualityInstance = AirQuality::GetInstance();
diff --git a/examples/all-clusters-app/linux/AllClustersCommandDelegate.h b/examples/all-clusters-app/linux/AllClustersCommandDelegate.h
index 7998cd15581a74..4022b06e9f8565 100644
--- a/examples/all-clusters-app/linux/AllClustersCommandDelegate.h
+++ b/examples/all-clusters-app/linux/AllClustersCommandDelegate.h
@@ -98,6 +98,11 @@ class AllClustersAppCommandHandler
* Should be called when it is necessary to change the air quality attribute.
*/
void OnAirQualityChange(uint32_t aEnum);
+
+ /**
+ * Should be called when it is necessary to change the operational state as a manual operation.
+ */
+ void OnOperationalStateChange(std::string device, std::string operation, Json::Value param);
};
class AllClustersCommandDelegate : public NamedPipeCommandDelegate
diff --git a/examples/all-clusters-app/nrfconnect/main/ZclDoorLockCallbacks.cpp b/examples/all-clusters-app/nrfconnect/main/ZclDoorLockCallbacks.cpp
index 8f741fcb83b7c3..eaf2bda516f23e 100644
--- a/examples/all-clusters-app/nrfconnect/main/ZclDoorLockCallbacks.cpp
+++ b/examples/all-clusters-app/nrfconnect/main/ZclDoorLockCallbacks.cpp
@@ -58,6 +58,6 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint)
Protocols::InteractionModel::Status status = DoorLock::Attributes::FeatureMap::Set(endpoint, 0);
if (status != Protocols::InteractionModel::Status::Success)
{
- LOG_ERR("Updating feature map %x", status);
+ LOG_ERR("Updating feature map %x", to_underlying(status));
}
}
diff --git a/examples/all-clusters-app/telink/src/ZclDoorLockCallbacks.cpp b/examples/all-clusters-app/telink/src/ZclDoorLockCallbacks.cpp
index 8f741fcb83b7c3..eaf2bda516f23e 100644
--- a/examples/all-clusters-app/telink/src/ZclDoorLockCallbacks.cpp
+++ b/examples/all-clusters-app/telink/src/ZclDoorLockCallbacks.cpp
@@ -58,6 +58,6 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint)
Protocols::InteractionModel::Status status = DoorLock::Attributes::FeatureMap::Set(endpoint, 0);
if (status != Protocols::InteractionModel::Status::Success)
{
- LOG_ERR("Updating feature map %x", status);
+ LOG_ERR("Updating feature map %x", to_underlying(status));
}
}
diff --git a/examples/all-clusters-minimal-app/asr/src/AppTask.cpp b/examples/all-clusters-minimal-app/asr/src/AppTask.cpp
index b97900d7533bd3..d6f77d2f28a836 100644
--- a/examples/all-clusters-minimal-app/asr/src/AppTask.cpp
+++ b/examples/all-clusters-minimal-app/asr/src/AppTask.cpp
@@ -225,7 +225,7 @@ void AppTask::OnOffUpdateClusterState(void)
if (status != Protocols::InteractionModel::Status::Success)
{
- ASR_LOG("ERR: updating on/off %x", status);
+ ASR_LOG("ERR: updating on/off %x", to_underlying(status));
}
}
diff --git a/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp b/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp
index dd43df8ec5f03f..7cbaf6f447d405 100644
--- a/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp
+++ b/examples/all-clusters-minimal-app/infineon/psoc6/src/AppTask.cpp
@@ -410,7 +410,7 @@ void AppTask::OnOffUpdateClusterState(intptr_t context)
if (status != Protocols::InteractionModel::Status::Success)
{
- P6_LOG("ERR: updating on/off %x", status);
+ P6_LOG("ERR: updating on/off %x", to_underlying(status));
}
}
diff --git a/examples/bridge-app/telink/src/AppTask.cpp b/examples/bridge-app/telink/src/AppTask.cpp
index 2f6f273cc0cbad..d21897bd2d36b6 100644
--- a/examples/bridge-app/telink/src/AppTask.cpp
+++ b/examples/bridge-app/telink/src/AppTask.cpp
@@ -597,12 +597,12 @@ void AppTask::UpdateClusterState(void)
if (status != Protocols::InteractionModel::Status::Success)
{
- LOG_ERR("Update OnOff fail: %x", status);
+ LOG_ERR("Update OnOff fail: %x", to_underlying(status));
}
uint8_t setLevel = sAppTask.mPwmRgbBlueLed.GetLevel();
status = Clusters::LevelControl::Attributes::CurrentLevel::Set(kExampleEndpointId, setLevel);
if (status != Protocols::InteractionModel::Status::Success)
{
- LOG_ERR("Update CurrentLevel fail: %x", status);
+ LOG_ERR("Update CurrentLevel fail: %x", to_underlying(status));
}
}
diff --git a/examples/chef/common/chef-rvc-operational-state-delegate.h b/examples/chef/common/chef-rvc-operational-state-delegate.h
index c8d63c2bb6efc2..f487e38000771d 100644
--- a/examples/chef/common/chef-rvc-operational-state-delegate.h
+++ b/examples/chef/common/chef-rvc-operational-state-delegate.h
@@ -20,7 +20,7 @@
#include
#include
-#include
+
#include
namespace chip {
diff --git a/examples/common/imgui_ui/windows/light.cpp b/examples/common/imgui_ui/windows/light.cpp
index a2dd030c218bec..86899e044b2ed1 100644
--- a/examples/common/imgui_ui/windows/light.cpp
+++ b/examples/common/imgui_ui/windows/light.cpp
@@ -76,7 +76,7 @@ void Light::UpdateState()
if (status != chip::Protocols::InteractionModel::Status::Success)
{
- ChipLogError(AppServer, "Failed to set on/off value: %d", status);
+ ChipLogError(AppServer, "Failed to set on/off value: %d", chip::to_underlying(status));
}
mTargetLightIsOn.ClearValue();
diff --git a/examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp b/examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp
index fd4a449d68d7b9..a46ea5db28df64 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp
+++ b/examples/contact-sensor-app/nxp/k32w/k32w0/main/AppTask.cpp
@@ -895,7 +895,7 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg)
Protocols::InteractionModel::Status status = app::Clusters::BooleanState::Attributes::StateValue::Set(1, newValue);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: updating boolean status value %x", status);
+ ChipLogError(NotSpecified, "ERR: updating boolean status value %x", to_underlying(status));
}
logBooleanStateEvent(newValue);
}
diff --git a/examples/contact-sensor-app/nxp/k32w/k32w1/main/AppTask.cpp b/examples/contact-sensor-app/nxp/k32w/k32w1/main/AppTask.cpp
index b1aa6792340fce..10039bb8c9270e 100644
--- a/examples/contact-sensor-app/nxp/k32w/k32w1/main/AppTask.cpp
+++ b/examples/contact-sensor-app/nxp/k32w/k32w1/main/AppTask.cpp
@@ -792,7 +792,7 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg)
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: updating boolean status value %x", status);
+ ChipLogError(NotSpecified, "ERR: updating boolean status value %x", to_underlying(status));
}
logBooleanStateEvent(newValue);
}
diff --git a/examples/contact-sensor-app/telink/src/AppTask.cpp b/examples/contact-sensor-app/telink/src/AppTask.cpp
index 0c4072d6b8e21e..dbcf9e1ce48405 100644
--- a/examples/contact-sensor-app/telink/src/AppTask.cpp
+++ b/examples/contact-sensor-app/telink/src/AppTask.cpp
@@ -98,7 +98,7 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg)
Protocols::InteractionModel::Status status = app::Clusters::BooleanState::Attributes::StateValue::Set(1, newValue);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: updating boolean status value %x", status);
+ ChipLogError(NotSpecified, "ERR: updating boolean status value %x", to_underlying(status));
}
}
diff --git a/examples/darwin-framework-tool/commands/common/MTRError.mm b/examples/darwin-framework-tool/commands/common/MTRError.mm
index d385983ca2fc94..f7680e822d323d 100644
--- a/examples/darwin-framework-tool/commands/common/MTRError.mm
+++ b/examples/darwin-framework-tool/commands/common/MTRError.mm
@@ -20,7 +20,6 @@
#import
#import
-#import
#import
#import
diff --git a/examples/dishwasher-app/dishwasher-common/include/operational-state-delegate-impl.h b/examples/dishwasher-app/dishwasher-common/include/operational-state-delegate-impl.h
index 9fd023db8194d9..5f017119930e5e 100644
--- a/examples/dishwasher-app/dishwasher-common/include/operational-state-delegate-impl.h
+++ b/examples/dishwasher-app/dishwasher-common/include/operational-state-delegate-impl.h
@@ -20,7 +20,7 @@
#include
#include
-#include
+
#include
namespace chip {
diff --git a/examples/energy-management-app/energy-management-common/energy-management-app.matter b/examples/energy-management-app/energy-management-common/energy-management-app.matter
index 1ab71d2cc0769d..c56280b2b72f08 100644
--- a/examples/energy-management-app/energy-management-common/energy-management-app.matter
+++ b/examples/energy-management-app/energy-management-common/energy-management-app.matter
@@ -1896,7 +1896,19 @@ endpoint 1 {
callback attribute ranges;
callback attribute voltage;
callback attribute activeCurrent;
+ callback attribute reactiveCurrent;
+ callback attribute apparentCurrent;
callback attribute activePower;
+ callback attribute reactivePower;
+ callback attribute apparentPower;
+ callback attribute RMSVoltage;
+ callback attribute RMSCurrent;
+ callback attribute RMSPower;
+ callback attribute frequency;
+ callback attribute harmonicCurrents;
+ callback attribute harmonicPhases;
+ callback attribute powerFactor;
+ callback attribute neutralCurrent;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
@@ -1963,11 +1975,9 @@ endpoint 1 {
callback attribute supplyState;
callback attribute faultState;
callback attribute chargingEnabledUntil;
- callback attribute dischargingEnabledUntil;
callback attribute circuitCapacity;
callback attribute minimumChargeCurrent;
callback attribute maximumChargeCurrent;
- callback attribute maximumDischargeCurrent;
callback attribute userMaximumChargeCurrent;
callback attribute randomizationDelayWindow;
callback attribute nextChargeStartTime;
@@ -1975,13 +1985,9 @@ endpoint 1 {
callback attribute nextChargeRequiredEnergy;
callback attribute nextChargeTargetSoC;
callback attribute approximateEVEfficiency;
- callback attribute stateOfCharge;
- callback attribute batteryCapacity;
- callback attribute vehicleID;
callback attribute sessionID;
callback attribute sessionDuration;
callback attribute sessionEnergyCharged;
- callback attribute sessionEnergyDischarged;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute eventList;
diff --git a/examples/energy-management-app/energy-management-common/energy-management-app.zap b/examples/energy-management-app/energy-management-common/energy-management-app.zap
index ba1fa29d585485..d795b4fd482448 100644
--- a/examples/energy-management-app/energy-management-common/energy-management-app.zap
+++ b/examples/energy-management-app/energy-management-common/energy-management-app.zap
@@ -2860,7 +2860,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
- "defaultValue": "",
+ "defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
@@ -2898,6 +2898,38 @@
"maxInterval": 65534,
"reportableChange": 0
},
+ {
+ "name": "ReactiveCurrent",
+ "code": 6,
+ "mfgCode": null,
+ "side": "server",
+ "type": "amperage_ma",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ApparentCurrent",
+ "code": 7,
+ "mfgCode": null,
+ "side": "server",
+ "type": "amperage_ma",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
{
"name": "ActivePower",
"code": 8,
@@ -2914,6 +2946,166 @@
"maxInterval": 65534,
"reportableChange": 0
},
+ {
+ "name": "ReactivePower",
+ "code": 9,
+ "mfgCode": null,
+ "side": "server",
+ "type": "power_mw",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "ApparentPower",
+ "code": 10,
+ "mfgCode": null,
+ "side": "server",
+ "type": "power_mw",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "RMSVoltage",
+ "code": 11,
+ "mfgCode": null,
+ "side": "server",
+ "type": "voltage_mv",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "RMSCurrent",
+ "code": 12,
+ "mfgCode": null,
+ "side": "server",
+ "type": "amperage_ma",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "RMSPower",
+ "code": 13,
+ "mfgCode": null,
+ "side": "server",
+ "type": "power_mw",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "Frequency",
+ "code": 14,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int64s",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "HarmonicCurrents",
+ "code": 15,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "HarmonicPhases",
+ "code": 16,
+ "mfgCode": null,
+ "side": "server",
+ "type": "array",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "PowerFactor",
+ "code": 17,
+ "mfgCode": null,
+ "side": "server",
+ "type": "int64s",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
+ {
+ "name": "NeutralCurrent",
+ "code": 18,
+ "mfgCode": null,
+ "side": "server",
+ "type": "amperage_ma",
+ "included": 1,
+ "storageOption": "External",
+ "singleton": 0,
+ "bounded": 0,
+ "defaultValue": null,
+ "reportable": 1,
+ "minInterval": 1,
+ "maxInterval": 65534,
+ "reportableChange": 0
+ },
{
"name": "GeneratedCommandList",
"code": 65528,
@@ -3701,22 +3893,6 @@
"maxInterval": 65534,
"reportableChange": 0
},
- {
- "name": "DischargingEnabledUntil",
- "code": 4,
- "mfgCode": null,
- "side": "server",
- "type": "epoch_s",
- "included": 1,
- "storageOption": "External",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": null,
- "reportable": 1,
- "minInterval": 1,
- "maxInterval": 65534,
- "reportableChange": 0
- },
{
"name": "CircuitCapacity",
"code": 5,
@@ -3765,22 +3941,6 @@
"maxInterval": 65534,
"reportableChange": 0
},
- {
- "name": "MaximumDischargeCurrent",
- "code": 8,
- "mfgCode": null,
- "side": "server",
- "type": "amperage_ma",
- "included": 1,
- "storageOption": "External",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": null,
- "reportable": 1,
- "minInterval": 1,
- "maxInterval": 65534,
- "reportableChange": 0
- },
{
"name": "UserMaximumChargeCurrent",
"code": 9,
@@ -3893,54 +4053,6 @@
"maxInterval": 65534,
"reportableChange": 0
},
- {
- "name": "StateOfCharge",
- "code": 48,
- "mfgCode": null,
- "side": "server",
- "type": "percent",
- "included": 1,
- "storageOption": "External",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": null,
- "reportable": 1,
- "minInterval": 1,
- "maxInterval": 65534,
- "reportableChange": 0
- },
- {
- "name": "BatteryCapacity",
- "code": 49,
- "mfgCode": null,
- "side": "server",
- "type": "energy_mwh",
- "included": 1,
- "storageOption": "External",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": null,
- "reportable": 1,
- "minInterval": 1,
- "maxInterval": 65534,
- "reportableChange": 0
- },
- {
- "name": "VehicleID",
- "code": 50,
- "mfgCode": null,
- "side": "server",
- "type": "char_string",
- "included": 1,
- "storageOption": "External",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": null,
- "reportable": 1,
- "minInterval": 1,
- "maxInterval": 65534,
- "reportableChange": 0
- },
{
"name": "SessionID",
"code": 64,
@@ -3989,22 +4101,6 @@
"maxInterval": 65534,
"reportableChange": 0
},
- {
- "name": "SessionEnergyDischarged",
- "code": 67,
- "mfgCode": null,
- "side": "server",
- "type": "energy_mwh",
- "included": 1,
- "storageOption": "External",
- "singleton": 0,
- "bounded": 0,
- "defaultValue": null,
- "reportable": 1,
- "minInterval": 1,
- "maxInterval": 65534,
- "reportableChange": 0
- },
{
"name": "GeneratedCommandList",
"code": 65528,
diff --git a/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp b/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp
index fe712d92ae1667..fdda913a868a22 100644
--- a/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp
+++ b/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp
@@ -246,12 +246,17 @@ CHIP_ERROR ElectricalPowerMeasurementDelegate::EndRangesRead()
return CHIP_NO_ERROR;
}
+static const Structs::HarmonicMeasurementStruct::Type kHarmonicCurrentMeasurements[] = {
+ { .order = 1, .measurement = MakeNullable(static_cast(100000)) }
+};
+
/* @brief This function is called by the cluster server at the start of read cycle
* This could take a semaphore to stop a background update of the data
*/
-CHIP_ERROR ElectricalPowerMeasurementDelegate::StartHarmonicCurrentsRead()
+CHIP_ERROR
+ElectricalPowerMeasurementDelegate::StartHarmonicCurrentsRead()
{
- /* Since we don't an implementation here we don't need to do anything here */
+ /* Since we have a static array we don't need to do anything here */
return CHIP_NO_ERROR;
}
CHIP_ERROR
@@ -269,34 +274,34 @@ ElectricalPowerMeasurementDelegate::GetHarmonicCurrentsByIndex(uint8_t harmonicC
* MatterReportingAttributeChangeCallback(mEndpointId, ElectricalPowerMeasurement::Id, HarmonicCurrents::Id);
*/
- /* if (rangeIndex >= ArraySize(mHarmonicCurrentMeasurements))
- * {
- * return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
- * }
- *
- * range = mHarmonicCurrentMeasurements[rangeIndex];
- *
- * return CHIP_NO_ERROR;
- */
+ /* Added to support testing using a static array for now */
+ if (harmonicCurrentsIndex >= ArraySize(kHarmonicCurrentMeasurements))
+ {
+ return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
+ }
- /* Return an empty list for now */
- return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
+ harmonicCurrent = kHarmonicCurrentMeasurements[harmonicCurrentsIndex];
+ return CHIP_NO_ERROR;
}
/* @brief This function is called by the cluster server at the end of read cycle
* This could release a semaphore to allow a background update of the data
*/
CHIP_ERROR ElectricalPowerMeasurementDelegate::EndHarmonicCurrentsRead()
{
- /* Since we don't an implementation here we don't need to do anything here */
+ /* Since we have a static array we don't need to do anything here */
return CHIP_NO_ERROR;
}
+static const Structs::HarmonicMeasurementStruct::Type kHarmonicPhaseMeasurements[] = {
+ { .order = 1, .measurement = MakeNullable(static_cast(100000)) }
+};
+
/* @brief This function is called by the cluster server at the start of read cycle
* This could take a semaphore to stop a background update of the data
*/
CHIP_ERROR ElectricalPowerMeasurementDelegate::StartHarmonicPhasesRead()
{
- /* Since we don't an implementation here we don't need to do anything here */
+ /* Since we have a static array we don't need to do anything here */
return CHIP_NO_ERROR;
}
@@ -314,25 +319,21 @@ CHIP_ERROR ElectricalPowerMeasurementDelegate::GetHarmonicPhasesByIndex(uint8_t
* MatterReportingAttributeChangeCallback(mEndpointId, ElectricalPowerMeasurement::Id, HarmonicPhases::Id);
*/
- /* if (rangeIndex >= ArraySize(mHarmonicPhaseMeasurements))
- * {
- * return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
- * }
- *
- * range = mHarmonicPhaseMeasurements[rangeIndex];
- *
- * return CHIP_NO_ERROR;
- */
+ /* Added to support testing using a static array for now */
+ if (harmonicPhaseIndex >= ArraySize(kHarmonicPhaseMeasurements))
+ {
+ return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
+ }
- /* Return an empty list for now */
- return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
+ harmonicPhase = kHarmonicPhaseMeasurements[harmonicPhaseIndex];
+ return CHIP_NO_ERROR;
}
/* @brief This function is called by the cluster server at the end of read cycle
* This could release a semaphore to allow a background update of the data
*/
CHIP_ERROR ElectricalPowerMeasurementDelegate::EndHarmonicPhasesRead()
{
- /* Since we don't an implementation here we don't need to do anything here */
+ /* Since we have a static array we don't need to do anything here */
return CHIP_NO_ERROR;
}
diff --git a/examples/energy-management-app/energy-management-common/src/EnergyEvseMain.cpp b/examples/energy-management-app/energy-management-common/src/EnergyEvseMain.cpp
index 92593efe6f8370..9beff80e8dc22a 100644
--- a/examples/energy-management-app/energy-management-common/src/EnergyEvseMain.cpp
+++ b/examples/energy-management-app/energy-management-common/src/EnergyEvseMain.cpp
@@ -152,9 +152,7 @@ CHIP_ERROR EnergyEvseInit()
/* Manufacturer may optionally not support all features, commands & attributes */
gEvseInstance = std::make_unique(
EndpointId(ENERGY_EVSE_ENDPOINT), *gEvseDelegate,
- BitMask(EnergyEvse::Feature::kChargingPreferences, EnergyEvse::Feature::kPlugAndCharge,
- EnergyEvse::Feature::kRfid, EnergyEvse::Feature::kSoCReporting,
- EnergyEvse::Feature::kV2x),
+ BitMask(EnergyEvse::Feature::kChargingPreferences, EnergyEvse::Feature::kRfid),
BitMask(EnergyEvse::OptionalAttributes::kSupportsUserMaximumChargingCurrent,
EnergyEvse::OptionalAttributes::kSupportsRandomizationWindow,
EnergyEvse::OptionalAttributes::kSupportsApproximateEvEfficiency),
@@ -224,13 +222,27 @@ CHIP_ERROR EnergyMeterInit()
}
/* Manufacturer may optionally not support all features, commands & attributes */
+ /* Turning on all optional features and attributes for test certification purposes */
gEPMInstance = std::make_unique(
EndpointId(ENERGY_EVSE_ENDPOINT), *gEPMDelegate,
- BitMask(ElectricalPowerMeasurement::Feature::kAlternatingCurrent),
+ BitMask(
+ ElectricalPowerMeasurement::Feature::kDirectCurrent, ElectricalPowerMeasurement::Feature::kAlternatingCurrent,
+ ElectricalPowerMeasurement::Feature::kPolyphasePower, ElectricalPowerMeasurement::Feature::kHarmonics,
+ ElectricalPowerMeasurement::Feature::kPowerQuality),
BitMask(
ElectricalPowerMeasurement::OptionalAttributes::kOptionalAttributeRanges,
ElectricalPowerMeasurement::OptionalAttributes::kOptionalAttributeVoltage,
- ElectricalPowerMeasurement::OptionalAttributes::kOptionalAttributeActiveCurrent));
+ ElectricalPowerMeasurement::OptionalAttributes::kOptionalAttributeActiveCurrent,
+ ElectricalPowerMeasurement::OptionalAttributes::kOptionalAttributeReactiveCurrent,
+ ElectricalPowerMeasurement::OptionalAttributes::kOptionalAttributeApparentCurrent,
+ ElectricalPowerMeasurement::OptionalAttributes::kOptionalAttributeReactivePower,
+ ElectricalPowerMeasurement::OptionalAttributes::kOptionalAttributeApparentPower,
+ ElectricalPowerMeasurement::OptionalAttributes::kOptionalAttributeRMSVoltage,
+ ElectricalPowerMeasurement::OptionalAttributes::kOptionalAttributeRMSCurrent,
+ ElectricalPowerMeasurement::OptionalAttributes::kOptionalAttributeRMSPower,
+ ElectricalPowerMeasurement::OptionalAttributes::kOptionalAttributeFrequency,
+ ElectricalPowerMeasurement::OptionalAttributes::kOptionalAttributePowerFactor,
+ ElectricalPowerMeasurement::OptionalAttributes::kOptionalAttributeNeutralCurrent));
if (!gEPMInstance)
{
diff --git a/examples/light-switch-app/qpg/args.gni b/examples/light-switch-app/qpg/args.gni
index d5dcdfe217c635..64db0987b3d7d6 100644
--- a/examples/light-switch-app/qpg/args.gni
+++ b/examples/light-switch-app/qpg/args.gni
@@ -23,6 +23,7 @@ chip_enable_ota_requestor = true
chip_openthread_ftd = false
enable_sleepy_device = true
chip_enable_icd_server = true
+chip_enable_icd_lit = true
# Disable lock tracking, since our FreeRTOS configuration does not set
# INCLUDE_xSemaphoreGetMutexHolder
diff --git a/examples/light-switch-app/qpg/src/AppTask.cpp b/examples/light-switch-app/qpg/src/AppTask.cpp
index 91579d7937ef9e..318e61b1e875c8 100644
--- a/examples/light-switch-app/qpg/src/AppTask.cpp
+++ b/examples/light-switch-app/qpg/src/AppTask.cpp
@@ -500,7 +500,7 @@ void AppTask::UpdateClusterState(void)
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: updating on/off %x", status);
+ ChipLogError(NotSpecified, "ERR: updating on/off %x", to_underlying(status));
}
*/
}
diff --git a/examples/lighting-app/asr/src/AppTask.cpp b/examples/lighting-app/asr/src/AppTask.cpp
index 0889f49e8f686f..b72ff5c8588f31 100755
--- a/examples/lighting-app/asr/src/AppTask.cpp
+++ b/examples/lighting-app/asr/src/AppTask.cpp
@@ -88,7 +88,7 @@ bool IsLightOn()
if (status != Protocols::InteractionModel::Status::Success)
{
- ASR_LOG("Error Read OnOff Attribute 0x%02x\n", status);
+ ASR_LOG("Error Read OnOff Attribute 0x%02x\n", to_underlying(status));
}
return on != false;
@@ -103,7 +103,7 @@ uint8_t GetLightLevel()
if (status != Protocols::InteractionModel::Status::Success)
{
- ASR_LOG("Error Read CurrentLevel Attribute 0x%02x\n", status);
+ ASR_LOG("Error Read CurrentLevel Attribute 0x%02x\n", to_underlying(status));
return -1;
}
diff --git a/examples/lighting-app/esp32/main/AppTask.cpp b/examples/lighting-app/esp32/main/AppTask.cpp
index cfbc87eeb3adf9..562ee4b763faff 100644
--- a/examples/lighting-app/esp32/main/AppTask.cpp
+++ b/examples/lighting-app/esp32/main/AppTask.cpp
@@ -193,7 +193,7 @@ void AppTask::UpdateClusterState()
if (status != Protocols::InteractionModel::Status::Success)
{
- ESP_LOGE(TAG, "Updating on/off cluster failed: %x", status);
+ ESP_LOGE(TAG, "Updating on/off cluster failed: %x", to_underlying(status));
}
ESP_LOGI(TAG, "Writing to Current Level cluster");
@@ -201,6 +201,6 @@ void AppTask::UpdateClusterState()
if (status != Protocols::InteractionModel::Status::Success)
{
- ESP_LOGE(TAG, "Updating level cluster failed: %x", status);
+ ESP_LOGE(TAG, "Updating level cluster failed: %x", to_underlying(status));
}
}
diff --git a/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp b/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp
index ce37a3184e85be..3af2ffad095f9b 100644
--- a/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp
+++ b/examples/lighting-app/infineon/cyw30739/src/LightingManager.cpp
@@ -54,7 +54,7 @@ bool LightingManager::IsLightOn(void)
if (status != Protocols::InteractionModel::Status::Success)
{
- printf("Error ReadServerAttribute 0x%02x\n", status);
+ printf("Error ReadServerAttribute 0x%02x\n", to_underlying(status));
}
return on != false;
@@ -103,7 +103,7 @@ void LightingManager::WriteClusterState(uint8_t value)
if (status != Protocols::InteractionModel::Status::Success)
{
- printf("Error WriteServerAttribute 0x%02x\n", status);
+ printf("Error WriteServerAttribute 0x%02x\n", to_underlying(status));
}
}
@@ -113,6 +113,6 @@ void LightingManager::WriteClusterLevel(uint8_t value)
if (status != Protocols::InteractionModel::Status::Success)
{
- printf("Error WriteServerAttribute 0x%02x\n", status);
+ printf("Error WriteServerAttribute 0x%02x\n", to_underlying(status));
}
}
diff --git a/examples/lighting-app/infineon/psoc6/src/AppTask.cpp b/examples/lighting-app/infineon/psoc6/src/AppTask.cpp
index c7c8cded19ebb7..49e6278ab032c9 100644
--- a/examples/lighting-app/infineon/psoc6/src/AppTask.cpp
+++ b/examples/lighting-app/infineon/psoc6/src/AppTask.cpp
@@ -558,7 +558,7 @@ void AppTask::UpdateClusterState(intptr_t context)
Protocols::InteractionModel::Status status = app::Clusters::OnOff::Attributes::OnOff::Set(1, newValue);
if (status != Protocols::InteractionModel::Status::Success)
{
- P6_LOG("ERR: updating on/off %x", status);
+ P6_LOG("ERR: updating on/off %x", to_underlying(status));
}
}
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
diff --git a/examples/lighting-app/mbed/main/AppTask.cpp b/examples/lighting-app/mbed/main/AppTask.cpp
index 27dba42b12b566..26403bdb5e5b28 100644
--- a/examples/lighting-app/mbed/main/AppTask.cpp
+++ b/examples/lighting-app/mbed/main/AppTask.cpp
@@ -465,7 +465,7 @@ void AppTask::UpdateClusterState()
Protocols::InteractionModel::Status status = app::Clusters::OnOff::Attributes::OnOff::Set(1, onoff);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "Updating on/off cluster failed: %x", status);
+ ChipLogError(NotSpecified, "Updating on/off cluster failed: %x", to_underlying(status));
}
uint8_t level = LightingMgr().GetLevel();
@@ -474,6 +474,6 @@ void AppTask::UpdateClusterState()
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "Updating level cluster failed: %x", status);
+ ChipLogError(NotSpecified, "Updating level cluster failed: %x", to_underlying(status));
}
}
diff --git a/examples/lighting-app/nrfconnect/main/AppTask.cpp b/examples/lighting-app/nrfconnect/main/AppTask.cpp
index 12cdbd9db3bfda..5eaa1b1b401524 100644
--- a/examples/lighting-app/nrfconnect/main/AppTask.cpp
+++ b/examples/lighting-app/nrfconnect/main/AppTask.cpp
@@ -694,7 +694,7 @@ void AppTask::UpdateClusterState()
if (status != Protocols::InteractionModel::Status::Success)
{
- LOG_ERR("Updating on/off cluster failed: %x", status);
+ LOG_ERR("Updating on/off cluster failed: %x", to_underlying(status));
}
// write the current level
@@ -702,7 +702,7 @@ void AppTask::UpdateClusterState()
if (status != Protocols::InteractionModel::Status::Success)
{
- LOG_ERR("Updating level cluster failed: %x", status);
+ LOG_ERR("Updating level cluster failed: %x", to_underlying(status));
}
});
}
diff --git a/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp b/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp
index 1c8130177e18d1..39c9584c883480 100644
--- a/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp
+++ b/examples/lighting-app/nxp/k32w/k32w0/main/AppTask.cpp
@@ -958,7 +958,7 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg)
Protocols::InteractionModel::Status status = app::Clusters::OnOff::Attributes::OnOff::Set(1, newValue);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: updating on/off %x", status);
+ ChipLogError(NotSpecified, "ERR: updating on/off %x", to_underlying(status));
}
}
diff --git a/examples/lighting-app/nxp/k32w/k32w1/main/AppTask.cpp b/examples/lighting-app/nxp/k32w/k32w1/main/AppTask.cpp
index 944d68857983e1..2eb2f8e095b8b1 100644
--- a/examples/lighting-app/nxp/k32w/k32w1/main/AppTask.cpp
+++ b/examples/lighting-app/nxp/k32w/k32w1/main/AppTask.cpp
@@ -856,7 +856,7 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg)
Protocols::InteractionModel::Status status = app::Clusters::OnOff::Attributes::OnOff::Set(1, newValue);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: updating on/off %x", status);
+ ChipLogError(NotSpecified, "ERR: updating on/off %x", to_underlying(status));
}
}
diff --git a/examples/lighting-app/qpg/src/AppTask.cpp b/examples/lighting-app/qpg/src/AppTask.cpp
index a6574f709024db..2bc0ffafec5d2a 100644
--- a/examples/lighting-app/qpg/src/AppTask.cpp
+++ b/examples/lighting-app/qpg/src/AppTask.cpp
@@ -647,14 +647,14 @@ void AppTask::UpdateClusterState(void)
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: updating on/off %x", status);
+ ChipLogError(NotSpecified, "ERR: updating on/off %x", to_underlying(status));
}
// Write new level value
status = Clusters::LevelControl::Attributes::CurrentLevel::Set(QPG_LIGHT_ENDPOINT_ID, LightingMgr().GetLevel());
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: updating level %x", status);
+ ChipLogError(NotSpecified, "ERR: updating level %x", to_underlying(status));
}
});
}
diff --git a/examples/lighting-app/silabs/src/AppTask.cpp b/examples/lighting-app/silabs/src/AppTask.cpp
index 2dc310b2684039..bce7b06cb5cb07 100644
--- a/examples/lighting-app/silabs/src/AppTask.cpp
+++ b/examples/lighting-app/silabs/src/AppTask.cpp
@@ -250,6 +250,6 @@ void AppTask::UpdateClusterState(intptr_t context)
if (status != Protocols::InteractionModel::Status::Success)
{
- SILABS_LOG("ERR: updating on/off %x", status);
+ SILABS_LOG("ERR: updating on/off %x", to_underlying(status));
}
}
diff --git a/examples/lighting-app/stm32/src/STM32WB5/AppTask.cpp b/examples/lighting-app/stm32/src/STM32WB5/AppTask.cpp
index 415da294ae8259..d102f8a9dfd421 100644
--- a/examples/lighting-app/stm32/src/STM32WB5/AppTask.cpp
+++ b/examples/lighting-app/stm32/src/STM32WB5/AppTask.cpp
@@ -448,14 +448,14 @@ void AppTask::UpdateClusterState(void)
Clusters::OnOff::Attributes::OnOff::Set(STM32_LIGHT_ENDPOINT_ID, LightingMgr().IsTurnedOn());
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: updating on/off %x", status);
+ ChipLogError(NotSpecified, "ERR: updating on/off %x", to_underlying(status));
}
// Write new level value
status = Clusters::LevelControl::Attributes::CurrentLevel::Set(STM32_LIGHT_ENDPOINT_ID, LightingMgr().GetLevel());
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: updating level %x", status);
+ ChipLogError(NotSpecified, "ERR: updating level %x", to_underlying(status));
}
}
diff --git a/examples/lighting-app/telink/src/AppTask.cpp b/examples/lighting-app/telink/src/AppTask.cpp
index edcb3004d2454c..54dd2703c16ce9 100644
--- a/examples/lighting-app/telink/src/AppTask.cpp
+++ b/examples/lighting-app/telink/src/AppTask.cpp
@@ -242,13 +242,13 @@ void AppTask::UpdateClusterState(void)
status = Clusters::OnOff::Attributes::OnOff::Set(kExampleEndpointId, isTurnedOn);
if (status != Protocols::InteractionModel::Status::Success)
{
- LOG_ERR("Update OnOff fail: %x", status);
+ LOG_ERR("Update OnOff fail: %x", to_underlying(status));
}
status = Clusters::LevelControl::Attributes::CurrentLevel::Set(kExampleEndpointId, setLevel);
if (status != Protocols::InteractionModel::Status::Success)
{
- LOG_ERR("Update CurrentLevel fail: %x", status);
+ LOG_ERR("Update CurrentLevel fail: %x", to_underlying(status));
}
}
diff --git a/examples/lighting-app/tizen/src/DBusInterface.cpp b/examples/lighting-app/tizen/src/DBusInterface.cpp
index 0332f6f82b4933..e39ca5c1e1232c 100644
--- a/examples/lighting-app/tizen/src/DBusInterface.cpp
+++ b/examples/lighting-app/tizen/src/DBusInterface.cpp
@@ -207,7 +207,7 @@ void DBusInterface::InitOnOff()
bool isOn = false;
auto status = Clusters::OnOff::Attributes::OnOff::Get(mEndpointId, &isOn);
VerifyOrReturn(status == Protocols::InteractionModel::Status::Success,
- ChipLogError(NotSpecified, "Error getting OnOff: 0x%x", status));
+ ChipLogError(NotSpecified, "Error getting OnOff: 0x%x", to_underlying(status)));
light_app_on_off_set_on_off(mIfaceOnOff, isOn);
}
@@ -217,14 +217,14 @@ void DBusInterface::InitColor()
uint8_t value = 0;
auto status = Clusters::ColorControl::Attributes::ColorMode::Get(mEndpointId, &value);
VerifyOrReturn(status == Protocols::InteractionModel::Status::Success,
- ChipLogError(NotSpecified, "Error getting ColorMode: 0x%x", status));
+ ChipLogError(NotSpecified, "Error getting ColorMode: 0x%x", to_underlying(status)));
light_app_color_control_set_color_mode(mIfaceColorControl, value);
}
{
uint16_t value = 0;
auto status = Clusters::ColorControl::Attributes::ColorTemperatureMireds::Get(mEndpointId, &value);
VerifyOrReturn(status == Protocols::InteractionModel::Status::Success,
- ChipLogError(NotSpecified, "Error getting ColorTemperatureMireds: 0x%x", status));
+ ChipLogError(NotSpecified, "Error getting ColorTemperatureMireds: 0x%x", to_underlying(status)));
light_app_color_control_set_color_temperature_mireds(mIfaceColorControl, value);
}
}
diff --git a/examples/lighting-app/tizen/src/LedManager.cpp b/examples/lighting-app/tizen/src/LedManager.cpp
index a19f49c3f322ea..474ba612287f16 100644
--- a/examples/lighting-app/tizen/src/LedManager.cpp
+++ b/examples/lighting-app/tizen/src/LedManager.cpp
@@ -63,7 +63,7 @@ void LedManager::InitOnOff()
bool isOn = false;
auto status = Clusters::OnOff::Attributes::OnOff::Get(mEndpointId, &isOn);
VerifyOrReturn(status == Protocols::InteractionModel::Status::Success,
- ChipLogError(NotSpecified, "Error getting OnOff: 0x%x", status));
+ ChipLogError(NotSpecified, "Error getting OnOff: 0x%x", to_underlying(status)));
SetOnOff(isOn);
}
diff --git a/examples/lit-icd-app/linux/args.gni b/examples/lit-icd-app/linux/args.gni
index c1421b0c721f9b..09ea58ef2a51d5 100644
--- a/examples/lit-icd-app/linux/args.gni
+++ b/examples/lit-icd-app/linux/args.gni
@@ -30,3 +30,4 @@ matter_enable_tracing_support = true
chip_enable_icd_server = true
chip_subscription_timeout_resumption = false
chip_icd_report_on_active_mode = true
+chip_enable_icd_lit = true
diff --git a/examples/lit-icd-app/silabs/build_for_wifi_args.gni b/examples/lit-icd-app/silabs/build_for_wifi_args.gni
index 139297d45a03db..3531a31ffde406 100644
--- a/examples/lit-icd-app/silabs/build_for_wifi_args.gni
+++ b/examples/lit-icd-app/silabs/build_for_wifi_args.gni
@@ -28,6 +28,7 @@ chip_enable_icd_server = true
chip_subscription_timeout_resumption = false
sl_use_subscription_synching = true
icd_enforce_sit_slow_poll_limit = true
+chip_enable_icd_lit = true
# ICD Matter Configuration flags
sl_idle_mode_duration_s = 3600 # 60min Idle Mode Duration
diff --git a/examples/lit-icd-app/silabs/openthread.gni b/examples/lit-icd-app/silabs/openthread.gni
index 8a3bb36475c49c..9d06737d622a2d 100644
--- a/examples/lit-icd-app/silabs/openthread.gni
+++ b/examples/lit-icd-app/silabs/openthread.gni
@@ -32,6 +32,7 @@ chip_subscription_timeout_resumption = false
sl_use_subscription_synching = true
icd_enforce_sit_slow_poll_limit = true
chip_icd_report_on_active_mode = true
+chip_enable_icd_lit = true
# Openthread Configuration flags
sl_ot_idle_interval_ms = 3600000 # 60mins Idle Polling Interval
diff --git a/examples/lock-app/asr/src/AppTask.cpp b/examples/lock-app/asr/src/AppTask.cpp
index b71ca5b84418ae..a90d0013761324 100644
--- a/examples/lock-app/asr/src/AppTask.cpp
+++ b/examples/lock-app/asr/src/AppTask.cpp
@@ -485,7 +485,7 @@ void AppTask::UpdateCluster(intptr_t context)
: Protocols::InteractionModel::Status::Failure;
if (status != Protocols::InteractionModel::Status::Success)
{
- ASR_LOG("ERR: updating lock state %x", status);
+ ASR_LOG("ERR: updating lock state %x", to_underlying(status));
}
}
diff --git a/examples/lock-app/esp32/main/AppTask.cpp b/examples/lock-app/esp32/main/AppTask.cpp
index d9f7e1d27df8eb..fbca981316f69b 100644
--- a/examples/lock-app/esp32/main/AppTask.cpp
+++ b/examples/lock-app/esp32/main/AppTask.cpp
@@ -23,7 +23,7 @@
#include
#include
#include
-#include
+
#include
#include
#include
@@ -471,6 +471,6 @@ void AppTask::UpdateClusterState(intptr_t context)
Protocols::InteractionModel::Status status = chip::app::Clusters::OnOff::Attributes::OnOff::Set(1, newValue);
if (status != Protocols::InteractionModel::Status::Success)
{
- ESP_LOGI(TAG, "ERR: updating on/off %x", status);
+ ESP_LOGI(TAG, "ERR: updating on/off %x", to_underlying(status));
}
}
diff --git a/examples/lock-app/genio/src/AppTask.cpp b/examples/lock-app/genio/src/AppTask.cpp
index c4e9290d6922b2..7a438dd4974d3d 100644
--- a/examples/lock-app/genio/src/AppTask.cpp
+++ b/examples/lock-app/genio/src/AppTask.cpp
@@ -602,6 +602,6 @@ void AppTask::UpdateClusterState(intptr_t context)
if (status != Protocols::InteractionModel::Status::Success)
{
- MT793X_LOG("ERR: updating lock state %x", status);
+ MT793X_LOG("ERR: updating lock state %x", to_underlying(status));
}
}
diff --git a/examples/lock-app/genio/src/ZclCallbacks.cpp b/examples/lock-app/genio/src/ZclCallbacks.cpp
index 20c51773000224..88ebaf641d86c7 100644
--- a/examples/lock-app/genio/src/ZclCallbacks.cpp
+++ b/examples/lock-app/genio/src/ZclCallbacks.cpp
@@ -66,31 +66,31 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint)
status = DoorLock::Attributes::LockType::Set(endpoint, DlLockType::kDeadBolt);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(Zcl, "Failed to set LockType %x", status);
+ ChipLogError(Zcl, "Failed to set LockType %x", to_underlying(status));
}
status = DoorLock::Attributes::NumberOfTotalUsersSupported::Set(endpoint, CONFIG_LOCK_NUM_USERS);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(Zcl, "Failed to set number of users %x", status);
+ ChipLogError(Zcl, "Failed to set number of users %x", to_underlying(status));
}
status = DoorLock::Attributes::NumberOfPINUsersSupported::Set(endpoint, CONFIG_LOCK_NUM_USERS);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(Zcl, "Failed to set number of PIN users %x", status);
+ ChipLogError(Zcl, "Failed to set number of PIN users %x", to_underlying(status));
}
status = DoorLock::Attributes::NumberOfRFIDUsersSupported::Set(endpoint, 0);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(Zcl, "Failed to set number of RFID users %x", status);
+ ChipLogError(Zcl, "Failed to set number of RFID users %x", to_underlying(status));
}
status = DoorLock::Attributes::NumberOfCredentialsSupportedPerUser::Set(endpoint, CONFIG_LOCK_NUM_CREDENTIALS_PER_USER);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(Zcl, "Failed to set number of credentials per user %x", status);
+ ChipLogError(Zcl, "Failed to set number of credentials per user %x", to_underlying(status));
}
// Note: Due to current logic of credential, do not enable PIN and RFID
@@ -99,7 +99,7 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint)
status = DoorLock::Attributes::FeatureMap::Set(endpoint, 0x101);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(Zcl, "Failed to set number of credentials per user %x", status);
+ ChipLogError(Zcl, "Failed to set number of credentials per user %x", to_underlying(status));
}
}
diff --git a/examples/lock-app/infineon/cyw30739/src/main.cpp b/examples/lock-app/infineon/cyw30739/src/main.cpp
index 10beef22c153e6..c82cc894bae5af 100644
--- a/examples/lock-app/infineon/cyw30739/src/main.cpp
+++ b/examples/lock-app/infineon/cyw30739/src/main.cpp
@@ -330,7 +330,7 @@ void UpdateClusterState(intptr_t context)
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(Zcl, "ERR: updating lock state %x", status);
+ ChipLogError(Zcl, "ERR: updating lock state %x", to_underlying(status));
}
}
diff --git a/examples/lock-app/infineon/psoc6/src/AppTask.cpp b/examples/lock-app/infineon/psoc6/src/AppTask.cpp
index b69a114c2f9ddb..9f29e32e6c618a 100644
--- a/examples/lock-app/infineon/psoc6/src/AppTask.cpp
+++ b/examples/lock-app/infineon/psoc6/src/AppTask.cpp
@@ -665,7 +665,7 @@ void AppTask::UpdateCluster(intptr_t context)
: Protocols::InteractionModel::Status::Failure;
if (status != Protocols::InteractionModel::Status::Success)
{
- P6_LOG("ERR: updating lock state %x", status);
+ P6_LOG("ERR: updating lock state %x", to_underlying(status));
}
}
diff --git a/examples/lock-app/mbed/main/AppTask.cpp b/examples/lock-app/mbed/main/AppTask.cpp
index eaa48d34a711ba..2dd5a4463dcf74 100644
--- a/examples/lock-app/mbed/main/AppTask.cpp
+++ b/examples/lock-app/mbed/main/AppTask.cpp
@@ -464,6 +464,6 @@ void AppTask::UpdateClusterState()
Protocols::InteractionModel::Status status = app::Clusters::OnOff::Attributes::OnOff::Set(1, newValue);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ZCL update failed: %lx", status);
+ ChipLogError(NotSpecified, "ZCL update failed: %lx", to_underlying(status));
}
}
diff --git a/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp b/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp
index ec7871f2d6f92d..63040970d9b9df 100644
--- a/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp
+++ b/examples/lock-app/nrfconnect/main/ZclCallbacks.cpp
@@ -115,7 +115,7 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint)
const auto logOnFailure = [](Protocols::InteractionModel::Status status, const char * attributeName) {
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(Zcl, "Failed to set DoorLock %s: %x", attributeName, status);
+ ChipLogError(Zcl, "Failed to set DoorLock %s: %x", attributeName, to_underlying(status));
}
};
diff --git a/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp b/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp
index 6e8a62e3d00716..7c6cffaf968c02 100644
--- a/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp
+++ b/examples/lock-app/nxp/k32w/k32w0/main/AppTask.cpp
@@ -781,7 +781,7 @@ void AppTask::UpdateClusterStateInternal(intptr_t arg)
if (status != chip::Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: updating door lock state %x", status);
+ ChipLogError(NotSpecified, "ERR: updating door lock state %x", chip::to_underlying(status));
}
}
diff --git a/examples/lock-app/qpg/src/AppTask.cpp b/examples/lock-app/qpg/src/AppTask.cpp
index 74e22e5892a977..7f9d922cc8558d 100644
--- a/examples/lock-app/qpg/src/AppTask.cpp
+++ b/examples/lock-app/qpg/src/AppTask.cpp
@@ -625,7 +625,7 @@ void AppTask::UpdateClusterState(void)
Protocols::InteractionModel::Status status = DoorLock::Attributes::LockState::Set(QPG_LOCK_ENDPOINT_ID, newValue);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: updating DoorLock %x", status);
+ ChipLogError(NotSpecified, "ERR: updating DoorLock %x", to_underlying(status));
}
}
else
diff --git a/examples/lock-app/qpg/src/ZclCallbacks.cpp b/examples/lock-app/qpg/src/ZclCallbacks.cpp
index e633c8eea16f0f..05518bff13cabd 100644
--- a/examples/lock-app/qpg/src/ZclCallbacks.cpp
+++ b/examples/lock-app/qpg/src/ZclCallbacks.cpp
@@ -117,7 +117,7 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint)
const auto logOnFailure = [](Protocols::InteractionModel::Status status, const char * attributeName) {
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(Zcl, "Failed to set DoorLock %s: %x", attributeName, status);
+ ChipLogError(Zcl, "Failed to set DoorLock %s: %x", attributeName, to_underlying(status));
}
};
diff --git a/examples/lock-app/silabs/src/AppTask.cpp b/examples/lock-app/silabs/src/AppTask.cpp
index c5bc828beaea5f..2510fa7f351c03 100644
--- a/examples/lock-app/silabs/src/AppTask.cpp
+++ b/examples/lock-app/silabs/src/AppTask.cpp
@@ -359,6 +359,6 @@ void AppTask::UpdateClusterState(intptr_t context)
if (status != Protocols::InteractionModel::Status::Success)
{
- SILABS_LOG("ERR: updating lock state %x", status);
+ SILABS_LOG("ERR: updating lock state %x", to_underlying(status));
}
}
diff --git a/examples/microwave-oven-app/microwave-oven-common/include/microwave-oven-device.h b/examples/microwave-oven-app/microwave-oven-common/include/microwave-oven-device.h
index 4e88aa1117c21e..7799ae6fc7574a 100644
--- a/examples/microwave-oven-app/microwave-oven-common/include/microwave-oven-device.h
+++ b/examples/microwave-oven-app/microwave-oven-common/include/microwave-oven-device.h
@@ -22,7 +22,7 @@
#include
#include
#include
-#include
+
#include
#include
#include
diff --git a/examples/ota-requestor-app/esp32/main/main.cpp b/examples/ota-requestor-app/esp32/main/main.cpp
index f8282ccdf22e30..c3ee1d5803b207 100644
--- a/examples/ota-requestor-app/esp32/main/main.cpp
+++ b/examples/ota-requestor-app/esp32/main/main.cpp
@@ -16,7 +16,6 @@
*/
#include "DeviceCallbacks.h"
-#include "app/util/af-enums.h"
#include "app/util/af.h"
#include "esp_heap_caps_init.h"
#include "esp_log.h"
diff --git a/examples/platform/asr/shell/matter_shell.cpp b/examples/platform/asr/shell/matter_shell.cpp
index f8abff11e9ebf7..bfa138f92ff0e5 100644
--- a/examples/platform/asr/shell/matter_shell.cpp
+++ b/examples/platform/asr/shell/matter_shell.cpp
@@ -88,7 +88,7 @@ void asr_matter_onoff(int value)
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogProgress(Zcl, "ERR: updating on/off %x", status);
+ ChipLogProgress(Zcl, "ERR: updating on/off %x", to_underlying(status));
}
}
diff --git a/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp b/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp
index 4bfb9afb9713cb..8ac373b643bfce 100644
--- a/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp
+++ b/examples/pump-app/cc13x2x7_26x2x7/main/AppTask.cpp
@@ -467,7 +467,7 @@ void AppTask::InitOnOffClusterState()
status = OnOff::Attributes::OnOff::Set(ONOFF_CLUSTER_ENDPOINT, false);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Init On/Off state %x", status);
+ ChipLogError(NotSpecified, "ERR: Init On/Off state %x", to_underlying(status));
}
}
@@ -503,25 +503,25 @@ void AppTask::UpdateCluster(intptr_t context)
PumpConfigurationAndControl::ControlModeEnum::kConstantFlow);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Constant Flow error %x", status);
+ ChipLogError(NotSpecified, "ERR: Constant Flow error %x", to_underlying(status));
}
status = PumpConfigurationAndControl::Attributes::ControlMode::Set(
PCC_CLUSTER_ENDPOINT, PumpConfigurationAndControl::ControlModeEnum::kConstantPressure);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Constant Pressure error %x", status);
+ ChipLogError(NotSpecified, "ERR: Constant Pressure error %x", to_underlying(status));
}
status = PumpConfigurationAndControl::Attributes::ControlMode::Set(
PCC_CLUSTER_ENDPOINT, PumpConfigurationAndControl::ControlModeEnum::kConstantSpeed);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Constant Speed error %x", status);
+ ChipLogError(NotSpecified, "ERR: Constant Speed error %x", to_underlying(status));
}
status = PumpConfigurationAndControl::Attributes::ControlMode::Set(
PCC_CLUSTER_ENDPOINT, PumpConfigurationAndControl::ControlModeEnum::kConstantTemperature);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Constant Temperature error %x", status);
+ ChipLogError(NotSpecified, "ERR: Constant Temperature error %x", to_underlying(status));
}
// Write the new values
@@ -529,98 +529,98 @@ void AppTask::UpdateCluster(intptr_t context)
status = OnOff::Attributes::OnOff::Set(ONOFF_CLUSTER_ENDPOINT, onOffState);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating On/Off state %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating On/Off state %x", to_underlying(status));
}
int16_t maxPressure = PumpMgr().GetMaxPressure();
status = PumpConfigurationAndControl::Attributes::MaxPressure::Set(PCC_CLUSTER_ENDPOINT, maxPressure);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxPressure %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxPressure %x", to_underlying(status));
}
uint16_t maxSpeed = PumpMgr().GetMaxSpeed();
status = PumpConfigurationAndControl::Attributes::MaxSpeed::Set(PCC_CLUSTER_ENDPOINT, maxSpeed);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxSpeed %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxSpeed %x", to_underlying(status));
}
uint16_t maxFlow = PumpMgr().GetMaxFlow();
status = PumpConfigurationAndControl::Attributes::MaxFlow::Set(PCC_CLUSTER_ENDPOINT, maxFlow);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxFlow %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxFlow %x", to_underlying(status));
}
int16_t minConstPress = PumpMgr().GetMinConstPressure();
status = PumpConfigurationAndControl::Attributes::MinConstPressure::Set(PCC_CLUSTER_ENDPOINT, minConstPress);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MinConstPressure %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MinConstPressure %x", to_underlying(status));
}
int16_t maxConstPress = PumpMgr().GetMaxConstPressure();
status = PumpConfigurationAndControl::Attributes::MaxConstPressure::Set(PCC_CLUSTER_ENDPOINT, maxConstPress);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxConstPressure %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxConstPressure %x", to_underlying(status));
}
int16_t minCompPress = PumpMgr().GetMinCompPressure();
status = PumpConfigurationAndControl::Attributes::MinCompPressure::Set(PCC_CLUSTER_ENDPOINT, minCompPress);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MinCompPressure %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MinCompPressure %x", to_underlying(status));
}
int16_t maxCompPress = PumpMgr().GetMaxCompPressure();
status = PumpConfigurationAndControl::Attributes::MaxCompPressure::Set(PCC_CLUSTER_ENDPOINT, maxCompPress);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxCompPressure %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxCompPressure %x", to_underlying(status));
}
uint16_t minConstSpeed = PumpMgr().GetMinConstSpeed();
status = PumpConfigurationAndControl::Attributes::MinConstSpeed::Set(PCC_CLUSTER_ENDPOINT, minConstSpeed);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MinConstSpeed %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MinConstSpeed %x", to_underlying(status));
}
uint16_t maxConstSpeed = PumpMgr().GetMaxConstSpeed();
status = PumpConfigurationAndControl::Attributes::MaxConstSpeed::Set(PCC_CLUSTER_ENDPOINT, maxConstSpeed);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxConstSpeed %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxConstSpeed %x", to_underlying(status));
}
uint16_t minConstFlow = PumpMgr().GetMinConstFlow();
status = PumpConfigurationAndControl::Attributes::MinConstFlow::Set(PCC_CLUSTER_ENDPOINT, minConstFlow);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MinConstFlow %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MinConstFlow %x", to_underlying(status));
}
uint16_t maxConstFlow = PumpMgr().GetMaxConstFlow();
status = PumpConfigurationAndControl::Attributes::MaxConstFlow::Set(PCC_CLUSTER_ENDPOINT, maxConstFlow);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxConstFlow %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxConstFlow %x", to_underlying(status));
}
int16_t minConstTemp = PumpMgr().GetMinConstTemp();
status = PumpConfigurationAndControl::Attributes::MinConstTemp::Set(PCC_CLUSTER_ENDPOINT, minConstTemp);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MinConstTemp %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MinConstTemp %x", to_underlying(status));
}
int16_t maxConstTemp = PumpMgr().GetMaxConstTemp();
status = PumpConfigurationAndControl::Attributes::MaxConstTemp::Set(PCC_CLUSTER_ENDPOINT, maxConstTemp);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxConstTemp %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxConstTemp %x", to_underlying(status));
}
}
diff --git a/examples/pump-app/cc13x4_26x4/main/AppTask.cpp b/examples/pump-app/cc13x4_26x4/main/AppTask.cpp
index 5c5e93919263d9..ea094e96767665 100644
--- a/examples/pump-app/cc13x4_26x4/main/AppTask.cpp
+++ b/examples/pump-app/cc13x4_26x4/main/AppTask.cpp
@@ -464,7 +464,7 @@ void AppTask::InitOnOffClusterState()
status = OnOff::Attributes::OnOff::Set(ONOFF_CLUSTER_ENDPOINT, false);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Init On/Off state %x", status);
+ ChipLogError(NotSpecified, "ERR: Init On/Off state %x", to_underlying(status));
}
}
@@ -500,25 +500,25 @@ void AppTask::UpdateCluster(intptr_t context)
PumpConfigurationAndControl::ControlModeEnum::kConstantFlow);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Constant Flow error %x", status);
+ ChipLogError(NotSpecified, "ERR: Constant Flow error %x", to_underlying(status));
}
status = PumpConfigurationAndControl::Attributes::ControlMode::Set(
PCC_CLUSTER_ENDPOINT, PumpConfigurationAndControl::ControlModeEnum::kConstantPressure);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Constant Pressure error %x", status);
+ ChipLogError(NotSpecified, "ERR: Constant Pressure error %x", to_underlying(status));
}
status = PumpConfigurationAndControl::Attributes::ControlMode::Set(
PCC_CLUSTER_ENDPOINT, PumpConfigurationAndControl::ControlModeEnum::kConstantSpeed);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Constant Speed error %x", status);
+ ChipLogError(NotSpecified, "ERR: Constant Speed error %x", to_underlying(status));
}
status = PumpConfigurationAndControl::Attributes::ControlMode::Set(
PCC_CLUSTER_ENDPOINT, PumpConfigurationAndControl::ControlModeEnum::kConstantTemperature);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Constant Temperature error %x", status);
+ ChipLogError(NotSpecified, "ERR: Constant Temperature error %x", to_underlying(status));
}
// Write the new values
@@ -526,98 +526,98 @@ void AppTask::UpdateCluster(intptr_t context)
status = OnOff::Attributes::OnOff::Set(ONOFF_CLUSTER_ENDPOINT, onOffState);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating On/Off state %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating On/Off state %x", to_underlying(status));
}
int16_t maxPressure = PumpMgr().GetMaxPressure();
status = PumpConfigurationAndControl::Attributes::MaxPressure::Set(PCC_CLUSTER_ENDPOINT, maxPressure);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxPressure %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxPressure %x", to_underlying(status));
}
uint16_t maxSpeed = PumpMgr().GetMaxSpeed();
status = PumpConfigurationAndControl::Attributes::MaxSpeed::Set(PCC_CLUSTER_ENDPOINT, maxSpeed);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxSpeed %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxSpeed %x", to_underlying(status));
}
uint16_t maxFlow = PumpMgr().GetMaxFlow();
status = PumpConfigurationAndControl::Attributes::MaxFlow::Set(PCC_CLUSTER_ENDPOINT, maxFlow);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxFlow %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxFlow %x", to_underlying(status));
}
int16_t minConstPress = PumpMgr().GetMinConstPressure();
status = PumpConfigurationAndControl::Attributes::MinConstPressure::Set(PCC_CLUSTER_ENDPOINT, minConstPress);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MinConstPressure %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MinConstPressure %x", to_underlying(status));
}
int16_t maxConstPress = PumpMgr().GetMaxConstPressure();
status = PumpConfigurationAndControl::Attributes::MaxConstPressure::Set(PCC_CLUSTER_ENDPOINT, maxConstPress);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxConstPressure %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxConstPressure %x", to_underlying(status));
}
int16_t minCompPress = PumpMgr().GetMinCompPressure();
status = PumpConfigurationAndControl::Attributes::MinCompPressure::Set(PCC_CLUSTER_ENDPOINT, minCompPress);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MinCompPressure %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MinCompPressure %x", to_underlying(status));
}
int16_t maxCompPress = PumpMgr().GetMaxCompPressure();
status = PumpConfigurationAndControl::Attributes::MaxCompPressure::Set(PCC_CLUSTER_ENDPOINT, maxCompPress);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxCompPressure %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxCompPressure %x", to_underlying(status));
}
uint16_t minConstSpeed = PumpMgr().GetMinConstSpeed();
status = PumpConfigurationAndControl::Attributes::MinConstSpeed::Set(PCC_CLUSTER_ENDPOINT, minConstSpeed);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MinConstSpeed %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MinConstSpeed %x", to_underlying(status));
}
uint16_t maxConstSpeed = PumpMgr().GetMaxConstSpeed();
status = PumpConfigurationAndControl::Attributes::MaxConstSpeed::Set(PCC_CLUSTER_ENDPOINT, maxConstSpeed);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxConstSpeed %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxConstSpeed %x", to_underlying(status));
}
uint16_t minConstFlow = PumpMgr().GetMinConstFlow();
status = PumpConfigurationAndControl::Attributes::MinConstFlow::Set(PCC_CLUSTER_ENDPOINT, minConstFlow);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MinConstFlow %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MinConstFlow %x", to_underlying(status));
}
uint16_t maxConstFlow = PumpMgr().GetMaxConstFlow();
status = PumpConfigurationAndControl::Attributes::MaxConstFlow::Set(PCC_CLUSTER_ENDPOINT, maxConstFlow);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxConstFlow %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxConstFlow %x", to_underlying(status));
}
int16_t minConstTemp = PumpMgr().GetMinConstTemp();
status = PumpConfigurationAndControl::Attributes::MinConstTemp::Set(PCC_CLUSTER_ENDPOINT, minConstTemp);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MinConstTemp %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MinConstTemp %x", to_underlying(status));
}
int16_t maxConstTemp = PumpMgr().GetMaxConstTemp();
status = PumpConfigurationAndControl::Attributes::MaxConstTemp::Set(PCC_CLUSTER_ENDPOINT, maxConstTemp);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxConstTemp %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxConstTemp %x", to_underlying(status));
}
}
diff --git a/examples/pump-app/nrfconnect/main/AppTask.cpp b/examples/pump-app/nrfconnect/main/AppTask.cpp
index 893c5dfd31794e..3a6eb9023ded0a 100644
--- a/examples/pump-app/nrfconnect/main/AppTask.cpp
+++ b/examples/pump-app/nrfconnect/main/AppTask.cpp
@@ -573,97 +573,97 @@ void AppTask::UpdateClusterState()
status = OnOff::Attributes::OnOff::Set(kOnOffClusterEndpoint, onOffState);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating On/Off state %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating On/Off state %x", to_underlying(status));
}
int16_t maxPressure = PumpMgr().GetMaxPressure();
status = PumpConfigurationAndControl::Attributes::MaxPressure::Set(kPccClusterEndpoint, maxPressure);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxPressure %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxPressure %x", to_underlying(status));
}
uint16_t maxSpeed = PumpMgr().GetMaxSpeed();
status = PumpConfigurationAndControl::Attributes::MaxSpeed::Set(kPccClusterEndpoint, maxSpeed);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxSpeed %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxSpeed %x", to_underlying(status));
}
uint16_t maxFlow = PumpMgr().GetMaxFlow();
status = PumpConfigurationAndControl::Attributes::MaxFlow::Set(kPccClusterEndpoint, maxFlow);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxFlow %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxFlow %x", to_underlying(status));
}
int16_t minConstPress = PumpMgr().GetMinConstPressure();
status = PumpConfigurationAndControl::Attributes::MinConstPressure::Set(kPccClusterEndpoint, minConstPress);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MinConstPressure %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MinConstPressure %x", to_underlying(status));
}
int16_t maxConstPress = PumpMgr().GetMaxConstPressure();
status = PumpConfigurationAndControl::Attributes::MaxConstPressure::Set(kPccClusterEndpoint, maxConstPress);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxConstPressure %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxConstPressure %x", to_underlying(status));
}
int16_t minCompPress = PumpMgr().GetMinCompPressure();
status = PumpConfigurationAndControl::Attributes::MinCompPressure::Set(kPccClusterEndpoint, minCompPress);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MinCompPressure %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MinCompPressure %x", to_underlying(status));
}
int16_t maxCompPress = PumpMgr().GetMaxCompPressure();
status = PumpConfigurationAndControl::Attributes::MaxCompPressure::Set(kPccClusterEndpoint, maxCompPress);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxCompPressure %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxCompPressure %x", to_underlying(status));
}
uint16_t minConstSpeed = PumpMgr().GetMinConstSpeed();
status = PumpConfigurationAndControl::Attributes::MinConstSpeed::Set(kPccClusterEndpoint, minConstSpeed);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MinConstSpeed %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MinConstSpeed %x", to_underlying(status));
}
uint16_t maxConstSpeed = PumpMgr().GetMaxConstSpeed();
status = PumpConfigurationAndControl::Attributes::MaxConstSpeed::Set(kPccClusterEndpoint, maxConstSpeed);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxConstSpeed %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxConstSpeed %x", to_underlying(status));
}
uint16_t minConstFlow = PumpMgr().GetMinConstFlow();
status = PumpConfigurationAndControl::Attributes::MinConstFlow::Set(kPccClusterEndpoint, minConstFlow);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MinConstFlow %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MinConstFlow %x", to_underlying(status));
}
uint16_t maxConstFlow = PumpMgr().GetMaxConstFlow();
status = PumpConfigurationAndControl::Attributes::MaxConstFlow::Set(kPccClusterEndpoint, maxConstFlow);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxConstFlow %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxConstFlow %x", to_underlying(status));
}
int16_t minConstTemp = PumpMgr().GetMinConstTemp();
status = PumpConfigurationAndControl::Attributes::MinConstTemp::Set(kPccClusterEndpoint, minConstTemp);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MinConstTemp %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MinConstTemp %x", to_underlying(status));
}
int16_t maxConstTemp = PumpMgr().GetMaxConstTemp();
status = PumpConfigurationAndControl::Attributes::MaxConstTemp::Set(kPccClusterEndpoint, maxConstTemp);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating MaxConstTemp %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating MaxConstTemp %x", to_underlying(status));
}
}
diff --git a/examples/pump-app/silabs/src/AppTask.cpp b/examples/pump-app/silabs/src/AppTask.cpp
index 588cd02001b9e8..365c53fc7a33ac 100644
--- a/examples/pump-app/silabs/src/AppTask.cpp
+++ b/examples/pump-app/silabs/src/AppTask.cpp
@@ -247,6 +247,6 @@ void AppTask::UpdateClusterState(intptr_t context)
status = chip::app::Clusters::OnOff::Attributes::OnOff::Set(PCC_CLUSTER_ENDPOINT, onOffState);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(NotSpecified, "ERR: Updating On/Off state %x", status);
+ ChipLogError(NotSpecified, "ERR: Updating On/Off state %x", to_underlying(status));
}
}
diff --git a/examples/pump-app/telink/src/AppTask.cpp b/examples/pump-app/telink/src/AppTask.cpp
index f2832b2b3e6699..368702d51ae11f 100644
--- a/examples/pump-app/telink/src/AppTask.cpp
+++ b/examples/pump-app/telink/src/AppTask.cpp
@@ -134,7 +134,7 @@ void AppTask::UpdateClusterState()
Protocols::InteractionModel::Status status = Clusters::OnOff::Attributes::OnOff::Set(kOnOffClusterEndpoint, onOffState);
if (status != Protocols::InteractionModel::Status::Success)
{
- LOG_ERR("ERR: Updating On/Off state %x", status);
+ LOG_ERR("ERR: Updating On/Off state %x", to_underlying(status));
}
int16_t maxPressure = PumpMgr().GetMaxPressure();
diff --git a/examples/rvc-app/rvc-common/include/rvc-operational-state-delegate.h b/examples/rvc-app/rvc-common/include/rvc-operational-state-delegate.h
index 3081a27ea3e625..6522793ac94dc9 100644
--- a/examples/rvc-app/rvc-common/include/rvc-operational-state-delegate.h
+++ b/examples/rvc-app/rvc-common/include/rvc-operational-state-delegate.h
@@ -20,7 +20,7 @@
#include
#include
-#include
+
#include
namespace chip {
diff --git a/examples/smoke-co-alarm-app/telink/prj.conf b/examples/smoke-co-alarm-app/telink/prj.conf
index 36f00385d93d53..3a6c279a6cb9dd 100755
--- a/examples/smoke-co-alarm-app/telink/prj.conf
+++ b/examples/smoke-co-alarm-app/telink/prj.conf
@@ -50,3 +50,5 @@ CONFIG_CHIP_CERTIFICATION_DECLARATION_STORAGE=n
# Enable Power Management
CONFIG_PM=y
+
+CONFIG_CHIP_ICD_LIT_SUPPORT=y
diff --git a/examples/thermostat/qpg/src/ZclCallbacks.cpp b/examples/thermostat/qpg/src/ZclCallbacks.cpp
index 0232634dd2effd..c66901656442cc 100644
--- a/examples/thermostat/qpg/src/ZclCallbacks.cpp
+++ b/examples/thermostat/qpg/src/ZclCallbacks.cpp
@@ -59,7 +59,7 @@ void emberAfThermostatClusterInitCallback(EndpointId endpoint)
const auto logOnFailure = [](Protocols::InteractionModel::Status status, const char * attributeName) {
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(Zcl, "Failed to set DoorLock %s: %x", attributeName, status);
+ ChipLogError(Zcl, "Failed to set DoorLock %s: %x", attributeName, to_underlying(status));
}
};
diff --git a/examples/virtual-device-app/android/java/DoorLockManager.cpp b/examples/virtual-device-app/android/java/DoorLockManager.cpp
index 96c66d6bc5bd34..b3e245ea75dac2 100644
--- a/examples/virtual-device-app/android/java/DoorLockManager.cpp
+++ b/examples/virtual-device-app/android/java/DoorLockManager.cpp
@@ -52,7 +52,8 @@ void emberAfDoorLockClusterInitCallback(EndpointId endpoint)
Protocols::InteractionModel::Status status = DoorLock::Attributes::FeatureMap::Set(endpoint, 0);
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogProgress(Zcl, "Device App::DoorLock::emberAfDoorLockClusterInitCallback()::Updating feature map %x", status);
+ ChipLogProgress(Zcl, "Device App::DoorLock::emberAfDoorLockClusterInitCallback()::Updating feature map %x",
+ to_underlying(status));
}
}
diff --git a/examples/window-app/nrfconnect/main/ZclCallbacks.cpp b/examples/window-app/nrfconnect/main/ZclCallbacks.cpp
index 428d488ceadc0c..12e95a7f566788 100644
--- a/examples/window-app/nrfconnect/main/ZclCallbacks.cpp
+++ b/examples/window-app/nrfconnect/main/ZclCallbacks.cpp
@@ -85,7 +85,7 @@ void emberAfWindowCoveringClusterInitCallback(chip::EndpointId endpoint)
const auto logOnFailure = [](Protocols::InteractionModel::Status status, const char * attributeName) {
if (status != Protocols::InteractionModel::Status::Success)
{
- ChipLogError(Zcl, "Failed to set WindowCovering %s: %x", attributeName, status);
+ ChipLogError(Zcl, "Failed to set WindowCovering %s: %x", attributeName, to_underlying(status));
}
};
diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py
index 984cb38080c897..fd4ad6f52867b5 100644
--- a/scripts/tests/chiptest/__init__.py
+++ b/scripts/tests/chiptest/__init__.py
@@ -209,7 +209,6 @@ def _GetDarwinFrameworkToolUnsupportedTests() -> Set[str]:
"Test_TC_GRPKEY_2_1", # darwin-framework-tool does not support writing readonly attributes by name
"Test_TC_LCFG_2_1", # darwin-framework-tool does not support writing readonly attributes by name
"Test_TC_OPCREDS_3_7", # darwin-framework-tool does not support the GetCommissionerRootCertificate command.
- "Test_TC_OPSTATE_2_4", # darwin-framework-tool does not currently support reading or subscribing to Events
"Test_TC_SMOKECO_2_2", # darwin-framework-tool does not currently support reading or subscribing to Events
"Test_TC_SMOKECO_2_3", # darwin-framework-tool does not currently support reading or subscribing to Events
"Test_TC_SMOKECO_2_4", # darwin-framework-tool does not currently support reading or subscribing to Events
diff --git a/scripts/tests/run_python_test.py b/scripts/tests/run_python_test.py
index fdea7767037aa6..1a9b54a3ad6736 100755
--- a/scripts/tests/run_python_test.py
+++ b/scripts/tests/run_python_test.py
@@ -125,6 +125,8 @@ def main(app: str, factoryreset: bool, factoryreset_app_only: bool, app_args: st
log_cooking_threads = []
app_process = None
+ app_pid = 0
+
if app:
if not os.path.exists(app):
if app is None:
@@ -133,11 +135,12 @@ def main(app: str, factoryreset: bool, factoryreset_app_only: bool, app_args: st
logging.info(f"Execute: {app_args}")
app_process = subprocess.Popen(
app_args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, bufsize=0)
+ app_pid = app_process.pid
DumpProgramOutputToQueue(
log_cooking_threads, Fore.GREEN + "APP " + Style.RESET_ALL, app_process, log_queue)
script_command = [script, "--paa-trust-store-path", os.path.join(DEFAULT_CHIP_ROOT, MATTER_DEVELOPMENT_PAA_ROOT_CERTS),
- '--log-format', '%(message)s'] + shlex.split(script_args)
+ '--log-format', '%(message)s', "--app-pid", str(app_pid)] + shlex.split(script_args)
if script_gdb:
#
diff --git a/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp b/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp
index 8fa2f36d3a3aab..b302f468aa38e4 100644
--- a/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp
+++ b/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.cpp
@@ -102,7 +102,7 @@ CHIP_ERROR BooleanStateConfigAttrAccess::ReadCurrentSensitivityLevel(const Concr
if (err == CHIP_ERROR_PERSISTED_STORAGE_VALUE_NOT_FOUND)
{
uint8_t supportedSensLevel;
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == SupportedSensitivityLevels::Get(aPath.mEndpointId, &supportedSensLevel),
+ VerifyOrReturnError(Status::Success == SupportedSensitivityLevels::Get(aPath.mEndpointId, &supportedSensLevel),
CHIP_IM_GLOBAL_STATUS(Failure));
VerifyOrReturnError(supportedSensLevel >= kMinSupportedSensitivityLevels, CHIP_IM_GLOBAL_STATUS(Failure));
VerifyOrReturnError(supportedSensLevel <= kMaxSupportedSensitivityLevels, CHIP_IM_GLOBAL_STATUS(Failure));
@@ -168,13 +168,13 @@ static bool emitAlarmsStateChangedEvent(EndpointId ep)
BooleanStateConfiguration::Events::AlarmsStateChanged::Type event;
BitMask active;
- VerifyOrReturnValue(EMBER_ZCL_STATUS_SUCCESS == AlarmsActive::Get(ep, &active), false);
+ VerifyOrReturnValue(Status::Success == AlarmsActive::Get(ep, &active), false);
event.alarmsActive = active;
if (HasFeature(ep, BooleanStateConfiguration::Feature::kAlarmSuppress))
{
BitMask suppressed;
- VerifyOrReturnValue(EMBER_ZCL_STATUS_SUCCESS == AlarmsSuppressed::Get(ep, &suppressed), false);
+ VerifyOrReturnValue(Status::Success == AlarmsSuppressed::Get(ep, &suppressed), false);
event.alarmsSuppressed.SetValue(suppressed);
}
@@ -214,7 +214,7 @@ static CHIP_ERROR emitSensorFaultEvent(EndpointId ep, BitMask= kMinSupportedSensitivityLevels, CHIP_IM_GLOBAL_STATUS(ConstraintError));
VerifyOrReturnError(supportedSensLevel <= kMaxSupportedSensitivityLevels, CHIP_IM_GLOBAL_STATUS(ConstraintError));
@@ -254,11 +254,10 @@ CHIP_ERROR SetAlarmsActive(EndpointId ep, BitMask alarmsEnabled;
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsEnabled::Get(ep, &alarmsEnabled),
- CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute));
+ VerifyOrReturnError(Status::Success == AlarmsEnabled::Get(ep, &alarmsEnabled), CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute));
VerifyOrReturnError(alarmsEnabled.HasAll(alarms), CHIP_IM_GLOBAL_STATUS(Failure));
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsActive::Set(ep, alarms), CHIP_IM_GLOBAL_STATUS(Failure));
+ VerifyOrReturnError(Status::Success == AlarmsActive::Set(ep, alarms), CHIP_IM_GLOBAL_STATUS(Failure));
emitAlarmsStateChangedEvent(ep);
return CHIP_NO_ERROR;
@@ -271,12 +270,11 @@ CHIP_ERROR SetAllEnabledAlarmsActive(EndpointId ep)
CHIP_IM_GLOBAL_STATUS(Failure));
BitMask alarmsEnabled;
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsEnabled::Get(ep, &alarmsEnabled),
- CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute));
+ VerifyOrReturnError(Status::Success == AlarmsEnabled::Get(ep, &alarmsEnabled), CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute));
if (alarmsEnabled.HasAny())
{
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsActive::Set(ep, alarmsEnabled), CHIP_IM_GLOBAL_STATUS(Failure));
+ VerifyOrReturnError(Status::Success == AlarmsActive::Set(ep, alarmsEnabled), CHIP_IM_GLOBAL_STATUS(Failure));
emitAlarmsStateChangedEvent(ep);
}
@@ -288,23 +286,21 @@ CHIP_ERROR ClearAllAlarms(EndpointId ep)
BitMask alarmsActive, alarmsSuppressed;
bool emitEvent = false;
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsActive::Get(ep, &alarmsActive),
- CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute));
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsSuppressed::Get(ep, &alarmsSuppressed),
+ VerifyOrReturnError(Status::Success == AlarmsActive::Get(ep, &alarmsActive), CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute));
+ VerifyOrReturnError(Status::Success == AlarmsSuppressed::Get(ep, &alarmsSuppressed),
CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute));
if (alarmsActive.HasAny())
{
alarmsActive.ClearAll();
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsActive::Set(ep, alarmsActive),
- CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute));
+ VerifyOrReturnError(Status::Success == AlarmsActive::Set(ep, alarmsActive), CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute));
emitEvent = true;
}
if (alarmsSuppressed.HasAny())
{
alarmsSuppressed.ClearAll();
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsSuppressed::Set(ep, alarmsSuppressed),
+ VerifyOrReturnError(Status::Success == AlarmsSuppressed::Set(ep, alarmsSuppressed),
CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute));
emitEvent = true;
}
@@ -329,10 +325,10 @@ CHIP_ERROR SuppressAlarms(EndpointId ep, BitMask alarmsActive, alarmsSuppressed, alarmsSupported;
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsSupported::Get(ep, &alarmsSupported), attribute_error);
+ VerifyOrReturnError(Status::Success == AlarmsSupported::Get(ep, &alarmsSupported), attribute_error);
VerifyOrReturnError(alarmsSupported.HasAll(alarm), CHIP_IM_GLOBAL_STATUS(ConstraintError));
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsActive::Get(ep, &alarmsActive), attribute_error);
+ VerifyOrReturnError(Status::Success == AlarmsActive::Get(ep, &alarmsActive), attribute_error);
VerifyOrReturnError(alarmsActive.HasAll(alarm), CHIP_IM_GLOBAL_STATUS(InvalidInState));
Delegate * delegate = GetDelegate(ep);
@@ -341,9 +337,9 @@ CHIP_ERROR SuppressAlarms(EndpointId ep, BitMaskHandleSuppressAlarm(alarm);
}
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsSuppressed::Get(ep, &alarmsSuppressed), attribute_error);
+ VerifyOrReturnError(Status::Success == AlarmsSuppressed::Get(ep, &alarmsSuppressed), attribute_error);
alarmsSuppressed.Set(alarm);
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AlarmsSuppressed::Set(ep, alarmsSuppressed), attribute_error);
+ VerifyOrReturnError(Status::Success == AlarmsSuppressed::Set(ep, alarmsSuppressed), attribute_error);
emitAlarmsStateChangedEvent(ep);
@@ -409,29 +405,29 @@ bool emberAfBooleanStateConfigurationClusterEnableDisableAlarmCallback(
uint8_t rawAlarm = static_cast(~alarms.Raw() & 0x03); // 0x03 is the current max bitmap
alarmsToDisable = BitMask(rawAlarm);
- VerifyOrExit(EMBER_ZCL_STATUS_SUCCESS == AlarmsSupported::Get(ep, &alarmsSupported), status.Emplace(Status::Failure));
+ VerifyOrExit(Status::Success == AlarmsSupported::Get(ep, &alarmsSupported), status.Emplace(Status::Failure));
VerifyOrExit(alarmsSupported.HasAll(alarms), status.Emplace(Status::ConstraintError));
- VerifyOrExit(EMBER_ZCL_STATUS_SUCCESS == AlarmsEnabled::Set(ep, alarms), status.Emplace(Status::Failure));
+ VerifyOrExit(Status::Success == AlarmsEnabled::Set(ep, alarms), status.Emplace(Status::Failure));
if (!isDelegateNull(delegate))
{
delegate->HandleEnableDisableAlarms(alarms);
}
- VerifyOrExit(EMBER_ZCL_STATUS_SUCCESS == AlarmsActive::Get(ep, &alarmsActive), status.Emplace(Status::Failure));
+ VerifyOrExit(Status::Success == AlarmsActive::Get(ep, &alarmsActive), status.Emplace(Status::Failure));
if (alarmsActive.HasAny(alarmsToDisable))
{
alarmsActive.Clear(alarmsToDisable);
- VerifyOrExit(EMBER_ZCL_STATUS_SUCCESS == AlarmsActive::Set(ep, alarmsActive), status.Emplace(Status::Failure));
+ VerifyOrExit(Status::Success == AlarmsActive::Set(ep, alarmsActive), status.Emplace(Status::Failure));
emit = true;
}
- VerifyOrExit(EMBER_ZCL_STATUS_SUCCESS == AlarmsSuppressed::Get(ep, &alarmsSuppressed), status.Emplace(Status::Failure));
+ VerifyOrExit(Status::Success == AlarmsSuppressed::Get(ep, &alarmsSuppressed), status.Emplace(Status::Failure));
if (alarmsSuppressed.HasAny(alarmsToDisable))
{
alarmsSuppressed.Clear(alarmsToDisable);
- VerifyOrExit(EMBER_ZCL_STATUS_SUCCESS == AlarmsSuppressed::Set(ep, alarmsSuppressed), status.Emplace(Status::Failure));
+ VerifyOrExit(Status::Success == AlarmsSuppressed::Set(ep, alarmsSuppressed), status.Emplace(Status::Failure));
emit = true;
}
diff --git a/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.h b/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.h
index 21813208c77249..547096053d04ea 100644
--- a/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.h
+++ b/src/app/clusters/boolean-state-configuration-server/boolean-state-configuration-server.h
@@ -27,6 +27,7 @@
#include
#include
#include
+#include
namespace chip {
namespace app {
@@ -46,7 +47,7 @@ CHIP_ERROR EmitSensorFault(EndpointId ep, chip::BitMask
#include
#include
-#include
+
#include
#include
#include
@@ -33,13 +33,15 @@ using namespace chip::app;
using namespace chip::app::Clusters;
using namespace chip::app::Clusters::BridgedDeviceBasicInformation;
+using chip::Protocols::InteractionModel::Status;
+
namespace {
void ReachableChanged(EndpointId endpointId)
{
MATTER_TRACE_INSTANT("ReachableChanged", "BridgeBasicInfo");
bool reachable = false;
- if (EMBER_ZCL_STATUS_SUCCESS != Attributes::Reachable::Get(endpointId, &reachable))
+ if (Status::Success != Attributes::Reachable::Get(endpointId, &reachable))
{
ChipLogError(Zcl, "ReachabledChanged: Failed to get Reachable value");
}
diff --git a/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp b/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp
index dbf3ee3116b317..40321f8c53297c 100644
--- a/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp
+++ b/src/app/clusters/dishwasher-alarm-server/dishwasher-alarm-server.cpp
@@ -92,7 +92,7 @@ Status DishwasherAlarmServer::GetLatchValue(EndpointId endpoint, BitMask mask)
{
BitMask supported;
- if (GetSupportedValue(endpoint, &supported) || !supported.HasAll(mask))
+ if (Status::Success != GetSupportedValue(endpoint, &supported) || !supported.HasAll(mask))
{
ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: Mask is not supported");
- return EMBER_ZCL_STATUS_FAILURE;
+ return Status::Failure;
}
Status status = Status::Success;
@@ -194,14 +194,14 @@ Status DishwasherAlarmServer::SetLatchValue(EndpointId endpoint, const BitMask supported;
- if (GetSupportedValue(endpoint, &supported) || !supported.HasAll(latch))
+ if (Status::Success != GetSupportedValue(endpoint, &supported) || !supported.HasAll(latch))
{
ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: Latch is not supported");
- return EMBER_ZCL_STATUS_FAILURE;
+ return Status::Failure;
}
Status status = Attributes::Latch::Set(endpoint, latch);
@@ -220,17 +220,17 @@ Status DishwasherAlarmServer::SetStateValue(EndpointId endpoint, const BitMask finalNewState;
finalNewState.Set(newState);
- if (GetSupportedValue(endpoint, &supported) || !supported.HasAll(finalNewState))
+ if (Status::Success != GetSupportedValue(endpoint, &supported) || !supported.HasAll(finalNewState))
{
ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: Alarm is not supported");
- return EMBER_ZCL_STATUS_FAILURE;
+ return Status::Failure;
}
BitMask mask;
- if (GetMaskValue(endpoint, &mask) || !mask.HasAll(finalNewState))
+ if (Status::Success != GetMaskValue(endpoint, &mask) || !mask.HasAll(finalNewState))
{
ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: Alarm is suppressed");
- return EMBER_ZCL_STATUS_FAILURE;
+ return Status::Failure;
}
Status status = Status::Success;
@@ -271,16 +271,16 @@ Status DishwasherAlarmServer::SetStateValue(EndpointId endpoint, const BitMask alarms)
{
BitMask supported;
- if (GetSupportedValue(endpoint, &supported) || !supported.HasAll(alarms))
+ if (Status::Success != GetSupportedValue(endpoint, &supported) || !supported.HasAll(alarms))
{
ChipLogProgress(Zcl, "Dishwasher Alarm: ERR: Alarm is not supported");
- return EMBER_ZCL_STATUS_FAILURE;
+ return Status::Failure;
}
BitMask state;
if (GetStateValue(endpoint, &state) != Status::Success)
{
- return EMBER_ZCL_STATUS_FAILURE;
+ return Status::Failure;
}
state.Clear(alarms);
@@ -354,7 +354,7 @@ static Status ResetHandler(const app::ConcreteCommandPath & commandPath, const B
if (!DishwasherAlarmServer::Instance().HasResetFeature(endpoint))
{
ChipLogProgress(Zcl, "Dishwasher Alarm feature: Unsupport Reset Command");
- return EMBER_ZCL_STATUS_UNSUPPORTED_COMMAND;
+ return Status::UnsupportedCommand;
}
// A server that is unable to reset alarms SHALL respond with a status code of FAILURE
diff --git a/src/app/clusters/door-lock-server/door-lock-server.cpp b/src/app/clusters/door-lock-server/door-lock-server.cpp
index 7f1a99131d4b90..c049e34ba0cec2 100644
--- a/src/app/clusters/door-lock-server/door-lock-server.cpp
+++ b/src/app/clusters/door-lock-server/door-lock-server.cpp
@@ -41,6 +41,7 @@ using namespace chip::app;
using namespace chip::app::DataModel;
using namespace chip::app::Clusters::DoorLock;
using namespace chip::app::Clusters::DoorLock::Attributes;
+using chip::Protocols::InteractionModel::ClusterStatusCode;
using chip::Protocols::InteractionModel::Status;
static constexpr uint8_t DOOR_LOCK_SCHEDULE_MAX_HOUR = 23;
@@ -120,9 +121,9 @@ void DoorLockServer::InitServer(chip::EndpointId endpointId)
ChipLogProgress(Zcl, "Door Lock cluster initialized at endpoint #%u", endpointId);
auto status = Attributes::LockState::SetNull(endpointId);
- if (EMBER_ZCL_STATUS_SUCCESS != status)
+ if (Status::Success != status)
{
- ChipLogError(Zcl, "[InitDoorLockServer] Unable to set the Lock State attribute to null [status=%d]", status);
+ ChipLogError(Zcl, "[InitDoorLockServer] Unable to set the Lock State attribute to null [status=%d]", to_underlying(status));
}
SetActuatorEnabled(endpointId, true);
@@ -260,7 +261,7 @@ bool DoorLockServer::HandleWrongCodeEntry(chip::EndpointId endpointId)
uint8_t wrongCodeEntryLimit = 0xFF;
auto status = Attributes::WrongCodeEntryLimit::Get(endpointId, &wrongCodeEntryLimit);
- if (EMBER_ZCL_STATUS_SUCCESS == status)
+ if (Status::Success == status)
{
if (++endpointContext->wrongCodeEntryAttempts >= wrongCodeEntryLimit)
{
@@ -269,7 +270,7 @@ bool DoorLockServer::HandleWrongCodeEntry(chip::EndpointId endpointId)
engageLockout(endpointId);
}
}
- else if (EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE != status)
+ else if (Status::UnsupportedAttribute != status)
{
ChipLogError(Zcl, "Failed to read Wrong Code Entry Limit attribute, status=0x%x", to_underlying(status));
return false;
@@ -300,11 +301,11 @@ bool DoorLockServer::engageLockout(chip::EndpointId endpointId)
}
auto status = Attributes::UserCodeTemporaryDisableTime::Get(endpointId, &lockoutTimeout);
- if (EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE == status)
+ if (Status::UnsupportedAttribute == status)
{
return false;
}
- if (EMBER_ZCL_STATUS_SUCCESS != status)
+ if (Status::Success != status)
{
ChipLogError(Zcl, "Unable to read the UserCodeTemporaryDisableTime attribute [status=%d]", to_underlying(status));
return false;
@@ -401,7 +402,7 @@ void DoorLockServer::setUserCommandHandler(chip::app::CommandHandler * commandOb
if (!SupportsUSR(commandPath.mEndpointId))
{
ChipLogProgress(Zcl, "[SetUser] User management is not supported [endpointId=%d]", commandPath.mEndpointId);
- sendClusterResponse(commandObj, commandPath, EMBER_ZCL_STATUS_UNSUPPORTED_COMMAND);
+ sendClusterResponse(commandObj, commandPath, ClusterStatusCode(Status::UnsupportedCommand));
return;
}
@@ -410,7 +411,7 @@ void DoorLockServer::setUserCommandHandler(chip::app::CommandHandler * commandOb
{
ChipLogError(Zcl, "[SetUser] Unable to get the fabric IDX [endpointId=%d,userIndex=%d]", commandPath.mEndpointId,
userIndex);
- sendClusterResponse(commandObj, commandPath, EMBER_ZCL_STATUS_FAILURE);
+ sendClusterResponse(commandObj, commandPath, ClusterStatusCode(Status::Failure));
return;
}
@@ -419,7 +420,7 @@ void DoorLockServer::setUserCommandHandler(chip::app::CommandHandler * commandOb
{
ChipLogError(Zcl, "[SetUser] Unable to get the source node index [endpointId=%d,userIndex=%d]", commandPath.mEndpointId,
userIndex);
- sendClusterResponse(commandObj, commandPath, EMBER_ZCL_STATUS_FAILURE);
+ sendClusterResponse(commandObj, commandPath, ClusterStatusCode(Status::Failure));
return;
}
@@ -433,7 +434,7 @@ void DoorLockServer::setUserCommandHandler(chip::app::CommandHandler * commandOb
if (!userIndexValid(commandPath.mEndpointId, userIndex))
{
ChipLogProgress(Zcl, "[SetUser] User index out of bounds [endpointId=%d,userIndex=%d]", commandPath.mEndpointId, userIndex);
- sendClusterResponse(commandObj, commandPath, EMBER_ZCL_STATUS_INVALID_COMMAND);
+ sendClusterResponse(commandObj, commandPath, ClusterStatusCode(Status::InvalidCommand));
return;
}
@@ -443,7 +444,7 @@ void DoorLockServer::setUserCommandHandler(chip::app::CommandHandler * commandOb
ChipLogProgress(Zcl, "[SetUser] Unable to set user: userName too long [endpointId=%d,userIndex=%d,userNameSize=%u]",
commandPath.mEndpointId, userIndex, static_cast(userName.Value().size()));
- sendClusterResponse(commandObj, commandPath, EMBER_ZCL_STATUS_INVALID_COMMAND);
+ sendClusterResponse(commandObj, commandPath, ClusterStatusCode(Status::InvalidCommand));
return;
}
@@ -453,7 +454,7 @@ void DoorLockServer::setUserCommandHandler(chip::app::CommandHandler * commandOb
"[SetUser] Unable to set the user: user status is out of range [endpointId=%d,userIndex=%d,userStatus=%u]",
commandPath.mEndpointId, userIndex, to_underlying(userStatus.Value()));
- sendClusterResponse(commandObj, commandPath, EMBER_ZCL_STATUS_INVALID_COMMAND);
+ sendClusterResponse(commandObj, commandPath, ClusterStatusCode(Status::InvalidCommand));
return;
}
@@ -462,11 +463,11 @@ void DoorLockServer::setUserCommandHandler(chip::app::CommandHandler * commandOb
ChipLogProgress(Zcl, "[SetUser] Unable to set the user: user type is unknown [endpointId=%d,userIndex=%d,userType=%u]",
commandPath.mEndpointId, userIndex, to_underlying(userType.Value()));
- sendClusterResponse(commandObj, commandPath, EMBER_ZCL_STATUS_INVALID_COMMAND);
+ sendClusterResponse(commandObj, commandPath, ClusterStatusCode(Status::InvalidCommand));
return;
}
- Status status = Status::Success;
+ ClusterStatusCode status(Status::Success);
switch (operationType)
{
case DataOperationTypeEnum::kAdd:
@@ -474,14 +475,14 @@ void DoorLockServer::setUserCommandHandler(chip::app::CommandHandler * commandOb
userType, credentialRule);
break;
case DataOperationTypeEnum::kModify:
- status = modifyUser(commandPath.mEndpointId, fabricIdx, sourceNodeId, userIndex, userName, userUniqueId, userStatus,
- userType, credentialRule);
+ status = ClusterStatusCode(modifyUser(commandPath.mEndpointId, fabricIdx, sourceNodeId, userIndex, userName, userUniqueId,
+ userStatus, userType, credentialRule));
break;
case DataOperationTypeEnum::kClear:
default:
// appclusters, 5.2.4.34: SetUser command allow only kAdd/kModify, we should respond with INVALID_COMMAND if we got kClear
// or anything else
- status = Status::InvalidCommand;
+ status = ClusterStatusCode(Status::InvalidCommand);
ChipLogProgress(Zcl, "[SetUser] Invalid operation type [endpointId=%d,operationType=%u]", commandPath.mEndpointId,
to_underlying(operationType));
break;
@@ -1873,26 +1874,25 @@ bool DoorLockServer::findUserIndexByCredential(chip::EndpointId endpointId, Cred
return false;
}
-Status DoorLockServer::createUser(chip::EndpointId endpointId, chip::FabricIndex creatorFabricIdx, chip::NodeId sourceNodeId,
- uint16_t userIndex, const Nullable & userName,
- const Nullable & userUniqueId, const Nullable & userStatus,
- const Nullable & userType, const Nullable & credentialRule,
- const Nullable & credential)
+ClusterStatusCode DoorLockServer::createUser(chip::EndpointId endpointId, chip::FabricIndex creatorFabricIdx,
+ chip::NodeId sourceNodeId, uint16_t userIndex,
+ const Nullable & userName, const Nullable & userUniqueId,
+ const Nullable & userStatus, const Nullable & userType,
+ const Nullable & credentialRule,
+ const Nullable & credential)
{
EmberAfPluginDoorLockUserInfo user;
if (!emberAfPluginDoorLockGetUser(endpointId, userIndex, user))
{
ChipLogError(Zcl, "[createUser] Unable to get the user from app [endpointId=%d,userIndex=%d]", endpointId, userIndex);
- return Status::Failure;
+ return ClusterStatusCode(Status::Failure);
}
// appclusters, 5.2.4.34: to modify user its status should be set to Available. If it is we should return OCCUPIED.
if (UserStatusEnum::kAvailable != user.userStatus)
{
ChipLogProgress(Zcl, "[createUser] Unable to overwrite existing user [endpointId=%d,userIndex=%d]", endpointId, userIndex);
- // TODO FixMe https://github.com/project-chip/connectedhomeip/issues/32100
- return static_cast(DlStatus::kOccupied);
- ;
+ return ClusterStatusCode::ClusterSpecificFailure(DlStatus::kOccupied);
}
const auto & newUserName = !userName.IsNull() ? userName.Value() : ""_span;
@@ -1918,7 +1918,7 @@ Status DoorLockServer::createUser(chip::EndpointId endpointId, chip::FabricIndex
endpointId, creatorFabricIdx, userIndex, static_cast(newUserName.size()), newUserName.data(),
newUserUniqueId, to_underlying(newUserStatus), to_underlying(newUserType), to_underlying(newCredentialRule),
static_cast(newTotalCredentials));
- return Status::Failure;
+ return ClusterStatusCode(Status::Failure);
}
ChipLogProgress(Zcl,
@@ -1932,7 +1932,7 @@ Status DoorLockServer::createUser(chip::EndpointId endpointId, chip::FabricIndex
sendRemoteLockUserChange(endpointId, LockDataTypeEnum::kUserIndex, DataOperationTypeEnum::kAdd, sourceNodeId, creatorFabricIdx,
userIndex, userIndex);
- return EMBER_ZCL_STATUS_SUCCESS;
+ return ClusterStatusCode(Status::Success);
}
Status DoorLockServer::modifyUser(chip::EndpointId endpointId, chip::FabricIndex modifierFabricIndex, chip::NodeId sourceNodeId,
@@ -2129,15 +2129,17 @@ DlStatus DoorLockServer::createNewCredentialAndUser(chip::EndpointId endpointId,
return DlStatus::kOccupied;
}
- auto status =
+ ClusterStatusCode status =
createUser(endpointId, creatorFabricIdx, sourceNodeId, availableUserIndex, Nullable(), Nullable(),
userStatus, userType, Nullable(), Nullable(credential));
- if (EMBER_ZCL_STATUS_SUCCESS != status)
+ if (!status.IsSuccess())
{
ChipLogProgress(Zcl,
"[SetCredential] Unable to create new user for credential: internal error "
"[endpointId=%d,credentialIndex=%d,userIndex=%d,status=%d]",
- endpointId, credential.credentialIndex, availableUserIndex, status);
+ endpointId, credential.credentialIndex, availableUserIndex,
+ status.HasClusterSpecificCode() ? status.GetClusterSpecificCode().Value()
+ : (to_underlying(status.GetStatus())));
return DlStatus::kFailure;
}
@@ -3406,18 +3408,17 @@ bool DoorLockServer::RemoteOperationEnabled(chip::EndpointId endpointId) const
}
void DoorLockServer::sendClusterResponse(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
- Status status)
+ ClusterStatusCode status)
{
VerifyOrDie(nullptr != commandObj);
- auto statusAsInteger = to_underlying(status);
- if (statusAsInteger == to_underlying(DlStatus::kOccupied) || statusAsInteger == to_underlying(DlStatus::kDuplicate))
+ if (status.HasClusterSpecificCode())
{
- VerifyOrDie(commandObj->AddClusterSpecificFailure(commandPath, static_cast(status)) == CHIP_NO_ERROR);
+ VerifyOrDie(commandObj->AddClusterSpecificFailure(commandPath, status.GetClusterSpecificCode().Value()) == CHIP_NO_ERROR);
}
else
{
- commandObj->AddStatus(commandPath, status);
+ commandObj->AddStatus(commandPath, status.GetStatus());
}
}
@@ -3514,7 +3515,7 @@ bool DoorLockServer::HandleRemoteLockOperation(chip::app::CommandHandler * comma
{
auto status = Attributes::RequirePINforRemoteOperation::Get(endpoint, &requirePin);
VerifyOrExit(
- EMBER_ZCL_STATUS_UNSUPPORTED_ATTRIBUTE == status || EMBER_ZCL_STATUS_SUCCESS == status,
+ Status::UnsupportedAttribute == status || Status::Success == status,
ChipLogError(Zcl, "Failed to read Require PIN For Remote Operation attribute, status=0x%x", to_underlying(status)));
}
// If the PIN is required but not provided we should exit
@@ -3957,7 +3958,7 @@ void DoorLockServer::setAliroReaderConfigCommandHandler(CommandHandler * command
ChipLogProgress(Zcl, "[SetAliroReaderConfig] Unable to set aliro reader config [endpointId=%d]", endpointID);
status = Status::Failure;
}
- sendClusterResponse(commandObj, commandPath, status);
+ sendClusterResponse(commandObj, commandPath, ClusterStatusCode(status));
}
void DoorLockServer::clearAliroReaderConfigCommandHandler(CommandHandler * commandObj, const ConcreteCommandPath & commandPath)
@@ -3979,7 +3980,7 @@ void DoorLockServer::clearAliroReaderConfigCommandHandler(CommandHandler * comma
ChipLogProgress(Zcl, "[SetAliroReaderConfig] Unable to set aliro reader config [endpointId=%d]", endpointID);
status = Status::Failure;
}
- sendClusterResponse(commandObj, commandPath, status);
+ sendClusterResponse(commandObj, commandPath, ClusterStatusCode(status));
}
// =============================================================================
@@ -4125,7 +4126,7 @@ void DoorLockServer::DoorLockOnAutoRelockCallback(System::Layer *, void * callba
auto endpointId = static_cast(reinterpret_cast(callbackContext));
Nullable lockState;
- if (Attributes::LockState::Get(endpointId, lockState) != EMBER_ZCL_STATUS_SUCCESS || lockState.IsNull() ||
+ if (Attributes::LockState::Get(endpointId, lockState) != Status::Success || lockState.IsNull() ||
lockState.Value() != DlLockState::kLocked)
{
ChipLogProgress(Zcl, "Door Auto relock timer expired. %s", "Locking...");
diff --git a/src/app/clusters/door-lock-server/door-lock-server.h b/src/app/clusters/door-lock-server/door-lock-server.h
index dd11ebdbd7db3f..f50a666ca67721 100644
--- a/src/app/clusters/door-lock-server/door-lock-server.h
+++ b/src/app/clusters/door-lock-server/door-lock-server.h
@@ -307,7 +307,7 @@ class DoorLockServer : public chip::app::AttributeAccessInterface
bool findUserIndexByCredential(chip::EndpointId endpointId, CredentialTypeEnum credentialType, chip::ByteSpan credentialData,
uint16_t & userIndex, uint16_t & credentialIndex, EmberAfPluginDoorLockUserInfo & userInfo);
- chip::Protocols::InteractionModel::Status
+ chip::Protocols::InteractionModel::ClusterStatusCode
createUser(chip::EndpointId endpointId, chip::FabricIndex creatorFabricIdx, chip::NodeId sourceNodeId, uint16_t userIndex,
const Nullable & userName, const Nullable & userUniqueId,
const Nullable & userStatus, const Nullable & userType,
@@ -479,7 +479,7 @@ class DoorLockServer : public chip::app::AttributeAccessInterface
bool engageLockout(chip::EndpointId endpointId);
static void sendClusterResponse(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
- chip::Protocols::InteractionModel::Status status);
+ chip::Protocols::InteractionModel::ClusterStatusCode status);
/**
* @brief Common handler for LockDoor, UnlockDoor, UnlockWithTimeout commands
diff --git a/src/app/clusters/groups-server/groups-server.cpp b/src/app/clusters/groups-server/groups-server.cpp
index 04e26a004b3aed..65bfbc1c3e5952 100644
--- a/src/app/clusters/groups-server/groups-server.cpp
+++ b/src/app/clusters/groups-server/groups-server.cpp
@@ -297,7 +297,7 @@ bool emberAfGroupsClusterRemoveGroupCallback(app::CommandHandler * commandObj, c
ScenesManagement::ScenesServer::Instance().GroupWillBeRemoved(fabricIndex, commandPath.mEndpointId, commandData.groupID);
#endif
response.groupID = commandData.groupID;
- response.status = GroupRemove(fabricIndex, commandPath.mEndpointId, commandData.groupID);
+ response.status = to_underlying(GroupRemove(fabricIndex, commandPath.mEndpointId, commandData.groupID));
commandObj->AddResponse(commandPath, response);
return true;
diff --git a/src/app/clusters/icd-management-server/icd-management-server.cpp b/src/app/clusters/icd-management-server/icd-management-server.cpp
index cac9e2dce3146e..27ecfe778a33bb 100644
--- a/src/app/clusters/icd-management-server/icd-management-server.cpp
+++ b/src/app/clusters/icd-management-server/icd-management-server.cpp
@@ -23,7 +23,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -51,9 +50,11 @@ class IcdManagementAttributeAccess : public AttributeAccessInterface
void Init(PersistentStorageDelegate & storage, Crypto::SymmetricKeystore * symmetricKeystore, FabricTable & fabricTable,
ICDConfigurationData & icdConfigurationData)
{
- mStorage = &storage;
- mSymmetricKeystore = symmetricKeystore;
- mFabricTable = &fabricTable;
+#if CHIP_CONFIG_ENABLE_ICD_CIP
+ mStorage = &storage;
+ mSymmetricKeystore = symmetricKeystore;
+ mFabricTable = &fabricTable;
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
mICDConfigurationData = &icdConfigurationData;
}
@@ -63,6 +64,8 @@ class IcdManagementAttributeAccess : public AttributeAccessInterface
CHIP_ERROR ReadIdleModeDuration(EndpointId endpoint, AttributeValueEncoder & encoder);
CHIP_ERROR ReadActiveModeDuration(EndpointId endpoint, AttributeValueEncoder & encoder);
CHIP_ERROR ReadActiveModeThreshold(EndpointId endpoint, AttributeValueEncoder & encoder);
+
+#if CHIP_CONFIG_ENABLE_ICD_CIP
CHIP_ERROR ReadRegisteredClients(EndpointId endpoint, AttributeValueEncoder & encoder);
CHIP_ERROR ReadICDCounter(EndpointId endpoint, AttributeValueEncoder & encoder);
CHIP_ERROR ReadClientsSupportedPerFabric(EndpointId endpoint, AttributeValueEncoder & encoder);
@@ -70,7 +73,9 @@ class IcdManagementAttributeAccess : public AttributeAccessInterface
PersistentStorageDelegate * mStorage = nullptr;
Crypto::SymmetricKeystore * mSymmetricKeystore = nullptr;
FabricTable * mFabricTable = nullptr;
- ICDConfigurationData * mICDConfigurationData = nullptr;
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
+
+ ICDConfigurationData * mICDConfigurationData = nullptr;
};
CHIP_ERROR IcdManagementAttributeAccess::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
@@ -88,6 +93,7 @@ CHIP_ERROR IcdManagementAttributeAccess::Read(const ConcreteReadAttributePath &
case IcdManagement::Attributes::ActiveModeThreshold::Id:
return ReadActiveModeThreshold(aPath.mEndpointId, aEncoder);
+#if CHIP_CONFIG_ENABLE_ICD_CIP
case IcdManagement::Attributes::RegisteredClients::Id:
return ReadRegisteredClients(aPath.mEndpointId, aEncoder);
@@ -96,6 +102,7 @@ CHIP_ERROR IcdManagementAttributeAccess::Read(const ConcreteReadAttributePath &
case IcdManagement::Attributes::ClientsSupportedPerFabric::Id:
return ReadClientsSupportedPerFabric(aPath.mEndpointId, aEncoder);
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
}
return CHIP_NO_ERROR;
@@ -116,6 +123,60 @@ CHIP_ERROR IcdManagementAttributeAccess::ReadActiveModeThreshold(EndpointId endp
return encoder.Encode(mICDConfigurationData->GetActiveModeThreshold().count());
}
+#if CHIP_CONFIG_ENABLE_ICD_CIP
+/**
+ * @brief Implementation of Fabric Delegate for ICD Management cluster
+ */
+class IcdManagementFabricDelegate : public FabricTable::Delegate
+{
+public:
+ void Init(PersistentStorageDelegate & storage, Crypto::SymmetricKeystore * symmetricKeystore,
+ ICDConfigurationData & icdConfigurationData)
+ {
+ mStorage = &storage;
+ mSymmetricKeystore = symmetricKeystore;
+ mICDConfigurationData = &icdConfigurationData;
+ }
+
+ void OnFabricRemoved(const FabricTable & fabricTable, FabricIndex fabricIndex) override
+ {
+ uint16_t supported_clients = mICDConfigurationData->GetClientsSupportedPerFabric();
+ ICDMonitoringTable table(*mStorage, fabricIndex, supported_clients, mSymmetricKeystore);
+ table.RemoveAll();
+ ICDNotifier::GetInstance().NotifyICDManagementEvent(ICDListener::ICDManagementEvents::kTableUpdated);
+ }
+
+private:
+ PersistentStorageDelegate * mStorage = nullptr;
+ Crypto::SymmetricKeystore * mSymmetricKeystore = nullptr;
+ ICDConfigurationData * mICDConfigurationData = nullptr;
+};
+
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
+
+} // namespace
+
+/*
+ * ICD Management Implementation
+ */
+#if CHIP_CONFIG_ENABLE_ICD_CIP
+PersistentStorageDelegate * ICDManagementServer::mStorage = nullptr;
+Crypto::SymmetricKeystore * ICDManagementServer::mSymmetricKeystore = nullptr;
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
+
+ICDConfigurationData * ICDManagementServer::mICDConfigurationData = nullptr;
+
+namespace {
+IcdManagementAttributeAccess gAttribute;
+#if CHIP_CONFIG_ENABLE_ICD_CIP
+IcdManagementFabricDelegate gFabricDelegate;
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
+} // namespace
+
+#if CHIP_CONFIG_ENABLE_ICD_CIP
+
+namespace {
+
CHIP_ERROR IcdManagementAttributeAccess::ReadRegisteredClients(EndpointId endpoint, AttributeValueEncoder & encoder)
{
uint16_t supported_clients = mICDConfigurationData->GetClientsSupportedPerFabric();
@@ -159,37 +220,6 @@ CHIP_ERROR IcdManagementAttributeAccess::ReadClientsSupportedPerFabric(EndpointI
return encoder.Encode(mICDConfigurationData->GetClientsSupportedPerFabric());
}
-/**
- * @brief Implementation of Fabric Delegate for ICD Management cluster
- */
-class IcdManagementFabricDelegate : public FabricTable::Delegate
-{
-public:
- void Init(PersistentStorageDelegate & storage, Crypto::SymmetricKeystore * symmetricKeystore,
- ICDConfigurationData & icdConfigurationData)
- {
- mStorage = &storage;
- mSymmetricKeystore = symmetricKeystore;
- mICDConfigurationData = &icdConfigurationData;
- }
-
- void OnFabricRemoved(const FabricTable & fabricTable, FabricIndex fabricIndex) override
- {
- uint16_t supported_clients = mICDConfigurationData->GetClientsSupportedPerFabric();
- ICDMonitoringTable table(*mStorage, fabricIndex, supported_clients, mSymmetricKeystore);
- table.RemoveAll();
- ICDNotifier::GetInstance().NotifyICDManagementEvent(ICDListener::ICDManagementEvents::kTableUpdated);
- }
-
-private:
- PersistentStorageDelegate * mStorage = nullptr;
- Crypto::SymmetricKeystore * mSymmetricKeystore = nullptr;
- ICDConfigurationData * mICDConfigurationData = nullptr;
-};
-
-IcdManagementFabricDelegate gFabricDelegate;
-IcdManagementAttributeAccess gAttribute;
-
/**
* @brief Function checks if the client has admin permissions to the cluster in the commandPath
*
@@ -216,14 +246,6 @@ CHIP_ERROR CheckAdmin(CommandHandler * commandObj, const ConcreteCommandPath & c
} // namespace
-/*
- * ICD Management Implementation
- */
-
-PersistentStorageDelegate * ICDManagementServer::mStorage = nullptr;
-Crypto::SymmetricKeystore * ICDManagementServer::mSymmetricKeystore = nullptr;
-ICDConfigurationData * ICDManagementServer::mICDConfigurationData = nullptr;
-
Status ICDManagementServer::RegisterClient(CommandHandler * commandObj, const ConcreteCommandPath & commandPath,
const Commands::RegisterClient::DecodableType & commandData, uint32_t & icdCounter)
{
@@ -335,6 +357,13 @@ Status ICDManagementServer::UnregisterClient(CommandHandler * commandObj, const
return InteractionModel::Status::Success;
}
+void ICDManagementServer::TriggerICDMTableUpdatedEvent()
+{
+ ICDNotifier::GetInstance().NotifyICDManagementEvent(ICDListener::ICDManagementEvents::kTableUpdated);
+}
+
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
+
Status ICDManagementServer::StayActiveRequest(FabricIndex fabricIndex)
{
// TODO: Implementent stay awake logic for end device
@@ -343,16 +372,13 @@ Status ICDManagementServer::StayActiveRequest(FabricIndex fabricIndex)
return InteractionModel::Status::UnsupportedCommand;
}
-void ICDManagementServer::TriggerICDMTableUpdatedEvent()
-{
- ICDNotifier::GetInstance().NotifyICDManagementEvent(ICDListener::ICDManagementEvents::kTableUpdated);
-}
-
void ICDManagementServer::Init(PersistentStorageDelegate & storage, Crypto::SymmetricKeystore * symmetricKeystore,
ICDConfigurationData & icdConfigurationData)
{
- mStorage = &storage;
- mSymmetricKeystore = symmetricKeystore;
+#if CHIP_CONFIG_ENABLE_ICD_CIP
+ mStorage = &storage;
+ mSymmetricKeystore = symmetricKeystore;
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
mICDConfigurationData = &icdConfigurationData;
}
@@ -360,6 +386,7 @@ void ICDManagementServer::Init(PersistentStorageDelegate & storage, Crypto::Symm
* Callbacks Implementation
*********************************************************/
+#if CHIP_CONFIG_ENABLE_ICD_CIP
/**
* @brief ICD Management Cluster RegisterClient Command callback (from client)
*
@@ -398,6 +425,7 @@ bool emberAfIcdManagementClusterUnregisterClientCallback(CommandHandler * comman
commandObj->AddStatus(commandPath, status);
return true;
}
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
/**
* @brief ICD Management Cluster StayActiveRequest Command callback (from client)
@@ -415,13 +443,15 @@ bool emberAfIcdManagementClusterStayActiveRequestCallback(CommandHandler * comma
void MatterIcdManagementPluginServerInitCallback()
{
PersistentStorageDelegate & storage = Server::GetInstance().GetPersistentStorage();
- FabricTable & fabricTable = Server::GetInstance().GetFabricTable();
Crypto::SymmetricKeystore * symmetricKeystore = Server::GetInstance().GetSessionKeystore();
+ FabricTable & fabricTable = Server::GetInstance().GetFabricTable();
ICDConfigurationData & icdConfigurationData = ICDConfigurationData::GetInstance().GetInstance();
+#if CHIP_CONFIG_ENABLE_ICD_CIP
// Configure and register Fabric delegate
gFabricDelegate.Init(storage, symmetricKeystore, icdConfigurationData);
fabricTable.AddFabricDelegate(&gFabricDelegate);
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
// Configure and register Attribute Access Override
gAttribute.Init(storage, symmetricKeystore, fabricTable, icdConfigurationData);
diff --git a/src/app/clusters/icd-management-server/icd-management-server.h b/src/app/clusters/icd-management-server/icd-management-server.h
index 0763f4863d1f0b..4462cb96d9c9f2 100644
--- a/src/app/clusters/icd-management-server/icd-management-server.h
+++ b/src/app/clusters/icd-management-server/icd-management-server.h
@@ -19,16 +19,29 @@
#include
#include
-#include
#include
-#include
#include
#include
-#include
#include
#include
#include
+#include
+
+#if CHIP_CONFIG_ENABLE_ICD_CIP
+#include
+#include
+#include
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
+
+using chip::Protocols::InteractionModel::Status;
+
+namespace chip {
+namespace Crypto {
+using SymmetricKeystore = SessionKeystore;
+} // namespace Crypto
+} // namespace chip
+
class ICDManagementServer
{
public:
@@ -37,6 +50,7 @@ class ICDManagementServer
static void Init(chip::PersistentStorageDelegate & storage, chip::Crypto::SymmetricKeystore * symmetricKeystore,
chip::ICDConfigurationData & ICDConfigurationData);
+#if CHIP_CONFIG_ENABLE_ICD_CIP
/**
* @brief Function that executes the business logic of the RegisterClient Command
*
@@ -52,17 +66,23 @@ class ICDManagementServer
chip::Protocols::InteractionModel::Status
UnregisterClient(chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath,
const chip::app::Clusters::IcdManagement::Commands::UnregisterClient::DecodableType & commandData);
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
chip::Protocols::InteractionModel::Status StayActiveRequest(chip::FabricIndex fabricIndex);
private:
+#if CHIP_CONFIG_ENABLE_ICD_CIP
/**
* @brief Triggers table update events to notify subscribers that an entry was added or removed
* from the ICDMonitoringTable.
*/
void TriggerICDMTableUpdatedEvent();
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
+ static chip::ICDConfigurationData * mICDConfigurationData;
+
+#if CHIP_CONFIG_ENABLE_ICD_CIP
static chip::PersistentStorageDelegate * mStorage;
static chip::Crypto::SymmetricKeystore * mSymmetricKeystore;
- static chip::ICDConfigurationData * mICDConfigurationData;
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
};
diff --git a/src/app/clusters/identify-server/identify-server.cpp b/src/app/clusters/identify-server/identify-server.cpp
index c93d96d3016e7e..257adf934a5328 100644
--- a/src/app/clusters/identify-server/identify-server.cpp
+++ b/src/app/clusters/identify-server/identify-server.cpp
@@ -104,7 +104,7 @@ static void onIdentifyClusterTick(chip::System::Layer * systemLayer, void * appS
{
EndpointId endpoint = identify->mEndpoint;
- if (EMBER_ZCL_STATUS_SUCCESS == Attributes::IdentifyTime::Get(endpoint, &identifyTime) && 0 != identifyTime)
+ if (Status::Success == Attributes::IdentifyTime::Get(endpoint, &identifyTime) && 0 != identifyTime)
{
identifyTime = static_cast(identifyTime == 0 ? 0 : identifyTime - 1);
// This tick writes the new attribute, which will trigger the Attribute
@@ -145,7 +145,7 @@ void MatterIdentifyClusterServerAttributeChangedCallback(const app::ConcreteAttr
return;
}
- if (EMBER_ZCL_STATUS_SUCCESS == Attributes::IdentifyTime::Get(endpoint, &identifyTime))
+ if (Status::Success == Attributes::IdentifyTime::Get(endpoint, &identifyTime))
{
/* effect identifier changed during identify */
if (identify->mTargetEffectIdentifier != identify->mCurrentEffectIdentifier)
@@ -229,8 +229,8 @@ bool emberAfIdentifyClusterTriggerEffectCallback(CommandHandler * commandObj, co
identify->mEffectVariant = effectVariant;
/* only call the callback if no identify is in progress */
- if (nullptr != identify->mOnEffectIdentifier &&
- EMBER_ZCL_STATUS_SUCCESS == Attributes::IdentifyTime::Get(endpoint, &identifyTime) && 0 == identifyTime)
+ if (nullptr != identify->mOnEffectIdentifier && Status::Success == Attributes::IdentifyTime::Get(endpoint, &identifyTime) &&
+ 0 == identifyTime)
{
identify->mCurrentEffectIdentifier = identify->mTargetEffectIdentifier;
identify->mOnEffectIdentifier(identify);
diff --git a/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.h b/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.h
index d82b353f7f3eb1..ef77717bc15480 100644
--- a/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.h
+++ b/src/app/clusters/microwave-oven-control-server/microwave-oven-control-server.h
@@ -23,7 +23,7 @@
#include
#include
#include
-#include
+
#include
namespace chip {
diff --git a/src/app/clusters/mode-base-server/mode-base-server.cpp b/src/app/clusters/mode-base-server/mode-base-server.cpp
index 6c5feb1d69c88e..76bd195376e9b0 100644
--- a/src/app/clusters/mode-base-server/mode-base-server.cpp
+++ b/src/app/clusters/mode-base-server/mode-base-server.cpp
@@ -135,7 +135,7 @@ CHIP_ERROR Instance::Init()
DataModel::Nullable onMode = GetOnMode();
bool onOffValueForStartUp = false;
if (!emberAfIsKnownVolatileAttribute(mEndpointId, OnOff::Id, OnOff::Attributes::StartUpOnOff::Id) &&
- OnOffServer::Instance().getOnOffValueForStartUp(mEndpointId, onOffValueForStartUp) == EMBER_ZCL_STATUS_SUCCESS)
+ OnOffServer::Instance().getOnOffValueForStartUp(mEndpointId, onOffValueForStartUp) == Status::Success)
{
if (onOffValueForStartUp && !onMode.IsNull())
{
diff --git a/src/app/clusters/mode-select-server/supported-modes-manager.h b/src/app/clusters/mode-select-server/supported-modes-manager.h
index 4a6ccd20c5f60a..3c36f188cb4a0e 100644
--- a/src/app/clusters/mode-select-server/supported-modes-manager.h
+++ b/src/app/clusters/mode-select-server/supported-modes-manager.h
@@ -19,7 +19,7 @@
#pragma once
#include
-#include
+
#include
namespace chip {
@@ -74,7 +74,7 @@ class SupportedModesManager
* @param mode The mode for which to search the ModeOptionStruct.
* @param dataPtr The pointer to receive the ModeOptionStruct, if one is found.
* @return Status::Success if successfully found the option. Otherwise, returns appropriate status code (found in
- * )
+ * )
*/
virtual Protocols::InteractionModel::Status getModeOptionByMode(EndpointId endpointId, uint8_t mode,
const ModeOptionStructType ** dataPtr) const = 0;
diff --git a/src/app/clusters/network-commissioning/network-commissioning.cpp b/src/app/clusters/network-commissioning/network-commissioning.cpp
index 6776897efce6fb..ffaff6bd49253a 100644
--- a/src/app/clusters/network-commissioning/network-commissioning.cpp
+++ b/src/app/clusters/network-commissioning/network-commissioning.cpp
@@ -34,6 +34,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -135,6 +136,26 @@ void Instance::Shutdown()
mpBaseDriver->Shutdown();
}
+#if !CHIP_DEVICE_CONFIG_SUPPORTS_CONCURRENT_CONNECTION
+void Instance::SendNonConcurrentConnectNetworkResponse()
+{
+ auto commandHandleRef = std::move(mAsyncCommandHandle);
+ auto commandHandle = commandHandleRef.Get();
+ if (commandHandle == nullptr)
+ {
+ return;
+ }
+
+#if CONFIG_NETWORK_LAYER_BLE
+ DeviceLayer::ConnectivityMgr().GetBleLayer()->IndicateBleClosing();
+#endif // CONFIG_NETWORK_LAYER_BLE
+ ChipLogProgress(NetworkProvisioning, "Non-concurrent mode. Send ConnectNetworkResponse(Success)");
+ Commands::ConnectNetworkResponse::Type response;
+ response.networkingStatus = NetworkCommissioning::Status::kSuccess;
+ commandHandle->AddResponse(mPath, response);
+}
+#endif // CHIP_DEVICE_CONFIG_SUPPORTS_CONCURRENT_CONNECTION
+
void Instance::InvokeCommand(HandlerContext & ctxt)
{
if (mAsyncCommandHandle.Get() != nullptr)
@@ -177,12 +198,7 @@ void Instance::InvokeCommand(HandlerContext & ctxt)
case Commands::ConnectNetwork::Id: {
VerifyOrReturn(mFeatureFlags.Has(Feature::kWiFiNetworkInterface) || mFeatureFlags.Has(Feature::kThreadNetworkInterface));
-#if CONFIG_NETWORK_LAYER_BLE && !CHIP_DEVICE_CONFIG_SUPPORTS_CONCURRENT_CONNECTION
- // If commissionee does not support Concurrent Connections, request the BLE to be stopped.
- // Start the ConnectNetwork, but this will not complete until the BLE is off.
- ChipLogProgress(NetworkProvisioning, "Closing BLE connections due to non-concurrent mode");
- DeviceLayer::DeviceControlServer::DeviceControlSvr().PostCloseAllBLEConnectionsToOperationalNetworkEvent();
-#endif
+
HandleCommand(
ctxt, [this](HandlerContext & ctx, const auto & req) { HandleConnectNetwork(ctx, req); });
return;
@@ -708,18 +724,22 @@ void Instance::HandleConnectNetwork(HandlerContext & ctx, const Commands::Connec
mAsyncCommandHandle = CommandHandler::Handle(&ctx.mCommandHandler);
mCurrentOperationBreadcrumb = req.breadcrumb;
- // In Non-concurrent mode postpone the final execution of ConnectNetwork until the operational
- // network has been fully brought up and kWiFiDeviceAvailable is delivered.
- // mConnectingNetworkIDLen and mConnectingNetworkID contains the received SSID
#if CHIP_DEVICE_CONFIG_SUPPORTS_CONCURRENT_CONNECTION
mpWirelessDriver->ConnectNetwork(req.networkID, this);
+#else
+ // In Non-concurrent mode postpone the final execution of ConnectNetwork until the operational
+ // network has been fully brought up and kOperationalNetworkStarted is delivered.
+ // mConnectingNetworkIDLen and mConnectingNetworkID contain the received SSID
+ // As per spec, send the ConnectNetworkResponse(Success) prior to releasing the commissioning channel
+ SendNonConcurrentConnectNetworkResponse();
#endif
}
void Instance::HandleNonConcurrentConnectNetwork()
{
ByteSpan nonConcurrentNetworkID = ByteSpan(mConnectingNetworkID, mConnectingNetworkIDLen);
- ChipLogProgress(NetworkProvisioning, "HandleNonConcurrentConnectNetwork() SSID=%s", mConnectingNetworkID);
+ ChipLogProgress(NetworkProvisioning, "Non-concurrent mode, Connect to Network SSID=%.*s", mConnectingNetworkIDLen,
+ mConnectingNetworkID);
mpWirelessDriver->ConnectNetwork(nonConcurrentNetworkID, this);
}
@@ -826,13 +846,19 @@ void Instance::HandleQueryIdentity(HandlerContext & ctx, const Commands::QueryId
void Instance::OnResult(Status commissioningError, CharSpan debugText, int32_t interfaceStatus)
{
auto commandHandleRef = std::move(mAsyncCommandHandle);
- auto commandHandle = commandHandleRef.Get();
+
+ // In Non-concurrent mode the commandHandle will be null here, the ConnectNetworkResponse
+ // has already been sent and the BLE will have been stopped, however the other functionality
+ // is still required
+#if CHIP_DEVICE_CONFIG_SUPPORTS_CONCURRENT_CONNECTION
+ auto commandHandle = commandHandleRef.Get();
if (commandHandle == nullptr)
{
// When the platform shutted down, interaction model engine will invalidate all commandHandle to avoid dangling references.
// We may receive the callback after it and should make it noop.
return;
}
+#endif // CHIP_DEVICE_CONFIG_SUPPORTS_CONCURRENT_CONNECTION
Commands::ConnectNetworkResponse::Type response;
response.networkingStatus = commissioningError;
@@ -856,13 +882,10 @@ void Instance::OnResult(Status commissioningError, CharSpan debugText, int32_t i
memcpy(mLastNetworkID, mConnectingNetworkID, mLastNetworkIDLen);
mLastNetworkingStatusValue.SetNonNull(commissioningError);
-#if CONFIG_NETWORK_LAYER_BLE && !CHIP_DEVICE_CONFIG_SUPPORTS_CONCURRENT_CONNECTION
- ChipLogProgress(NetworkProvisioning, "Non-concurrent mode, ConnectNetworkResponse will NOT be sent");
- // Do not send the ConnectNetworkResponse if in non-concurrent mode
- // Issue #30576 raised to modify CommandHandler to notify it if no response required
-#else
+#if CHIP_DEVICE_CONFIG_SUPPORTS_CONCURRENT_CONNECTION
commandHandle->AddResponse(mPath, response);
-#endif
+#endif // CHIP_DEVICE_CONFIG_SUPPORTS_CONCURRENT_CONNECTION
+
if (commissioningError == Status::kSuccess)
{
CommitSavedBreadcrumb();
@@ -1063,8 +1086,11 @@ void Instance::OnPlatformEventHandler(const DeviceLayer::ChipDeviceEvent * event
{
this_->OnFailSafeTimerExpired();
}
- else if (event->Type == DeviceLayer::DeviceEventType::kWiFiDeviceAvailable)
+ else if ((event->Type == DeviceLayer::DeviceEventType::kWiFiDeviceAvailable) ||
+ (event->Type == DeviceLayer::DeviceEventType::kOperationalNetworkStarted))
+
{
+ // In Non-Concurrent mode connect the operational channel, as BLE has been stopped
this_->HandleNonConcurrentConnectNetwork();
}
}
diff --git a/src/app/clusters/network-commissioning/network-commissioning.h b/src/app/clusters/network-commissioning/network-commissioning.h
index 03fa72f6bfbd26..a286b7c79c4f3b 100644
--- a/src/app/clusters/network-commissioning/network-commissioning.h
+++ b/src/app/clusters/network-commissioning/network-commissioning.h
@@ -78,6 +78,9 @@ class Instance : public CommandHandlerInterface,
void OnCommissioningComplete();
void OnFailSafeTimerExpired();
+#if !CHIP_DEVICE_CONFIG_SUPPORTS_CONCURRENT_CONNECTION
+ void SendNonConcurrentConnectNetworkResponse();
+#endif
const BitFlags mFeatureFlags;
DeviceLayer::NetworkCommissioning::Internal::WirelessDriver * const mpWirelessDriver;
diff --git a/src/app/clusters/operational-state-server/operational-state-cluster-objects.h b/src/app/clusters/operational-state-server/operational-state-cluster-objects.h
index 58fd8401e8adcc..7a2ffa96d04a89 100644
--- a/src/app/clusters/operational-state-server/operational-state-cluster-objects.h
+++ b/src/app/clusters/operational-state-server/operational-state-cluster-objects.h
@@ -19,7 +19,7 @@
#pragma once
#include
-#include
+
#include
namespace chip {
diff --git a/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp b/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp
index 213d9d64b8b5a4..edd0b5729c2708 100644
--- a/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp
+++ b/src/app/clusters/ota-requestor/DefaultOTARequestor.cpp
@@ -410,14 +410,13 @@ void DefaultOTARequestor::CancelImageUpdate()
CHIP_ERROR DefaultOTARequestor::GetUpdateStateProgressAttribute(EndpointId endpointId, app::DataModel::Nullable & progress)
{
- VerifyOrReturnError(OtaRequestorServerGetUpdateStateProgress(endpointId, progress) == EMBER_ZCL_STATUS_SUCCESS,
- CHIP_ERROR_BAD_REQUEST);
+ VerifyOrReturnError(OtaRequestorServerGetUpdateStateProgress(endpointId, progress) == Status::Success, CHIP_ERROR_BAD_REQUEST);
return CHIP_NO_ERROR;
}
CHIP_ERROR DefaultOTARequestor::GetUpdateStateAttribute(EndpointId endpointId, OTAUpdateStateEnum & state)
{
- VerifyOrReturnError(OtaRequestorServerGetUpdateState(endpointId, state) == EMBER_ZCL_STATUS_SUCCESS, CHIP_ERROR_BAD_REQUEST);
+ VerifyOrReturnError(OtaRequestorServerGetUpdateState(endpointId, state) == Status::Success, CHIP_ERROR_BAD_REQUEST);
return CHIP_NO_ERROR;
}
diff --git a/src/app/clusters/ota-requestor/OTARequestorInterface.h b/src/app/clusters/ota-requestor/OTARequestorInterface.h
index d81b67424f0b60..f03ccab4c75d2d 100644
--- a/src/app/clusters/ota-requestor/OTARequestorInterface.h
+++ b/src/app/clusters/ota-requestor/OTARequestorInterface.h
@@ -21,7 +21,7 @@
*/
#include
-#include
+
#include
#pragma once
diff --git a/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp b/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp
index 76f2a3d01830ed..c3eebe257c6b17 100644
--- a/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp
+++ b/src/app/clusters/pump-configuration-and-control-server/pump-configuration-and-control-server.cpp
@@ -32,6 +32,8 @@ using namespace chip::app;
using namespace chip::app::Clusters;
using namespace chip::app::Clusters::PumpConfigurationAndControl;
+using chip::Protocols::InteractionModel::Status;
+
namespace chip {
namespace app {
namespace Clusters {
@@ -232,7 +234,7 @@ bool HasFeature(EndpointId endpoint, Feature feature)
{
bool hasFeature;
uint32_t featureMap;
- hasFeature = (Attributes::FeatureMap::Get(endpoint, &featureMap) == EMBER_ZCL_STATUS_SUCCESS);
+ hasFeature = (Attributes::FeatureMap::Get(endpoint, &featureMap) == Status::Success);
return hasFeature ? ((featureMap & to_underlying(feature)) != 0) : false;
}
diff --git a/src/app/clusters/resource-monitoring-server/replacement-product-list-manager.h b/src/app/clusters/resource-monitoring-server/replacement-product-list-manager.h
index bd63dabca180c9..cdf64cc2c3dce2 100644
--- a/src/app/clusters/resource-monitoring-server/replacement-product-list-manager.h
+++ b/src/app/clusters/resource-monitoring-server/replacement-product-list-manager.h
@@ -20,7 +20,7 @@
#include
#include
-#include
+
#include
namespace chip {
diff --git a/src/app/clusters/scenes-server/scenes-server.cpp b/src/app/clusters/scenes-server/scenes-server.cpp
index a62427dfffadda..d05d7da84f9a53 100644
--- a/src/app/clusters/scenes-server/scenes-server.cpp
+++ b/src/app/clusters/scenes-server/scenes-server.cpp
@@ -66,6 +66,10 @@ CHIP_ERROR AddResponseOnError(CommandHandlerInterface::HandlerContext & ctx, Res
{
resp.status = to_underlying(Protocols::InteractionModel::Status::NotFound);
}
+ else if (CHIP_ERROR_NO_MEMORY == err)
+ {
+ resp.status = to_underlying(Protocols::InteractionModel::Status::ResourceExhausted);
+ }
else
{
resp.status = to_underlying(StatusIB(err).mStatus);
@@ -168,7 +172,6 @@ CHIP_ERROR UpdateFabricSceneInfo(EndpointId endpoint, FabricIndex fabric, Option
/// @brief Gets the SceneInfoStruct array associated to an endpoint
/// @param endpoint target endpoint
-/// @param fabric target fabric
/// @return Optional with no value not found, Span of SceneInfoStruct
Span ScenesServer::FabricSceneInfo::GetFabricSceneInfo(EndpointId endpoint)
{
@@ -675,13 +678,21 @@ void ScenesServer::InvokeCommand(HandlerContext & ctxt)
// AttributeAccessInterface
CHIP_ERROR ScenesServer::Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder)
{
+ uint16_t endpointTableSize = 0;
+ ReturnErrorOnFailure(StatusIB(Attributes::SceneTableSize::Get(aPath.mEndpointId, &endpointTableSize)).ToChipError());
+
+ // Get Scene Table Instance
+ SceneTable * sceneTable = scenes::GetSceneTableImpl(aPath.mEndpointId, endpointTableSize);
+
switch (aPath.mAttributeId)
{
case Attributes::FabricSceneInfo::Id: {
- return aEncoder.EncodeList([&](const auto & encoder) -> CHIP_ERROR {
+ return aEncoder.EncodeList([&, sceneTable](const auto & encoder) -> CHIP_ERROR {
Span fabricSceneInfoSpan = mFabricSceneInfo.GetFabricSceneInfo(aPath.mEndpointId);
for (auto & info : fabricSceneInfoSpan)
{
+ // Update the SceneInfoStruct's Capacity in case it's capacity was limited by other fabrics
+ sceneTable->GetRemainingCapacity(info.fabricIndex, info.remainingCapacity);
ReturnErrorOnFailure(encoder.Encode(info));
}
return CHIP_NO_ERROR;
@@ -918,12 +929,10 @@ void ScenesServer::HandleStoreScene(HandlerContext & ctx, const Commands::StoreS
CHIP_ERROR err = StoreSceneParse(ctx.mCommandHandler.GetAccessingFabricIndex(), ctx.mRequestPath.mEndpointId, req.groupID,
req.sceneID, mGroupProvider);
- if (CHIP_NO_ERROR == err)
- {
- ReturnOnFailure(UpdateLastConfiguredBy(ctx, response));
- }
+ ReturnOnFailure(AddResponseOnError(ctx, response, err));
- response.status = to_underlying(StatusIB(err).mStatus);
+ ReturnOnFailure(UpdateLastConfiguredBy(ctx, response));
+ response.status = to_underlying(Protocols::InteractionModel::Status::Success);
ctx.mCommandHandler.AddResponse(ctx.mRequestPath, response);
}
@@ -1031,6 +1040,13 @@ void ScenesServer::HandleCopyScene(HandlerContext & ctx, const Commands::CopySce
ReturnOnFailure(AddResponseOnError(ctx, response,
sceneTable->GetRemainingCapacity(ctx.mCommandHandler.GetAccessingFabricIndex(), capacity)));
+ if (0 == capacity)
+ {
+ response.status = to_underlying(Protocols::InteractionModel::Status::ResourceExhausted);
+ ctx.mCommandHandler.AddResponse(ctx.mRequestPath, response);
+ return;
+ }
+
// Checks if we copy a single scene or all of them
if (req.mode.GetField(app::Clusters::ScenesManagement::CopyModeBitmap::kCopyAllScenes))
{
@@ -1043,13 +1059,6 @@ void ScenesServer::HandleCopyScene(HandlerContext & ctx, const Commands::CopySce
ctx, response,
sceneTable->GetAllSceneIdsInGroup(ctx.mCommandHandler.GetAccessingFabricIndex(), req.groupIdentifierFrom, sceneList)));
- if (0 == capacity)
- {
- response.status = to_underlying(Protocols::InteractionModel::Status::ResourceExhausted);
- ctx.mCommandHandler.AddResponse(ctx.mRequestPath, response);
- return;
- }
-
for (auto & sceneId : sceneList)
{
SceneTableEntry scene(SceneStorageId(sceneId, req.groupIdentifierFrom));
@@ -1062,13 +1071,13 @@ void ScenesServer::HandleCopyScene(HandlerContext & ctx, const Commands::CopySce
ReturnOnFailure(AddResponseOnError(
ctx, response, sceneTable->SetSceneTableEntry(ctx.mCommandHandler.GetAccessingFabricIndex(), scene)));
- }
- // Update SceneInfoStruct Attributes
- ReturnOnFailure(
- AddResponseOnError(ctx, response,
- UpdateFabricSceneInfo(ctx.mRequestPath.mEndpointId, ctx.mCommandHandler.GetAccessingFabricIndex(),
- Optional(), Optional(), Optional())));
+ // Update SceneInfoStruct Attributes after each insert in case we hit max capacity in the middle of the loop
+ ReturnOnFailure(AddResponseOnError(
+ ctx, response,
+ UpdateFabricSceneInfo(ctx.mRequestPath.mEndpointId, ctx.mCommandHandler.GetAccessingFabricIndex(),
+ Optional(), Optional(), Optional() /* = sceneValid*/)));
+ }
ReturnOnFailure(UpdateLastConfiguredBy(ctx, response));
@@ -1112,7 +1121,7 @@ void emberAfScenesManagementClusterServerInitCallback(EndpointId endpoint)
Status status = Attributes::LastConfiguredBy::SetNull(endpoint);
if (Status::Success != status)
{
- ChipLogDetail(Zcl, "ERR: setting LastConfiguredBy on Endpoint %hu Status: %x", endpoint, status);
+ ChipLogDetail(Zcl, "ERR: setting LastConfiguredBy on Endpoint %hu Status: %x", endpoint, to_underlying(status));
}
// Initialize the FabricSceneInfo by getting the number of scenes and the remaining capacity for storing fabric scene data
@@ -1126,7 +1135,7 @@ void emberAfScenesManagementClusterServerInitCallback(EndpointId endpoint)
void MatterScenesManagementClusterServerShutdownCallback(EndpointId endpoint)
{
uint16_t endpointTableSize = 0;
- ReturnOnFailure(Attributes::SceneTableSize::Get(endpoint, &endpointTableSize));
+ VerifyOrReturn(Status::Success == Attributes::SceneTableSize::Get(endpoint, &endpointTableSize));
// Get Scene Table Instance
SceneTable * sceneTable = scenes::GetSceneTableImpl(endpoint, endpointTableSize);
diff --git a/src/app/clusters/temperature-control-server/supported-temperature-levels-manager.h b/src/app/clusters/temperature-control-server/supported-temperature-levels-manager.h
index 754be5701dd33c..5ff3db169261be 100644
--- a/src/app/clusters/temperature-control-server/supported-temperature-levels-manager.h
+++ b/src/app/clusters/temperature-control-server/supported-temperature-levels-manager.h
@@ -19,7 +19,7 @@
#pragma once
#include
-#include
+
#include
namespace chip {
diff --git a/src/app/clusters/time-synchronization-server/time-synchronization-delegate.h b/src/app/clusters/time-synchronization-server/time-synchronization-delegate.h
index 6ef37f2403927d..7d5bad65ff0d2e 100644
--- a/src/app/clusters/time-synchronization-server/time-synchronization-delegate.h
+++ b/src/app/clusters/time-synchronization-server/time-synchronization-delegate.h
@@ -23,6 +23,7 @@
#include
#include
#include
+#include
namespace chip {
namespace app {
@@ -43,7 +44,7 @@ class Delegate
inline bool HasFeature(Feature feature)
{
uint32_t map;
- bool success = (Attributes::FeatureMap::Get(mEndpoint, &map) == EMBER_ZCL_STATUS_SUCCESS);
+ bool success = (Attributes::FeatureMap::Get(mEndpoint, &map) == Protocols::InteractionModel::Status::Success);
return success ? (map & to_underlying(feature)) : false;
}
diff --git a/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp b/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp
index 62d5e1b2c77da8..120cd2b3dd8416 100644
--- a/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp
+++ b/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.cpp
@@ -280,19 +280,18 @@ CHIP_ERROR CloseValve(EndpointId ep)
DataModel::Nullable rDuration;
CHIP_ERROR attribute_error = CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute);
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == TargetState::Set(ep, ValveConfigurationAndControl::ValveStateEnum::kClosed),
+ VerifyOrReturnError(Status::Success == TargetState::Set(ep, ValveConfigurationAndControl::ValveStateEnum::kClosed),
attribute_error);
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS ==
- CurrentState::Set(ep, ValveConfigurationAndControl::ValveStateEnum::kTransitioning),
+ VerifyOrReturnError(Status::Success == CurrentState::Set(ep, ValveConfigurationAndControl::ValveStateEnum::kTransitioning),
attribute_error);
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == OpenDuration::SetNull(ep), attribute_error);
+ VerifyOrReturnError(Status::Success == OpenDuration::SetNull(ep), attribute_error);
if (HasFeature(ep, ValveConfigurationAndControl::Feature::kLevel))
{
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == TargetLevel::Set(ep, 0), attribute_error);
+ VerifyOrReturnError(Status::Success == TargetLevel::Set(ep, 0), attribute_error);
}
if (HasFeature(ep, ValveConfigurationAndControl::Feature::kTimeSync))
{
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AutoCloseTime::SetNull(ep), attribute_error);
+ VerifyOrReturnError(Status::Success == AutoCloseTime::SetNull(ep), attribute_error);
}
SetRemainingDurationNull(ep);
RemainingDurationTable * item = GetRemainingDurationItem(ep);
@@ -329,11 +328,11 @@ CHIP_ERROR SetValveLevel(EndpointId ep, DataModel::Nullable level, Data
uint64_t time = openDuration.Value() * chip::kMicrosecondsPerSecond;
autoCloseTime.SetNonNull(chipEpochTime + time);
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AutoCloseTime::Set(ep, autoCloseTime), attribute_error);
+ VerifyOrReturnError(Status::Success == AutoCloseTime::Set(ep, autoCloseTime), attribute_error);
}
else
{
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == AutoCloseTime::SetNull(ep), attribute_error);
+ VerifyOrReturnError(Status::Success == AutoCloseTime::SetNull(ep), attribute_error);
}
#else
return CHIP_ERROR_NOT_IMPLEMENTED;
@@ -343,19 +342,18 @@ CHIP_ERROR SetValveLevel(EndpointId ep, DataModel::Nullable level, Data
// level can only be null if LVL feature is not supported
if (HasFeature(ep, ValveConfigurationAndControl::Feature::kLevel) && !level.IsNull())
{
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == TargetLevel::Set(ep, level), attribute_error);
+ VerifyOrReturnError(Status::Success == TargetLevel::Set(ep, level), attribute_error);
}
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == OpenDuration::Set(ep, openDuration), attribute_error);
+ VerifyOrReturnError(Status::Success == OpenDuration::Set(ep, openDuration), attribute_error);
SetRemainingDuration(ep, openDuration);
// Trigger report for remainingduration
MatterReportingAttributeChangeCallback(ep, ValveConfigurationAndControl::Id, RemainingDuration::Id);
// set targetstate to open
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == TargetState::Set(ep, ValveConfigurationAndControl::ValveStateEnum::kOpen),
+ VerifyOrReturnError(Status::Success == TargetState::Set(ep, ValveConfigurationAndControl::ValveStateEnum::kOpen),
attribute_error);
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS ==
- CurrentState::Set(ep, ValveConfigurationAndControl::ValveStateEnum::kTransitioning),
+ VerifyOrReturnError(Status::Success == CurrentState::Set(ep, ValveConfigurationAndControl::ValveStateEnum::kTransitioning),
attribute_error);
// start movement towards target
@@ -365,7 +363,7 @@ CHIP_ERROR SetValveLevel(EndpointId ep, DataModel::Nullable level, Data
DataModel::Nullable cLevel = delegate->HandleOpenValve(level);
if (HasFeature(ep, ValveConfigurationAndControl::Feature::kLevel))
{
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == CurrentLevel::Set(ep, cLevel), attribute_error);
+ VerifyOrReturnError(Status::Success == CurrentLevel::Set(ep, cLevel), attribute_error);
}
}
// start countdown
@@ -378,8 +376,7 @@ CHIP_ERROR UpdateCurrentLevel(EndpointId ep, Percent currentLevel)
{
if (HasFeature(ep, ValveConfigurationAndControl::Feature::kLevel))
{
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == CurrentLevel::Set(ep, currentLevel),
- CHIP_IM_GLOBAL_STATUS(ConstraintError));
+ VerifyOrReturnError(Status::Success == CurrentLevel::Set(ep, currentLevel), CHIP_IM_GLOBAL_STATUS(ConstraintError));
return CHIP_NO_ERROR;
}
return CHIP_IM_GLOBAL_STATUS(UnsupportedAttribute);
@@ -387,7 +384,7 @@ CHIP_ERROR UpdateCurrentLevel(EndpointId ep, Percent currentLevel)
CHIP_ERROR UpdateCurrentState(EndpointId ep, ValveConfigurationAndControl::ValveStateEnum currentState)
{
- VerifyOrReturnError(EMBER_ZCL_STATUS_SUCCESS == CurrentState::Set(ep, currentState), CHIP_IM_GLOBAL_STATUS(ConstraintError));
+ VerifyOrReturnError(Status::Success == CurrentState::Set(ep, currentState), CHIP_IM_GLOBAL_STATUS(ConstraintError));
emitValveStateChangedEvent(ep, currentState);
return CHIP_NO_ERROR;
}
@@ -406,7 +403,7 @@ void UpdateAutoCloseTime(uint64_t time)
if (!d.IsNull() && d.Value() != 0)
{
uint64_t closingTime = d.Value() * chip::kMicrosecondsPerSecond + time;
- if (EMBER_ZCL_STATUS_SUCCESS != AutoCloseTime::Set(t.endpoint, closingTime))
+ if (Status::Success != AutoCloseTime::Set(t.endpoint, closingTime))
{
ChipLogError(Zcl, "Unable to update AutoCloseTime");
}
@@ -431,7 +428,7 @@ bool emberAfValveConfigurationAndControlClusterOpenCallback(
Optional status = Optional::Missing();
// if fault is registered return FailureDueToFault
- if (EMBER_ZCL_STATUS_SUCCESS == ValveFault::Get(ep, &fault) && fault.HasAny())
+ if (Status::Success == ValveFault::Get(ep, &fault) && fault.HasAny())
{
commandObj->AddClusterSpecificFailure(commandPath,
to_underlying(ValveConfigurationAndControl::StatusCodeEnum::kFailureDueToFault));
@@ -450,7 +447,7 @@ bool emberAfValveConfigurationAndControlClusterOpenCallback(
}
else
{
- VerifyOrExit(EMBER_ZCL_STATUS_SUCCESS == DefaultOpenDuration::Get(ep, duration), status.Emplace(Status::Failure));
+ VerifyOrExit(Status::Success == DefaultOpenDuration::Get(ep, duration), status.Emplace(Status::Failure));
}
if (HasFeature(ep, ValveConfigurationAndControl::Feature::kLevel))
@@ -460,7 +457,7 @@ bool emberAfValveConfigurationAndControlClusterOpenCallback(
{
level.SetNonNull(targetLevel.Value());
}
- else if (EMBER_ZCL_STATUS_SUCCESS == DefaultOpenLevel::Get(ep, &defOpenLevel))
+ else if (Status::Success == DefaultOpenLevel::Get(ep, &defOpenLevel))
{
level.SetNonNull(defOpenLevel);
}
@@ -497,7 +494,7 @@ bool emberAfValveConfigurationAndControlClusterCloseCallback(
BitMask fault(0);
// if fault is registered return FailureDueToFault
- if (EMBER_ZCL_STATUS_SUCCESS == ValveFault::Get(ep, &fault) && fault.HasAny())
+ if (Status::Success == ValveFault::Get(ep, &fault) && fault.HasAny())
{
commandObj->AddClusterSpecificFailure(commandPath,
to_underlying(ValveConfigurationAndControl::StatusCodeEnum::kFailureDueToFault));
diff --git a/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.h b/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.h
index 5e94c000aeab27..74c8a623c02c61 100644
--- a/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.h
+++ b/src/app/clusters/valve-configuration-and-control-server/valve-configuration-and-control-server.h
@@ -30,6 +30,7 @@
#include
#include
#include
+#include
namespace chip {
namespace app {
@@ -49,7 +50,7 @@ void UpdateAutoCloseTime(uint64_t time);
inline bool HasFeature(EndpointId ep, Feature feature)
{
uint32_t map;
- bool success = (Attributes::FeatureMap::Get(ep, &map) == EMBER_ZCL_STATUS_SUCCESS);
+ bool success = (Attributes::FeatureMap::Get(ep, &map) == Protocols::InteractionModel::Status::Success);
return success ? (map & to_underlying(feature)) : false;
}
diff --git a/src/app/icd/icd.gni b/src/app/icd/icd.gni
index 1f2ac247f6fb38..8994cf486106aa 100644
--- a/src/app/icd/icd.gni
+++ b/src/app/icd/icd.gni
@@ -17,6 +17,8 @@ declare_args() {
# TODO - Add Specifics when the design is refined
chip_enable_icd_server = false
+ chip_enable_icd_lit = false
+
# Matter SDK Configuration flag to enable ICD client functionality
# TODO - Add Specifics when the design is refined
chip_enable_icd_client = false
@@ -29,3 +31,9 @@ declare_args() {
# Set to true to enforce SIT Slow Polling Max value to 15seconds (spec 9.16.1.5)
icd_enforce_sit_slow_poll_limit = false
}
+
+# Set the defaults for CIP and UAT features to be consistent with the LIT value.
+declare_args() {
+ chip_enable_icd_checkin = chip_enable_icd_lit
+ chip_enable_icd_user_active_mode_trigger = chip_enable_icd_lit
+}
diff --git a/src/app/icd/server/BUILD.gn b/src/app/icd/server/BUILD.gn
index 41c73b5f7e6bbc..9a10430a3303ff 100644
--- a/src/app/icd/server/BUILD.gn
+++ b/src/app/icd/server/BUILD.gn
@@ -22,8 +22,15 @@ buildconfig_header("icd-server-buildconfig") {
header = "ICDServerBuildConfig.h"
header_dir = "app/icd/server"
+ if (chip_enable_icd_lit) {
+ assert(chip_enable_icd_checkin && chip_enable_icd_user_active_mode_trigger)
+ }
+
defines = [
"CHIP_CONFIG_ENABLE_ICD_SERVER=${chip_enable_icd_server}",
+ "CHIP_CONFIG_ENABLE_ICD_LIT=${chip_enable_icd_lit}",
+ "CHIP_CONFIG_ENABLE_ICD_CIP=${chip_enable_icd_checkin}",
+ "CHIP_CONFIG_ENABLE_ICD_UAT=${chip_enable_icd_user_active_mode_trigger}",
"ICD_REPORT_ON_ENTER_ACTIVE_MODE=${chip_icd_report_on_active_mode}",
"ICD_MAX_NOTIFICATION_SUBSCRIBERS=${icd_max_notification_subscribers}",
"ICD_ENFORCE_SIT_SLOW_POLL_LIMIT=${icd_enforce_sit_slow_poll_limit}",
@@ -66,13 +73,19 @@ source_set("manager") {
public_deps = [
":configuration-data",
- ":monitoring-table",
":notifier",
":observer",
- ":sender",
"${chip_root}/src/app:subscription-manager",
"${chip_root}/src/credentials:credentials",
+ "${chip_root}/src/messaging",
]
+
+ if (chip_enable_icd_checkin) {
+ public_deps += [
+ ":monitoring-table",
+ ":sender",
+ ]
+ }
}
source_set("sender") {
diff --git a/src/app/icd/server/ICDManager.cpp b/src/app/icd/server/ICDManager.cpp
index 05948feb3406a1..057cc089e9624f 100644
--- a/src/app/icd/server/ICDManager.cpp
+++ b/src/app/icd/server/ICDManager.cpp
@@ -20,7 +20,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -37,18 +36,23 @@ using namespace chip::app::Clusters;
using namespace chip::app::Clusters::IcdManagement;
using namespace System::Clock;
+using chip::Protocols::InteractionModel::Status;
+
static_assert(UINT8_MAX >= CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS,
"ICDManager::mOpenExchangeContextCount cannot hold count for the max exchange count");
void ICDManager::Init(PersistentStorageDelegate * storage, FabricTable * fabricTable, Crypto::SymmetricKeystore * symmetricKeystore,
- Messaging::ExchangeManager * exchangeManager, SubscriptionsInfoProvider * manager)
+ Messaging::ExchangeManager * exchangeManager, SubscriptionsInfoProvider * subInfoProvider)
{
+#if CHIP_CONFIG_ENABLE_ICD_CIP
VerifyOrDie(storage != nullptr);
VerifyOrDie(fabricTable != nullptr);
VerifyOrDie(symmetricKeystore != nullptr);
VerifyOrDie(exchangeManager != nullptr);
- VerifyOrDie(manager != nullptr);
+ VerifyOrDie(subInfoProvider != nullptr);
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
+#if CHIP_CONFIG_ENABLE_ICD_LIT
// LIT ICD Verification Checks
if (SupportsFeature(Feature::kLongIdleTimeSupport))
{
@@ -63,18 +67,21 @@ void ICDManager::Init(PersistentStorageDelegate * storage, FabricTable * fabricT
// VerifyOrDieWithMsg((GetSlowPollingInterval() <= GetSITPollingThreshold()) , AppServer,
// "LIT support is required for slow polling intervals superior to 15 seconds");
}
+#endif // CHIP_CONFIG_ENABLE_ICD_LIT
VerifyOrDie(ICDNotifier::GetInstance().Subscribe(this) == CHIP_NO_ERROR);
+#if CHIP_CONFIG_ENABLE_ICD_CIP
mStorage = storage;
mFabricTable = fabricTable;
mSymmetricKeystore = symmetricKeystore;
mExchangeManager = exchangeManager;
- mSubManager = manager;
+ mSubInfoProvider = subInfoProvider;
VerifyOrDie(ICDConfigurationData::GetInstance().GetICDCounter().Init(mStorage, DefaultStorageKeyAllocator::ICDCheckInCounter(),
ICDConfigurationData::kICDCounterPersistenceIncrement) ==
CHIP_NO_ERROR);
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
UpdateICDMode();
UpdateOperationState(OperationalState::IdleMode);
@@ -91,13 +98,14 @@ void ICDManager::Shutdown()
ICDConfigurationData::GetInstance().SetICDMode(ICDConfigurationData::ICDMode::SIT);
mOperationalState = OperationalState::ActiveMode;
-
- mStorage = nullptr;
- mFabricTable = nullptr;
- mSubManager = nullptr;
-
mStateObserverPool.ReleaseAll();
+
+#if CHIP_CONFIG_ENABLE_ICD_CIP
+ mStorage = nullptr;
+ mFabricTable = nullptr;
+ mSubInfoProvider = nullptr;
mICDSenderPool.ReleaseAll();
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
}
bool ICDManager::SupportsFeature(Feature feature)
@@ -105,13 +113,14 @@ bool ICDManager::SupportsFeature(Feature feature)
// Can't use attribute accessors/Attributes::FeatureMap::Get in unit tests
#if !CONFIG_BUILD_FOR_HOST_UNIT_TEST
uint32_t featureMap = 0;
- bool success = (Attributes::FeatureMap::Get(kRootEndpointId, &featureMap) == EMBER_ZCL_STATUS_SUCCESS);
+ bool success = (Attributes::FeatureMap::Get(kRootEndpointId, &featureMap) == Status::Success);
return success ? ((featureMap & to_underlying(feature)) != 0) : false;
#else
return ((mFeatureMap & to_underlying(feature)) != 0);
#endif // !CONFIG_BUILD_FOR_HOST_UNIT_TEST
}
+#if CHIP_CONFIG_ENABLE_ICD_CIP
void ICDManager::SendCheckInMsgs()
{
#if !CONFIG_BUILD_FOR_HOST_UNIT_TEST
@@ -148,7 +157,7 @@ void ICDManager::SendCheckInMsgs()
continue;
}
- bool active = mSubManager->SubjectHasActiveSubscription(entry.fabricIndex, entry.monitoredSubject);
+ bool active = mSubInfoProvider->SubjectHasActiveSubscription(entry.fabricIndex, entry.monitoredSubject);
if (active)
{
continue;
@@ -179,12 +188,66 @@ void ICDManager::SendCheckInMsgs()
#endif // CONFIG_BUILD_FOR_HOST_UNIT_TEST
}
+bool ICDManager::CheckInMessagesWouldBeSent()
+{
+ for (const auto & fabricInfo : *mFabricTable)
+ {
+ uint16_t supported_clients = ICDConfigurationData::GetInstance().GetClientsSupportedPerFabric();
+
+ ICDMonitoringTable table(*mStorage, fabricInfo.GetFabricIndex(), supported_clients /*Table entry limit*/,
+ mSymmetricKeystore);
+ if (table.IsEmpty())
+ {
+ continue;
+ }
+
+ for (uint16_t i = 0; i < table.Limit(); i++)
+ {
+ ICDMonitoringEntry entry(mSymmetricKeystore);
+ CHIP_ERROR err = table.Get(i, entry);
+ if (err == CHIP_ERROR_NOT_FOUND)
+ {
+ break;
+ }
+
+ if (err != CHIP_NO_ERROR)
+ {
+ // Try to fetch the next entry upon failure (should not happen).
+ ChipLogError(AppServer, "Failed to retrieved ICDMonitoring entry, will try next entry.");
+ continue;
+ }
+
+ // At least one registration would require a Check-In message
+ VerifyOrReturnValue(mSubInfoProvider->SubjectHasActiveSubscription(entry.fabricIndex, entry.monitoredSubject), true);
+ }
+ }
+
+ // None of the registrations would require a Check-In message
+ return false;
+}
+
+void ICDManager::TriggerCheckInMessages()
+{
+ VerifyOrReturn(SupportsFeature(Feature::kCheckInProtocolSupport));
+
+ // Only trigger Check-In messages when we are in IdleMode.
+ // If we are already in ActiveMode, Check-In messages have already been sent.
+ VerifyOrReturn(mOperationalState == OperationalState::IdleMode);
+
+ // If we don't have any Check-In messages to send, do nothing
+ VerifyOrReturn(CheckInMessagesWouldBeSent());
+
+ UpdateOperationState(OperationalState::ActiveMode);
+}
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
+
void ICDManager::UpdateICDMode()
{
assertChipStackLockedByCurrentThread();
ICDConfigurationData::ICDMode tempMode = ICDConfigurationData::ICDMode::SIT;
+#if CHIP_CONFIG_ENABLE_ICD_LIT
// Device can only switch to the LIT operating mode if LIT support is present
if (SupportsFeature(Feature::kLongIdleTimeSupport))
{
@@ -202,6 +265,7 @@ void ICDManager::UpdateICDMode()
}
}
}
+#endif // CHIP_CONFIG_ENABLE_ICD_LIT
if (ICDConfigurationData::GetInstance().GetICDMode() != tempMode)
{
@@ -236,15 +300,21 @@ void ICDManager::UpdateOperationState(OperationalState state)
// When the active mode interval is 0, we stay in idleMode until a notification brings the icd into active mode
// unless the device would need to send Check-In messages
// TODO(#30281) : Verify how persistent subscriptions affects this at ICDManager::Init
- if (ICDConfigurationData::GetInstance().GetActiveModeDuration() > kZero || CheckInMessagesWouldBeSent())
+ if (ICDConfigurationData::GetInstance().GetActiveModeDuration() > kZero
+#if CHIP_CONFIG_ENABLE_ICD_CIP
+ || CheckInMessagesWouldBeSent()
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
+ )
{
DeviceLayer::SystemLayer().StartTimer(ICDConfigurationData::GetInstance().GetIdleModeDuration(), OnIdleModeDone, this);
}
Milliseconds32 slowPollInterval = ICDConfigurationData::GetInstance().GetSlowPollingInterval();
+#if CHIP_CONFIG_ENABLE_ICD_CIP
// Going back to Idle, all Check-In messages are sent
mICDSenderPool.ReleaseAll();
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
CHIP_ERROR err = DeviceLayer::ConnectivityMgr().SetPollingInterval(slowPollInterval);
if (err != CHIP_NO_ERROR)
@@ -285,10 +355,12 @@ void ICDManager::UpdateOperationState(OperationalState state)
ChipLogError(AppServer, "Failed to set Fast Polling Interval: err %" CHIP_ERROR_FORMAT, err.Format());
}
+#if CHIP_CONFIG_ENABLE_ICD_CIP
if (SupportsFeature(Feature::kCheckInProtocolSupport))
{
SendCheckInMsgs();
}
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
postObserverEvent(ObserverEventType::EnterActiveMode);
}
@@ -371,12 +443,14 @@ void ICDManager::OnKeepActiveRequest(KeepActiveFlags request)
this->mOpenExchangeContextCount++;
}
+#if CHIP_CONFIG_ENABLE_ICD_CIP
if (request.Has(KeepActiveFlag::kCheckInInProgress))
{
// There can be multiple check-in at the same time.
// Keep track of the requests count.
this->mCheckInRequestCount++;
}
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
this->SetKeepActiveModeRequirements(request, true /* state */);
}
@@ -406,6 +480,7 @@ void ICDManager::OnActiveRequestWithdrawal(KeepActiveFlags request)
}
}
+#if CHIP_CONFIG_ENABLE_ICD_CIP
if (request.Has(KeepActiveFlag::kCheckInInProgress))
{
// There can be multiple open exchange contexts at the same time.
@@ -424,6 +499,7 @@ void ICDManager::OnActiveRequestWithdrawal(KeepActiveFlags request)
this->SetKeepActiveModeRequirements(KeepActiveFlag::kCheckInInProgress, false /* state */);
}
}
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
if (request.Has(KeepActiveFlag::kCommissioningWindowOpen) || request.Has(KeepActiveFlag::kFailSafeArmed))
{
@@ -506,57 +582,5 @@ void ICDManager::postObserverEvent(ObserverEventType event)
});
}
-bool ICDManager::CheckInMessagesWouldBeSent()
-{
- for (const auto & fabricInfo : *mFabricTable)
- {
- uint16_t supported_clients = ICDConfigurationData::GetInstance().GetClientsSupportedPerFabric();
-
- ICDMonitoringTable table(*mStorage, fabricInfo.GetFabricIndex(), supported_clients /*Table entry limit*/,
- mSymmetricKeystore);
- if (table.IsEmpty())
- {
- continue;
- }
-
- for (uint16_t i = 0; i < table.Limit(); i++)
- {
- ICDMonitoringEntry entry(mSymmetricKeystore);
- CHIP_ERROR err = table.Get(i, entry);
- if (err == CHIP_ERROR_NOT_FOUND)
- {
- break;
- }
-
- if (err != CHIP_NO_ERROR)
- {
- // Try to fetch the next entry upon failure (should not happen).
- ChipLogError(AppServer, "Failed to retrieved ICDMonitoring entry, will try next entry.");
- continue;
- }
-
- // At least one registration would require a Check-In message
- VerifyOrReturnValue(mSubManager->SubjectHasActiveSubscription(entry.fabricIndex, entry.monitoredSubject), true);
- }
- }
-
- // None of the registrations would require a Check-In message
- return false;
-}
-
-void ICDManager::TriggerCheckInMessages()
-{
- VerifyOrReturn(SupportsFeature(Feature::kCheckInProtocolSupport));
-
- // Only trigger Check-In messages when we are in IdleMode.
- // If we are already in ActiveMode, Check-In messages have already been sent.
- VerifyOrReturn(mOperationalState == OperationalState::IdleMode);
-
- // If we don't have any Check-In messages to send, do nothing
- VerifyOrReturn(CheckInMessagesWouldBeSent());
-
- UpdateOperationState(OperationalState::ActiveMode);
-}
-
} // namespace app
} // namespace chip
diff --git a/src/app/icd/server/ICDManager.h b/src/app/icd/server/ICDManager.h
index f115a41bdddcc8..396e6be20d0606 100644
--- a/src/app/icd/server/ICDManager.h
+++ b/src/app/icd/server/ICDManager.h
@@ -17,18 +17,32 @@
#pragma once
#include
+
+#include
+
+#if CHIP_CONFIG_ENABLE_ICD_CIP
+#include // nogncheck
+#include // nogncheck
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
+
#include
-#include
#include
-#include
#include
#include
#include
+#include
#include
+#include
#include
#include
#include
+namespace chip {
+namespace Crypto {
+using SymmetricKeystore = SessionKeystore;
+}
+} // namespace chip
+
namespace chip {
namespace app {
@@ -94,8 +108,16 @@ class ICDManager : public ICDListener
*/
void postObserverEvent(ObserverEventType event);
OperationalState GetOperationalState() { return mOperationalState; }
+
+#if CHIP_CONFIG_ENABLE_ICD_CIP
void SendCheckInMsgs();
+ /**
+ * @brief Trigger the ICDManager to send Check-In message if necessary
+ */
+ void TriggerCheckInMessages();
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
+
#ifdef CONFIG_BUILD_FOR_HOST_UNIT_TEST
void SetTestFeatureMapValue(uint32_t featureMap) { mFeatureMap = featureMap; };
#endif
@@ -108,11 +130,6 @@ class ICDManager : public ICDListener
void OnICDManagementServerEvent(ICDManagementEvents event) override;
void OnSubscriptionReport() override;
- /**
- * @brief Trigger the ICDManager to send Check-In message if necessary
- */
- void TriggerCheckInMessages();
-
protected:
friend class TestICDManager;
@@ -127,10 +144,14 @@ class ICDManager : public ICDListener
*/
static void OnTransitionToIdle(System::Layer * aLayer, void * appState);
+#if CHIP_CONFIG_ENABLE_ICD_CIP
+ uint8_t mCheckInRequestCount = 0;
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
+
uint8_t mOpenExchangeContextCount = 0;
- uint8_t mCheckInRequestCount = 0;
private:
+#if CHIP_CONFIG_ENABLE_ICD_CIP
/**
* @brief Function checks if at least one client registration would require a Check-In message
*
@@ -139,22 +160,23 @@ class ICDManager : public ICDListener
* they all have associated subscriptions.
*/
bool CheckInMessagesWouldBeSent();
+#endif // CHIP_CONFIG_ENABLE_ICD_CIP
KeepActiveFlags mKeepActiveFlags{ 0 };
// Initialize mOperationalState to ActiveMode so the init sequence at bootup triggers the IdleMode behaviour first.
OperationalState mOperationalState = OperationalState::ActiveMode;
+ bool mTransitionToIdleCalled = false;
+ ObjectPool mStateObserverPool;
+#if CHIP_CONFIG_ENABLE_ICD_CIP
PersistentStorageDelegate * mStorage = nullptr;
FabricTable * mFabricTable = nullptr;
Messaging::ExchangeManager * mExchangeManager = nullptr;
Crypto::SymmetricKeystore * mSymmetricKeystore = nullptr;
- SubscriptionsInfoProvider * mSubManager = nullptr;
-
- bool mTransitionToIdleCalled = false;
-
- ObjectPool mStateObserverPool;
+ SubscriptionsInfoProvider * mSubInfoProvider = nullptr;
ObjectPool